[PATCH 1/1] Instructions and patch for using backports to build wcn36xx

Olof Johansson dev at skyshaper.net
Fri Jul 5 08:02:48 EDT 2013


Updated the instructions initially done by kvalo to be a bit more
comprehensive.

Also, add the patch necessary for the backports git to out repo.
---
 backports/0001-wcn36xx-backports-config.patch | 125 ++++++++++++++++++++++++++
 backports/README-backports                    |  76 ++++++++++++++++
 2 files changed, 201 insertions(+)
 create mode 100644 backports/0001-wcn36xx-backports-config.patch
 create mode 100644 backports/README-backports

diff --git a/backports/0001-wcn36xx-backports-config.patch b/backports/0001-wcn36xx-backports-config.patch
new file mode 100644
index 0000000..3512e1f
--- /dev/null
+++ b/backports/0001-wcn36xx-backports-config.patch
@@ -0,0 +1,125 @@
+From 5f8af8a8090439dcf34d1948a48dc192c3f4efaf Mon Sep 17 00:00:00 2001
+From: Coil <dev at skyshaper.net>
+Date: Thu, 4 Jul 2013 10:11:54 +0200
+Subject: [PATCH 1/1] wcn36xx backports config
+
+---
+ backport/defconfigs/wcn36xx                        | 12 +++++++
+ copy-list.mac80211                                 | 38 ++++++++++++++++++++++
+ copy-list.wcn36xx                                  | 11 +++++++
+ .../0005-wcn36xx-make-kconfig/wcn36xx.patch        | 21 ++++++++++++
+ 4 files changed, 82 insertions(+)
+ create mode 100644 backport/defconfigs/wcn36xx
+ create mode 100644 copy-list.mac80211
+ create mode 100644 copy-list.wcn36xx
+ create mode 100644 patches/unified-drivers/network/0005-wcn36xx-make-kconfig/wcn36xx.patch
+
+diff --git a/backport/defconfigs/wcn36xx b/backport/defconfigs/wcn36xx
+new file mode 100644
+index 0000000..d7105bf
+--- /dev/null
++++ b/backport/defconfigs/wcn36xx
+@@ -0,0 +1,12 @@
++CPTCFG_CFG80211=m
++CPTCFG_CFG80211_DEFAULT_PS=y
++CPTCFG_CFG80211_DEBUGFS=y
++CPTCFG_MAC80211=m
++# CPTCFG_MAC80211_RC_PID is not set
++# CPTCFG_MAC80211_RC_MINSTREL is not set
++# CPTCFG_MAC80211_RC_DEFAULT_MINSTREL is not set
++CPTCFG_MAC80211_DEBUGFS=y
++CPTCFG_MAC80211_MESSAGE_TRACING=y
++CPTCFG_WLAN=y
++CPTCFG_ATH_CARDS=m
++CPTCFG_WCN36XX=m
+diff --git a/copy-list.mac80211 b/copy-list.mac80211
+new file mode 100644
+index 0000000..48e9ecf
+--- /dev/null
++++ b/copy-list.mac80211
+@@ -0,0 +1,38 @@
++#
++# This file specifies which sources are copied from the kernel
++# into the backports package.
++#
++# Directories must end with a slash (e.g. "net/wireless/") and
++# are then copied with all their contents.
++#
++# It is also possible to rename while copying, to do so list
++# old name -> new name
++# Note that in this case the spaces are needed: " -> "
++#
++
++COPYING
++MAINTAINERS
++
++# 802.11
++drivers/net/wireless/Kconfig
++drivers/net/wireless/Makefile
++
++include/linux/ieee80211.h
++include/linux/pci_ids.h
++
++include/uapi/linux/nl80211.h
++include/linux/rfkill.h -> include/linux/rfkill_backport.h
++include/uapi/linux/rfkill.h -> include/uapi/linux/rfkill_backport.h
++
++include/net/cfg80211.h
++include/net/cfg80211-wext.h
++include/net/ieee80211_radiotap.h
++include/net/mac80211.h
++include/net/regulatory.h
++
++net/Makefile
++net/Kconfig
++net/wireless/
++net/mac80211/
++
++drivers/net/wireless/ath/
+diff --git a/copy-list.wcn36xx b/copy-list.wcn36xx
+new file mode 100644
+index 0000000..795262a
+--- /dev/null
++++ b/copy-list.wcn36xx
+@@ -0,0 +1,11 @@
++#
++# To use this, use the --extra-driver argument to gentree.py,
++# like this:
++#	--extra-driver /path/to/alx/ copy-list.alx
++#
++# This probably needs to be changed to target/linux/src/
++# to support "make linux-src" in alx, but then the Makefile
++# is not good ...
++#
++wcn36xx/ -> drivers/net/wireless/ath/wcn36xx/
++
+diff --git a/patches/unified-drivers/network/0005-wcn36xx-make-kconfig/wcn36xx.patch b/patches/unified-drivers/network/0005-wcn36xx-make-kconfig/wcn36xx.patch
+new file mode 100644
+index 0000000..4b14f65
+--- /dev/null
++++ b/patches/unified-drivers/network/0005-wcn36xx-make-kconfig/wcn36xx.patch
+@@ -0,0 +1,21 @@
++diff -ur backport-fixup/drivers/net/wireless/ath/Kconfig backport-wcn/drivers/net/wireless/ath/Kconfig
++--- backport-fixup/drivers/net/wireless/ath/Kconfig	2013-07-04 09:47:48.000000000 +0200
+++++ backport-wcn/drivers/net/wireless/ath/Kconfig	2013-07-04 09:48:55.000000000 +0200
++@@ -32,5 +32,6 @@
++ source "drivers/net/wireless/ath/ar5523/Kconfig"
++ source "drivers/net/wireless/ath/wil6210/Kconfig"
++ source "drivers/net/wireless/ath/ath10k/Kconfig"
+++source "drivers/net/wireless/ath/wcn36xx/Kconfig"
++ 
++ endif
++diff -ur backport-fixup/drivers/net/wireless/ath/Makefile backport-wcn/drivers/net/wireless/ath/Makefile
++--- backport-fixup/drivers/net/wireless/ath/Makefile	2013-07-04 09:47:48.000000000 +0200
+++++ backport-wcn/drivers/net/wireless/ath/Makefile	2013-07-04 09:49:48.000000000 +0200
++@@ -5,6 +5,7 @@
++ obj-$(CONFIG_AR5523)		+= ar5523/
++ obj-$(CONFIG_WIL6210)		+= wil6210/
++ obj-$(CONFIG_ATH10K)		+= ath10k/
+++obj-$(CONFIG_WCN36XX)		+= wcn36xx/
++ 
++ obj-$(CONFIG_ATH_COMMON)	+= ath.o
++ 
+-- 
+1.8.3.1
+
diff --git a/backports/README-backports b/backports/README-backports
new file mode 100644
index 0000000..113ed6e
--- /dev/null
+++ b/backports/README-backports
@@ -0,0 +1,76 @@
+This file describes how to build wcn36xx with backports
+It assumes you have a prepared cyanogenmod built somewhere already
+
+1) Open up a terminal
+2) Change to a directory where you'll keep your git repositories like ~/git/
+3) Checkout backports
+    # git clone git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/backports.git
+
+4 Checkout linux-next
+    # git clone --no-checkout git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
+    The --no-checkout is there to save space since backports will pickout the relevant stuff anyway.
+
+5) Checkout wcn36xx from upstream or your own branch
+    # git clone git at github.com:KrasnikovEugene/wcn36xx.git
+
+6) Prepare backports 
+    # cd backports
+    # cp ../wcn36xx/backports/0001-wcn36xx-backports-config.patch .
+    # git am 0001-wcn36xx-backports-config.patch
+
+7) Generate a build tree
+    Stay in the backports folder and do a git log
+    Find the first commit that says something like:
+    "This puts us in sync with next-20130618"
+    Then execute the command:
+    # ./gentree.py --verbose --clean --git-revision next-20130618 --copy-list copy-list.mac80211 --extra-driver ../ copy-list.wcn36xx ../linux-next/ ../backport-wcn
+
+    This command will create the folder ../backport-wcn where it will put all the necessary linux stuff from linux-next.
+    It will also apply a number of patches, if any of these fail you must sort it out otherwise the build folder will 
+    not be ready.
+
+8) # cd ../backport-wcn
+
+9) Time to build!
+
+   # export CM_BUILD=mako
+   # export CM_ROOT=~/mako/cm-10.1
+   This sets up some links to your cm build
+
+   # make KLIB=$CM_ROOT/out/target/product/$CM_BUILD/obj/KERNEL_OBJ \
+        KLIB_BUILD=$CM_ROOT/out/target/product/$CM_BUILD/obj/KERNEL_OBJ \
+        ARCH=arm \
+        CROSS_COMPILE=$CM_ROOT/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi- \
+        defconfig-wcn36xx
+
+    This executes the defconfig for the environment
+    
+
+    # make KLIB=$CM_ROOT/out/target/product/$CM_BUILD/obj/KERNEL_OBJ \
+        KLIB_BUILD=$CM_ROOT/out/target/product/$CM_BUILD/obj/KERNEL_OBJ \
+        ARCH=arm \
+        CROSS_COMPILE=$CM_ROOT/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
+
+    Builds the module and all necessary compat/cfg80211/mac80211 modules as well.
+
+10) Symlink wcn36xx driver to your own repository
+
+    The gentree.py command will copy the driver from the place you pointed out.
+    In this case '../'. However, if you want to work on it I recommend replacing the
+    folder with a symlink to where you have your repo for wcn36xx.
+    # rm -rf drivers/net/wireless/ath/wcn36xx
+    # ln -s ~/git/wcn36xx drivers/net/wireless/ath/wcn36xx
+
+NOTES FOR OSX:
+To make this run on OSX (Mountain Lion) I had to do some changes.
+1) The make commands shall not use the same path for the CROSS_COMPILE option. "linux-x86" must be replaced with "darwin-x86".
+
+2) The Makefile in backport-wcn must be modified. 
+    The comment on line 101 looking like this:
+		# RHEL as well, sadly we need to grep for it				;\
+    It must be remove or else you will get a bash error.
+
+3) You must modify the kconf/Makefile 
+   To the first line in this file (beginning with CFLAGS) add -DKBUILD_NO_NLS to the end.
+   Otherwise you will get a lkc.h error when building.
+ 
-- 
1.8.3.1




More information about the wcn36xx mailing list