Skip to contentSkip to conversation

backports: kernel integration support

RFC In review Luis R. Rodriguez 4 participants 24 messages Oct 29, 2014 – Nov 3, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover backports: kernel integration support

From: "Luis R. Rodriguez" <[email protected]>

Here's a v2 spin on the previous RFCs with a new patch added at the end that actually modifies gentree.py to add the ability to do the kernel integration magic now.

If you'd like to test this get Linus' tree and reset it to some old kernel:

git reset --hard v3.15

Then get linux-next and reset it to the latest supported tag:

git reset --hard next-20141003o

apply this series on top of that lest backports tree and then do somethine like:

mcgrof@ergon ~/backports (git::master)$ ./gentree.py --clean --integrate --gitdebug /home/mcgrof/linux-next/ /home/mcgrof/test-linus-tree/

The test-linus-tree in this case is a clone of Linus' tree reset to v3.15. What this will do is add the drivers that backports supports into that tree already backported for you and with tha appropriate kconfig / makefile magic done. The way we use --gitdebug is that since you are using a git tree for Linus' tree you'll see commits of each change done by the integration, this leverages off of Johannes's git debug work but applies now also nicely for integration to see each step.

On 'make menuconfig' you will now see a backports menu, drivers will only be available if you do not enable them on your older kernel options. Right now things build with make M=backports and the last piece of integration with vmlinux still needs some refinement. I notice that the souce "drivers/..." on some backports/drivers/ Kconfig files didn't get modified with source "backports/drivers/..." so that needs to be fixed to populate more divers.

This obviously also needs testing to ensure we don't break packaging of backports with ckmake, but we can start looking at that once we at least complete integration which hopefully shouldn't take much longer.

Reminder: we should add a Kconfig entry for the LINUX_BACKPORT define symbol as part of this work as some folks dont' want to use it.

Please note that this last patch was a bit sloppy but hence the RFC, figured its best to get this out for more eyeball review than hogging it up longer.

Luis R. Rodriguez (4):
backports: replace CPTCFG prefix for CONFIG_BACKPORT
backports: replace BACKPORT_PWD with BACKPORT_DIR
backports: use BACKPORT_DIR prefix on kconfig sources
backports: add kernl integration support to gentree.py

 backport/Kconfig                                   |   47 -
 backport/Kconfig.sources                           |   23 +
 backport/Makefile                                  |    7 +-
 backport/Makefile.build                            |    4 +-
 backport/Makefile.kernel                           |   54 +-
 backport/Makefile.real                             |    4 +-
 backport/backport-include/asm/dma-mapping.h        |    4 +-
 backport/backport-include/backport/backport.h      |    3 +-
 backport/backport-include/backport/checks.h        |   12 -
 backport/backport-include/backport/leds-disabled.h |    2 +-
 backport/backport-include/net/net_namespace.h      |    4 +-
 backport/compat/Makefile                           |   42 +-
 backport/compat/backport-3.15.c                    |    4 +-
 backport/compat/backports.h                        |    4 +-
 backport/defconfigs/alx                            |    2 +-
 backport/defconfigs/ar5523                         |   16 +-
 backport/defconfigs/ath10k                         |   22 +-
 backport/defconfigs/ath5k                          |   16 +-
 backport/defconfigs/ath6kl                         |   14 +-
 backport/defconfigs/ath9k                          |   18 +-
 backport/defconfigs/ath9k-debug                    |   38 +-
 backport/defconfigs/b43                            |   40 +-
 backport/defconfigs/b43legacy                      |   24 +-
 backport/defconfigs/brcmfmac                       |   14 +-
 backport/defconfigs/brcmsmac                       |   18 +-
 backport/defconfigs/carl9170                       |   16 +-
 backport/defconfigs/cw1200                         |   18 +-
 backport/defconfigs/hwsim                          |   24 +-
 backport/defconfigs/ieee802154                     |   16 +-
 backport/defconfigs/igb                            |    4 +-
 backport/defconfigs/iwlwifi                        |   34 +-
 backport/defconfigs/media                          | 1026 ++++++++++----------
 backport/defconfigs/nfc                            |   40 +-
 backport/defconfigs/rtlwifi                        |   46 +-
 backport/defconfigs/wcn36xx                        |   26 +-
 backport/defconfigs/wifi                           |  232 ++---
 backport/defconfigs/wil6210                        |   10 +-
 backport/defconfigs/wwan                           |   12 +-
 backport/scripts/uninstall.sh                      |    4 +-
 devel/ckmake                                       |    4 +-
 devel/doc/kconfig-operation                        |   22 +-
 gentree.py                                         |  212 +++-
 lib/bpversion.py                                   |   48 +
 lib/kconfig.py                                     |  136 ++-
 patches/backport-adjustments/devcoredump.patch     |    4 +-
 45 files changed, 1323 insertions(+), 1047 deletions(-)
 delete mode 100644 backport/Kconfig
 create mode 100644 backport/Kconfig.sources
 delete mode 100644 backport/backport-include/backport/checks.h
 create mode 100644 lib/bpversion.py
Signature · 1 line
2.1.1
#1 lore raw

RFC v2 1/4 backports: replace CPTCFG prefix for CONFIG_BACKPORT

From: "Luis R. Rodriguez" <[email protected]>

In order to support built-in kernel integration we want to use a more generic approach to defining symbols, CPTCFG was nice as it was short and relied on the fact that kconfig can work with a getenv(CONFIG_) but for kernel integration this doesn't work so well. Instead let's just stick to the regular CONFIG_ namespace and add the BACKPORT prefix to it.

Apart from these expected changes:

for i in $(find ./ | grep -v "\.git"); do perl -pi -e'$_ =~ s|CPTCFG|CONFIG_BACKPORT|gs;' $i; done

we also had to modify Makefiles and Kconfig entries quite a bit in order to accomplish the same goal. This means extending our kconfig parser. This adds some initial code for integration, this doesn't run yet.

Since we have to really understand what is in your kernel, what we carry over, and deal with this on the Kconfig parser we can now easily just ensure that whenever we backport a solution that the user doesn't have this built-in. We previously had a checks.h file for this but with these new changes this is no longer needed.

---
 backport/Kconfig                                   |    6 +-
 backport/Makefile.kernel                           |   36 +-
 backport/Makefile.real                             |    2 +-
 backport/backport-include/asm/dma-mapping.h        |    4 +-
 backport/backport-include/backport/backport.h      |    1 -
 backport/backport-include/backport/checks.h        |   12 -
 backport/backport-include/backport/leds-disabled.h |    2 +-
 backport/backport-include/net/net_namespace.h      |    4 +-
 backport/compat/Makefile                           |   38 +-
 backport/compat/backport-3.15.c                    |    4 +-
 backport/compat/backports.h                        |    4 +-
 backport/defconfigs/alx                            |    2 +-
 backport/defconfigs/ar5523                         |   16 +-
 backport/defconfigs/ath10k                         |   22 +-
 backport/defconfigs/ath5k                          |   16 +-
 backport/defconfigs/ath6kl                         |   14 +-
 backport/defconfigs/ath9k                          |   18 +-
 backport/defconfigs/ath9k-debug                    |   38 +-
 backport/defconfigs/b43                            |   40 +-
 backport/defconfigs/b43legacy                      |   24 +-
 backport/defconfigs/brcmfmac                       |   14 +-
 backport/defconfigs/brcmsmac                       |   18 +-
 backport/defconfigs/carl9170                       |   16 +-
 backport/defconfigs/cw1200                         |   18 +-
 backport/defconfigs/hwsim                          |   24 +-
 backport/defconfigs/ieee802154                     |   16 +-
 backport/defconfigs/igb                            |    4 +-
 backport/defconfigs/iwlwifi                        |   34 +-
 backport/defconfigs/media                          | 1026 ++++++++++----------
 backport/defconfigs/nfc                            |   40 +-
 backport/defconfigs/rtlwifi                        |   46 +-
 backport/defconfigs/wcn36xx                        |   26 +-
 backport/defconfigs/wifi                           |  232 ++---
 backport/defconfigs/wil6210                        |   10 +-
 backport/defconfigs/wwan                           |   12 +-
 devel/ckmake                                       |    4 +-
 devel/doc/kconfig-operation                        |   22 +-
 gentree.py                                         |   30 +-
 lib/kconfig.py                                     |   79 +-
 patches/backport-adjustments/devcoredump.patch     |    4 +-
 40 files changed, 1028 insertions(+), 950 deletions(-)
 delete mode 100644 backport/backport-include/backport/checks.h
backport/Kconfig +5 -1
index b14a268..f63f4fd 100644
@@ -14,11 +14,15 @@ config BACKPORTED_KERNEL_NAME
 source Kconfig.kernel
 source Kconfig.versions
 
-# some hacks ...
+# some hacks for when we use backports to generate a package
+# to build modules out of tree.
+#ignore-parser-package
 config WIRELESS
 	def_bool y
+#ignore-parser-package
 config NET_CORE
 	def_bool y
+#ignore-parser-package
 config EXPERT
 	def_bool y
 
backport/Makefile.kernel +18 -18
index dcb2ba7..c31def8 100644
@@ -20,23 +20,23 @@ export backport_srctree = $(M)
 
 obj-y += compat/
 
-obj-$(CPTCFG_CFG80211) += net/wireless/
-obj-$(CPTCFG_MAC80211) += net/mac80211/
-obj-$(CPTCFG_WLAN) += drivers/net/wireless/
-obj-$(CPTCFG_BT) += net/bluetooth/
-obj-$(CPTCFG_BT) += drivers/bluetooth/
-obj-$(CPTCFG_SSB) += drivers/ssb/
-obj-$(CPTCFG_BCMA) += drivers/bcma/
-obj-$(CPTCFG_ETHERNET) += drivers/net/ethernet/
-obj-$(CPTCFG_USB_NET_RNDIS_WLAN) += drivers/net/usb/
-obj-$(CPTCFG_NFC) += net/nfc/
-obj-$(CPTCFG_NFC) += drivers/nfc/
-obj-$(CPTCFG_MEDIA_SUPPORT) += drivers/media/
+obj-$(CONFIG_BACKPORT_CFG80211) += net/wireless/
+obj-$(CONFIG_BACKPORT_MAC80211) += net/mac80211/
+obj-$(CONFIG_BACKPORT_WLAN) += drivers/net/wireless/
+obj-$(CONFIG_BACKPORT_BT) += net/bluetooth/
+obj-$(CONFIG_BACKPORT_BT) += drivers/bluetooth/
+obj-$(CONFIG_BACKPORT_SSB) += drivers/ssb/
+obj-$(CONFIG_BACKPORT_BCMA) += drivers/bcma/
+obj-$(CONFIG_BACKPORT_ETHERNET) += drivers/net/ethernet/
+obj-$(CONFIG_BACKPORT_USB_NET_RNDIS_WLAN) += drivers/net/usb/
+obj-$(CONFIG_BACKPORT_NFC) += net/nfc/
+obj-$(CONFIG_BACKPORT_NFC) += drivers/nfc/
+obj-$(CONFIG_BACKPORT_MEDIA_SUPPORT) += drivers/media/
 
-obj-$(CPTCFG_IEEE802154) += net/ieee802154/
-obj-$(CPTCFG_BT) += net/ieee802154/
-obj-$(CPTCFG_MAC802154) += net/mac802154/
-obj-$(CPTCFG_IEEE802154) += drivers/net/ieee802154/
+obj-$(CONFIG_BACKPORT_IEEE802154) += net/ieee802154/
+obj-$(CONFIG_BACKPORT_BT) += net/ieee802154/
+obj-$(CONFIG_BACKPORT_MAC802154) += net/mac802154/
+obj-$(CONFIG_BACKPORT_IEEE802154) += drivers/net/ieee802154/
 
-obj-$(CPTCFG_USB_WDM) += drivers/usb/class/
-obj-$(CPTCFG_USB_USBNET) += drivers/net/usb/
+obj-$(CONFIG_BACKPORT_USB_WDM) += drivers/usb/class/
+obj-$(CONFIG_BACKPORT_USB_USBNET) += drivers/net/usb/
backport/Makefile.real +1 -1
index f60d5ca..4475570 100644
@@ -9,7 +9,7 @@ endif
 # disable built-in rules for this file
 .SUFFIXES:
 
-export CONFIG_=CPTCFG_
+#export CONFIG_=CONFIG_BACKPORT_
 
 .PHONY: menuconfig
 menuconfig:
backport/backport-include/asm/dma-mapping.h +2 -2
index 844fe3b..a65562c 100644
@@ -3,12 +3,12 @@
 #include_next <asm/dma-mapping.h>
 #include <linux/version.h>
 
-#if defined(CPTCFG_BACKPORT_BUILD_DMA_SHARED_HELPERS)
+#if defined(CONFIG_BACKPORT_BUILD_DMA_SHARED_HELPERS)
 #define dma_common_get_sgtable LINUX_BACKPORT(dma_common_get_sgtable)
 int
 dma_common_get_sgtable(struct device *dev, struct sg_table *sgt,
 		       void *cpu_addr, dma_addr_t dma_addr, size_t size);
-#endif /* defined(CPTCFG_BACKPORT_BUILD_DMA_SHARED_HELPERS) */
+#endif /* defined(CONFIG_BACKPORT_BUILD_DMA_SHARED_HELPERS) */
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)
 
backport/backport-include/backport/backport.h +0 -1
index 7cf21aa..8edb151 100644
@@ -5,7 +5,6 @@
 
 #ifndef __ASSEMBLY__
 #define LINUX_BACKPORT(__sym) backport_ ##__sym
-#include <backport/checks.h>
 #endif
 
 #endif /* __BACKPORT_H */
backport/backport-include/backport/checks.h deleted +0 -12
deleted file mode 100644
index d2c3492..0000000
@@ -1,12 +0,0 @@
-#ifndef __BACKPORT_CHECKS
-#define __BACKPORT_CHECKS
-
-#if defined(CONFIG_MAC80211) && defined(CPTCFG_MAC80211)
-#error "You must not have mac80211 built into your kernel if you want to enable it"
-#endif
-
-#if defined(CONFIG_CFG80211) && defined(CPTCFG_CFG80211)
-#error "You must not have cfg80211 built into your kernel if you want to enable it"
-#endif
-
-#endif /* __BACKPORT_CHECKS */
backport/backport-include/backport/leds-disabled.h +1 -1
index 501f2a0..984242a 100644
@@ -8,7 +8,7 @@
  * allows compilation.
  */
 
-#ifdef CPTCFG_BACKPORT_BUILD_LEDS
+#ifdef CONFIG_BACKPORT_BUILD_LEDS
 #include <linux/list.h>
 #include <linux/spinlock.h>
 #include <linux/rwsem.h>
backport/backport-include/net/net_namespace.h +2 -2
index e83b103..1746c48 100644
@@ -3,7 +3,7 @@
 
 #include_next <net/net_namespace.h>
 
-#if IS_ENABLED(CPTCFG_IEEE802154_6LOWPAN)
+#if IS_ENABLED(CONFIG_BACKPORT_IEEE802154_6LOWPAN)
 #include <linux/version.h>
 #include <net/netns/ieee802154_6lowpan.h>
 
