Yocto Bug #6945
v4 cover Yocto Bug #6945
From: He Zhe <[email protected]>
- Add KERNEL_IMAGETYPES to support building packaging and installing
multi types of kernel images, such as zImage uImage, at one time.
- KERNEL_IMAGETYPE works as it did.
- v2: Update with the latest oe-core
- v3: Add KERNEL_IMAGETYPES, leave KERNEL_IMAGETYPE as is
- v4: Turn package name to lower case to meet opkg's requrement Modify "if test" in kernel-fitimage.bbclass and kernel-uimage.bbclass
He Zhe (1):
kernel: Add KERNEL_IMAGETYPES to build multi types of kernel at one
time
meta/classes/kernel-fitimage.bbclass | 21 +++--- meta/classes/kernel-grub.bbclass | 46 +++++++---- meta/classes/kernel-uimage.bbclass | 22 +++--- meta/classes/kernel.bbclass | 130 +++++++++++++++++++++++--------- meta/conf/documentation.conf | 1 + meta/recipes-kernel/linux/linux-dtb.inc | 81 ++++++++++++-------- 6 files changed, 199 insertions(+), 102 deletions(-)
Signature · 1 line
1.9.1
PATCH v4 1/1 kernel: Add KERNEL_IMAGETYPES to build multi types of kernel at one time
From: He Zhe <[email protected]>
Add KERNEL_IMAGETYPES to support building packaging and installing multi types of kernel images, such as zImage uImage, at one time. KERNEL_IMAGETYPE works as it did.
Fixes [YOCTO #6945].
--- meta/classes/kernel-fitimage.bbclass | 21 +++--- meta/classes/kernel-grub.bbclass | 46 +++++++---- meta/classes/kernel-uimage.bbclass | 22 +++--- meta/classes/kernel.bbclass | 130 +++++++++++++++++++++++--------- meta/conf/documentation.conf | 1 + meta/recipes-kernel/linux/linux-dtb.inc | 81 ++++++++++++-------- 6 files changed, 199 insertions(+), 102 deletions(-)
meta/classes/kernel-fitimage.bbclass +12 -9
@@ -1,8 +1,8 @@ inherit kernel-uboot python __anonymous () { - kerneltype = d.getVar('KERNEL_IMAGETYPE', True) - if kerneltype == 'fitImage': + kerneltype = d.getVar('KERNEL_IMAGETYPES', True) or "" + if 'fitImage' in kerneltype.split(): depends = d.getVar("DEPENDS", True) depends = "%s u-boot-mkimage-native dtc-native" % depends d.setVar("DEPENDS", depends)
@@ -10,7 +10,10 @@ python __anonymous () { # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal # to kernel.bbclass . We have to override it, since we pack zImage # (at least for now) into the fitImage . - d.setVar("KERNEL_IMAGETYPE_FOR_MAKE", "zImage") + typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE", True) or "" + if 'fitImage' in typeformake.split(): + typeformake.replace('fitImage', 'zImage') + d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake) image = d.getVar('INITRAMFS_IMAGE', True) if image:
@@ -154,7 +157,7 @@ EOF } do_assemble_fitimage() { - if test "x${KERNEL_IMAGETYPE}" = "xfitImage" ; then + if test "x${KERNEL_IMAGETYPES}" =~ "fitImage" ; then kernelcount=1 dtbcount="" rm -f fit-image.its
@@ -217,14 +220,14 @@ addtask assemble_fitimage before do_install after do_compile kernel_do_deploy_append() { # Update deploy directory - if test "x${KERNEL_IMAGETYPE}" = "xfitImage" ; then + if test "x${KERNEL_IMAGETYPES}" =~ "fitImage" ; then cd ${B} echo "Copying fit-image.its source file..." - its_base_name="${KERNEL_IMAGETYPE}-its-${PV}-${PR}-${MACHINE}-${DATETIME}" - its_symlink_name=${KERNEL_IMAGETYPE}-its-${MACHINE} + its_base_name="fitImage-its-${PV}-${PR}-${MACHINE}-${DATETIME}" + its_symlink_name=fitImage-its-${MACHINE} install -m 0644 fit-image.its ${DEPLOYDIR}/${its_base_name}.its - linux_bin_base_name="${KERNEL_IMAGETYPE}-linux.bin-${PV}-${PR}-${MACHINE}-${DATETIME}" - linux_bin_symlink_name=${KERNEL_IMAGETYPE}-linux.bin-${MACHINE} + linux_bin_base_name="fitImage-linux.bin-${PV}-${PR}-${MACHINE}-${DATETIME}" + linux_bin_symlink_name=fitImage-linux.bin-${MACHINE} install -m 0644 linux.bin ${DEPLOYDIR}/${linux_bin_base_name}.bin cd ${DEPLOYDIR}
meta/classes/kernel-grub.bbclass +31 -15
84 lines not on this page · raw message
meta/classes/kernel-uimage.bbclass +12 -10
@@ -1,23 +1,25 @@ inherit kernel-uboot python __anonymous () { - kerneltype = d.getVar('KERNEL_IMAGETYPE', True) - if kerneltype == 'uImage': + if "uImage" in (d.getVar('KERNEL_IMAGETYPES', True) or "").split(): depends = d.getVar("DEPENDS", True) depends = "%s u-boot-mkimage-native" % depends d.setVar("DEPENDS", depends) - # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal - # to kernel.bbclass . We override the variable here, since we need - # to build uImage using the kernel build system if and only if - # KEEPUIMAGE == yes. Otherwise, we pack compressed vmlinux into - # the uImage . - if d.getVar("KEEPUIMAGE", True) != 'yes': - d.setVar("KERNEL_IMAGETYPE_FOR_MAKE", "zImage") + # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal + # to kernel.bbclass . We override the variable here, since we need + # to build uImage using the kernel build system if and only if + # KEEPUIMAGE == yes. Otherwise, we pack compressed vmlinux into + # the uImage . + if d.getVar("KEEPUIMAGE", True) != 'yes': + typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE", True) or "" + if "uImage" in typeformake.split(): + typeformake.replace('uImage', 'zImage') + d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake) } do_uboot_mkimage() { - if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then + if test "x${KERNEL_IMAGETYPES}" =~ "uImage" ; then if test "x${KEEPUIMAGE}" != "xyes" ; then uboot_prep_kimage
meta/classes/kernel.bbclass +95 -35
204 lines not on this page · raw message
meta/conf/documentation.conf +1 -0
@@ -245,6 +245,7 @@ KERNEL_CLASSES[doc] = "A list of classes defining kernel image types that kernel KERNEL_EXTRA_ARGS[doc] = "Specifies additional make command-line arguments the OpenEmbedded build system passes on when compiling the kernel." KERNEL_FEATURES[doc] = "Includes additional metadata from the Yocto Project kernel Git repository. The metadata you add through this variable includes config fragments and features descriptions." KERNEL_IMAGETYPE[doc] = "The type of kernel to build for a device, usually set by the machine configuration files and defaults to 'zImage'." +KERNEL_IMAGETYPES[doc] = "The list of types of kernel to build for a device, usually set by the machine configuration files and defaults to KERNEL_IMAGETYPE." KERNEL_MODULE_AUTOLOAD[doc] = "Lists kernel modules that need to be auto-loaded during boot" KERNEL_MODULE_PROBECONF[doc] = "Lists kernel modules for which the build system expects to find module_conf_* values that specify configuration for each of the modules" KERNEL_PATH[doc] = "The location of the kernel sources. This variable is set to the value of the STAGING_KERNEL_DIR within the module class (module.bbclass)."
meta/recipes-kernel/linux/linux-dtb.inc +48 -33
104 lines not on this page · raw message
Signature · 1 line
1.9.1
Ping.
Quoted 23 lines · On 08/10/2015 08:46 PM, [email protected] wrote:
From: He Zhe <[email protected]>
- Add
KERNEL_IMAGETYPESto support building packaging and installing
multi types of kernel images, such as zImage uImage, at one time.
-KERNEL_IMAGETYPEworks as it did.
- v2: Update with the latest oe-core
- v3: AddKERNEL_IMAGETYPES, leaveKERNEL_IMAGETYPEas is
- v4: Turn package name to lower case to meet opkg's requrement Modify "if test" in kernel-fitimage.bbclass and kernel-uimage.bbclassHe Zhe (1):
kernel: AddKERNEL_IMAGETYPESto build multi types of kernel at one
timemeta/classes/kernel-fitimage.bbclass | 21 +++--- meta/classes/kernel-grub.bbclass | 46 +++++++---- meta/classes/kernel-uimage.bbclass | 22 +++--- meta/classes/kernel.bbclass | 130 +++++++++++++++++++++++--------- meta/conf/documentation.conf | 1 + meta/recipes-kernel/linux/linux-dtb.inc | 81 ++++++++++++-------- 6 files changed, 199 insertions(+), 102 deletions(-)
Quoted 1 line · He Zhe
Ping.
Everyone still has this on their list. I'm just back from vacation now, and will put a review in my TODO list.
But for now .. patience is still requested.
Cheers,
Bruce
Quoted 26 lines · On 08/10/2015 08:46 PM, [email protected] wrote:
Quoted 23 lines
From: He Zhe <[email protected]>
- Add
KERNEL_IMAGETYPESto support building packaging and installing
multi types of kernel images, such as zImage uImage, at one time.
-KERNEL_IMAGETYPEworks as it did.
- v2: Update with the latest oe-core
- v3: AddKERNEL_IMAGETYPES, leaveKERNEL_IMAGETYPEas is
- v4: Turn package name to lower case to meet opkg's requrement Modify "if test" in kernel-fitimage.bbclass and kernel-uimage.bbclassHe Zhe (1):
kernel: AddKERNEL_IMAGETYPESto build multi types of kernel at one
timemeta/classes/kernel-fitimage.bbclass | 21 +++--- meta/classes/kernel-grub.bbclass | 46 +++++++---- meta/classes/kernel-uimage.bbclass | 22 +++--- meta/classes/kernel.bbclass | 130 +++++++++++++++++++++++--------- meta/conf/documentation.conf | 1 + meta/recipes-kernel/linux/linux-dtb.inc | 81 ++++++++++++-------- 6 files changed, 199 insertions(+), 102 deletions(-)