From 8035fae171ec7bbf9229c0294b661714e8520036 Mon Sep 17 00:00:00 2001 From: Nathan Rossi Date: Fri, 11 Apr 2014 17:33:12 +1000 Subject: linux/linux-machine-kconfig.inc: Refactor out kconfig merging * Move the kconfig merging task into separate include * Update the merging to use "scripts/kconfig/merge_config.sh" instead of concatenating files together Signed-off-by: Nathan Rossi --- recipes-kernel/linux/linux-machine-kconfig.inc | 21 +++++++++++++++++++++ recipes-kernel/linux/linux-xlnx.inc | 23 +---------------------- 2 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 recipes-kernel/linux/linux-machine-kconfig.inc diff --git a/recipes-kernel/linux/linux-machine-kconfig.inc b/recipes-kernel/linux/linux-machine-kconfig.inc new file mode 100644 index 00000000..881847d0 --- /dev/null +++ b/recipes-kernel/linux/linux-machine-kconfig.inc @@ -0,0 +1,21 @@ +# +# This include file implements the merging of *.cfg files from the SRC_URI for +# the Kernel. +# + +# returns all the elements from the src uri that are .cfg files +def find_config_fragments(d): + sources=src_patches(d, True) + sources_list=[] + for s in sources: + if s.endswith('.cfg'): + sources_list.append(s) + return sources_list + +kernel_do_configure_prepend() { + # Find all ".cfg" files and merge them together into a .config + CFG_FILES="${@" ".join(find_config_fragments(d))}" + if [ ! -z "$CFG_FILES" ]; then + ${S}/scripts/kconfig/merge_config.sh -m $CFG_FILES + fi +} diff --git a/recipes-kernel/linux/linux-xlnx.inc b/recipes-kernel/linux/linux-xlnx.inc index 74f9bc71..b72c0e04 100644 --- a/recipes-kernel/linux/linux-xlnx.inc +++ b/recipes-kernel/linux/linux-xlnx.inc @@ -19,6 +19,7 @@ S = "${WORKDIR}/git" # Inherit/include base functionality inherit kernel require linux-machine-common.inc +require linux-machine-kconfig.inc # Override COMPATIBLE_MACHINE to include your machine in a bbappend file. COMPATIBLE_MACHINE = "qemumicroblaze|qemuzynq|microblaze|zynq" @@ -27,25 +28,3 @@ COMPATIBLE_MACHINE = "qemumicroblaze|qemuzynq|microblaze|zynq" # Arch specific kernel configuration parts MACHINE_KCONFIG_append_zynq += "common/linux/zynq/defconfig_${LINUX_VERSION}.cfg" MACHINE_KCONFIG_append_microblaze += "common/linux/microblaze/defconfig_${LINUX_VERSION}.cfg" - -# returns all the elements from the src uri that are .cfg files -def find_config_fragments(d): - sources=src_patches(d, True) - sources_list=[] - for s in sources: - if s.endswith('.cfg'): - sources_list.append(s) - return sources_list - -kernel_do_configure_prepend() { - # Find all ".cfg" files and cat them together into a .config - CFG_FILES="${@" ".join(find_config_fragments(d))}" - if [ ! -z "$CFG_FILES" ]; then - echo "# Generated by linux-xlnx recipe in meta-xilinx" > "${B}/.config" - for i in $CFG_FILES; do - echo "Joining configuration file $i" - echo "# $i" >> "${B}/.config" - cat $i >> "${B}/.config" - done - fi -} -- cgit v1.2.3-54-g00ecf