@@ -22,6 +22,6 @@ net_ieee802154_lowpan(struct net *net)
 	return &net->ieee802154_lowpan;
 }
 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) */
-#endif /* CPTCFG_IEEE802154_6LOWPAN */
+#endif /* CONFIG_BACKPORT_IEEE802154_6LOWPAN */
 
 #endif	/* _COMPAT_NET_NET_NAMESPACE_H */
backport/compat/Makefile +19 -19
index 6d210b0..aba2c3a 100644
@@ -3,23 +3,23 @@ obj-m += compat.o
 compat-y += main.o
 
 # Kernel backport compatibility code
-compat-$(CPTCFG_BACKPORT_KERNEL_3_0) += compat-3.0.o
-compat-$(CPTCFG_BACKPORT_KERNEL_3_1) += compat-3.1.o
-compat-$(CPTCFG_BACKPORT_KERNEL_3_2) += backport-3.2.o
-compat-$(CPTCFG_BACKPORT_KERNEL_3_3) += compat-3.3.o
-compat-$(CPTCFG_BACKPORT_KERNEL_3_4) += compat-3.4.o
-compat-$(CPTCFG_BACKPORT_KERNEL_3_5) += compat-3.5.o user_namespace.o
-compat-$(CPTCFG_BACKPORT_KERNEL_3_6) += compat-3.6.o
-compat-$(CPTCFG_BACKPORT_KERNEL_3_7) += compat-3.7.o
-compat-$(CPTCFG_BACKPORT_KERNEL_3_8) += compat-3.8.o
-compat-$(CPTCFG_BACKPORT_KERNEL_3_9) += compat-3.9.o
-compat-$(CPTCFG_BACKPORT_KERNEL_3_10) += backport-3.10.o
-compat-$(CPTCFG_BACKPORT_KERNEL_3_12) += backport-3.12.o
-compat-$(CPTCFG_BACKPORT_KERNEL_3_13) += backport-3.13.o
-compat-$(CPTCFG_BACKPORT_KERNEL_3_14) += backport-3.14.o
-compat-$(CPTCFG_BACKPORT_KERNEL_3_15) += backport-3.15.o
-compat-$(CPTCFG_BACKPORT_KERNEL_3_17) += backport-3.17.o
-compat-$(CPTCFG_BACKPORT_KERNEL_3_18) += backport-3.18.o
+compat-$(CONFIG_BACKPORT_KERNEL_3_0) += compat-3.0.o
+compat-$(CONFIG_BACKPORT_KERNEL_3_1) += compat-3.1.o
+compat-$(CONFIG_BACKPORT_KERNEL_3_2) += backport-3.2.o
+compat-$(CONFIG_BACKPORT_KERNEL_3_3) += compat-3.3.o
+compat-$(CONFIG_BACKPORT_KERNEL_3_4) += compat-3.4.o
+compat-$(CONFIG_BACKPORT_KERNEL_3_5) += compat-3.5.o user_namespace.o
+compat-$(CONFIG_BACKPORT_KERNEL_3_6) += compat-3.6.o
+compat-$(CONFIG_BACKPORT_KERNEL_3_7) += compat-3.7.o
+compat-$(CONFIG_BACKPORT_KERNEL_3_8) += compat-3.8.o
+compat-$(CONFIG_BACKPORT_KERNEL_3_9) += compat-3.9.o
+compat-$(CONFIG_BACKPORT_KERNEL_3_10) += backport-3.10.o
+compat-$(CONFIG_BACKPORT_KERNEL_3_12) += backport-3.12.o
+compat-$(CONFIG_BACKPORT_KERNEL_3_13) += backport-3.13.o
+compat-$(CONFIG_BACKPORT_KERNEL_3_14) += backport-3.14.o
+compat-$(CONFIG_BACKPORT_KERNEL_3_15) += backport-3.15.o
+compat-$(CONFIG_BACKPORT_KERNEL_3_17) += backport-3.17.o
+compat-$(CONFIG_BACKPORT_KERNEL_3_18) += backport-3.18.o
 
-compat-$(CPTCFG_BACKPORT_BUILD_CRYPTO_CCM) += crypto-ccm.o
-compat-$(CPTCFG_BACKPORT_BUILD_DMA_SHARED_HELPERS) += dma-shared-helpers.o
+compat-$(CONFIG_BACKPORT_BUILD_CRYPTO_CCM) += crypto-ccm.o
+compat-$(CONFIG_BACKPORT_BUILD_DMA_SHARED_HELPERS) += dma-shared-helpers.o
backport/compat/backport-3.15.c +2 -2
index 75216eb..e6c5a10 100644
@@ -15,7 +15,7 @@
 #include <linux/string.h>
 #include <net/net_namespace.h>
 
-#if IS_ENABLED(CPTCFG_IEEE802154_6LOWPAN)
+#if IS_ENABLED(CONFIG_BACKPORT_IEEE802154_6LOWPAN)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0)
 /* the above kernel dependency is set to match the dependencies file */
 struct netns_ieee802154_lowpan ieee802154_lowpan;
@@ -27,7 +27,7 @@ struct netns_ieee802154_lowpan *net_ieee802154_lowpan(struct net *net)
 }
 EXPORT_SYMBOL_GPL(net_ieee802154_lowpan);
 #endif
