From adaab2273d586f51a22aa4ee8b84db6d4c316926 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Fri, 31 Oct 2014 23:55:07 -0700 Subject: [PATCH] backports: split Kconfig into Kconfig.package and Kconfig.sources 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 --- backport/Kconfig.package | 24 ++++++++++++++++++++++++ backport/{Kconfig => Kconfig.sources} | 21 --------------------- gentree.py | 27 ++++++++++++++++++++++----- 3 files changed, 46 insertions(+), 26 deletions(-) create mode 100644 backport/Kconfig.package rename backport/{Kconfig => Kconfig.sources} (59%) diff --git a/backport/Kconfig.package b/backport/Kconfig.package new file mode 100644 index 000000000000..96845740a42a --- /dev/null +++ b/backport/Kconfig.package @@ -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 b/backport/Kconfig.sources similarity index 59% rename from backport/Kconfig rename to backport/Kconfig.sources index b729d4709296..cdf993c9ecb1 100644 --- a/backport/Kconfig +++ b/backport/Kconfig.sources @@ -1,24 +1,3 @@ -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" diff --git a/gentree.py b/gentree.py index 7632b908b94c..71e52e44c6b6 100755 --- a/gentree.py +++ b/gentree.py @@ -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() -- 2.30.2