Skip to contentSkip to conversation

linux-kexecboot: use kernel_conf_variable like linux.inc does and respect CMDLINE_DEBUG

PATCH Superseded Martin Jansa 3 participants 6 messages Nov 20, 2011 – Nov 25, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 linux-kexecboot: use kernel_conf_variable like linux.inc does and respect CMDLINE_DEBUG

---
 recipes-kernel/linux/linux-kexecboot.inc |   92 ++++++++++++++---------------
 1 files changed, 44 insertions(+), 48 deletions(-)
recipes-kernel/linux/linux-kexecboot.inc +44 -48
index ea0bbd6..b5cf18a 100644
@@ -11,7 +11,6 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
 # only as fallback for patches available only in linux-PV dir and ie defconfigs needs to go from linux-kexecboot-PV
 FILESPATH_append = ":${FILE_DIRNAME}/linux-${PV}"
 
-
 DEPENDS += "xz-native"
 
 # Kernel bootlogo is distro-specific (default is OE logo).
@@ -19,6 +18,10 @@ DEPENDS += "xz-native"
 LOGO_SIZE ?= "."
 SRC_URI = "file://${LOGO_SIZE}/logo_linux_clut224.ppm.bz2"
 
+# Set the verbosity of kernel messages during runtime
+# You can define CMDLINE_DEBUG in your local.conf or distro.conf to override this behaviour
+CMDLINE_DEBUG ?= '${@base_contains("IMAGE_FEATURES", "debug-tweaks", "debug", "loglevel=3", d)}'
+
 # Note how we set loglevel=3 and master console on serial to protect bootlogo.
 CMDLINE_c7x0 = "console=tty1 console=ttyS0,115200n8 loglevel=3"
 CMDLINE_tosa = "console=tty1 console=ttyS0,115200n8 loglevel=3"
@@ -46,28 +49,39 @@ LOCALVERSION ?= ""
 # we want the smallest size
 INITRAMFS_IMAGE = "initramfs-kexecboot-klibc-image"
 