-#endif /* CPTCFG_IEEE802154_6LOWPAN */
+#endif /* CONFIG_BACKPORT_IEEE802154_6LOWPAN */
 
 /**
  * devm_kstrdup - Allocate resource managed space and
backport/compat/backports.h +2 -2
index c9094ac..36700f4 100644
@@ -3,7 +3,7 @@
 
 #include <linux/version.h>
 
-#ifdef CPTCFG_BACKPORT_BUILD_CRYPTO_CCM
+#ifdef CONFIG_BACKPORT_BUILD_CRYPTO_CCM
 int crypto_ccm_module_init(void);
 void crypto_ccm_module_exit(void);
 #else
@@ -13,7 +13,7 @@ static inline void crypto_ccm_module_exit(void)
 {}
 #endif
 
-#ifdef CPTCFG_BACKPORT_BUILD_WANT_DEV_COREDUMP
+#ifdef CONFIG_BACKPORT_BUILD_WANT_DEV_COREDUMP
 int devcoredump_init(void);
 void devcoredump_exit(void);
 #else
backport/defconfigs/alx +1 -1
index b4ae66f..a11e927 100644
@@ -1 +1 @@
-CPTCFG_ALX=m
+CONFIG_BACKPORT_ALX=m
backport/defconfigs/ar5523 +8 -8
index b218d9a..8ee68d9 100644
@@ -1,8 +1,8 @@
-CPTCFG_CFG80211=m
-CPTCFG_CFG80211_WEXT=y
-CPTCFG_MAC80211=m
-CPTCFG_MAC80211_LEDS=y
-CPTCFG_MAC80211_MESH=y
-CPTCFG_WLAN=y
-CPTCFG_ATH_CARDS=m
-CPTCFG_AR5523=m
+CONFIG_BACKPORT_CFG80211=m
+CONFIG_BACKPORT_CFG80211_WEXT=y
+CONFIG_BACKPORT_MAC80211=m
+CONFIG_BACKPORT_MAC80211_LEDS=y
+CONFIG_BACKPORT_MAC80211_MESH=y
+CONFIG_BACKPORT_WLAN=y
+CONFIG_BACKPORT_ATH_CARDS=m
+CONFIG_BACKPORT_AR5523=m
backport/defconfigs/ath10k +11 -11
index c791c99..74948a3 100644
@@ -1,11 +1,11 @@
-CPTCFG_CFG80211=m
-CPTCFG_CFG80211_WEXT=y
-CPTCFG_MAC80211=m
-CPTCFG_MAC80211_LEDS=y
-CPTCFG_MAC80211_MESH=y
-CPTCFG_WLAN=y
-CPTCFG_ATH_CARDS=m
-CPTCFG_ATH10K_PCI=m
-CPTCFG_ATH10K=m
-CPTCFG_ATH10K_DEBUG=y
-CPTCFG_ATH10K_DEBUGFS=y
+CONFIG_BACKPORT_CFG80211=m
+CONFIG_BACKPORT_CFG80211_WEXT=y
+CONFIG_BACKPORT_MAC80211=m
+CONFIG_BACKPORT_MAC80211_LEDS=y
+CONFIG_BACKPORT_MAC80211_MESH=y
+CONFIG_BACKPORT_WLAN=y
+CONFIG_BACKPORT_ATH_CARDS=m
+CONFIG_BACKPORT_ATH10K_PCI=m
+CONFIG_BACKPORT_ATH10K=m
+CONFIG_BACKPORT_ATH10K_DEBUG=y
+CONFIG_BACKPORT_ATH10K_DEBUGFS=y
backport/defconfigs/ath5k +8 -8
index df95c57..140ae08 100644
@@ -1,8 +1,8 @@
-CPTCFG_CFG80211=m
-CPTCFG_CFG80211_WEXT=y
-CPTCFG_MAC80211=m
-CPTCFG_MAC80211_LEDS=y
-CPTCFG_MAC80211_MESH=y
-CPTCFG_WLAN=y
-CPTCFG_ATH_CARDS=m
-CPTCFG_ATH5K=m
+CONFIG_BACKPORT_CFG80211=m
+CONFIG_BACKPORT_CFG80211_WEXT=y
+CONFIG_BACKPORT_MAC80211=m
+CONFIG_BACKPORT_MAC80211_LEDS=y
+CONFIG_BACKPORT_MAC80211_MESH=y
+CONFIG_BACKPORT_WLAN=y
+CONFIG_BACKPORT_ATH_CARDS=m
+CONFIG_BACKPORT_ATH5K=m
backport/defconfigs/ath6kl +7 -7
index a372127..517540e 100644
@@ -1,7 +1,7 @@
-CPTCFG_CFG80211=m
-CPTCFG_CFG80211_WEXT=y
-CPTCFG_WLAN=y
-CPTCFG_ATH_CARDS=m
-CPTCFG_ATH6KL=m
-CPTCFG_ATH6KL_SDIO=m
-CPTCFG_ATH6KL_USB=m
+CONFIG_BACKPORT_CFG80211=m
+CONFIG_BACKPORT_CFG80211_WEXT=y
+CONFIG_BACKPORT_WLAN=y
+CONFIG_BACKPORT_ATH_CARDS=m
+CONFIG_BACKPORT_ATH6KL=m
+CONFIG_BACKPORT_ATH6KL_SDIO=m
+CONFIG_BACKPORT_ATH6KL_USB=m
backport/defconfigs/ath9k +9 -9
index 0e935cc..355f7d3 100644
@@ -1,9 +1,9 @@
-CPTCFG_CFG80211=m
-CPTCFG_CFG80211_WEXT=y
-CPTCFG_MAC80211=m
-CPTCFG_MAC80211_LEDS=y
-CPTCFG_MAC80211_MESH=y
-CPTCFG_WLAN=y
-CPTCFG_ATH_CARDS=m
-CPTCFG_ATH9K=m
-CPTCFG_ATH9K_HTC=m
+CONFIG_BACKPORT_CFG80211=m
+CONFIG_BACKPORT_CFG80211_WEXT=y
+CONFIG_BACKPORT_MAC80211=m
+CONFIG_BACKPORT_MAC80211_LEDS=y
+CONFIG_BACKPORT_MAC80211_MESH=y
+CONFIG_BACKPORT_WLAN=y
+CONFIG_BACKPORT_ATH_CARDS=m
+CONFIG_BACKPORT_ATH9K=m
+CONFIG_BACKPORT_ATH9K_HTC=m
backport/defconfigs/ath9k-debug +19 -19
index b7baedd..fa009ff 100644
@@ -1,19 +1,19 @@
-CPTCFG_CFG80211=m
-CPTCFG_CFG80211_WEXT=y
-CPTCFG_MAC80211=m
-CPTCFG_MAC80211_LEDS=y
-CPTCFG_MAC80211_MESH=y
-CPTCFG_MAC80211_DEBUGFS=y
-CPTCFG_MAC80211_DEBUG_MENU=y
-CPTCFG_MAC80211_VERBOSE_DEBUG=y
-CPTCFG_MAC80211_MLME_DEBUG=y
-CPTCFG_MAC80211_STA_DEBUG=y
-CPTCFG_MAC80211_HT_DEBUG=y
-CPTCFG_MAC80211_IBSS_DEBUG=y
-CPTCFG_MAC80211_PS_DEBUG=y
-CPTCFG_WLAN=y
-CPTCFG_ATH_CARDS=m
-CPTCFG_ATH9K=m
-CPTCFG_ATH9K_HTC=m
-CPTCFG_ATH_DEBUG=y
-CPTCFG_ATH9K_DEBUGFS=y
+CONFIG_BACKPORT_CFG80211=m
+CONFIG_BACKPORT_CFG80211_WEXT=y
+CONFIG_BACKPORT_MAC80211=m
+CONFIG_BACKPORT_MAC80211_LEDS=y
+CONFIG_BACKPORT_MAC80211_MESH=y
+CONFIG_BACKPORT_MAC80211_DEBUGFS=y
+CONFIG_BACKPORT_MAC80211_DEBUG_MENU=y
+CONFIG_BACKPORT_MAC80211_VERBOSE_DEBUG=y
+CONFIG_BACKPORT_MAC80211_MLME_DEBUG=y
+CONFIG_BACKPORT_MAC80211_STA_DEBUG=y
+CONFIG_BACKPORT_MAC80211_HT_DEBUG=y
+CONFIG_BACKPORT_MAC80211_IBSS_DEBUG=y
+CONFIG_BACKPORT_MAC80211_PS_DEBUG=y
+CONFIG_BACKPORT_WLAN=y
+CONFIG_BACKPORT_ATH_CARDS=m
+CONFIG_BACKPORT_ATH9K=m
+CONFIG_BACKPORT_ATH9K_HTC=m
+CONFIG_BACKPORT_ATH_DEBUG=y
+CONFIG_BACKPORT_ATH9K_DEBUGFS=y
backport/defconfigs/b43 +20 -20
index dd2ba89..5946a12 100644
@@ -1,20 +1,20 @@
-CPTCFG_CFG80211=m
-CPTCFG_CFG80211_WEXT=y
-CPTCFG_MAC80211=m
-CPTCFG_MAC80211_MESH=y
-CPTCFG_MAC80211_LEDS=y
-CPTCFG_WLAN=y
-CPTCFG_B43=m
-CPTCFG_B43_BCMA=y
-CPTCFG_B43_PCMCIA=y
-CPTCFG_B43_SDIO=y
-CPTCFG_B43_PHY_N=y
-CPTCFG_B43_PHY_LP=y
-CPTCFG_B43_PHY_HT=y
-CPTCFG_BCMA=m
-CPTCFG_BCMA_HOST_PCI=y
-CPTCFG_SSB=m
-CPTCFG_SSB_PCIHOST=y
-CPTCFG_SSB_PCMCIAHOST=y
-CPTCFG_SSB_SDIOHOST=y
-CPTCFG_SSB_DRIVER_PCICORE=y
+CONFIG_BACKPORT_CFG80211=m
+CONFIG_BACKPORT_CFG80211_WEXT=y
+CONFIG_BACKPORT_MAC80211=m
+CONFIG_BACKPORT_MAC80211_MESH=y
+CONFIG_BACKPORT_MAC80211_LEDS=y
+CONFIG_BACKPORT_WLAN=y
+CONFIG_BACKPORT_B43=m
+CONFIG_BACKPORT_B43_BCMA=y
+CONFIG_BACKPORT_B43_PCMCIA=y
+CONFIG_BACKPORT_B43_SDIO=y
+CONFIG_BACKPORT_B43_PHY_N=y
+CONFIG_BACKPORT_B43_PHY_LP=y
+CONFIG_BACKPORT_B43_PHY_HT=y
+CONFIG_BACKPORT_BCMA=m
+CONFIG_BACKPORT_BCMA_HOST_PCI=y
+CONFIG_BACKPORT_SSB=m
+CONFIG_BACKPORT_SSB_PCIHOST=y
+CONFIG_BACKPORT_SSB_PCMCIAHOST=y
+CONFIG_BACKPORT_SSB_SDIOHOST=y
+CONFIG_BACKPORT_SSB_DRIVER_PCICORE=y
backport/defconfigs/b43legacy +12 -12
index 9a7fbe9..10636d6 100644
@@ -1,12 +1,12 @@
-CPTCFG_CFG80211=m
-CPTCFG_CFG80211_WEXT=y
-CPTCFG_MAC80211=m
-CPTCFG_MAC80211_MESH=y
-CPTCFG_MAC80211_LEDS=y
-CPTCFG_WLAN=y
-CPTCFG_B43LEGACY=m
-CPTCFG_SSB=m
-CPTCFG_SSB_PCIHOST=y
-CPTCFG_SSB_PCMCIAHOST=y
-CPTCFG_SSB_SDIOHOST=y
-CPTCFG_SSB_DRIVER_PCICORE=y
+CONFIG_BACKPORT_CFG80211=m
+CONFIG_BACKPORT_CFG80211_WEXT=y
+CONFIG_BACKPORT_MAC80211=m
+CONFIG_BACKPORT_MAC80211_MESH=y
+CONFIG_BACKPORT_MAC80211_LEDS=y
+CONFIG_BACKPORT_WLAN=y
+CONFIG_BACKPORT_B43LEGACY=m
+CONFIG_BACKPORT_SSB=m
+CONFIG_BACKPORT_SSB_PCIHOST=y
+CONFIG_BACKPORT_SSB_PCMCIAHOST=y
+CONFIG_BACKPORT_SSB_SDIOHOST=y
+CONFIG_BACKPORT_SSB_DRIVER_PCICORE=y
backport/defconfigs/brcmfmac +7 -7
index f4657c7..4f61341 100644
@@ -1,7 +1,7 @@
-CPTCFG_CFG80211=m
-CPTCFG_CFG80211_WEXT=y
-CPTCFG_WLAN=y
-CPTCFG_BRCMFMAC=m
-CPTCFG_BRCMFMAC_SDIO=y
-CPTCFG_BRCMFMAC_USB=y
-CPTCFG_BRCMFMAC_PCIE=y
+CONFIG_BACKPORT_CFG80211=m
+CONFIG_BACKPORT_CFG80211_WEXT=y
+CONFIG_BACKPORT_WLAN=y
+CONFIG_BACKPORT_BRCMFMAC=m
+CONFIG_BACKPORT_BRCMFMAC_SDIO=y
+CONFIG_BACKPORT_BRCMFMAC_USB=y
+CONFIG_BACKPORT_BRCMFMAC_PCIE=y
backport/defconfigs/brcmsmac +9 -9
index a1c56bc..4b9b287 100644
@@ -1,9 +1,9 @@
-CPTCFG_CFG80211=m
-CPTCFG_CFG80211_WEXT=y
-CPTCFG_MAC80211=m
-CPTCFG_MAC80211_LEDS=y
-CPTCFG_WLAN=y
-CPTCFG_BRCMSMAC=m
-CPTCFG_BCMA=m
-CPTCFG_BCMA_HOST_PCI=y
-CPTCFG_BCMA_DRIVER_GPIO=y
+CONFIG_BACKPORT_CFG80211=m
+CONFIG_BACKPORT_CFG80211_WEXT=y
+CONFIG_BACKPORT_MAC80211=m
+CONFIG_BACKPORT_MAC80211_LEDS=y
+CONFIG_BACKPORT_WLAN=y
+CONFIG_BACKPORT_BRCMSMAC=m
+CONFIG_BACKPORT_BCMA=m
+CONFIG_BACKPORT_BCMA_HOST_PCI=y
+CONFIG_BACKPORT_BCMA_DRIVER_GPIO=y
backport/defconfigs/carl9170 +8 -8
index cc94e37..e2ec2b7 100644
@@ -1,8 +1,8 @@
-CPTCFG_CFG80211=m
-CPTCFG_CFG80211_WEXT=y
-CPTCFG_MAC80211=m
-CPTCFG_MAC80211_LEDS=y
-CPTCFG_MAC80211_MESH=y
-CPTCFG_WLAN=y
-CPTCFG_ATH_CARDS=m
-CPTCFG_CARL9170=m
+CONFIG_BACKPORT_CFG80211=m
+CONFIG_BACKPORT_CFG80211_WEXT=y
+CONFIG_BACKPORT_MAC80211=m
+CONFIG_BACKPORT_MAC80211_LEDS=y
+CONFIG_BACKPORT_MAC80211_MESH=y
+CONFIG_BACKPORT_WLAN=y
+CONFIG_BACKPORT_ATH_CARDS=m
+CONFIG_BACKPORT_CARL9170=m
backport/defconfigs/cw1200 +9 -9
index ba03143..65ee72d 100644
@@ -1,9 +1,9 @@
-CPTCFG_CFG80211=m
-CPTCFG_CFG80211_WEXT=y
-CPTCFG_MAC80211=m
-CPTCFG_MAC80211_LEDS=y
-CPTCFG_MAC80211_MESH=y
-CPTCFG_WLAN=y
-CPTCFG_CW1200=m
-CPTCFG_CW1200_WLAN_SDIO=m
-CPTCFG_CW1200_WLAN_SPI=m
+CONFIG_BACKPORT_CFG80211=m
+CONFIG_BACKPORT_CFG80211_WEXT=y
+CONFIG_BACKPORT_MAC80211=m
+CONFIG_BACKPORT_MAC80211_LEDS=y
+CONFIG_BACKPORT_MAC80211_MESH=y
+CONFIG_BACKPORT_WLAN=y
+CONFIG_BACKPORT_CW1200=m
+CONFIG_BACKPORT_CW1200_WLAN_SDIO=m
+CONFIG_BACKPORT_CW1200_WLAN_SPI=m
backport/defconfigs/hwsim +12 -12
index 9d8006e..a4115ee 100644
@@ -1,12 +1,12 @@
-CPTCFG_CFG80211=m
-CPTCFG_CFG80211_DEFAULT_PS=y
-CPTCFG_CFG80211_DEBUGFS=y
-CPTCFG_CFG80211_WEXT=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_MAC80211_HWSIM=m
+CONFIG_BACKPORT_CFG80211=m
+CONFIG_BACKPORT_CFG80211_DEFAULT_PS=y
+CONFIG_BACKPORT_CFG80211_DEBUGFS=y
+CONFIG_BACKPORT_CFG80211_WEXT=y
+CONFIG_BACKPORT_MAC80211=m
+# CONFIG_BACKPORT_MAC80211_RC_PID is not set
+# CONFIG_BACKPORT_MAC80211_RC_MINSTREL is not set
+# CONFIG_BACKPORT_MAC80211_RC_DEFAULT_MINSTREL is not set
+CONFIG_BACKPORT_MAC80211_DEBUGFS=y
+CONFIG_BACKPORT_MAC80211_MESSAGE_TRACING=y
+CONFIG_BACKPORT_WLAN=y
+CONFIG_BACKPORT_MAC80211_HWSIM=m
backport/defconfigs/ieee802154 +8 -8
index 2c6730a..b7bf674 100644
@@ -1,8 +1,8 @@
-CPTCFG_IEEE802154_DRIVERS=m
-CPTCFG_IEEE802154_FAKEHARD=m
-CPTCFG_IEEE802154_FAKELB=m
-CPTCFG_IEEE802154_AT86RF230=m
-CPTCFG_IEEE802154_MRF24J40=m
-CPTCFG_IEEE802154=m
-CPTCFG_IEEE802154_6LOWPAN=m
-CPTCFG_MAC802154=m
+CONFIG_BACKPORT_IEEE802154_DRIVERS=m
+CONFIG_BACKPORT_IEEE802154_FAKEHARD=m
+CONFIG_BACKPORT_IEEE802154_FAKELB=m
+CONFIG_BACKPORT_IEEE802154_AT86RF230=m
+CONFIG_BACKPORT_IEEE802154_MRF24J40=m
+CONFIG_BACKPORT_IEEE802154=m
+CONFIG_BACKPORT_IEEE802154_6LOWPAN=m
+CONFIG_BACKPORT_MAC802154=m
backport/defconfigs/igb +2 -2
index 8045257..8265381 100644
@@ -1,2 +1,2 @@
-CPTCFG_NET_VENDOR_INTEL=y
-CPTCFG_IGB=m
+CONFIG_BACKPORT_NET_VENDOR_INTEL=y
+CONFIG_BACKPORT_IGB=m
backport/defconfigs/iwlwifi +17 -17
index fe7c6c1..0dd8f9a 100644
@@ -1,17 +1,17 @@
-CPTCFG_CFG80211=m
-CPTCFG_CFG80211_DEFAULT_PS=y
-CPTCFG_CFG80211_DEBUGFS=y
-CPTCFG_CFG80211_WEXT=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_IWLWIFI=m
-CPTCFG_IWLDVM=m
-CPTCFG_IWLMVM=m
-CPTCFG_IWLWIFI_DEBUG=y
-CPTCFG_IWLWIFI_DEBUGFS=y
-CPTCFG_IWLWIFI_DEVICE_TRACING=y
+CONFIG_BACKPORT_CFG80211=m
+CONFIG_BACKPORT_CFG80211_DEFAULT_PS=y
+CONFIG_BACKPORT_CFG80211_DEBUGFS=y
+CONFIG_BACKPORT_CFG80211_WEXT=y
+CONFIG_BACKPORT_MAC80211=m
+# CONFIG_BACKPORT_MAC80211_RC_PID is not set
+# CONFIG_BACKPORT_MAC80211_RC_MINSTREL is not set
+# CONFIG_BACKPORT_MAC80211_RC_DEFAULT_MINSTREL is not set
+CONFIG_BACKPORT_MAC80211_DEBUGFS=y
+CONFIG_BACKPORT_MAC80211_MESSAGE_TRACING=y
+CONFIG_BACKPORT_WLAN=y
+CONFIG_BACKPORT_IWLWIFI=m
+CONFIG_BACKPORT_IWLDVM=m
+CONFIG_BACKPORT_IWLMVM=m
+CONFIG_BACKPORT_IWLWIFI_DEBUG=y
+CONFIG_BACKPORT_IWLWIFI_DEBUGFS=y
+CONFIG_BACKPORT_IWLWIFI_DEVICE_TRACING=y
backport/defconfigs/media +513 -513

1,026 lines not on this page · raw message

backport/defconfigs/nfc +20 -20
index c00f10f..9d60afe 100644
@@ -1,20 +1,20 @@
-CPTCFG_NFC=m
-CPTCFG_NFC_DIGITAL=m
-CPTCFG_NFC_HCI=m
-CPTCFG_NFC_MEI_PHY=m
-CPTCFG_NFC_MICROREAD=m
-CPTCFG_NFC_MICROREAD_I2C=m
-CPTCFG_NFC_MICROREAD_MEI=m
-CPTCFG_NFC_MRVL=m
-CPTCFG_NFC_MRVL_USB=m
-CPTCFG_NFC_NCI=m
-CPTCFG_NFC_NCI_SPI=y
-CPTCFG_NFC_PN533=m
-CPTCFG_NFC_PN544=m
-CPTCFG_NFC_PN544_I2C=m
-CPTCFG_NFC_PN544_MEI=m
-CPTCFG_NFC_PORT100=m
-CPTCFG_NFC_SHDLC=y
-CPTCFG_NFC_SIM=m
-CPTCFG_NFC_TRF7970A=m
-CPTCFG_NFC_WILINK=m
+CONFIG_BACKPORT_NFC=m
+CONFIG_BACKPORT_NFC_DIGITAL=m
+CONFIG_BACKPORT_NFC_HCI=m
+CONFIG_BACKPORT_NFC_MEI_PHY=m
+CONFIG_BACKPORT_NFC_MICROREAD=m
+CONFIG_BACKPORT_NFC_MICROREAD_I2C=m
+CONFIG_BACKPORT_NFC_MICROREAD_MEI=m
+CONFIG_BACKPORT_NFC_MRVL=m
+CONFIG_BACKPORT_NFC_MRVL_USB=m
+CONFIG_BACKPORT_NFC_NCI=m
+CONFIG_BACKPORT_NFC_NCI_SPI=y
+CONFIG_BACKPORT_NFC_PN533=m
+CONFIG_BACKPORT_NFC_PN544=m
+CONFIG_BACKPORT_NFC_PN544_I2C=m
+CONFIG_BACKPORT_NFC_PN544_MEI=m
+CONFIG_BACKPORT_NFC_PORT100=m
+CONFIG_BACKPORT_NFC_SHDLC=y
+CONFIG_BACKPORT_NFC_SIM=m
+CONFIG_BACKPORT_NFC_TRF7970A=m
+CONFIG_BACKPORT_NFC_WILINK=m
backport/defconfigs/rtlwifi +23 -23

46 lines not on this page · raw message

backport/defconfigs/wcn36xx +13 -13
index 374eb11..ef19898 100644
@@ -1,13 +1,13 @@
-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
-CPTCFG_WCN36XX_DEBUGFS=y
+CONFIG_BACKPORT_CFG80211=m
+CONFIG_BACKPORT_CFG80211_DEFAULT_PS=y
+CONFIG_BACKPORT_CFG80211_DEBUGFS=y
+CONFIG_BACKPORT_MAC80211=m
+# CONFIG_BACKPORT_MAC80211_RC_PID is not set
+# CONFIG_BACKPORT_MAC80211_RC_MINSTREL is not set
+# CONFIG_BACKPORT_MAC80211_RC_DEFAULT_MINSTREL is not set
+CONFIG_BACKPORT_MAC80211_DEBUGFS=y
+CONFIG_BACKPORT_MAC80211_MESSAGE_TRACING=y
+CONFIG_BACKPORT_WLAN=y
+CONFIG_BACKPORT_ATH_CARDS=m
+CONFIG_BACKPORT_WCN36XX=m
+CONFIG_BACKPORT_WCN36XX_DEBUGFS=y
backport/defconfigs/wifi +116 -116

232 lines not on this page · raw message

backport/defconfigs/wil6210 +5 -5
index 3fa29b8..0d08636 100644
@@ -1,5 +1,5 @@
-CPTCFG_CFG80211=m
-CPTCFG_CFG80211_WEXT=y
-CPTCFG_WLAN=y
-CPTCFG_ATH_CARDS=m
-CPTCFG_WIL6210=m
+CONFIG_BACKPORT_CFG80211=m
+CONFIG_BACKPORT_CFG80211_WEXT=y
+CONFIG_BACKPORT_WLAN=y
+CONFIG_BACKPORT_ATH_CARDS=m
+CONFIG_BACKPORT_WIL6210=m
backport/defconfigs/wwan +6 -6
index 5b4d2e7..64fd61e 100644
@@ -1,6 +1,6 @@
-CPTCFG_USB_USBNET=m
-CPTCFG_USB_NET_CDC_NCM=m
-CPTCFG_USB_NET_CDC_MBIM=m
-CPTCFG_USB_NET_QMI_WWAN=m
-CPTCFG_USB_SIERRA_NET=m
-CPTCFG_USB_WDM=m
+CONFIG_BACKPORT_USB_USBNET=m
+CONFIG_BACKPORT_USB_NET_CDC_NCM=m
+CONFIG_BACKPORT_USB_NET_CDC_MBIM=m
+CONFIG_BACKPORT_USB_NET_QMI_WWAN=m
+CONFIG_BACKPORT_USB_SIERRA_NET=m
+CONFIG_BACKPORT_USB_WDM=m
devel/ckmake +2 -2
index 0c238a6..122d201 100755
@@ -164,7 +164,7 @@ def process_kernel(num, kset, cmdline_args):
 
         all_config_name = os.path.join(work_dir, 'all.config')
         all_config = open(all_config_name, 'w')
-        all_config.write("CPTCFG_CFG80211_INTERNAL_REGDB=n\n")
+        all_config.write("CONFIG_BACKPORT_CFG80211_INTERNAL_REGDB=n\n")
         config_name = 'allnoconfig'
         if cmdline_args.allyesconfig:
             config_name = 'allyesconfig'
@@ -172,7 +172,7 @@ def process_kernel(num, kset, cmdline_args):
             all_config.write(
                 open(os.path.join(work_dir, 'defconfigs', cmdline_args.defconfig)).read())
         else:
-            all_config.write("CPTCFG_BACKPORT_USERSEL_BUILD_ALL=y\n")
+            all_config.write("CONFIG_BACKPORT_USERSEL_BUILD_ALL=y\n")
         all_config.close()
 
         all_config_env = os.environ.copy()
devel/doc/kconfig-operation +11 -11
index 0245889..f938942 100644
@@ -64,16 +64,16 @@ being compiled against is older than X.
 All together, this allows the correct options to be selected by the user.
 
 There's one more caveat: At backport configuration time, the CONFIG_
-environment variable is set to CPTCFG_ ("compat config", but also chosen
-because it has the same length as CONFIG_). This shows up in the .config
-file and other places, and in fact in all makefiles and in the code. The
-reason for this is that it must be possible to distinguish between kernel
-and backport options (even though we sort of port over kernel options).
-This allows code to, for example, have "#ifdef CONFIG_PM" which can only
-be set or cleared in the kernel, not in the backport configuration. Since
-this is needed, a transformation step is done at backport creation time.
-
+environment variable is always replaced with CONFIG_BACKPORT_ for things
+we backport.
 
+This shows up in the .config file and other places, and in fact in all
+makefiles and in the code. The reason for this is that it must be possible
+to distinguish between kernel and backport options (even though we sort
+of port over kernel options). This allows code to, for example, have
+"#ifdef CONFIG_PM" which can only be set or cleared in the kernel, not
+in the backport configuration. Since this is needed, a transformation
+step is done at backport creation time.
 
  Backport creation for Kconfig
 -------------------------------
@@ -82,9 +82,9 @@ In order to achieve correct operation with all the above, multiple steps
 are necessary during the backport creation process.
 
 These are the problems and their solutions:
- 1) As just mentioned, all symbols are now named CPTCFG_* instead of the
+ 1) As just mentioned, all symbols are now named CONFIG_BACKPORT_* instead of the
     original CONFIG_*. This requires that all code files (and makefiles)
-    are updated to use CPTCFG_* and CPTCFG_*_MODULE instead of the CONFIG_
+    are updated to use CONFIG_BACKPORT_* and CONFIG_BACKPORT_*_MODULE instead of the CONFIG_
     versions of the same. However, not *all* CONFIG_* usage may be changed
     since some options must come from the kernel still. More importantly,
     kernel options "leak" into the backport build and the rename avoids
gentree.py +20 -10
index 9b4db98..47e3ca2 100755
@@ -228,9 +228,9 @@ def add_automatic_backports(args):
                 raise Exception('backporting a module requires a #module-name')
             for of in o_files:
                 mf.write('%s-objs += %s\n' % (module_name, of))
-            mf.write('obj-$(CPTCFG_%s) += %s.o\n' % (sym, module_name))
+            mf.write('obj-$(CONFIG_BACKPORT_%s) += %s.o\n' % (sym, module_name))
         elif symtype == 'bool':
-            mf.write('compat-$(CPTCFG_%s) += %s\n' % (sym, ' '.join(o_files)))
+            mf.write('compat-$(CONFIG_BACKPORT_%s) += %s\n' % (sym, ' '.join(o_files)))
 
         # finally create the include file
         syms = []
@@ -243,14 +243,14 @@ def add_automatic_backports(args):
         for f in h_files:
             outf = open(os.path.join(args.outdir, 'include', f), 'w')
             outf.write('/* Automatically created during backport process */\n')
-            outf.write('#ifndef CPTCFG_%s\n' % sym)
+            outf.write('#ifndef CONFIG_BACKPORT_%s\n' % sym)
             outf.write('#include_next <%s>\n' % f)
             outf.write('#else\n');
             for s in syms:
                 outf.write('#undef %s\n' % s)
                 outf.write('#define %s LINUX_BACKPORT(%s)\n' % (s, s))
             outf.write('#include <%s>\n' % (os.path.dirname(f) + '/backport-' + os.path.basename(f), ))
-            outf.write('#endif /* CPTCFG_%s */\n' % sym)
+            outf.write('#endif /* CONFIG_BACKPORT_%s */\n' % sym)
     return disable_list
 
 def git_debug_init(args):
@@ -552,6 +552,7 @@ def process(kerneldir, outdir, copy_list_file, git_revision=None,
                 gitdebug, verbose, extra_driver, kup, kup_test,
                 test_cocci, profile_cocci)
     rel_prep = None
+    integrate = False
 
     # start processing ...
     if (args.kup or args.kup_test):
@@ -758,11 +759,19 @@ def process(kerneldir, outdir, copy_list_file, git_revision=None,
 
     # some post-processing is required
     configtree = kconfig.ConfigTree(os.path.join(args.outdir, 'Kconfig'))
+    orig_symbols = configtree.symbols()
+
     logwrite('Modify Kconfig tree ...')
     configtree.prune_sources(ignore=['Kconfig.kernel', 'Kconfig.versions'])
     git_debug_snapshot(args, "prune Kconfig tree")
-    configtree.force_tristate_modular()
-    git_debug_snapshot(args, "force tristate options modular")
+
+    configtree.adjust_backported_configs(integrate, orig_symbols)
+    git_debug_snapshot(args, "adjust backports config symbols we port")
+
+    if (not integrate):
+        configtree.force_tristate_modular()
+        git_debug_snapshot(args, "force tristate options modular")
+
     configtree.modify_selects()
     git_debug_snapshot(args, "convert select to depends on")
 
@@ -819,8 +828,9 @@ def process(kerneldir, outdir, copy_list_file, git_revision=None,
 
     # rewrite Makefile and source symbols
     regexes = []
-    for some_symbols in [symbols[i:i + 50] for i in range(0, len(symbols), 50)]:
-        r = 'CONFIG_((' + '|'.join([s + '(_MODULE)?' for s in some_symbols]) + ')([^A-Za-z0-9_]|$))'
+    all_symbols = orig_symbols + symbols
+    for some_symbols in [all_symbols[i:i + 50] for i in range(0, len(all_symbols), 50)]:
+        r = 'CONFIG_((?!BACKPORT)(' + '|'.join([s + '(_MODULE)?' for s in some_symbols]) + ')([^A-Za-z0-9_]|$))'
         regexes.append(re.compile(r, re.MULTILINE))
     for root, dirs, files in os.walk(args.outdir):
         # don't go into .git dir (possible debug thing)
@@ -829,7 +839,7 @@ def process(kerneldir, outdir, copy_list_file, git_revision=None,
         for f in files:
             data = open(os.path.join(root, f), 'r').read()
             for r in regexes:
-                data = r.sub(r'CPTCFG_\1', data)
+                data = r.sub(r'CONFIG_BACKPORT_\1', data)
             data = re.sub(r'\$\(srctree\)', '$(backport_srctree)', data)
             data = re.sub(r'-Idrivers', '-I$(backport_srctree)/drivers', data)
             fo = open(os.path.join(root, f), 'w')
@@ -875,7 +885,7 @@ def process(kerneldir, outdir, copy_list_file, git_revision=None,
     # groups -- 50 seemed safer and is still fast)
     regexes = []
     for some_symbols in [disable_makefile[i:i + 50] for i in range(0, len(disable_makefile), 50)]:
-        r = '^([^#].*((CPTCFG|CONFIG)_(' + '|'.join([s for s in some_symbols]) + ')))'
+        r = '^([^#].*((CONFIG_BACKPORT|CONFIG)_(' + '|'.join([s for s in some_symbols]) + ')))'
         regexes.append(re.compile(r, re.MULTILINE))
     for f in maketree.get_makefiles():
         data = open(f, 'r').read()
lib/kconfig.py +78 -1

93 lines not on this page · raw message

patches/backport-adjustments/devcoredump.patch +2 -2
index 3378884..1d31c77 100644
@@ -107,7 +107,7 @@ index c0a360e99f64..da20e61f6c06 100644
  #include <linux/vmalloc.h>
  
 -#ifdef CONFIG_DEV_COREDUMP
-+#ifdef CPTCFG_BACKPORT_BUILD_WANT_DEV_COREDUMP
++#ifdef CONFIG_BACKPORT_BUILD_WANT_DEV_COREDUMP
  void dev_coredumpv(struct device *dev, const void *data, size_t datalen,
  		   gfp_t gfp);
  
@@ -116,6 +116,6 @@ index c0a360e99f64..da20e61f6c06 100644
  	free(data);
  }
 -#endif /* CONFIG_DEV_COREDUMP */
-+#endif /* CPTCFG_BACKPORT_BUILD_WANT_DEV_COREDUMP */
++#endif /* CONFIG_BACKPORT_BUILD_WANT_DEV_COREDUMP */
  
  #endif /* __DEVCOREDUMP_H */
Signature · 1 line
2.1.1
#2 lore raw

Re: [RFC v2 1/4] backports: replace CPTCFG prefix for CONFIG_BACKPORT

Quoted 9 lines · Luis R. Rodriguez

From: "Luis R. Rodriguez" <[email protected]>

In order to support built-in kernel integration we want to use a more generic approach to defining symbols, CPTCFG was nice as it was short and relied on the fact that kconfig can work with a getenv(CONFIG_) but for kernel integration this doesn't work so well. Instead let's just stick to the regular CONFIG_ namespace and add the BACKPORT prefix to it.

Quoted 3 lines

Apart from these expected changes:

for i in $(find ./ | grep -v "\.git"); do perl -pi -e'$_ =~ s|CPTCFG|CONFIG_BACKPORT|gs;' $i; done

I really think you need to make this optional for the in-tree generation, otherwise it will complicate things a lot for anyone who's already using backports in a way that doesn't have it regenerated all the time.

Additionally, CPTCFG_ had the advantage of having the same length as CONFIG_, so code style wise it was nicer to replace.

Please make this a post-process step that runs on everything, including the backport stuff, rather than running only on the source and assuming the backport stuff already uses this convention.

johannes

#3 lore raw

Re: [RFC v2 1/4] backports: replace CPTCFG prefix for CONFIG_BACKPORT

Quoted 10 lines · Johannes Berg
Quoted 9 lines · Luis R. Rodriguez

From: "Luis R. Rodriguez" <[email protected]>

In order to support built-in kernel integration we want to use a more generic approach to defining symbols, CPTCFG was nice as it was short and relied on the fact that kconfig can work with a getenv(CONFIG_) but for kernel integration this doesn't work so well. Instead let's just stick to the regular CONFIG_ namespace and add the BACKPORT prefix to it.

Quoted 8 lines
Quoted 3 lines

Apart from these expected changes:

for i in $(find ./ | grep -v "\.git"); do perl -pi -e'$_ =~ s|CPTCFG|CONFIG_BACKPORT|gs;' $i; done

I really think you need to make this optional for the in-tree generation, otherwise it will complicate things a lot for anyone who's already using backports in a way that doesn't have it regenerated all the time.

Logistically I do agree this will implicate tons of merge conflicts if a git tree was used for development based on backports, however functionally I don't expect this this to create divergence.

Quoted 6 lines

Additionally, CPTCFG_ had the advantage of having the same length as CONFIG_, so code style wise it was nicer to replace.

Please make this a post-process step that runs on everything, including the backport stuff, rather than running only on the source and assuming the backport stuff already uses this convention.

I want to but lets consider the amount of work to maintain the two separate approaches, is it worth it?

Luis

#4 lore raw

Re: [RFC v2 1/4] backports: replace CPTCFG prefix for CONFIG_BACKPORT

Quoted 8 lines · Luis R. Rodriguez
Quoted 4 lines

I really think you need to make this optional for the in-tree generation, otherwise it will complicate things a lot for anyone who's already using backports in a way that doesn't have it regenerated all the time.

Logistically I do agree this will implicate tons of merge conflicts if a git tree was used for development based on backports, however functionally I don't expect this this to create divergence.

Agree, but it's going to be a nightmare from the merge point of view, and also the CPTCFG_ is nicer to replace back and forth between backports-based development and the kernel, due to this:

Quoted 11 lines
Quoted 8 lines

Additionally, CPTCFG_ had the advantage of having the same length as CONFIG_, so code style wise it was nicer to replace.

Please make this a post-process step that runs on everything, including the backport stuff, rather than running only on the source and assuming the backport stuff already uses this convention.

I want to but lets consider the amount of work to maintain the two separate approaches, is it worth it?

I don't see why it'd be maintaining two approaches? Right now we have scripting to replace CONFIG_ with CPTCFG_, so couldn't we just add more scripting to replace CPTCFG_ with CONFIG_BACKPORT_ ?

That also makes me think of something else - we currently use BACKPORT_ as a prefix for some of the other stuff under compat/Kconfig, and in fact rename some things (like CONFIG_BACKPORT_AVERAGE) so maybe also using CONFIG_BACKPORT_ here isn't a great idea? Might want to use something else, say CONFIG_BPT_ or so.

johannes

#5 lore raw

Re: [RFC v2 1/4] backports: replace CPTCFG prefix for CONFIG_BACKPORT

Quoted 6 lines · Johannes Berg
Quoted 4 lines · Luis R. Rodriguez
Quoted 3 lines

Please make this a post-process step that runs on everything, including the backport stuff, rather than running only on the source and assuming the backport stuff already uses this convention.

Quoted 6 lines
Quoted 2 lines

I want to but lets consider the amount of work to maintain the two separate approaches, is it worth it?

I don't see why it'd be maintaining two approaches? Right now we have scripting to replace CONFIG_ with CPTCFG_, so couldn't we just add more scripting to replace CPTCFG_ with CONFIG_BACKPORT_ ?

Hm, OK well let me give it a shot, at compilation time which approach are we going to use? I don't like the idea of having two different sets of naming approaching for packaging and integration, however I can see how that might be useful for determining where some code might come from or how backports was used, but other than that we would need to pick if we're going to support the integration naming scheme also for packaging as an option or just use CPTCFG for it. If the same naming scheme is an option then that means we either have to test both or leave one untested. This is why I ultimately would prefer we just stick to one approach for both.

The fact that CPTCFG has same length as CONFIG really has no empirical value, its just cosmetic, meanwhile I am however more concerned with the above and I think its worth some serious consideration.

Quoted 5 lines

That also makes me think of something else - we currently use BACKPORT_ as a prefix for some of the other stuff under compat/Kconfig, and in fact rename some things (like CONFIG_BACKPORT_AVERAGE) so maybe also using CONFIG_BACKPORT_ here isn't a great idea? Might want to use something else, say CONFIG_BPT_ or so.

That's a good point, I take it that it does not matter which one we pick for each, so long as its different? If so I think CONFIG_BACKPORT is pretty clear for things we carry over like device drivers, but this is just subjective and so long as we pick something I think it'll be fine.

I do believe the harder thing to decide is the above possible divergence thing and if we can agree on that I think the rest of the series is not as controversial.

Luis

#6 lore raw

Re: [RFC v2 1/4] backports: replace CPTCFG prefix for CONFIG_BACKPORT

Quoted 11 lines · Luis R. Rodriguez
Quoted 5 lines

That also makes me think of something else - we currently use BACKPORT_ as a prefix for some of the other stuff under compat/Kconfig, and in fact rename some things (like CONFIG_BACKPORT_AVERAGE) so maybe also using CONFIG_BACKPORT_ here isn't a great idea? Might want to use something else, say CONFIG_BPT_ or so.

That's a good point, I take it that it does not matter which one we pick for each, so long as its different? If so I think CONFIG_BACKPORT is pretty clear for things we carry over like device drivers, but this is just subjective and so long as we pick something I think it'll be fine.

Thought about this some more, the stuff under compat/ is just backported through a slightly different strategy -- the Kconfig copy-file stuff but yet its very similar to the copy-list mechanism, where it ends up is different but I am not sure if it makes sense to keep a different naming scheme for each backport strategy.

Luis

#7 lore raw

Re: [RFC v2 1/4] backports: replace CPTCFG prefix for CONFIG_BACKPORT

Quoted 13 lines · Luis R. Rodriguez
Quoted 11 lines · Luis R. Rodriguez
Quoted 5 lines

That also makes me think of something else - we currently use BACKPORT_ as a prefix for some of the other stuff under compat/Kconfig, and in fact rename some things (like CONFIG_BACKPORT_AVERAGE) so maybe also using CONFIG_BACKPORT_ here isn't a great idea? Might want to use something else, say CONFIG_BPT_ or so.

That's a good point, I take it that it does not matter which one we pick for each, so long as its different? If so I think CONFIG_BACKPORT is pretty clear for things we carry over like device drivers, but this is just subjective and so long as we pick something I think it'll be fine.

Quoted 5 lines

Thought about this some more, the stuff under compat/ is just backported through a slightly different strategy -- the Kconfig copy-file stuff but yet its very similar to the copy-list mechanism, where it ends up is different but I am not sure if it makes sense to keep a different naming scheme for each backport strategy.

Yes, but the stuff under compat/ is also treated specially by the scripting - config symbols there automatically replace the ones in the rest of the tree for example (see "config AVERAGE" for example, you get "depends on BACKPORT_AVERAGE" and some BUILD_PACKPORT_AVERAGE magic)

johannes

#8 lore raw

Re: [RFC v2 1/4] backports: replace CPTCFG prefix for CONFIG_BACKPORT

Quoted 20 lines · Johannes Berg
Quoted 13 lines · Luis R. Rodriguez
Quoted 11 lines · Luis R. Rodriguez
Quoted 5 lines

That also makes me think of something else - we currently use BACKPORT_ as a prefix for some of the other stuff under compat/Kconfig, and in fact rename some things (like CONFIG_BACKPORT_AVERAGE) so maybe also using CONFIG_BACKPORT_ here isn't a great idea? Might want to use something else, say CONFIG_BPT_ or so.

That's a good point, I take it that it does not matter which one we pick for each, so long as its different? If so I think CONFIG_BACKPORT is pretty clear for things we carry over like device drivers, but this is just subjective and so long as we pick something I think it'll be fine.

Quoted 5 lines

Thought about this some more, the stuff under compat/ is just backported through a slightly different strategy -- the Kconfig copy-file stuff but yet its very similar to the copy-list mechanism, where it ends up is different but I am not sure if it makes sense to keep a different naming scheme for each backport strategy.

Quoted 4 lines

Yes, but the stuff under compat/ is also treated specially by the scripting - config symbols there automatically replace the ones in the rest of the tree for example (see "config AVERAGE" for example, you get "depends on BACKPORT_AVERAGE" and some BUILD_PACKPORT_AVERAGE magic)

With my current code I end up with on a package (not integration):

config BACKPORT_BUILD_AVERAGE
bool
depends on !AVERAGE
default y if BACKPORT_USERSEL_BUILD_ALL
default y if BACKPORT_AVERAGE
#h-file linux/average.h
#c-file lib/average.c

config BACKPORT_AVERAGE
bool

I do see I on the package with this on the Makfile though:

compat-$(CONFIG_BACKPORT_BACKPORT_BUILD_AVERAGE) += lib-average.o

Would it not suffice to just ensure we don't have BACKPORT_BACKPORT_ here and just BACKPORT_ once ?

Luis

#9 lore raw

Re: [RFC v2 1/4] backports: replace CPTCFG prefix for CONFIG_BACKPORT

Quoted 14 lines · Luis R. Rodriguez

With my current code I end up with on a package (not integration):

config BACKPORT_BUILD_AVERAGE
bool
depends on !AVERAGE
default y if BACKPORT_USERSEL_BUILD_ALL
default y if BACKPORT_AVERAGE
#h-file linux/average.h
#c-file lib/average.c

config BACKPORT_AVERAGE
bool

Quoted 7 lines

I do see I on the package with this on the Makfile though:

compat-$(CONFIG_BACKPORT_BACKPORT_BUILD_AVERAGE) += lib-average.o

Would it not suffice to just ensure we don't have BACKPORT_BACKPORT_ here and just BACKPORT_ once ?

The BACKPORT_BACKPORT_ is actually correct ... but it'll be really hard to make sense of :-)

johannes

#10 lore raw

Re: [RFC v2 1/4] backports: replace CPTCFG prefix for CONFIG_BACKPORT

Quoted 19 lines · Johannes Berg
Quoted 17 lines · Luis R. Rodriguez

With my current code I end up with on a package (not integration):

config BACKPORT_BUILD_AVERAGE
bool
depends on !AVERAGE
default y if BACKPORT_USERSEL_BUILD_ALL
default y if BACKPORT_AVERAGE
#h-file linux/average.h
#c-file lib/average.c

config BACKPORT_AVERAGE
bool

I do see I on the package with this on the Makfile though:

Quoted 7 lines
Quoted 4 lines

compat-$(CONFIG_BACKPORT_BACKPORT_BUILD_AVERAGE) += lib-average.o

Would it not suffice to just ensure we don't have BACKPORT_BACKPORT_ here and just BACKPORT_ once ?

The BACKPORT_BACKPORT_ is actually correct ... but it'll be really hard to make sense of :-)

OK I'll prefix the stuff we copy over with something else then, BPAUTO.

Luis

#11 lore raw

Re: [RFC v2 1/4] backports: replace CPTCFG prefix for CONFIG_BACKPORT

Quoted 1 line · Luis R. Rodriguez

OK I'll prefix the stuff we copy over with something else then, BPAUTO.

I still want to keep CPTCFG though :)

johannes

#12 lore raw

Re: [RFC v2 1/4] backports: replace CPTCFG prefix for CONFIG_BACKPORT

Quoted 5 lines · Johannes Berg
Quoted 1 line · Luis R. Rodriguez

OK I'll prefix the stuff we copy over with something else then, BPAUTO.

I still want to keep CPTCFG though :)

:*( OK I'll give it a shot...

Luis

#13 lore raw

RFC v2 2/4 backports: replace BACKPORT_PWD with BACKPORT_DIR

In reply to Luis R. Rodriguez

From: "Luis R. Rodriguez" <[email protected]>

This will also be used for built-in kernel integration, by using this we can share more code with the built-in kernel approach.

---
 backport/Makefile             | 6 +++---
 backport/Makefile.build       | 4 ++--
 backport/Makefile.real        | 2 +-
 backport/scripts/uninstall.sh | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)
backport/Makefile +3 -3
index ea3982b..fcf2f01 100644
@@ -6,7 +6,7 @@ ifeq ($(KERNELRELEASE),)
 
 MAKEFLAGS += --no-print-directory
 SHELL := /bin/bash
-BACKPORT_PWD := $(shell pwd)
+BACKPORT_DIR := $(shell pwd)
 
 KMODDIR ?= updates
 ifneq ($(origin KLIB), undefined)
@@ -20,7 +20,7 @@ KERNEL_CONFIG := $(KLIB_BUILD)/.config
 KERNEL_MAKEFILE := $(KLIB_BUILD)/Makefile
 CONFIG_MD5 := $(shell md5sum $(KERNEL_CONFIG) 2>/dev/null | sed 's/\s.*//')
 
-export KLIB KLIB_BUILD BACKPORT_PWD KMODDIR KMODPATH_ARG
+export KLIB KLIB_BUILD BACKPORT_DIR KMODDIR KMODPATH_ARG
 
 # disable built-in rules for this file
 .SUFFIXES:
@@ -159,5 +159,5 @@ help: defconfig-help
 	@echo ""
 	@echo "Execute "make" or "make all" to build all targets marked with [*]"
 else
-include $(BACKPORT_PWD)/Makefile.kernel
+include $(BACKPORT_DIR)/Makefile.kernel
 endif
backport/Makefile.build +2 -2
index d209041..a848b37 100644
@@ -3,8 +3,8 @@ export
 
 .PHONY: modules
 modules:
-	@$(MAKE) -C $(KLIB_BUILD) M=$(BACKPORT_PWD) modules
+	@$(MAKE) -C $(KLIB_BUILD) M=$(BACKPORT_DIR) modules
 
 .PHONY: clean
 clean:
-	@$(MAKE) -C $(KLIB_BUILD) M=$(BACKPORT_PWD) clean
+	@$(MAKE) -C $(KLIB_BUILD) M=$(BACKPORT_DIR) clean
backport/Makefile.real +1 -1
index 4475570..1a55ce5 100644
@@ -89,7 +89,7 @@ modules: backport-include/backport/autoconf.h
 
 .PHONY: install
 install: modules
-	@$(MAKE) -C $(KLIB_BUILD) M=$(BACKPORT_PWD)			\
+	@$(MAKE) -C $(KLIB_BUILD) M=$(BACKPORT_DIR)			\
 		INSTALL_MOD_DIR=$(KMODDIR) $(KMODPATH_ARG)		\
 		modules_install
 	@./scripts/blacklist.sh $(KLIB)/ $(KLIB)/$(KMODDIR)
backport/scripts/uninstall.sh +2 -2
index 1eb42b0..b46d3fe 100755
@@ -10,8 +10,8 @@ else
 	compr=""
 fi
 
-for driver in $(find ${BACKPORT_PWD} -type f -name *.ko); do
-	mod_name=${driver/${BACKPORT_PWD}/${KLIB}${KMODDIR}}${compr}
+for driver in $(find ${BACKPORT_DIR} -type f -name *.ko); do
+	mod_name=${driver/${BACKPORT_DIR}/${KLIB}${KMODDIR}}${compr}
 	echo "  uninstall" $mod_name
 	rm -f $mod_name
 done
Signature · 1 line
2.1.1
#14 lore raw

Re: [RFC v2 2/4] backports: replace BACKPORT_PWD with BACKPORT_DIR

Quoted 5 lines · Luis R. Rodriguez

From: "Luis R. Rodriguez" <[email protected]>

This will also be used for built-in kernel integration, by using this we can share more code with the built-in kernel approach.

I see no issues with this, looks like a straight rename.

johannes

#15 lore raw

Re: [RFC v2 2/4] backports: replace BACKPORT_PWD with BACKPORT_DIR

Quoted 8 lines · Johannes Berg
Quoted 5 lines · Luis R. Rodriguez

From: "Luis R. Rodriguez" <[email protected]>

This will also be used for built-in kernel integration, by using this we can share more code with the built-in kernel approach.

I see no issues with this, looks like a straight rename.

I'll add your Reviewed-by at least.

Luis

#16 lore raw

RFC v2 3/4 backports: use BACKPORT_DIR prefix on kconfig sources

In reply to Luis R. Rodriguez

From: "Luis R. Rodriguez" <[email protected]>

This will allow us to do less work for built-in integration support. This requires a bit of self evaluation of the variable within our kconfig library, ideally we'd have support for groking all variables defined within the Kconfig setup but that requires quite a lot more work as it means also parsing Makefiles and inheriting these definitions within config symbols when used. Since we only define one right now and its used for built-in support we deal with it ourselves for now.

Please consider the complexity of adding others, it doesn't seem like there would be much need for others though. If others wanted to use a different BACKPORT_DIR path other than 'backports' that would require tweaking here, but we'll start by assuming no one will want to do that.

---
 backport/Kconfig | 37 ++++++++++++++++++++-----------------
 lib/kconfig.py   | 47 ++++++++++++++++++++++++++++++++++++-----------
 2 files changed, 56 insertions(+), 28 deletions(-)
backport/Kconfig +20 -17
index f63f4fd..c523323 100644
@@ -1,5 +1,8 @@
 mainmenu "Linux Backports from $BACKPORTED_KERNEL_NAME $BACKPORTED_KERNEL_VERSION (with backports $BACKPORTS_VERSION)"
 
+config BACKPORT_DIR
+	string
+	option env="BACKPORT_DIR"
 config BACKPORTS_VERSION
 	string
 	option env="BACKPORTS_VERSION"
@@ -11,8 +14,8 @@ config BACKPORTED_KERNEL_NAME
 	option env="BACKPORTED_KERNEL_NAME"
 
 # these will be generated
-source Kconfig.kernel
-source Kconfig.versions
+source "$BACKPORT_DIR/Kconfig.kernel"
+source "$BACKPORT_DIR/Kconfig.versions"
 
 # some hacks for when we use backports to generate a package
 # to build modules out of tree.
@@ -27,25 +30,25 @@ config EXPERT
 	def_bool y
 
 # this has the configuration for the backport code
-source compat/Kconfig
+source "$BACKPORT_DIR/compat/Kconfig"
 
 # these are copied from the kernel
-source net/wireless/Kconfig
-source net/mac80211/Kconfig
-source net/bluetooth/Kconfig
-source drivers/net/wireless/Kconfig
-source drivers/net/ethernet/Kconfig
-source drivers/net/usb/Kconfig
+source "$BACKPORT_DIR/net/wireless/Kconfig"
+source "$BACKPORT_DIR/net/mac80211/Kconfig"
+source "$BACKPORT_DIR/net/bluetooth/Kconfig"
+source "$BACKPORT_DIR/drivers/net/wireless/Kconfig"
+source "$BACKPORT_DIR/drivers/net/ethernet/Kconfig"
+source "$BACKPORT_DIR/drivers/net/usb/Kconfig"
 
-source drivers/ssb/Kconfig
-source drivers/bcma/Kconfig
+source "$BACKPORT_DIR/drivers/ssb/Kconfig"
+source "$BACKPORT_DIR/drivers/bcma/Kconfig"
 
-source net/nfc/Kconfig
+source "$BACKPORT_DIR/net/nfc/Kconfig"
 
-source drivers/media/Kconfig
+source "$BACKPORT_DIR/drivers/media/Kconfig"
 
-source net/ieee802154/Kconfig
-source net/mac802154/Kconfig
-source drivers/net/ieee802154/Kconfig
+source "$BACKPORT_DIR/net/ieee802154/Kconfig"
+source "$BACKPORT_DIR/net/mac802154/Kconfig"
+source "$BACKPORT_DIR/drivers/net/ieee802154/Kconfig"
 
-source drivers/usb/class/Kconfig
+source "$BACKPORT_DIR/drivers/usb/class/Kconfig"
lib/kconfig.py +36 -11

65 lines not on this page · raw message

Signature · 1 line
2.1.1
#17 lore raw

Re: [RFC v2 3/4] backports: use BACKPORT_DIR prefix on kconfig sources

Quoted 15 lines · Luis R. Rodriguez

src_line = re.compile(r'^\s*source\s+"?(?P<src>[^\s"]*)"?\s*$')

lib/kconfig.py +4 -3
+bk_src_line = re.compile(r'^\s*source\s+"?\$BACKPORT_DIR/(?P<src>[^\s"]*)"?\s*$')
 tri_line = re.compile(r'^(?P<spc>\s+)tristate')
 bool_line = re.compile(r'^(?P<spc>\s+)bool')
 cfg_line = re.compile(r'^(?P<opt>config|menuconfig)\s+(?P<sym>[^\s]*)')
@@ -21,23 +22,47 @@ class ConfigTree(object):
         yield f
         for l in open(os.path.join(self.basedir, f), 'r'):
             m = src_line.match(l)
-            if m and os.path.exists(os.path.join(self.basedir, m.group('src'))):
-                for i in self._walk(m.group('src')):
-                    yield i
+            if m:
+                bm = bk_src_line.match(l)
+                if bm:

lib/kconfig.py class ConfigTree(object): · line 37

Quoted 10 lines
lib/kconfig.py +10 -0
+                    if os.path.exists(os.path.join(self.basedir, bm.group('src'))):
+                        for i in self._walk(os.path.join(self.basedir, bm.group('src'))):
+                            yield i
+                    elif os.path.exists(os.path.join(self.basedir, 'backports/' + bm.group('src'))):
+                        for i in self._walk(os.path.join(self.basedir, 'backports/' + bm.group('src'))):
+                            yield i
+                else:
+                    if os.path.exists(os.path.join(self.basedir, m.group('src'))):
+                        for i in self._walk(m.group('src')):
+                            yield i

Are you even using the src_line regular expression any more? Seems like you could just modify it though to make the (\$BACKPORT_DIR/) part optional.

Quoted 7 lines
lib/kconfig.py +0 -3
     def _prune_sources(self, f, ignore):
         for nf in self._walk(f):
             out = ''
             for l in open(os.path.join(self.basedir, nf), 'r'):
-                m = src_line.match(l)
-                if not m:
-                    out += l

lib/kconfig.py class ConfigTree(object): · line 48

Quoted 10 lines
lib/kconfig.py +6 -4
-                    continue
-                src = m.group('src')
-                if src in ignore or os.path.exists(os.path.join(self.basedir, src)):
-                    out += l
+                bm = bk_src_line.match(l)
+                if bm:
+                    bp_src = bm.group('src')
+                    if bp_src in ignore or \
+                       os.path.exists(os.path.join(self.basedir, bp_src)) or \
+                       os.path.exists(os.path.join(self.basedir, 'backports/' + bp_src)):

I'd prefer parentheses instead of \ line continuations :)

the backports/ part seems to be for integration only?

lib/kconfig.py class ConfigTree(object): · line 57

Quoted 5 lines
lib/kconfig.py +5 -0
+                    m = src_line.match(l)
+                    # we should consider disallowing these as it could mean
+                    # someone forgot to add the BACKPORT_DIR prefix to
+                    # the kconfig source entries which we will need to
+                    # support built-in integration.

If you put it in the same RE then you can just print a warning on this if detected but skip it otherwise.

johannes

#18 lore raw

Re: [RFC v2 3/4] backports: use BACKPORT_DIR prefix on kconfig sources

Quoted 23 lines · Johannes Berg
Quoted 21 lines · Luis R. Rodriguez

src_line = re.compile(r'^\s*source\s+"?(?P<src>[^\s"]*)"?\s*$')

lib/kconfig.py +10 -3
+bk_src_line = re.compile(r'^\s*source\s+"?\$BACKPORT_DIR/(?P<src>[^\s"]*)"?\s*$')
 tri_line = re.compile(r'^(?P<spc>\s+)tristate')
 bool_line = re.compile(r'^(?P<spc>\s+)bool')
 cfg_line = re.compile(r'^(?P<opt>config|menuconfig)\s+(?P<sym>[^\s]*)')
@@ -21,23 +22,47 @@ class ConfigTree(object):
         yield f
         for l in open(os.path.join(self.basedir, f), 'r'):
             m = src_line.match(l)
-            if m and os.path.exists(os.path.join(self.basedir, m.group('src'))):
-                for i in self._walk(m.group('src')):
-                    yield i
+            if m:
+                bm = bk_src_line.match(l)
+                if bm:
+                    if os.path.exists(os.path.join(self.basedir, bm.group('src'))):
+                        for i in self._walk(os.path.join(self.basedir, bm.group('src'))):
+                            yield i
+                    elif os.path.exists(os.path.join(self.basedir, 'backports/' + bm.group('src'))):
+                        for i in self._walk(os.path.join(self.basedir, 'backports/' + bm.group('src'))):
+                            yield i
Quoted 8 lines

lib/kconfig.py class ConfigTree(object): · line 37

Quoted 4 lines
lib/kconfig.py +4 -0
+                else:
+                    if os.path.exists(os.path.join(self.basedir, m.group('src'))):
+                        for i in self._walk(m.group('src')):
+                            yield i

Are you even using the src_line regular expression any more? Seems like you could just modify it though to make the (\$BACKPORT_DIR/) part optional.

Sure make sense. I suppose we should be consistant too and use $BACKPORT_DIR.

Quoted 18 lines
Quoted 7 lines
lib/kconfig.py +0 -3
     def _prune_sources(self, f, ignore):
         for nf in self._walk(f):
             out = ''
             for l in open(os.path.join(self.basedir, nf), 'r'):
-                m = src_line.match(l)
-                if not m:
-                    out += l

lib/kconfig.py class ConfigTree(object): · line 48

Quoted 10 lines
lib/kconfig.py +6 -4
-                    continue
-                src = m.group('src')
-                if src in ignore or os.path.exists(os.path.join(self.basedir, src)):
-                    out += l
+                bm = bk_src_line.match(l)
+                if bm:
+                    bp_src = bm.group('src')
+                    if bp_src in ignore or \
+                       os.path.exists(os.path.join(self.basedir, bp_src)) or \
+                       os.path.exists(os.path.join(self.basedir, 'backports/' + bp_src)):
Quoted 1 line

I'd prefer parentheses instead of \ line continuations :)

OK :)

Quoted 1 line

the backports/ part seems to be for integration only?

I think I went trigger happy since the bk_src_line should have picked up on the fact that backports directory prefix would already have been used. I'll re-test and remove not needed thing and try to consolidate the regexp.

Quoted 8 lines

lib/kconfig.py class ConfigTree(object): · line 57

Quoted 5 lines
lib/kconfig.py +5 -0
+                    m = src_line.match(l)
+                    # we should consider disallowing these as it could mean
+                    # someone forgot to add the BACKPORT_DIR prefix to
+                    # the kconfig source entries which we will need to
+                    # support built-in integration.

If you put it in the same RE then you can just print a warning on this if detected but skip it otherwise.

What I meant by this was more of the things that could go into a Kconfig which we perhaps are not parsing yet which might depend on a path, so its not clear to me what regexp to use. Right now it will just leave the lines intact and I guess that's fine for now.

Luis

#19 lore raw

RFC v2 4/4 backports: add kernl integration support to gentree.py

In reply to Luis R. Rodriguez

From: "Luis R. Rodriguez" <[email protected]>

---
 backport/Kconfig                              |  54 --------
 backport/Kconfig.sources                      |  23 ++++
 backport/Makefile                             |   3 +-
 backport/Makefile.kernel                      |  18 +++
 backport/backport-include/backport/backport.h |   2 +
 backport/compat/Makefile                      |   4 +
 gentree.py                                    | 186 +++++++++++++++++++++-----
 lib/bpversion.py                              |  48 +++++++
 lib/kconfig.py                                |  12 +-
 9 files changed, 260 insertions(+), 90 deletions(-)
 delete mode 100644 backport/Kconfig
 create mode 100644 backport/Kconfig.sources
 create mode 100644 lib/bpversion.py
backport/Kconfig deleted +0 -54
deleted file mode 100644
index c523323..0000000
@@ -1,54 +0,0 @@
-mainmenu "Linux Backports from $BACKPORTED_KERNEL_NAME $BACKPORTED_KERNEL_VERSION (with backports $BACKPORTS_VERSION)"
-
-config BACKPORT_DIR
-	string
-	option env="BACKPORT_DIR"
-config BACKPORTS_VERSION
-	string
-	option env="BACKPORTS_VERSION"
-config BACKPORTED_KERNEL_VERSION
-	string
-	option env="BACKPORTED_KERNEL_VERSION"
-config BACKPORTED_KERNEL_NAME
-	string
-	option env="BACKPORTED_KERNEL_NAME"
-
-# these will be generated
-source "$BACKPORT_DIR/Kconfig.kernel"
-source "$BACKPORT_DIR/Kconfig.versions"
-
-# some hacks for when we use backports to generate a package
-# to build modules out of tree.
-#ignore-parser-package
-config WIRELESS
-	def_bool y
-#ignore-parser-package
-config NET_CORE
-	def_bool y
-#ignore-parser-package
-config EXPERT
-	def_bool y
-
-# this has the configuration for the backport code
-source "$BACKPORT_DIR/compat/Kconfig"
-
-# these are copied from the kernel
-source "$BACKPORT_DIR/net/wireless/Kconfig"
-source "$BACKPORT_DIR/net/mac80211/Kconfig"
-source "$BACKPORT_DIR/net/bluetooth/Kconfig"
-source "$BACKPORT_DIR/drivers/net/wireless/Kconfig"
-source "$BACKPORT_DIR/drivers/net/ethernet/Kconfig"
-source "$BACKPORT_DIR/drivers/net/usb/Kconfig"
-
-source "$BACKPORT_DIR/drivers/ssb/Kconfig"
-source "$BACKPORT_DIR/drivers/bcma/Kconfig"
-
-source "$BACKPORT_DIR/net/nfc/Kconfig"
-
-source "$BACKPORT_DIR/drivers/media/Kconfig"
-
-source "$BACKPORT_DIR/net/ieee802154/Kconfig"
-source "$BACKPORT_DIR/net/mac802154/Kconfig"
-source "$BACKPORT_DIR/drivers/net/ieee802154/Kconfig"
-
-source "$BACKPORT_DIR/drivers/usb/class/Kconfig"
backport/Kconfig.sources new file +23 -0
new file mode 100644
index 0000000..cdf993c
@@ -0,0 +1,23 @@
+# this has the configuration for the backport code
+source "$BACKPORT_DIR/compat/Kconfig"
+
+# these are copied from the kernel
+source "$BACKPORT_DIR/net/wireless/Kconfig"
+source "$BACKPORT_DIR/net/mac80211/Kconfig"
+source "$BACKPORT_DIR/net/bluetooth/Kconfig"
+source "$BACKPORT_DIR/drivers/net/wireless/Kconfig"
+source "$BACKPORT_DIR/drivers/net/ethernet/Kconfig"
+source "$BACKPORT_DIR/drivers/net/usb/Kconfig"
+
+source "$BACKPORT_DIR/drivers/ssb/Kconfig"
+source "$BACKPORT_DIR/drivers/bcma/Kconfig"
+
+source "$BACKPORT_DIR/net/nfc/Kconfig"
+
+source "$BACKPORT_DIR/drivers/media/Kconfig"
+
+source "$BACKPORT_DIR/net/ieee802154/Kconfig"
+source "$BACKPORT_DIR/net/mac802154/Kconfig"
+source "$BACKPORT_DIR/drivers/net/ieee802154/Kconfig"
+
+source "$BACKPORT_DIR/drivers/usb/class/Kconfig"
backport/Makefile +2 -1
index fcf2f01..b2ada90 100644
@@ -19,8 +19,9 @@ KLIB_BUILD ?= $(KLIB)/build/
 KERNEL_CONFIG := $(KLIB_BUILD)/.config
 KERNEL_MAKEFILE := $(KLIB_BUILD)/Makefile
 CONFIG_MD5 := $(shell md5sum $(KERNEL_CONFIG) 2>/dev/null | sed 's/\s.*//')
+BACKPORT_PACKAGE := 1
 
-export KLIB KLIB_BUILD BACKPORT_DIR KMODDIR KMODPATH_ARG
+export KLIB KLIB_BUILD BACKPORT_DIR KMODDIR KMODPATH_ARG BACKPORT_PACKAGE
 
 # disable built-in rules for this file
 .SUFFIXES:
backport/Makefile.kernel +18 -0
index c31def8..6efea0d 100644
@@ -1,3 +1,4 @@
+ifneq ($(BACKPORT_PACKAGE),)
 # Since 2.6.21, try-run is available, but cc-disable-warning
 # was only added later, so we add it here ourselves:
 backport-cc-disable-warning = $(call try-run,\
@@ -13,10 +14,27 @@ NOSTDINC_FLAGS := \
 	-DBACKPORTS_VERSION=\"$(BACKPORTS_VERSION)\" \
 	-DBACKPORTED_KERNEL_VERSION=\"$(BACKPORTED_KERNEL_VERSION)\" \
 	-DBACKPORTED_KERNEL_NAME=\"$(BACKPORTED_KERNEL_NAME)\" \
+	-DBACKPORT_PACKAGE=\"$(BACKPORT_PACKAGE)\" \
 	$(BACKPORTS_GIT_TRACKER_DEF) \
 	$(CFLAGS)
 
 export backport_srctree = $(M)
+else
+export BACKPORT_DIR = backports/
+export backport_srctree = $(BACKPORT_DIR)
+NOSTDINC_FLAGS := \
+	-I$(BACKPORT_DIR)/backport-include/ \
+	-I$(BACKPORT_DIR)/backport-include/uapi \
+	-I$(BACKPORT_DIR)/include/ \
+	-I$(BACKPORT_DIR)/include/uapi \
+	-include $(BACKPORT_DIR)/backport-include/backport/backport.h \
+	-DBACKPORTS_VERSION=\"$(BACKPORTS_VERSION)\" \
+	-DBACKPORTED_KERNEL_VERSION=\"$(BACKPORTED_KERNEL_VERSION)\" \
+	-DBACKPORTED_KERNEL_NAME=\"$(BACKPORTED_KERNEL_NAME)\" \
+	$(BACKPORTS_GIT_TRACKER_DEF) \
+	$(CFLAGS)
+endif
+
 
 obj-y += compat/
 
backport/backport-include/backport/backport.h +2 -0
index 8edb151..10c7c35 100644
@@ -1,6 +1,8 @@
 #ifndef __BACKPORT_H
 #define __BACKPORT_H
+#ifdef BACKPORT_PACKAGE
 #include <backport/autoconf.h>
+#endif
 #include <linux/kconfig.h>
 
 #ifndef __ASSEMBLY__
backport/compat/Makefile +4 -0
index aba2c3a..b8fa48c 100644
@@ -1,5 +1,9 @@
 ccflags-y += -I$(src)
+ifneq ($(BACKPORT_PACKAGE),)
 obj-m += compat.o
+else
+obj-y += compat.o
+endif
 compat-y += main.o
 
 # Kernel backport compatibility code
gentree.py +152 -34

289 lines not on this page · raw message

lib/bpversion.py new file +48 -0

48 lines not on this page · raw message

lib/kconfig.py +11 -1
index 29c42ad..5366085 100644
@@ -12,6 +12,8 @@ cfg_line = re.compile(r'^(?P<opt>config|menuconfig)\s+(?P<sym>[^\s]*)')
 sel_line = re.compile(r'^(?P<spc>\s+)select\s+(?P<sym>[^\s]*)\s*$')
 backport_line = re.compile(r'^\s+#(?P<key>[ch]-file|module-name)\s*(?P<name>.*)')
 ignore_parse_p = re.compile(r'^\s+#(?P<key>ignore-parser-package)')
+kernel_versin_config = re.compile(r'^(?P<opt>config)\s+(?P<sym>BACKPORT_KERNEL_[\d])')
+ignore_syms = re.compile(r'^(?P<opt>config|menuconfig)\s+(?P<sym>BACKPORT_DIR|BACKPORTS_VERSION|BACKPORTED_KERNEL_VERSION|BACKPORTED_KERNEL_NAME|BACKPORT_LINUX)')
 
 class ConfigTree(object):
     def __init__(self, rootfile):
@@ -84,7 +86,7 @@ class ConfigTree(object):
 
     def _mod_kconfig_line(self, l, orig_symbols):
         for sym in orig_symbols:
-            if sym in l:
+            if sym in l and 'BACKPORT_' not in l:
                 return re.sub(r' (' + sym + ')', r' BACKPORT_\1', l)
         return l
 
@@ -99,6 +101,14 @@ class ConfigTree(object):
                 if pm:
                     ignore_parse_modular = True
                     continue
+                vm = kernel_versin_config.match(l)
+                if vm:
+                    out += l
+                    continue
+                ig = ignore_syms.match(l)
+                if ig:
+                    out += l
+                    continue
                 n = cfg_line.match(l)
                 if n:
                     m = n
Signature · 1 line
2.1.1
#20 lore raw

Re: [RFC v2 4/4] backports: add kernl integration support to gentree.py

Quoted 17 lines · Luis R. Rodriguez

From: "Luis R. Rodriguez" <[email protected]>

---
 backport/Kconfig                              |  54 --------
 backport/Kconfig.sources                      |  23 ++++
 backport/Makefile                             |   3 +-
 backport/Makefile.kernel                      |  18 +++
 backport/backport-include/backport/backport.h |   2 +
 backport/compat/Makefile                      |   4 +
 gentree.py                                    | 186 +++++++++++++++++++++-----
 lib/bpversion.py                              |  48 +++++++
 lib/kconfig.py                                |  12 +-
 9 files changed, 260 insertions(+), 90 deletions(-)
 delete mode 100644 backport/Kconfig
 create mode 100644 backport/Kconfig.sources
 create mode 100644 lib/bpversion.py

This breaks my usual gentree.py run.

~/backports> ./gentree.py --clean --git-revision next-20141023 ~/backports/linux-next/ /dev/shm/backports-next Get original source files from git ...
Traceback (most recent call last):
File "./gentree.py", line 1028, in <module>

    ret = _main()

File "./gentree.py", line 517, in _main
logwrite=logwrite)
File "./gentree.py", line 637, in process
copy_files(os.path.join(source_dir, 'backport'), backport_files, args.outdir)
File "./gentree.py", line 175, in copy_files
os.path.join(outdir, tgtitem))
File "/usr/lib64/python2.7/shutil.py", line 119, in copy
copyfile(src, dst)
File "/usr/lib64/python2.7/shutil.py", line 82, in copyfile
with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: '/root/backports/backport/Kconfig.package'

I don't see Kconfig.package in this series. Did you forget to git add it?

Stefan

#21 lore raw

Re: [RFC v2 4/4] backports: add kernl integration support to gentree.py

Quoted 38 lines · Stefan Assmann
Quoted 17 lines · Luis R. Rodriguez

From: "Luis R. Rodriguez" <[email protected]>

---
 backport/Kconfig                              |  54 --------
 backport/Kconfig.sources                      |  23 ++++
 backport/Makefile                             |   3 +-
 backport/Makefile.kernel                      |  18 +++
 backport/backport-include/backport/backport.h |   2 +
 backport/compat/Makefile                      |   4 +
 gentree.py                                    | 186 +++++++++++++++++++++-----
 lib/bpversion.py                              |  48 +++++++
 lib/kconfig.py                                |  12 +-
 9 files changed, 260 insertions(+), 90 deletions(-)
 delete mode 100644 backport/Kconfig
 create mode 100644 backport/Kconfig.sources
 create mode 100644 lib/bpversion.py

This breaks my usual gentree.py run.

~/backports> ./gentree.py --clean --git-revision next-20141023 ~/backports/linux-next/ /dev/shm/backports-next Get original source files from git ...
Traceback (most recent call last):
File "./gentree.py", line 1028, in <module>

    ret = _main()

File "./gentree.py", line 517, in _main
logwrite=logwrite)
File "./gentree.py", line 637, in process
copy_files(os.path.join(source_dir, 'backport'), backport_files, args.outdir)
File "./gentree.py", line 175, in copy_files
os.path.join(outdir, tgtitem))
File "/usr/lib64/python2.7/shutil.py", line 119, in copy
copyfile(src, dst)
File "/usr/lib64/python2.7/shutil.py", line 82, in copyfile
with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: '/root/backports/backport/Kconfig.package'

Quoted 1 line

I don't see Kconfig.package in this series. Did you forget to git add it?

Oops yes, here is the new patch:

Quoted 1 line

From 2f981d2de3da505d3ad54778afd7c8789c2b46cc Mon Sep 17 00:00:00 2001

From: "Luis R. Rodriguez" <[email protected]>
Date: Wed, 29 Oct 2014 01:08:24 -0700
Subject: [PATCH] backports: add kernl integration support to gentree.py

---
 backport/Kconfig                              |  54 --------
 backport/Kconfig.package                      |  31 +++++
 backport/Kconfig.sources                      |  23 ++++
 backport/Makefile                             |   3 +-
 backport/Makefile.kernel                      |  18 +++
 backport/backport-include/backport/backport.h |   2 +
 backport/compat/Makefile                      |   4 +
 gentree.py                                    | 186 +++++++++++++++++++++-----
 lib/bpversion.py                              |  48 +++++++
 lib/kconfig.py                                |  12 +-
 10 files changed, 291 insertions(+), 90 deletions(-)
 delete mode 100644 backport/Kconfig
 create mode 100644 backport/Kconfig.package
 create mode 100644 backport/Kconfig.sources
 create mode 100644 lib/bpversion.py
backport/Kconfig deleted +0 -54
deleted file mode 100644
index c523323..0000000
@@ -1,54 +0,0 @@
-mainmenu "Linux Backports from $BACKPORTED_KERNEL_NAME $BACKPORTED_KERNEL_VERSION (with backports $BACKPORTS_VERSION)"
-
-config BACKPORT_DIR
-	string
-	option env="BACKPORT_DIR"
-config BACKPORTS_VERSION
-	string
-	option env="BACKPORTS_VERSION"
-config BACKPORTED_KERNEL_VERSION
-	string
-	option env="BACKPORTED_KERNEL_VERSION"
-config BACKPORTED_KERNEL_NAME
-	string
-	option env="BACKPORTED_KERNEL_NAME"
-
-# these will be generated
-source "$BACKPORT_DIR/Kconfig.kernel"
-source "$BACKPORT_DIR/Kconfig.versions"
-
-# some hacks for when we use backports to generate a package
-# to build modules out of tree.
-#ignore-parser-package
-config WIRELESS
-	def_bool y
-#ignore-parser-package
-config NET_CORE
-	def_bool y
-#ignore-parser-package
-config EXPERT
-	def_bool y
-
-# this has the configuration for the backport code
-source "$BACKPORT_DIR/compat/Kconfig"
-
-# these are copied from the kernel
-source "$BACKPORT_DIR/net/wireless/Kconfig"
-source "$BACKPORT_DIR/net/mac80211/Kconfig"
-source "$BACKPORT_DIR/net/bluetooth/Kconfig"
-source "$BACKPORT_DIR/drivers/net/wireless/Kconfig"
-source "$BACKPORT_DIR/drivers/net/ethernet/Kconfig"
-source "$BACKPORT_DIR/drivers/net/usb/Kconfig"
-
-source "$BACKPORT_DIR/drivers/ssb/Kconfig"
-source "$BACKPORT_DIR/drivers/bcma/Kconfig"
-
-source "$BACKPORT_DIR/net/nfc/Kconfig"
-
-source "$BACKPORT_DIR/drivers/media/Kconfig"
-
-source "$BACKPORT_DIR/net/ieee802154/Kconfig"
-source "$BACKPORT_DIR/net/mac802154/Kconfig"
-source "$BACKPORT_DIR/drivers/net/ieee802154/Kconfig"
-
-source "$BACKPORT_DIR/drivers/usb/class/Kconfig"
backport/Kconfig.package new file +31 -0
new file mode 100644
index 0000000..1382cdb
@@ -0,0 +1,31 @@
+mainmenu "Backports from $BACKPORTED_KERNEL_NAME $BACKPORTED_KERNEL_VERSION (backports $BACKPORTS_VERSION)"
+
+config BACKPORT_DIR
+	string
+	option env="BACKPORT_DIR"
+config BACKPORTS_VERSION
+	string
+	option env="BACKPORTS_VERSION"
+config BACKPORTED_KERNEL_VERSION
+	string
+	option env="BACKPORTED_KERNEL_VERSION"
+config BACKPORTED_KERNEL_NAME
+	string
+	option env="BACKPORTED_KERNEL_NAME"
+
+# some hacks for when we use backports to generate a package
+# to build modules out of tree.
+#ignore-parser-package
+config WIRELESS
+	def_bool y
+#ignore-parser-package
+config NET_CORE
+	def_bool y
+#ignore-parser-package
+config EXPERT
+	def_bool y
+
+# these will be generated
+source "$BACKPORT_DIR/Kconfig.kernel"
+source "$BACKPORT_DIR/Kconfig.versions"
+source "$BACKPORT_DIR/Kconfig.sources"
backport/Kconfig.sources new file +23 -0
new file mode 100644
index 0000000..cdf993c
@@ -0,0 +1,23 @@
+# this has the configuration for the backport code
+source "$BACKPORT_DIR/compat/Kconfig"
+
+# these are copied from the kernel
+source "$BACKPORT_DIR/net/wireless/Kconfig"
+source "$BACKPORT_DIR/net/mac80211/Kconfig"
+source "$BACKPORT_DIR/net/bluetooth/Kconfig"
+source "$BACKPORT_DIR/drivers/net/wireless/Kconfig"
+source "$BACKPORT_DIR/drivers/net/ethernet/Kconfig"
+source "$BACKPORT_DIR/drivers/net/usb/Kconfig"
+
+source "$BACKPORT_DIR/drivers/ssb/Kconfig"
+source "$BACKPORT_DIR/drivers/bcma/Kconfig"
+
+source "$BACKPORT_DIR/net/nfc/Kconfig"
+
+source "$BACKPORT_DIR/drivers/media/Kconfig"
+
+source "$BACKPORT_DIR/net/ieee802154/Kconfig"
+source "$BACKPORT_DIR/net/mac802154/Kconfig"
+source "$BACKPORT_DIR/drivers/net/ieee802154/Kconfig"
+
+source "$BACKPORT_DIR/drivers/usb/class/Kconfig"
backport/Makefile +2 -1
index fcf2f01..b2ada90 100644
@@ -19,8 +19,9 @@ KLIB_BUILD ?= $(KLIB)/build/
 KERNEL_CONFIG := $(KLIB_BUILD)/.config
 KERNEL_MAKEFILE := $(KLIB_BUILD)/Makefile
 CONFIG_MD5 := $(shell md5sum $(KERNEL_CONFIG) 2>/dev/null | sed 's/\s.*//')
+BACKPORT_PACKAGE := 1
 
-export KLIB KLIB_BUILD BACKPORT_DIR KMODDIR KMODPATH_ARG
+export KLIB KLIB_BUILD BACKPORT_DIR KMODDIR KMODPATH_ARG BACKPORT_PACKAGE
 
 # disable built-in rules for this file
 .SUFFIXES:
