summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel-yocto.bbclass
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2015-03-24 14:57:49 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-25 12:39:46 +0000
commit4dbe239ff4e9dbe0216a554a806d41537c82cfb4 (patch)
tree025d11e576265e4eb841f6bfc9279578af50914a /meta/classes/kernel-yocto.bbclass
parentdf6d275d749d181f94102997efed80ae464455d7 (diff)
downloadpoky-4dbe239ff4e9dbe0216a554a806d41537c82cfb4.tar.gz
kernel-yocto: allow in-tree defconfigs
In a similar manner to the kernel itself, which does the following to bring a defconfig into the configuration: defconfig: $(obj)/conf ifeq ($(KBUILD_DEFCONFIG),) $< --defconfig $(Kconfig) else @echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) endif We do the same with the linux-yocto configuration processing. If a defconfig is specified via the KBUILD_DEFCONFIG variable, we copy it from the source tree, into a common location and normalized "defconfig" name, where the rest of the process will include and incorporate it into the configuration process. If the fetcher has already placed a defconfig in WORKDIR (from the SRC_URI), we don't overwrite it, but instead warn the user that SRC_URI defconfigs take precedence. [YOCTO: #7474] (From OE-Core rev: 5f5595eebeb81be7e824d998228e4ef9f0bfac7d) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel-yocto.bbclass')
-rw-r--r--meta/classes/kernel-yocto.bbclass39
1 files changed, 37 insertions, 2 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 1e226a5722..14551a23f2 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -56,6 +56,7 @@ def get_machine_branch(d, default):
56 return default 56 return default
57 57
58do_kernel_metadata() { 58do_kernel_metadata() {
59 set +e
59 cd ${S} 60 cd ${S}
60 export KMETA=${KMETA} 61 export KMETA=${KMETA}
61 62
@@ -75,6 +76,41 @@ do_kernel_metadata() {
75 machine_srcrev="${SRCREV}" 76 machine_srcrev="${SRCREV}"
76 fi 77 fi
77 78
79 # In a similar manner to the kernel itself:
80 #
81 # defconfig: $(obj)/conf
82 # ifeq ($(KBUILD_DEFCONFIG),)
83 # $< --defconfig $(Kconfig)
84 # else
85 # @echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'"
86 # $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
87 # endif
88 #
89 # If a defconfig is specified via the KBUILD_DEFCONFIG variable, we copy it
90 # from the source tree, into a common location and normalized "defconfig" name,
91 # where the rest of the process will include and incoroporate it into the build
92 #
93 # If the fetcher has already placed a defconfig in WORKDIR (from the SRC_URI),
94 # we don't overwrite it, but instead warn the user that SRC_URI defconfigs take
95 # precendence.
96 #
97 if [ -n "${KBUILD_DEFCONFIG}" ]; then
98 if [ -f "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}" ]; then
99 if [ -f "${WORKDIR}/defconfig" ]; then
100 # If the two defconfigs are the same, leave the existing one in place
101 cmp "${WORKDIR}/defconfig" "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}"
102 if [ $? -ne 0 ]; then
103 bbnote "defconfig detected in WORKDIR. ${KBUILD_DEFCONFIG} skipped"
104 else
105 cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${WORKDIR}/defconfig
106 sccs="${WORKDIR}/defconfig"
107 fi
108 fi
109 else
110 bbfatal "A KBUILD_DECONFIG '${KBUILD_DEFCONFIG}' was specified, but not present in the source tree"
111 fi
112 fi
113
78 # if we have a defined/set meta branch we should not be generating 114 # if we have a defined/set meta branch we should not be generating
79 # any meta data. The passed branch has what we need. 115 # any meta data. The passed branch has what we need.
80 if [ -n "${KMETA}" ]; then 116 if [ -n "${KMETA}" ]; then
@@ -86,11 +122,10 @@ do_kernel_metadata() {
86 bbfatal "Could not create ${machine_branch}" 122 bbfatal "Could not create ${machine_branch}"
87 fi 123 fi
88 124
89 sccs="${@" ".join(find_sccs(d))}" 125 sccs="$sccs ${@" ".join(find_sccs(d))}"
90 patches="${@" ".join(find_patches(d))}" 126 patches="${@" ".join(find_patches(d))}"
91 feat_dirs="${@" ".join(find_kernel_feature_dirs(d))}" 127 feat_dirs="${@" ".join(find_kernel_feature_dirs(d))}"
92 128
93 set +e
94 # add any explicitly referenced features onto the end of the feature 129 # add any explicitly referenced features onto the end of the feature
95 # list that is passed to the kernel build scripts. 130 # list that is passed to the kernel build scripts.
96 if [ -n "${KERNEL_FEATURES}" ]; then 131 if [ -n "${KERNEL_FEATURES}" ]; then