]> code.ossystems Code Review - openembedded-core.git/commitdiff
kernel: add dynamic configuration and patching
authorBruce Ashfield <bruce.ashfield@windriver.com>
Fri, 23 Jul 2010 16:58:21 +0000 (12:58 -0400)
committerRichard Purdie <rpurdie@linux.intel.com>
Mon, 9 Aug 2010 16:20:35 +0000 (17:20 +0100)
This change adds the ability to dynamicaly modify a git based
linux repo during the do_patch and do_configure changes.

The bulk of the work is done by the kern_tools, and the recipe
simply needs to add createme and modifyme scripts to go along
with the existing configme.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
meta/packages/kern-tools/kern-tools-native_git.bb
meta/packages/linux/linux-wrs_git.bb

index 4e4b86b979add1e8c5a4217ec4ba5a359b05ff15..d21d2b0aaa955f09199820710abceed01a8ef421 100644 (file)
@@ -14,7 +14,8 @@ S = "${WORKDIR}"
 
 kern_tools_LIST = kgit kgit-init kgit-meta \
                   kgit-checkpoint kgit-clean \
-                  generate_cfg kconf_check configme
+                  generate_cfg kconf_check configme \
+                 createme modifyme get_defconfig
 
 do_compile() { 
        :
index d6a81d1a5943b68f6ae22c467f6356d53c2936d7..ddd387743b36408cad311e1365eb3a963d21390c 100644 (file)
@@ -24,13 +24,34 @@ COMPATIBLE_MACHINE = "(qemuarm|qemux86|qemuppc|qemumips)"
 
 LINUX_VERSION = "v2.6.34"
 LINUX_VERSION_EXTENSION = "-wr-${LINUX_KERNEL_TYPE}"
-PR = "r2"
+PR = "r3"
 
 S = "${WORKDIR}/linux"
 B = "${WORKDIR}/linux-${WRMACHINE}-${LINUX_KERNEL_TYPE}-build"
 
 do_patch() {
-    echo "[INFO] Patching is currently not supported"
+       cd ${S}
+       if [ -f ${WORKDIR}/defconfig ]; then
+           defconfig=${WORKDIR}/defconfig
+       fi
+
+       createme ${TARGET_ARCH} ${WRMACHINE}-${LINUX_KERNEL_TYPE} ${defconfig}
+       if [ $? -ne 0 ]; then
+               echo "ERROR. Could not create ${WRMACHINE}-${LINUX_KERNEL_TYPE}"
+               exit 1
+       fi
+
+       updateme ${WORKDIR}
+       if [ $? -ne 0 ]; then
+               echo "ERROR. Could not update ${WRMACHINE}-${LINUX_KERNEL_TYPE}"
+               exit 1
+       fi
+
+       patchme ${WRMACHINE}-${LINUX_KERNEL_TYPE}
+       if [ $? -ne 0 ]; then
+               echo "ERROR. Could not modify ${WRMACHINE}-${LINUX_KERNEL_TYPE}"
+               exit 1
+       fi
 }
 
 do_wrlinux_checkout() {
@@ -50,9 +71,14 @@ addtask wrlinux_checkout before do_patch after do_unpack
 
 do_wrlinux_configme() {
        echo "Doing wrlinux configme"
-       rm -rf ${B}
+
        cd ${S}
-       configme
+       configme --reconfig
+       if [ $? -ne 0 ]; then
+               echo "ERROR. Could not configure ${WRMACHINE}-${LINUX_KERNEL_TYPE}"
+               exit 1
+       fi
+
        echo "# CONFIG_WRNOTE is not set" >> ${B}/.config
        echo "# Global settings from linux recipe" >> ${B}/.config
        echo "CONFIG_LOCALVERSION="\"${LINUX_VERSION_EXTENSION}\" >> ${B}/.config
@@ -72,9 +98,7 @@ do_wrlinux_link_vmlinux() {
 do_wrlinux_configme[depends] = "kern-tools-native:do_populate_sysroot"
 addtask wrlinux_configme before do_configure after do_patch
 addtask wrlinux_link_vmlinux after do_compile before do_install
-
-# XXX 
-#addtask wrlinux_configcheck after do_configure before do_compile
+addtask wrlinux_configcheck after do_configure before do_compile
 
 inherit kernel