]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
image-vm.bbclass: support specifying an initramfs
authorPatrick Ohly <patrick.ohly@intel.com>
Thu, 3 Sep 2015 18:42:31 +0000 (20:42 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 6 Sep 2015 14:24:25 +0000 (15:24 +0100)
Set INITRD_IMAGE to automatically add a custom initramfs to the boot
partition.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/image-vm.bbclass

index 3df2c362e03c511a1e0afc6f945c70272144fe5a..0632667084fc6d0d8b5a38644145b78bf21bbb1f 100644 (file)
@@ -3,6 +3,11 @@ SYSLINUX_PROMPT ?= "0"
 SYSLINUX_LABELS = "boot"
 LABELS_append = " ${SYSLINUX_LABELS} "
 
+# Using an initramfs is optional. Enable it by setting INITRD_IMAGE.
+INITRD_IMAGE ?= ""
+INITRD ?= "${@'${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE}-${MACHINE}.cpio.gz' if '${INITRD_IMAGE}' else ''}"
+do_bootdirectdisk[depends] += "${@'${INITRD_IMAGE}:do_rootfs' if '${INITRD_IMAGE}' else ''}"
+
 # need to define the dependency and the ROOTFS for directdisk
 do_bootdirectdisk[depends] += "${PN}:do_rootfs"
 ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}.ext4"