backport/Makefile.kernel +18 -0
index c31def8..6efea0d 100644
@@ -1,3 +1,4 @@
+ifneq ($(BACKPORT_PACKAGE),)
 # Since 2.6.21, try-run is available, but cc-disable-warning
 # was only added later, so we add it here ourselves:
 backport-cc-disable-warning = $(call try-run,\
@@ -13,10 +14,27 @@ NOSTDINC_FLAGS := \
 	-DBACKPORTS_VERSION=\"$(BACKPORTS_VERSION)\" \
 	-DBACKPORTED_KERNEL_VERSION=\"$(BACKPORTED_KERNEL_VERSION)\" \
 	-DBACKPORTED_KERNEL_NAME=\"$(BACKPORTED_KERNEL_NAME)\" \
+	-DBACKPORT_PACKAGE=\"$(BACKPORT_PACKAGE)\" \
 	$(BACKPORTS_GIT_TRACKER_DEF) \
 	$(CFLAGS)
 
 export backport_srctree = $(M)
+else
+export BACKPORT_DIR = backports/
+export backport_srctree = $(BACKPORT_DIR)
+NOSTDINC_FLAGS := \
+	-I$(BACKPORT_DIR)/backport-include/ \
+	-I$(BACKPORT_DIR)/backport-include/uapi \
+	-I$(BACKPORT_DIR)/include/ \
+	-I$(BACKPORT_DIR)/include/uapi \
+	-include $(BACKPORT_DIR)/backport-include/backport/backport.h \
+	-DBACKPORTS_VERSION=\"$(BACKPORTS_VERSION)\" \
+	-DBACKPORTED_KERNEL_VERSION=\"$(BACKPORTED_KERNEL_VERSION)\" \
+	-DBACKPORTED_KERNEL_NAME=\"$(BACKPORTED_KERNEL_NAME)\" \
+	$(BACKPORTS_GIT_TRACKER_DEF) \
+	$(CFLAGS)
+endif
+
 
 obj-y += compat/
 
backport/backport-include/backport/backport.h +2 -0
index 8edb151..10c7c35 100644
@@ -1,6 +1,8 @@
 #ifndef __BACKPORT_H
 #define __BACKPORT_H
+#ifdef BACKPORT_PACKAGE
 #include <backport/autoconf.h>
+#endif
 #include <linux/kconfig.h>
 
 #ifndef __ASSEMBLY__
backport/compat/Makefile +4 -0
index aba2c3a..b8fa48c 100644
@@ -1,5 +1,9 @@
 ccflags-y += -I$(src)
+ifneq ($(BACKPORT_PACKAGE),)
 obj-m += compat.o
+else
+obj-y += compat.o
+endif
 compat-y += main.o
 
 # Kernel backport compatibility code
gentree.py +152 -34

289 lines not on this page · raw message

lib/bpversion.py new file +48 -0

48 lines not on this page · raw message

lib/kconfig.py +11 -1
index 29c42ad..5366085 100644
@@ -12,6 +12,8 @@ cfg_line = re.compile(r'^(?P<opt>config|menuconfig)\s+(?P<sym>[^\s]*)')
 sel_line = re.compile(r'^(?P<spc>\s+)select\s+(?P<sym>[^\s]*)\s*$')
 backport_line = re.compile(r'^\s+#(?P<key>[ch]-file|module-name)\s*(?P<name>.*)')
 ignore_parse_p = re.compile(r'^\s+#(?P<key>ignore-parser-package)')
+kernel_versin_config = re.compile(r'^(?P<opt>config)\s+(?P<sym>BACKPORT_KERNEL_[\d])')
+ignore_syms = re.compile(r'^(?P<opt>config|menuconfig)\s+(?P<sym>BACKPORT_DIR|BACKPORTS_VERSION|BACKPORTED_KERNEL_VERSION|BACKPORTED_KERNEL_NAME|BACKPORT_LINUX)')
 
 class ConfigTree(object):
     def __init__(self, rootfile):
@@ -84,7 +86,7 @@ class ConfigTree(object):
 
     def _mod_kconfig_line(self, l, orig_symbols):
         for sym in orig_symbols:
-            if sym in l:
+            if sym in l and 'BACKPORT_' not in l:
                 return re.sub(r' (' + sym + ')', r' BACKPORT_\1', l)
         return l
 
@@ -99,6 +101,14 @@ class ConfigTree(object):
                 if pm:
                     ignore_parse_modular = True
                     continue
+                vm = kernel_versin_config.match(l)
+                if vm:
+                    out += l
+                    continue
+                ig = ignore_syms.match(l)
+                if ig:
+                    out += l
+                    continue
                 n = cfg_line.match(l)
                 if n:
                     m = n
Signature · 1 line
2.1.1
#22 lore raw

Re: [RFC v2 4/4] backports: add kernl integration support to gentree.py

Quoted 3 lines · Luis R. Rodriguez
 backport/Kconfig                              |  54 --------
 backport/Kconfig.package                      |  31 +++++
 backport/Kconfig.sources                      |  23 ++++

I think you should do this split as a separate patch.

backport/Kconfig.package line 31

Quoted 4 lines
backport/Kconfig.package new file +4 -0
+# these will be generated
+source "$BACKPORT_DIR/Kconfig.kernel"
+source "$BACKPORT_DIR/Kconfig.versions"
+source "$BACKPORT_DIR/Kconfig.sources"

Not true - Kconfig.sources exists below?

Quoted 1 line

+ifneq ($(BACKPORT_PACKAGE),)

I think it'd be easier to understand if you called this

BACKPORT_INTEGRATED

and inverted the logic.

Quoted 22 lines
gentree.py +22 -0
+        # Only the kconfig 'mainmenu' entries grok variables, we want to keep
+        # this the main Kconfig as part of our program to be able to give it
+        # enough dynamic information
+        k = open(os.path.join(args.outdir, 'Kconfig'), 'w')
+        k.write('config BACKPORT_DIR\n')
+        k.write('\tstring\n')
+        k.write('\tdefault "backports/"\n')
+        k.write('config BACKPORTS_VERSION\n')
+        k.write('\tstring\n')
+        k.write('\tdefault "%s"\n' % backports_version)
+        k.write('config BACKPORTED_KERNEL_VERSION\n')
+        k.write('\tstring\n')
+        k.write('\tdefault "%s"\n' % kernel_version)
+        k.write('config BACKPORTED_KERNEL_NAME\n')
+        k.write('\tstring\n')
+        k.write('\tdefault "%s"\n' % args.base_name)
+        k.write('\n')
+        k.write('menuconfig BACKPORT_LINUX\n')
+        k.write('\tbool "Backport %s %s (backports %s)"\n' % (args.base_name, kernel_version, backports_version))
+        k.write('\tdefault n\n')
+        k.write('\t---help--- \n')
+        k.write('\t  Enabling this will let give you the opportunity to use\n')

gentree.py def process(kerneldir, outdir, copy_list_file, git_revision=None, · line 705

Quoted 10 lines
gentree.py +10 -0
+        k.write('\t  features and drivers backported from %s %s\n' % (args.base_name, kernel_version))
+        k.write('\t  on the kernel your are using. This is experimental and you should\n')
+        k.write('\t  say no unless you\'d like to help test things.\n')
+        k.write('\n')
+        k.write('if BACKPORT_LINUX\n')
+        k.write('\n')
+        k.write('source "$BACKPORT_DIR/Kconfig.versions"\n')
+        k.write('source "$BACKPORT_DIR/Kconfig.sources"\n')
+        k.write('\n')
+        k.write('endif # BACKPORT_LINUX\n')

This is really really ugly - please just have a file template, and maybe replace some things in it or provide them as env variables through the Makefile or so.

gentree.py def process(kerneldir, outdir, copy_list_file, git_revision=None, · line 993

Quoted 3 lines
gentree.py +3 -0
+    if args.integrate:
+        f = open(os.path.join(args.outdir, '../arch/x86/Kconfig'), 'a')
+        f.write('source "backports/Kconfig"\n')

That seems like a bad idea - maybe better integrate it under some arch-independent file?

gentree.py def process(kerneldir, outdir, copy_list_file, git_revision=None, · line 1003

Quoted 10 lines
gentree.py +10 -0
+        f.close()
+        git_debug_snapshot(args, "hooked backport Kconfig to supported architectures")
+
+        f = open(os.path.join(args.outdir, '../MAINTAINERS'), 'a')
+        f.write('M:\tHauke Mehrtens <[email protected]>\n')
+        f.write('M:\tLuis R. Rodriguez <[email protected]>\n')
+        f.write('L:\[email protected]\n')
+        f.write('T:\tgit://git.kernel.org/pub/scm/linux/kernel/git/backports/backports.git\n')
+        f.write('F:\tbackports/\n')
+        f.close()

That's ... odd? doesn't even fit the MAINTAINERS file style? Anyway I think it's probably not necessary.

gentree.py def process(kerneldir, outdir, copy_list_file, git_revision=None, · line 1014

Quoted 11 lines
gentree.py +11 -0
+        git_debug_snapshot(args, "add backport maintainers entry")
+
+        f = open(os.path.join(args.outdir, '../Makefile'), 'a')
+        f.write('ifeq ($(KBUILD_EXTMOD),)\n')
+        f.write('backports-y := backports/\n')
+        f.write('vmlinux-dirs += $(patsubst %/,%,$(filter %/, $(backports-y) $(backports-m)))\n')
+        f.write('vmlinux-alldirs += $(patsubst %/,%,$(filter %/, $(backports-n) $(backports-)))\n')
+        f.write('backports-y       := $(patsubst %/, %/built-in.o, $(backports-y))\n')
+        f.write('KBUILD_VMLINUX_MAIN += $(backports-y)\n')
+        f.write('endif\n')
+        f.close()

That could be a template file again that you just copy.

[... I need more time to review, don't have much this morning ...]

johannes

#23 lore raw

Re: [RFC v2 4/4] backports: add kernl integration support to gentree.py

Quoted 7 lines · Johannes Berg
Quoted 3 lines · Luis R. Rodriguez
 backport/Kconfig                              |  54 --------
 backport/Kconfig.package                      |  31 +++++
 backport/Kconfig.sources                      |  23 ++++

I think you should do this split as a separate patch.

Indeed, will do.

Quoted 6 lines

backport/Kconfig.package line 31

Quoted 4 lines
backport/Kconfig.package new file +4 -0
+# these will be generated
+source "$BACKPORT_DIR/Kconfig.kernel"
+source "$BACKPORT_DIR/Kconfig.versions"
+source "$BACKPORT_DIR/Kconfig.sources"

Not true - Kconfig.sources exists below?

Will fix comment.

Quoted 5 lines
Quoted 1 line

+ifneq ($(BACKPORT_PACKAGE),)

I think it'd be easier to understand if you called this

BACKPORT_INTEGRATED

Sure.

Quoted 1 line

and inverted the logic.

OK.

Quoted 33 lines
Quoted 22 lines
gentree.py +22 -0
+        # Only the kconfig 'mainmenu' entries grok variables, we want to keep
+        # this the main Kconfig as part of our program to be able to give it
+        # enough dynamic information
+        k = open(os.path.join(args.outdir, 'Kconfig'), 'w')
+        k.write('config BACKPORT_DIR\n')
+        k.write('\tstring\n')
+        k.write('\tdefault "backports/"\n')
+        k.write('config BACKPORTS_VERSION\n')
+        k.write('\tstring\n')
+        k.write('\tdefault "%s"\n' % backports_version)
+        k.write('config BACKPORTED_KERNEL_VERSION\n')
+        k.write('\tstring\n')
+        k.write('\tdefault "%s"\n' % kernel_version)
+        k.write('config BACKPORTED_KERNEL_NAME\n')
+        k.write('\tstring\n')
+        k.write('\tdefault "%s"\n' % args.base_name)
+        k.write('\n')
+        k.write('menuconfig BACKPORT_LINUX\n')
+        k.write('\tbool "Backport %s %s (backports %s)"\n' % (args.base_name, kernel_version, backports_version))
+        k.write('\tdefault n\n')
+        k.write('\t---help--- \n')
+        k.write('\t  Enabling this will let give you the opportunity to use\n')

gentree.py def process(kerneldir, outdir, copy_list_file, git_revision=None, · line 705

Quoted 10 lines
gentree.py +10 -0
+        k.write('\t  features and drivers backported from %s %s\n' % (args.base_name, kernel_version))
+        k.write('\t  on the kernel your are using. This is experimental and you should\n')
+        k.write('\t  say no unless you\'d like to help test things.\n')
+        k.write('\n')
+        k.write('if BACKPORT_LINUX\n')
+        k.write('\n')
+        k.write('source "$BACKPORT_DIR/Kconfig.versions"\n')
+        k.write('source "$BACKPORT_DIR/Kconfig.sources"\n')
+        k.write('\n')
+        k.write('endif # BACKPORT_LINUX\n')
Quoted 3 lines

This is really really ugly - please just have a file template, and maybe replace some things in it or provide them as env variables through the Makefile or so.

That's the thing, we can pass variables on the Makefile but based on my tests Kconfig will only interpret them on "mainmenu", but not others. This is why I kept it embedded completely as part of the program. A template and easy search / replace should make it nicer to edit for sure, will give that a shot.

Quoted 6 lines

gentree.py def process(kerneldir, outdir, copy_list_file, git_revision=None, · line 993

Quoted 3 lines
gentree.py +3 -0
+    if args.integrate:
+        f = open(os.path.join(args.outdir, '../arch/x86/Kconfig'), 'a')
+        f.write('source "backports/Kconfig"\n')

That seems like a bad idea - maybe better integrate it under some arch-independent file?

I like that idea, the only one that would make sense would be top level then. Will modify that then.

Quoted 11 lines

gentree.py def process(kerneldir, outdir, copy_list_file, git_revision=None, · line 1003

Quoted 10 lines
gentree.py +10 -0
+        f.close()
+        git_debug_snapshot(args, "hooked backport Kconfig to supported architectures")
+
+        f = open(os.path.join(args.outdir, '../MAINTAINERS'), 'a')
+        f.write('M:\tHauke Mehrtens <[email protected]>\n')
+        f.write('M:\tLuis R. Rodriguez <[email protected]>\n')
+        f.write('L:\[email protected]\n')
+        f.write('T:\tgit://git.kernel.org/pub/scm/linux/kernel/git/backports/backports.git\n')
+        f.write('F:\tbackports/\n')
+        f.close()
Quoted 2 lines

That's ... odd? doesn't even fit the MAINTAINERS file style? Anyway I think it's probably not necessary.

OK.

Quoted 12 lines

gentree.py def process(kerneldir, outdir, copy_list_file, git_revision=None, · line 1014

Quoted 11 lines
gentree.py +11 -0
+        git_debug_snapshot(args, "add backport maintainers entry")
+
+        f = open(os.path.join(args.outdir, '../Makefile'), 'a')
+        f.write('ifeq ($(KBUILD_EXTMOD),)\n')
+        f.write('backports-y := backports/\n')
+        f.write('vmlinux-dirs += $(patsubst %/,%,$(filter %/, $(backports-y) $(backports-m)))\n')
+        f.write('vmlinux-alldirs += $(patsubst %/,%,$(filter %/, $(backports-n) $(backports-)))\n')
+        f.write('backports-y       := $(patsubst %/, %/built-in.o, $(backports-y))\n')
+        f.write('KBUILD_VMLINUX_MAIN += $(backports-y)\n')
+        f.write('endif\n')
+        f.close()
Quoted 1 line

That could be a template file again that you just copy.

In the end wend with a patch since the above doesn't work well as there is tons of places where the variables are re-used. I will allow for integration patches then, that will be part of my next respin.

Quoted 1 line

[... I need more time to review, don't have much this morning ...]

OK.

Luis