[poky] Applying a defconfig easily to a kernel

Bryan O'Donoghue bryan.odonoghue at intel.com
Sat Feb 4 02:53:14 PST 2012


Greetings list.

I've had a hard time applying a complete - unmodified defconfig to my
local git kernel config. So rather than dig through the internals of
the build process, I took the following short-cut.

It works - is it "wrong" though ? I like it because it's
easy/straightforward. Basically if I define a defconfig - the system
will trust the file and apply it directly - which I suspect is what
99% of people who supply a defconfig will want anyway.

Consider applying.

diff --git a/meta/classes/kernel-yocto.bbclass
b/meta/classes/kernel-yocto.bbclass
index 1b73e6e..f278472 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -178,8 +178,15 @@ do_kernel_configme() {
               exit 1
       fi

-       echo "# Global settings from linux recipe" >> ${B}/.config
-       echo "CONFIG_LOCALVERSION="\"${LINUX_VERSION_EXTENSION}\" >>
${B}/.config
+       if [ -f ${WORKDIR}/defconfig ]; then
+               echo "[INFO] HAVE A DEFCONFIG - copying verbatim"
+               cat ${WORKDIR}/defconfig
+               cp ${WORKDIR}/defconfig ${B}/.config
+       else
+               echo "# Global settings from linux recipe" >> ${B}/.config
+               echo
"CONFIG_LOCALVERSION="\"${LINUX_VERSION_EXTENSION}\" >> ${B}/.config
+       fi
+
 }

 python do_kernel_configcheck()



More information about the poky mailing list