Patchwork [6/9] bootimg.bbclass: take initramfs into consideration

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date June 16, 2014, 10:46 a.m.
Message ID <4492b52274d0ac89938a17bd569aedff723e69bc.1402915083.git.Qi.Chen@windriver.com>
Download mbox | patch
Permalink /patch/73859/
State New
Headers show

Comments

Qi.Chen@windriver.com - June 16, 2014, 10:46 a.m.
It's a reasonable assumption that if INITRAMFS_IMAGE is set, the user
wants to do something with it. So the bootimg.bbclass should not just
ignore the existence of INITRAMFS_IMAGE.

This patch fixes the bootimg.bbclass to ship the initramfs image or
the bundled kernel for later use.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/classes/bootimg.bbclass |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index 7678567..b925265 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -66,6 +66,11 @@  populate() {
 
 	# Install bzImage, initrd, and rootfs.img in DEST for all loaders to use.
 	install -m 0644 ${STAGING_KERNEL_DIR}/bzImage ${DEST}/vmlinuz
+	if [ -n "${INITRAMFS_IMAGE}" ] && [ "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then
+		install -m 0644 ${STAGING_KERNEL_DIR}/bzImage-initramfs-${MACHINE}.bin ${DEST}/vmlinuz-initramfs
+	elif [ -n "${INITRAMFS_IMAGE}" ]; then
+		install -m 0644 ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.cpio.gz ${DEST}/initrd.img
+	fi
 
 	if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then
 		install -m 0644 ${INITRD} ${DEST}/initrd
@@ -237,4 +242,4 @@  IMAGE_TYPEDEP_iso = "ext3"
 IMAGE_TYPEDEP_hddimg = "ext3"
 IMAGE_TYPES_MASKED += "iso hddimg"
 
-addtask bootimg before do_build
+addtask bootimg before do_build after do_bundle_initramfs