From 532bd5b5ede84760f6318b2e6d214e73cf034898 Mon Sep 17 00:00:00 2001 From: Balint Reczey Date: Thu, 23 Nov 2017 20:27:16 +0100 Subject: [PATCH] Build minimized images in a 1GiB image --- live-build/auto/config | 5 +++++ live-build/ubuntu-cpc/hooks/032-disk-image.binary | 4 ++-- live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary | 2 ++ live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/live-build/auto/config b/live-build/auto/config index 1faf049b..4f3304b2 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -717,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/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() {