Skip to content
This repository has been archived by the owner on Apr 19, 2019. It is now read-only.

Commit

Permalink
image-dsk.bbclass: fix INITRD content bug when producing bundle images
Browse files Browse the repository at this point in the history
When producing the rootfs for swupd images, the actual
do_uefiapp/deploy_uefiapp runs inside the virtual bundle-* image
recipes where the .dsk format is inactive. In that case we need
to include the INITRD_IMAGE.

The previous logic was an attempt to enable the use of
image-dsk.bbclass without side effects when the corresponding format
was not active. However, because of the UEFI app that isn't possible
and not desirable (because we want to get consistent content of the
rootfs, regardless of the image format).

That's okay for ostro-image.bb, because it only inherits the class if
the platform really needs it.

Signed-off-by: Patrick Ohly <[email protected]>
  • Loading branch information
pohly committed Mar 29, 2016
1 parent 5ba7c21 commit 64a7495
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions meta-ostro/classes/image-dsk.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ COMPRESSIONTYPES_append = " vdi"
COMPRESS_CMD_vdi = "qemu-img convert -O vdi ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.vdi"
COMPRESS_DEPENDS_vdi = "qemu-native"

IMAGE_DSK_ACTIVE = "${@ bool([x for x in d.getVar('IMAGE_FSTYPES', True).split() if x == 'dsk' or x.startswith('dsk.')])}"
python () {
if d.getVar('IMAGE_DSK_ACTIVE', True) == 'True':
d.setVar('IMAGE_NAME_SUFFIX', '')
}

do_uefiapp[depends] += " \
systemd:do_deploy \
virtual/kernel:do_deploy \
Expand All @@ -49,7 +43,15 @@ IMAGE_DEPENDS_dsk += " \
dosfstools-native:do_populate_sysroot \
dosfstools-native:do_populate_sysroot \
"
INITRD_append = "${@ ('${DEPLOY_DIR_IMAGE}/' + d.getVar('INITRD_IMAGE', expand=True) + '-${MACHINE}.cpio.gz') if d.getVar('INITRD_IMAGE', True) and ${IMAGE_DSK_ACTIVE} else ''}"

# Always ensure that the INITRD_IMAGE gets added to the initramfs .cpio.
# This needs to be done even when the actual .dsk image format is inactive,
# because the .cpio file gets copied into the rootfs, and that rootfs
# must be consistent regardless of the image format. This became relevant
# when adding swupd bundle support, because there virtual images
# without active .dsk are used to generate the rootfs for other
# images with .dsk format.
INITRD_append = "${@ ('${DEPLOY_DIR_IMAGE}/' + d.getVar('INITRD_IMAGE', expand=True) + '-${MACHINE}.cpio.gz') if d.getVar('INITRD_IMAGE', True) else ''}"

PACKAGES = " "
EXCLUDE_FROM_WORLD = "1"
Expand Down

0 comments on commit 64a7495

Please sign in to comment.