diff --git a/debian/changelog b/debian/changelog index 0d2ea697..1ba7a071 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,8 +6,11 @@ livecd-rootfs (2.485) UNRELEASED; urgency=medium [ Balint Reczey ] * Use default xz compression (-6) for raspi2 image. Xz with -0 generated ~35% bigger compressed image. (LP: #1732681) + * Zero fill space in UEFI partitions, too + * Set LB_ISO_PREPARER to livecd-rootfs to avoid unbound variable in default string + * Build minimized images in a 1GiB image - -- Balint Reczey Mon, 20 Nov 2017 21:18:53 +0100 + -- Balint Reczey Thu, 23 Nov 2017 20:29:29 +0100 livecd-rootfs (2.484) bionic; urgency=medium diff --git a/live-build/auto/config b/live-build/auto/config index 8c749ec6..4f3304b2 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -694,6 +694,7 @@ esac lb config noauto \ --mode ubuntu \ --distribution "$SUITE" \ + --iso-preparer "livecd-rootfs" \ --bootstrap-keyring ubuntu-keyring \ --binary-images "$BINARY_IMAGES" \ --memtest "$MEMTEST" \ @@ -716,6 +717,11 @@ echo "SUBPROJECT=\"${SUBPROJECT:-}\"" >> config/chroot echo "LB_BINARY_HOOKS=\"$BINARY_HOOKS\"" >> config/binary echo "BUILDSTAMP=\"$NOW\"" >> config/binary echo "SUBPROJECT=\"${SUBPROJECT:-}\"" >> config/binary +if [ "${SUBPROJECT:-}" = minimized ]; then + # try building minimized images in a 1GiB image but still allow overriding + # IMAGE_SIZE in lb build + echo 'IMAGE_SIZE=${IMAGE_SIZE:-'$((1024*1024*1024))'}' >> config/binary +fi case $ARCH+$SUBARCH in armhf+raspi2) diff --git a/live-build/functions b/live-build/functions index 549f3be3..04397fdb 100644 --- a/live-build/functions +++ b/live-build/functions @@ -171,6 +171,9 @@ umount_disk_image() { local uefi_dev="/dev/mapper${loop_device///dev/}p15" if [ -e "$mountpoint/boot/efi" -a -b "$uefi_dev" ]; then + # zero fill free space in UEFI partition + cat < /dev/zero > "$mountpoint/boot/efi/bloat_file" 2> /dev/null || true + rm "$mountpoint/boot/efi/bloat_file" umount --detach-loop "$mountpoint/boot/efi" fi diff --git a/live-build/ubuntu-cpc/hooks/032-disk-image.binary b/live-build/ubuntu-cpc/hooks/032-disk-image.binary index 7989ff6a..71db6d24 100755 --- a/live-build/ubuntu-cpc/hooks/032-disk-image.binary +++ b/live-build/ubuntu-cpc/hooks/032-disk-image.binary @@ -3,10 +3,10 @@ IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process" FS_LABEL="cloudimg-rootfs" -. config/functions - . config/binary +. config/functions + BOOTPART_START= BOOTPART_END= BOOT_MOUNTPOINT= diff --git a/live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary b/live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary index 8e8b0070..1dece0a3 100755 --- a/live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary +++ b/live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary @@ -12,6 +12,8 @@ esac IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process" FS_LABEL="cloudimg-rootfs" +. config/binary + . config/functions create_partitions() { diff --git a/live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary b/live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary index 649843e4..b97ef55b 100755 --- a/live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary +++ b/live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary @@ -10,6 +10,8 @@ esac IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process" FS_LABEL="cloudimg-rootfs" +. config/binary + . config/functions create_partitions() {