diff options
author | Nathan Rossi <nathan.rossi@xilinx.com> | 2014-04-11 17:33:12 +1000 |
---|---|---|
committer | Nathan Rossi <nathan.rossi@xilinx.com> | 2014-04-11 17:33:12 +1000 |
commit | 8035fae171ec7bbf9229c0294b661714e8520036 (patch) | |
tree | 964fb5734005aa0a1f6bc5fb0b06fc092237a3f2 | |
parent | a500677ff3dc5a62a2294e2b99fa2a6d9a03a0eb (diff) | |
download | meta-xilinx-8035fae171ec7bbf9229c0294b661714e8520036.tar.gz |
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 <nathan.rossi@xilinx.com>
-rw-r--r-- | recipes-kernel/linux/linux-machine-kconfig.inc | 21 | ||||
-rw-r--r-- | recipes-kernel/linux/linux-xlnx.inc | 23 |
2 files changed, 22 insertions, 22 deletions
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 @@ | |||
1 | # | ||
2 | # This include file implements the merging of *.cfg files from the SRC_URI for | ||
3 | # the Kernel. | ||
4 | # | ||
5 | |||
6 | # returns all the elements from the src uri that are .cfg files | ||
7 | def find_config_fragments(d): | ||
8 | sources=src_patches(d, True) | ||
9 | sources_list=[] | ||
10 | for s in sources: | ||
11 | if s.endswith('.cfg'): | ||
12 | sources_list.append(s) | ||
13 | return sources_list | ||
14 | |||
15 | kernel_do_configure_prepend() { | ||
16 | # Find all ".cfg" files and merge them together into a .config | ||
17 | CFG_FILES="${@" ".join(find_config_fragments(d))}" | ||
18 | if [ ! -z "$CFG_FILES" ]; then | ||
19 | ${S}/scripts/kconfig/merge_config.sh -m $CFG_FILES | ||
20 | fi | ||
21 | } | ||
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" | |||
19 | # Inherit/include base functionality | 19 | # Inherit/include base functionality |
20 | inherit kernel | 20 | inherit kernel |
21 | require linux-machine-common.inc | 21 | require linux-machine-common.inc |
22 | require linux-machine-kconfig.inc | ||
22 | 23 | ||
23 | # Override COMPATIBLE_MACHINE to include your machine in a bbappend file. | 24 | # Override COMPATIBLE_MACHINE to include your machine in a bbappend file. |
24 | COMPATIBLE_MACHINE = "qemumicroblaze|qemuzynq|microblaze|zynq" | 25 | COMPATIBLE_MACHINE = "qemumicroblaze|qemuzynq|microblaze|zynq" |
@@ -27,25 +28,3 @@ COMPATIBLE_MACHINE = "qemumicroblaze|qemuzynq|microblaze|zynq" | |||
27 | # Arch specific kernel configuration parts | 28 | # Arch specific kernel configuration parts |
28 | MACHINE_KCONFIG_append_zynq += "common/linux/zynq/defconfig_${LINUX_VERSION}.cfg" | 29 | MACHINE_KCONFIG_append_zynq += "common/linux/zynq/defconfig_${LINUX_VERSION}.cfg" |
29 | MACHINE_KCONFIG_append_microblaze += "common/linux/microblaze/defconfig_${LINUX_VERSION}.cfg" | 30 | MACHINE_KCONFIG_append_microblaze += "common/linux/microblaze/defconfig_${LINUX_VERSION}.cfg" |
30 | |||
31 | # returns all the elements from the src uri that are .cfg files | ||
32 | def find_config_fragments(d): | ||
33 | sources=src_patches(d, True) | ||
34 | sources_list=[] | ||
35 | for s in sources: | ||
36 | if s.endswith('.cfg'): | ||
37 | sources_list.append(s) | ||
38 | return sources_list | ||
39 | |||
40 | kernel_do_configure_prepend() { | ||
41 | # Find all ".cfg" files and cat them together into a .config | ||
42 | CFG_FILES="${@" ".join(find_config_fragments(d))}" | ||
43 | if [ ! -z "$CFG_FILES" ]; then | ||
44 | echo "# Generated by linux-xlnx recipe in meta-xilinx" > "${B}/.config" | ||
45 | for i in $CFG_FILES; do | ||
46 | echo "Joining configuration file $i" | ||
47 | echo "# $i" >> "${B}/.config" | ||
48 | cat $i >> "${B}/.config" | ||
49 | done | ||
50 | fi | ||
51 | } | ||