From 4a168af95420bb5bd54d65f988a12e6409cc0118 Mon Sep 17 00:00:00 2001 From: Balint Reczey Date: Tue, 14 Nov 2017 18:44:06 +0100 Subject: [PATCH 1/2] Skip setting up initrd for s390x when it is not generated for the image This fixes building minimized s390x images. --- .../ubuntu-cpc/hooks/032-disk-image.binary | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/live-build/ubuntu-cpc/hooks/032-disk-image.binary b/live-build/ubuntu-cpc/hooks/032-disk-image.binary index e369dfc9..789bcd00 100755 --- a/live-build/ubuntu-cpc/hooks/032-disk-image.binary +++ b/live-build/ubuntu-cpc/hooks/032-disk-image.binary @@ -144,27 +144,32 @@ default=ubuntu [ubuntu] target = /boot image = /boot/vmlinuz -ramdisk = /boot/initrd.img parameters = root=LABEL=cloudimg-rootfs EOF - # Kernel initramfs hooks end up creating a copy - # rather than a symlink FIXME - pushd mountpoint/boot - ln -sf initrd.img-* initrd.img - popd - + ZIPL_EXTRA_PARAMS= + if [ -e mountpoint/boot/initrd.img-* ]; then + # Kernel initramfs hooks end up creating a copy + # rather than a symlink FIXME + pushd mountpoint/boot + ln -sf initrd.img-* initrd.img + popd + + ZIPL_EXTRA_PARAMS=--ramdisk=/boot/initrd.img + + echo "ramdisk = /boot/initrd.img" >> mountpoint/etc/zipl.conf + fi + # Create bootmap file chroot mountpoint /sbin/zipl -V \ --image=/boot/vmlinuz \ - --ramdisk=/boot/initrd.img \ --parameters='root=LABEL=cloudimg-rootfs' \ --target=/boot/ \ --targetbase=$loop_device \ --targettype=SCSI \ --targetblocksize=512 \ - --targetoffset=2048 - + --targetoffset=2048 \ + $ZIPL_EXTRA_PARAMS fi if [ -n "$BOOT_MOUNTPOINT" ]; then From 578fa5a92d16a339a9c2696479bb56584f56e745 Mon Sep 17 00:00:00 2001 From: Balint Reczey Date: Tue, 14 Nov 2017 19:04:21 +0100 Subject: [PATCH 2/2] Update changelog --- debian/changelog | 7 +++++++ live-build/ubuntu-cpc/hooks/032-disk-image.binary | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index f801abe0..7fe8f90b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.483) UNRELEASED; urgency=medium + + * Skip setting up initrd for s390x when it is not generated for the image. + This fixes building minimized s390x images. + + -- Balint Reczey Tue, 14 Nov 2017 18:51:14 +0100 + livecd-rootfs (2.482) bionic; urgency=medium * Remove boot/grub leftovers from our root squashfs, left behind after diff --git a/live-build/ubuntu-cpc/hooks/032-disk-image.binary b/live-build/ubuntu-cpc/hooks/032-disk-image.binary index 789bcd00..7989ff6a 100755 --- a/live-build/ubuntu-cpc/hooks/032-disk-image.binary +++ b/live-build/ubuntu-cpc/hooks/032-disk-image.binary @@ -155,9 +155,9 @@ EOF ln -sf initrd.img-* initrd.img popd - ZIPL_EXTRA_PARAMS=--ramdisk=/boot/initrd.img - echo "ramdisk = /boot/initrd.img" >> mountpoint/etc/zipl.conf + + ZIPL_EXTRA_PARAMS=--ramdisk=/boot/initrd.img fi # Create bootmap file