+kernel_conf_variable() {
+        CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;"
+        if test "$2" = "n"
+        then
+                echo "# CONFIG_$1 is not set" >> ${S}/.config
+        else
+                echo "CONFIG_$1=$2" >> ${S}/.config
+        fi
+}
+
 do_configure_prepend() {
 
         echo "" > ${S}/.config
+        CONF_SED_SCRIPT=""
 
         #
         # CONFIG_CMDLINE mangling
         #
-        echo "CONFIG_CMDLINE_BOOL=y" >> ${S}/.config
-        echo "CONFIG_CMDLINE=\"${CMDLINE}\"" >> ${S}/.config
+        kernel_conf_variable CMDLINE_BOOL y
+        kernel_conf_variable CMDLINE "\"${CMDLINE} ${CMDLINE_DEBUG}\""
 
         # mips and x86
-        echo "CONFIG_CMDLINE_OVERRIDE=y" >> ${S}/.config
+        kernel_conf_variable CMDLINE_OVERRIDE y
 
         # sh only
-        echo "CONFIG_CMDLINE_OVERWRITE=y" >> ${S}/.config
-        echo "# CONFIG_CMDLINE_EXTEND is not set" >> ${S}/.config
+        kernel_conf_variable CMDLINE_OVERWRITE y
+        kernel_conf_variable CMDLINE_EXTEND n
 
         #
         # endian support
         #
         if [ "${SITEINFO_ENDIANNESS}" = "be" ]; then
-                echo "CONFIG_CPU_BIG_ENDIAN=y"          >> ${S}/.config
+                kernel_conf_variable CPU_BIG_ENDIAN y
         fi
 
         #
@@ -75,60 +89,42 @@ do_configure_prepend() {
         #
         if [ -e ${WORKDIR}/logo_linux_clut224.ppm ]; then
                 install -m 0644 ${WORKDIR}/logo_linux_clut224.ppm drivers/video/logo/logo_linux_clut224.ppm
-                echo "CONFIG_LOGO=y"                    >> ${S}/.config
-                echo "CONFIG_LOGO_LINUX_CLUT224=y"      >> ${S}/.config
+                kernel_conf_variable LOGO y
+                kernel_conf_variable LOGO_LINUX_CLUT224 y
         fi
 
         # When enabling thumb for userspace we also need thumb support in the kernel
         if [ "${ARM_INSTRUCTION_SET}" = "thumb" ] ; then
-            sed -i -e /CONFIG_ARM_THUMB/d ${WORKDIR}/defconfig 
-            echo "CONFIG_ARM_THUMB=y" >> ${S}/.config
+                kernel_conf_variable ARM_THUMB y
         fi
 
-        sed -e '/CONFIG_CMDLINE=/d' \
-            -e '/CONFIG_CMDLINE_BOOL/d' \
-            -e '/CONFIG_CMDLINE_OVERRIDE/d' \
-            -e '/CONFIG_CMDLINE_OVERWRITE/d' \
-            -e '/CONFIG_CMDLINE_EXTEND/d' \
-            -e '/CONFIG_CPU_BIG_ENDIAN/d' \
-            -e '/CONFIG_LOGO=/d' \
-            -e '/CONFIG_LOGO_LINUX_CLUT224=/d' \
-            -e '/CONFIG_LOCALVERSION/d' \
-            -e '/CONFIG_LOCALVERSION_AUTO/d' \
-            < '${WORKDIR}/defconfig' >>'${S}/.config'
-
-        echo 'CONFIG_LOCALVERSION="${LOCALVERSION}"' >>${S}/.config
-        echo '# CONFIG_LOCALVERSION_AUTO is not set' >>${S}/.config
+        kernel_conf_variable LOCALVERSION "\"${LOCALVERSION}\""
+        kernel_conf_variable LOCALVERSION_AUTO n
 
         # Force sane defaults for kexec-enabled kernels and keep size small
-        sed -i -e /CONFIG_BLK_DEV_INITRD/d \
-               -e /CONFIG_KEXEC/d \
-               -e /=m/d \
-               -e /CONFIG_MODULES/d \
-               -e /CONFIG_DEBUG_ERRORS/d \
-               -e /CONFIG_DEBUG_BUGVERBOSE/d \
-               -e /CONFIG_DEBUG_KERNEL/d \
-               ${S}/.config
-
-               echo 'CONFIG_BLK_DEV_INITRD=y' >>${S}/.config
-               echo 'CONFIG_KEXEC=y' >>${S}/.config
-               echo '# CONFIG_MODULES is not set' >> ${S}/.config
+        kernel_conf_variable BLK_DEV_INITRD y
+        kernel_conf_variable KEXEC y
+        CONF_SED_SCRIPT="$CONF_SED_SCRIPT /=m/d;"
+        kernel_conf_variable MODULES n
+        kernel_conf_variable DEBUG_ERRORS n
+        kernel_conf_variable DEBUG_BUGVERBOSE n
+        kernel_conf_variable DEBUG_KERNEL n
 
         # Force lzma for arm kernels only
         if [ "${ARCH}" = "arm" ] ; then
-
-            sed -i -e /CONFIG_KERNEL/d \
-               -e /CONFIG_INITRAMFS_COMPRESSION/d \
-               -e /CONFIG_INITRAMFS_SOURCE/d \
-               -e /CONFIG_RD/d \
-               ${S}/.config
-
-               echo 'CONFIG_KERNEL_LZMA=y' >>${S}/.config
-               echo 'CONFIG_INITRAMFS_COMPRESSION_LZMA=y' >>${S}/.config
-               echo 'CONFIG_INITRAMFS_SOURCE="initramfs.cpio.lzma"' >>${S}/.config
-               echo 'CONFIG_RD_LZMA=y' >>${S}/.config
+                CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_KERNEL/d;"
+                CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_RD/d;"
+                CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_INITRAMFS_COMPRESSION/d;"
+                CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_INITRAMFS_SOURCE/d;"
+                kernel_conf_variable KERNEL_LZMA y
+                kernel_conf_variable RD_LZMA y
+                kernel_conf_variable INITRAMFS_COMPRESSION_LZMA y
+                kernel_conf_variable INITRAMFS_SOURCE "\"initramfs.cpio.lzma\""
         fi
 
+        sed -e "${CONF_SED_SCRIPT}" \
+                        < '${WORKDIR}/defconfig' >>'${S}/.config'
+
         yes '' | oe_runmake oldconfig
 }
 
Signature · 1 line
1.7.8.rc3
#1 lore raw

PATCH 2/2 linux-git: move CMDLINE_DEBUG to linux-git.inc to be used also for linux-kexecboot

---
 recipes-kernel/linux/linux-git.inc |    2 ++
 recipes-kernel/linux/linux_git.bb  |    1 -
 2 files changed, 2 insertions(+), 1 deletions(-)
recipes-kernel/linux/linux-git.inc +2 -0
index 84f09f5..4367ae8 100644
@@ -4,6 +4,8 @@ PV = "${OLD_KERNEL_RELEASE}+${KERNEL_RELEASE}+gitr${SRCPV}"
 
 SRCREV = "65112dccf8a113737684366349d7f9ec373ddc47"
 
+CMDLINE_DEBUG = "debug"
+
 SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git;protocol=git;branch=master \
            file://defconfig"
 S = "${WORKDIR}/git"
recipes-kernel/linux/linux_git.bb +0 -1
index fbe3049..256ee0e 100644
@@ -1,4 +1,3 @@
-CMDLINE_DEBUG = "debug"
 require linux.inc
 require linux-git.inc
 
Signature · 1 line
1.7.8.rc3
#2 lore raw

PATCH v2 1/1 linux-kexecboot: use kernel_conf_variable like linux.inc does and respect CMDLINE_DEBUG

In reply to Martin Jansa
---
 recipes-kernel/linux/linux-kexecboot.inc |  104 ++++++++++++++---------------
 1 files changed, 50 insertions(+), 54 deletions(-)
recipes-kernel/linux/linux-kexecboot.inc +50 -54
index ea0bbd6..c7b29f3 100644
@@ -11,7 +11,6 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
 # only as fallback for patches available only in linux-PV dir and ie defconfigs needs to go from linux-kexecboot-PV
 FILESPATH_append = ":${FILE_DIRNAME}/linux-${PV}"
 
-
 DEPENDS += "xz-native"
 
 # Kernel bootlogo is distro-specific (default is OE logo).
@@ -19,13 +18,17 @@ DEPENDS += "xz-native"
 LOGO_SIZE ?= "."
 SRC_URI = "file://${LOGO_SIZE}/logo_linux_clut224.ppm.bz2"
 
+# Set the verbosity of kernel messages during runtime
+# You can define CMDLINE_DEBUG in your local.conf or distro.conf to override this behaviour
+CMDLINE_DEBUG ?= '${@base_contains("IMAGE_FEATURES", "debug-tweaks", "debug", "loglevel=3", d)}'
+
 # Note how we set loglevel=3 and master console on serial to protect bootlogo.
-CMDLINE_c7x0 = "console=tty1 console=ttyS0,115200n8 loglevel=3"
-CMDLINE_tosa = "console=tty1 console=ttyS0,115200n8 loglevel=3"
-CMDLINE_poodle = "console=tty1 console=ttyS0,115200n8 fbcon=rotate:1 loglevel=3"
-CMDLINE_akita = "console=tty1 console=ttyS0,115200n8 fbcon=rotate:1 loglevel=3"
-CMDLINE_collie = "console=tty1 console=ttySA0,115200n8 fbcon=rotate:1 mem=64M loglevel=3"
-CMDLINE_spitz = "console=tty1 console=ttyS0,115200n8 fbcon=rotate:1 loglevel=3"
+CMDLINE_c7x0 = "console=tty1 console=ttyS0,115200n8"
+CMDLINE_tosa = "console=tty1 console=ttyS0,115200n8"
+CMDLINE_poodle = "console=tty1 console=ttyS0,115200n8 fbcon=rotate:1"
+CMDLINE_akita = "console=tty1 console=ttyS0,115200n8 fbcon=rotate:1"
+CMDLINE_collie = "console=tty1 console=ttySA0,115200n8 fbcon=rotate:1 mem=64M"
+CMDLINE_spitz = "console=tty1 console=ttyS0,115200n8 fbcon=rotate:1"
 
 PACKAGES = ""
 PROVIDES = ""
@@ -46,28 +49,39 @@ LOCALVERSION ?= ""
 # we want the smallest size
 INITRAMFS_IMAGE = "initramfs-kexecboot-klibc-image"
 
+kernel_conf_variable() {
+        CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;"
+        if test "$2" = "n"
+        then
+                echo "# CONFIG_$1 is not set" >> ${S}/.config
+        else
+                echo "CONFIG_$1=$2" >> ${S}/.config
+        fi
+}
+
 do_configure_prepend() {
 
         echo "" > ${S}/.config
+        CONF_SED_SCRIPT=""
 
         #
         # CONFIG_CMDLINE mangling
         #
-        echo "CONFIG_CMDLINE_BOOL=y" >> ${S}/.config
-        echo "CONFIG_CMDLINE=\"${CMDLINE}\"" >> ${S}/.config
+        kernel_conf_variable CMDLINE_BOOL y
+        kernel_conf_variable CMDLINE "\"${CMDLINE} ${CMDLINE_DEBUG}\""
 
         # mips and x86
-        echo "CONFIG_CMDLINE_OVERRIDE=y" >> ${S}/.config
+        kernel_conf_variable CMDLINE_OVERRIDE y
 
         # sh only
-        echo "CONFIG_CMDLINE_OVERWRITE=y" >> ${S}/.config
-        echo "# CONFIG_CMDLINE_EXTEND is not set" >> ${S}/.config
+        kernel_conf_variable CMDLINE_OVERWRITE y
+        kernel_conf_variable CMDLINE_EXTEND n
 
         #
         # endian support
         #
         if [ "${SITEINFO_ENDIANNESS}" = "be" ]; then
-                echo "CONFIG_CPU_BIG_ENDIAN=y"          >> ${S}/.config
+                kernel_conf_variable CPU_BIG_ENDIAN y
         fi
 
         #
@@ -75,60 +89,42 @@ do_configure_prepend() {
         #
         if [ -e ${WORKDIR}/logo_linux_clut224.ppm ]; then
                 install -m 0644 ${WORKDIR}/logo_linux_clut224.ppm drivers/video/logo/logo_linux_clut224.ppm
-                echo "CONFIG_LOGO=y"                    >> ${S}/.config
-                echo "CONFIG_LOGO_LINUX_CLUT224=y"      >> ${S}/.config
+                kernel_conf_variable LOGO y
+                kernel_conf_variable LOGO_LINUX_CLUT224 y
         fi
 
         # When enabling thumb for userspace we also need thumb support in the kernel
         if [ "${ARM_INSTRUCTION_SET}" = "thumb" ] ; then
-            sed -i -e /CONFIG_ARM_THUMB/d ${WORKDIR}/defconfig 
-            echo "CONFIG_ARM_THUMB=y" >> ${S}/.config
+                kernel_conf_variable ARM_THUMB y
         fi
 
-        sed -e '/CONFIG_CMDLINE=/d' \
-            -e '/CONFIG_CMDLINE_BOOL/d' \
-            -e '/CONFIG_CMDLINE_OVERRIDE/d' \
-            -e '/CONFIG_CMDLINE_OVERWRITE/d' \
-            -e '/CONFIG_CMDLINE_EXTEND/d' \
-            -e '/CONFIG_CPU_BIG_ENDIAN/d' \
-            -e '/CONFIG_LOGO=/d' \
-            -e '/CONFIG_LOGO_LINUX_CLUT224=/d' \
-            -e '/CONFIG_LOCALVERSION/d' \
-            -e '/CONFIG_LOCALVERSION_AUTO/d' \
-            < '${WORKDIR}/defconfig' >>'${S}/.config'
-
-        echo 'CONFIG_LOCALVERSION="${LOCALVERSION}"' >>${S}/.config
-        echo '# CONFIG_LOCALVERSION_AUTO is not set' >>${S}/.config
+        kernel_conf_variable LOCALVERSION "\"${LOCALVERSION}\""
+        kernel_conf_variable LOCALVERSION_AUTO n
 
         # Force sane defaults for kexec-enabled kernels and keep size small
-        sed -i -e /CONFIG_BLK_DEV_INITRD/d \
-               -e /CONFIG_KEXEC/d \
-               -e /=m/d \
-               -e /CONFIG_MODULES/d \
-               -e /CONFIG_DEBUG_ERRORS/d \
-               -e /CONFIG_DEBUG_BUGVERBOSE/d \
-               -e /CONFIG_DEBUG_KERNEL/d \
-               ${S}/.config
-
-               echo 'CONFIG_BLK_DEV_INITRD=y' >>${S}/.config
-               echo 'CONFIG_KEXEC=y' >>${S}/.config
-               echo '# CONFIG_MODULES is not set' >> ${S}/.config
+        kernel_conf_variable BLK_DEV_INITRD y
+        kernel_conf_variable KEXEC y
+        CONF_SED_SCRIPT="$CONF_SED_SCRIPT /=m/d;"
+        kernel_conf_variable MODULES n
+        kernel_conf_variable DEBUG_ERRORS n
+        kernel_conf_variable DEBUG_BUGVERBOSE n
+        kernel_conf_variable DEBUG_KERNEL n
 
         # Force lzma for arm kernels only
         if [ "${ARCH}" = "arm" ] ; then
-
-            sed -i -e /CONFIG_KERNEL/d \
-               -e /CONFIG_INITRAMFS_COMPRESSION/d \
-               -e /CONFIG_INITRAMFS_SOURCE/d \
-               -e /CONFIG_RD/d \
-               ${S}/.config
-
-               echo 'CONFIG_KERNEL_LZMA=y' >>${S}/.config
-               echo 'CONFIG_INITRAMFS_COMPRESSION_LZMA=y' >>${S}/.config
-               echo 'CONFIG_INITRAMFS_SOURCE="initramfs.cpio.lzma"' >>${S}/.config
-               echo 'CONFIG_RD_LZMA=y' >>${S}/.config
+                CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_KERNEL/d;"
+                CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_RD/d;"
+                CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_INITRAMFS_COMPRESSION/d;"
+                CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_INITRAMFS_SOURCE/d;"
+                kernel_conf_variable KERNEL_LZMA y
+                kernel_conf_variable RD_LZMA y
+                kernel_conf_variable INITRAMFS_COMPRESSION_LZMA y
+                kernel_conf_variable INITRAMFS_SOURCE "\"initramfs.cpio.lzma\""
         fi
 
+        sed -e "${CONF_SED_SCRIPT}" \
+                        < '${WORKDIR}/defconfig' >>'${S}/.config'
+
         yes '' | oe_runmake oldconfig
 }
 
Signature · 1 line
1.7.8.rc3
#3 lore raw
Quoted 171 lines · Martin Jansa

---
 recipes-kernel/linux/linux-kexecboot.inc |  104 ++++++++++++++---------------

 1 files changed, 50 insertions(+), 54 deletions(-)
recipes-kernel/linux/linux-kexecboot.inc +0 -0
index ea0bbd6..c7b29f3 100644
@@ -11,7 +11,6 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
  # only as fallback for patches available only in linux-PV dir and ie defconfigs needs to go from linux-kexecboot-PV

 FILESPATH_append = ":${FILE_DIRNAME}/linux-${PV}"

-
 DEPENDS += "xz-native"

 # Kernel bootlogo is distro-specific (default is OE logo).

recipes-kernel/linux/linux-kexecboot.inc +0 -0
@@ -19,13 +18,17 @@ DEPENDS += "xz-native"

 LOGO_SIZE ?= "."
 SRC_URI = "file://${LOGO_SIZE}/logo_linux_clut224.ppm.bz2"

recipes-kernel/linux/linux-kexecboot.inc +4 -0
+# Set the verbosity of kernel messages during runtime
+# You can define CMDLINE_DEBUG in your local.conf or distro.conf to override this behaviour
+CMDLINE_DEBUG ?= '${@base_contains("IMAGE_FEATURES", "debug-tweaks", "debug", "loglevel=3", d)}'
+

 # Note how we set loglevel=3 and master console on serial to protect bootlogo.

recipes-kernel/linux/linux-kexecboot.inc +6 -6
-CMDLINE_c7x0 = "console=tty1 console=ttyS0,115200n8 loglevel=3"
-CMDLINE_tosa = "console=tty1 console=ttyS0,115200n8 loglevel=3"
-CMDLINE_poodle = "console=tty1 console=ttyS0,115200n8 fbcon=rotate:1 loglevel=3"
-CMDLINE_akita = "console=tty1 console=ttyS0,115200n8 fbcon=rotate:1 loglevel=3"
-CMDLINE_collie = "console=tty1 console=ttySA0,115200n8 fbcon=rotate:1 mem=64M loglevel=3"
-CMDLINE_spitz = "console=tty1 console=ttyS0,115200n8 fbcon=rotate:1 loglevel=3"
+CMDLINE_c7x0 = "console=tty1 console=ttyS0,115200n8"
+CMDLINE_tosa = "console=tty1 console=ttyS0,115200n8"
+CMDLINE_poodle = "console=tty1 console=ttyS0,115200n8 fbcon=rotate:1"
+CMDLINE_akita = "console=tty1 console=ttyS0,115200n8 fbcon=rotate:1"
+CMDLINE_collie = "console=tty1 console=ttySA0,115200n8 fbcon=rotate:1 mem=64M"
+CMDLINE_spitz = "console=tty1 console=ttyS0,115200n8 fbcon=rotate:1"

 PACKAGES = ""
 PROVIDES = ""

recipes-kernel/linux/linux-kexecboot.inc +0 -0
@@ -46,28 +49,39 @@ LOCALVERSION ?= ""
  # we want the smallest size

 INITRAMFS_IMAGE = "initramfs-kexecboot-klibc-image"

recipes-kernel/linux/linux-kexecboot.inc +10 -0
+kernel_conf_variable() {
+        CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;"
+        if test "$2" = "n"
+        then
+                echo "# CONFIG_$1 is not set" >> ${S}/.config
+        else
+                echo "CONFIG_$1=$2" >> ${S}/.config
+        fi
+}
+

 do_configure_prepend() {

        echo "" > ${S}/.config
+        CONF_SED_SCRIPT=""

        #
        # CONFIG_CMDLINE mangling
        #
-        echo "CONFIG_CMDLINE_BOOL=y" >> ${S}/.config
-        echo "CONFIG_CMDLINE=\"${CMDLINE}\"" >> ${S}/.config
+        kernel_conf_variable CMDLINE_BOOL y
+        kernel_conf_variable CMDLINE "\"${CMDLINE} ${CMDLINE_DEBUG}\""

        # mips and x86
-        echo "CONFIG_CMDLINE_OVERRIDE=y" >> ${S}/.config
+        kernel_conf_variable CMDLINE_OVERRIDE y
        # sh only
-        echo "CONFIG_CMDLINE_OVERWRITE=y" >> ${S}/.config
-        echo "# CONFIG_CMDLINE_EXTEND is not set" >> ${S}/.config
+        kernel_conf_variable CMDLINE_OVERWRITE y
+        kernel_conf_variable CMDLINE_EXTEND n

        #

        # endian support
        #
        if [ "${SITEINFO_ENDIANNESS}" = "be" ]; then
-                echo "CONFIG_CPU_BIG_ENDIAN=y"          >> ${S}/.config
+                kernel_conf_variable CPU_BIG_ENDIAN y
        fi

        #

recipes-kernel/linux/linux-kexecboot.inc +0 -0
@@ -75,60 +89,42 @@ do_configure_prepend() {
         #

        if [ -e ${WORKDIR}/logo_linux_clut224.ppm ]; then
                install -m 0644 ${WORKDIR}/logo_linux_clut224.ppm drivers/video/logo/logo_linux_clut224.ppm
-                echo "CONFIG_LOGO=y"                    >> ${S}/.config
-                echo "CONFIG_LOGO_LINUX_CLUT224=y"      >> ${S}/.config
+                kernel_conf_variable LOGO y
+                kernel_conf_variable LOGO_LINUX_CLUT224 y
        fi

        # When enabling thumb for userspace we also need thumb support in the kernel if [ "${ARM_INSTRUCTION_SET}" = "thumb" ] ; then
-            sed -i -e /CONFIG_ARM_THUMB/d ${WORKDIR}/defconfig
-            echo "CONFIG_ARM_THUMB=y" >> ${S}/.config
+                kernel_conf_variable ARM_THUMB y
        fi

-        sed -e '/CONFIG_CMDLINE=/d' \
-            -e '/CONFIG_CMDLINE_BOOL/d' \
-            -e '/CONFIG_CMDLINE_OVERRIDE/d' \
-            -e '/CONFIG_CMDLINE_OVERWRITE/d' \
-            -e '/CONFIG_CMDLINE_EXTEND/d' \
-            -e '/CONFIG_CPU_BIG_ENDIAN/d' \
-            -e '/CONFIG_LOGO=/d' \
-            -e '/CONFIG_LOGO_LINUX_CLUT224=/d' \
-            -e '/CONFIG_LOCALVERSION/d' \
-            -e '/CONFIG_LOCALVERSION_AUTO/d' \
-            < '${WORKDIR}/defconfig' >>'${S}/.config'
-
-        echo 'CONFIG_LOCALVERSION="${LOCALVERSION}"' >>${S}/.config
-        echo '# CONFIG_LOCALVERSION_AUTO is not set' >>${S}/.config
+        kernel_conf_variable LOCALVERSION "\"${LOCALVERSION}\""
+        kernel_conf_variable LOCALVERSION_AUTO n

        # Force sane defaults for kexec-enabled kernels and keep size small
-        sed -i -e /CONFIG_BLK_DEV_INITRD/d \
-               -e /CONFIG_KEXEC/d \
-               -e /=m/d \
-               -e /CONFIG_MODULES/d \
-               -e /CONFIG_DEBUG_ERRORS/d \
-               -e /CONFIG_DEBUG_BUGVERBOSE/d \
-               -e /CONFIG_DEBUG_KERNEL/d \
-               ${S}/.config
-
-               echo 'CONFIG_BLK_DEV_INITRD=y' >>${S}/.config
-               echo 'CONFIG_KEXEC=y' >>${S}/.config
-               echo '# CONFIG_MODULES is not set' >> ${S}/.config
+        kernel_conf_variable BLK_DEV_INITRD y
+        kernel_conf_variable KEXEC y
+        CONF_SED_SCRIPT="$CONF_SED_SCRIPT /=m/d;"
+        kernel_conf_variable MODULES n
+        kernel_conf_variable DEBUG_ERRORS n
+        kernel_conf_variable DEBUG_BUGVERBOSE n
+        kernel_conf_variable DEBUG_KERNEL n

        # Force lzma for arm kernels only
        if [ "${ARCH}" = "arm" ] ; then

recipes-kernel/linux/linux-kexecboot.inc +8 -11
-
-            sed -i -e /CONFIG_KERNEL/d \
-               -e /CONFIG_INITRAMFS_COMPRESSION/d \
-               -e /CONFIG_INITRAMFS_SOURCE/d \
-               -e /CONFIG_RD/d \
-               ${S}/.config
-
-               echo 'CONFIG_KERNEL_LZMA=y' >>${S}/.config
-               echo 'CONFIG_INITRAMFS_COMPRESSION_LZMA=y' >>${S}/.config
-               echo 'CONFIG_INITRAMFS_SOURCE="initramfs.cpio.lzma"' >>${S}/.config
-               echo 'CONFIG_RD_LZMA=y' >>${S}/.config
+                CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_KERNEL/d;"
+                CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_RD/d;"
+                CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_INITRAMFS_COMPRESSION/d;"
+                CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_INITRAMFS_SOURCE/d;"
+                kernel_conf_variable KERNEL_LZMA y
+                kernel_conf_variable RD_LZMA y
+                kernel_conf_variable INITRAMFS_COMPRESSION_LZMA y
+                kernel_conf_variable INITRAMFS_SOURCE "\"initramfs.cpio.lzma\""

        fi

+        sed -e "${CONF_SED_SCRIPT}" \
+                        < '${WORKDIR}/defconfig' >>'${S}/.config' +
        yes '' | oe_runmake oldconfig
 }

Quoted 9 lines

--
1.7.8.rc3

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

Martin,

I agree for the use kernel_conf_variable but I'm unsure about CMDLINE_DEBUG. In fact, I hardcoded it purposedly with commit 8929166 with the following reasons:

* Being a second-stage bootloader we don't expect any output on screen.
* Adding 'debug' as commandline arg is pointless because
* linux-kexecboot is compiled without debug and printk in order
* to minimize the size.
* Full debug implies not only editing the commandline (e.g. earlyprintk)
* but re-enabling full debug options in the defconfigs

Regards

Andrea

#4 lore raw
Quoted 7 lines · Andrea Adami

On Sun, Nov 20, 2011 at 12:26 PM, Martin Jansa <[email protected]> wrote:
Martin,

I agree for the use kernel_conf_variable but I'm unsure about CMDLINE_DEBUG. In fact, I hardcoded it purposedly with commit 8929166 with the following reasons:

Quoted 6 lines

* Being a second-stage bootloader we don't expect any output on screen.
* Adding 'debug' as commandline arg is pointless because
* linux-kexecboot is compiled without debug and printk in order
* to minimize the size.
* Full debug implies not only editing the commandline (e.g. earlyprintk)
* but re-enabling full debug options in the defconfigs

I had some issues with 3.2.0-rc2 when used as linux-kexecboot, that's why I've added this, but later found out that it's really a bit incomplete, that's why I have followup patch for this:
https://gitorious.org/shr/meta-handheld/commit/6bc710615b587fc0bfd8fc4372cad0de5599dd82?format=patch

But with latest SRCREV it works again, so in theory I don't need it, but still it would be usefull to have easy way to debug even this stage (maybe you still remember older kernel version where it worked fine as 3rd stage and failed to boot as 2nd stage..).

BTW: here is upgrade to 3.2.0-rc2 with those changes to linux-kexecboot.inc applied
https://gitorious.org/shr/meta-handheld/commit/27ca3d24353a5473f4f1aade00ba7a52b667e28c?format=patch

(be aware that I do rebase that branch sometimes so if those commits are not valid anymore just look at last few commits in that branch).

Regards,

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#5 lore raw
Quoted 27 lines · On Monday 21 November 2011 12:52:13 Martin Jansa wrote:
Quoted 8 lines · Andrea Adami

On Sun, Nov 20, 2011 at 12:26 PM, Martin Jansa <[email protected]>
wrote: Martin,

I agree for the use kernel_conf_variable but I'm unsure about CMDLINE_DEBUG. In fact, I hardcoded it purposedly with commit 8929166 with the
following reasons:

Quoted 6 lines

* Being a second-stage bootloader we don't expect any output on screen.
* Adding 'debug' as commandline arg is pointless because
* linux-kexecboot is compiled without debug and printk in order
* to minimize the size.
* Full debug implies not only editing the commandline (e.g. earlyprintk)
* but re-enabling full debug options in the defconfigs

I had some issues with 3.2.0-rc2 when used as linux-kexecboot, that's why I've added this, but later found out that it's really a bit incomplete, that's why I have followup patch for this:
https://gitorious.org/shr/meta-handheld/commit/6bc710615b587fc0bfd8fc4372cad
0de5599dd82?format=patch

But with latest SRCREV it works again, so in theory I don't need it, but still it would be usefull to have easy way to debug even this stage (maybe you still remember older kernel version where it worked fine as 3rd stage and failed to boot as 2nd stage..).

Quoted 7 lines

BTW: here is upgrade to 3.2.0-rc2 with those changes to linux-kexecboot.inc applied
https://gitorious.org/shr/meta-handheld/commit/27ca3d24353a5473f4f1aade00ba7
a52b667e28c?format=patch

(be aware that I do rebase that branch sometimes so if those commits are not valid anymore just look at last few commits in that branch).

As discussed on IRC I've merged the latest version of this branch to meta- handheld master now, thanks.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre