backports: split Kconfig into Kconfig.package and Kconfig.sources
authorLuis R. Rodriguez <mcgrof@suse.com>
Sat, 1 Nov 2014 06:55:07 +0000 (23:55 -0700)
committerLuis R. Rodriguez <mcgrof@do-not-panic.com>
Fri, 14 Nov 2014 21:47:16 +0000 (13:47 -0800)
This splits up the Kconfig from things which are needed due to
our copy of code from the kernel and things which we need
specifically only for packaging backports. We will later then
share the Kconfig.souce for instance for kernel integration.

While at it, split up the list of files that we need to copy
into what we know could be shared for integration. The the
case of backport packaging Kconfig.package will be copied to
the package's Kconfig when building the package with gentree.py.

Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
backport/Kconfig [deleted file]
backport/Kconfig.package [new file with mode: 0644]
backport/Kconfig.sources [new file with mode: 0644]
gentree.py

diff --git a/backport/Kconfig b/backport/Kconfig
deleted file mode 100644 (file)
index b729d47..0000000
+++ /dev/null
@@ -1,44 +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"
-
-source "$BACKPORT_DIR/Kconfig.kernel"
-source "$BACKPORT_DIR/Kconfig.versions"
-
-# Packaging hacks
-source "$BACKPORT_DIR/Kconfig.package.hacks"
-
-# 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"
diff --git a/backport/Kconfig.package b/backport/Kconfig.package
new file mode 100644 (file)
index 0000000..9684574
--- /dev/null
@@ -0,0 +1,24 @@
+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"
+
+# Packaging hacks
+source "$BACKPORT_DIR/Kconfig.package.hacks"
+
+# Code we backport
+source "$BACKPORT_DIR/Kconfig.sources"
+
+# these will be generated
+source "$BACKPORT_DIR/Kconfig.kernel"
+source "$BACKPORT_DIR/Kconfig.versions"
diff --git a/backport/Kconfig.sources b/backport/Kconfig.sources
new file mode 100644 (file)
index 0000000..cdf993c
--- /dev/null
@@ -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"
index 7632b908b94c140fb19023e1d5a81de6186e2ff9..71e52e44c6b6b0e3c1c209bcae9ee949a7e1afd4 100755 (executable)
@@ -798,12 +798,28 @@ def process(kerneldir, copy_list_file, git_revision=None,
     check_output_dir(bpid.target_dir, args.clean)
 
     # do the copy
+    backport_package_files = [(x, x) for x in [
+        'Makefile',
+        'kconf/',
+        'Makefile.real',
+        'Makefile.kernel',
+        'Kconfig.package.hacks',
+        'scripts/',
+        '.blacklist.map',
+        '.gitignore',
+        'Makefile.build'] ]
+    backport_package_files += [
+            ('Kconfig.package', 'Kconfig'),
+            ]
     backport_files = [(x, x) for x in [
-        'Kconfig', 'Kconfig.package.hacks',
-        'Makefile', 'Makefile.build', 'Makefile.kernel', '.gitignore',
-        'Makefile.real', 'compat/', 'backport-include/', 'kconf/',
-        'scripts/', '.blacklist.map',
+        'Kconfig.sources',
+        'compat/',
+        'backport-include/',
     ]]
+
+    if not bpid.integrate:
+        backport_files += backport_package_files
+
     if not args.git_revision:
         logwrite('Copy original source files ...')
     else:
@@ -827,6 +843,7 @@ def process(kerneldir, copy_list_file, git_revision=None,
     git_debug_snapshot(args, 'Add driver sources')
 
     disable_list = add_automatic_backports(args)
+
     if disable_list:
         # No need to verify_sources() as compat's Kconfig has no 'source' call
         bpcfg = kconfig.ConfigTree(os.path.join(bpid.target_dir, 'compat', 'Kconfig'), bpid)
@@ -877,7 +894,7 @@ def process(kerneldir, copy_list_file, git_revision=None,
 
     # write local symbol list -- needed during packaging build
     if not bpid.integrate:
-        f = open(os.path.join(bpid.project_dir, '.local-symbols'), 'w')
+        f = open(os.path.join(bpid.target_dir, '.local-symbols'), 'w')
         for sym in symbols:
             f.write('%s=\n' % sym)
         f.close()