From 5beab54dee5824d14d4aa3cd3de6330831382893 Mon Sep 17 00:00:00 2001 From: CloudBuilder Date: Fri, 8 Jan 2021 15:18:41 +0000 Subject: [PATCH] Imported 2.664.10 No reason for CPC update specified. --- debian/changelog | 18 +++++++- live-build/auto/config | 13 ++---- live-build/functions | 44 +++++++++++++------ .../hooks.d/base/disk-image-ppc64el.binary | 1 + .../hooks.d/base/disk-image-uefi.binary | 4 +- .../ubuntu-cpc/hooks.d/base/disk-image.binary | 1 + live-build/ubuntu-cpc/hooks.d/base/wsl.binary | 1 + 7 files changed, 56 insertions(+), 26 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3d8633e3..82c3163c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,24 @@ -livecd-rootfs (2.664.8.1) focal; urgency=medium +livecd-rootfs (2.664.10) focal; urgency=medium + + * Do not hard-code the UC20 amd64 image size to 8GB as now ubuntu-image + should be able to properly calculate the needed size itself. + * But per discussion, we might want to keep the UC20 images a bit bigger than + what's defined via the gadget/rootfs contents, to make sure writable is + comfortably big enough. Use the same hard-coded value as for UC16 and UC18. + (LP: #1905990) + + -- Ɓukasz 'sil2100' Zemczak Fri, 27 Nov 2020 17:58:38 +0100 + +livecd-rootfs (2.664.9) focal; urgency=medium + + [ John Chittum] + * Backport Ensure toolsVersion set in vmdk header (LP: #1893898) [ Dimitri John Ledkov & Joshua Powers ] * amd64: always install grub-pc with shim-signed (LP: #1901906), and ensure to autoremove packages - -- Robert C Jennings Fri, 20 Nov 2020 15:08:54 -0600 + -- Robert C Jennings Fri, 20 Nov 2020 14:35:51 -0600 livecd-rootfs (2.664.8) focal; urgency=medium diff --git a/live-build/auto/config b/live-build/auto/config index 761dd429..c64d83ad 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -360,14 +360,8 @@ case $IMAGEFORMAT in case $MODEL in pc-amd64|pc-i386) if [ -z "${SUBARCH:-}" ]; then - case $SUITE in - xenial|bionic) - UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS --image-size 3700M" - ;; - *) - UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS --image-size 8G" - ;; - esac + # This is to make sure there's enough writable space + UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS --image-size 3700M" fi ;; *) ;; @@ -775,8 +769,7 @@ case $PROJECT in add_package install grub-pc ;; amd64) - add_package install grub-pc-bin - add_package install grub-efi-amd64-signed + add_package install grub-pc add_package install shim-signed ;; esac diff --git a/live-build/functions b/live-build/functions index 17e42cd7..d69adddd 100644 --- a/live-build/functions +++ b/live-build/functions @@ -242,28 +242,46 @@ modify_vmdk_header() { # Extract the vmdk header for manipulation dd if="${vmdk_name}" of="${descriptor}" bs=1 skip=512 count=1024 + echo "Cat'ing original vmdk disk descriptor to console for debugging." + # cat header so we are aware of the original descriptor for debugging + cat $descriptor + + # trim null bytes to treat as standard text file + tr -d '\000' < $descriptor > $newdescriptor - # The sed lines below is where the magic is. Specifically: - # ddb.toolsVersion: sets the open-vm-tools so that VMware shows - # the tooling as current - # ddb.virtualHWVersion: set the version to 7, which covers most - # current versions of VMware - # createType: make sure its set to stream Optimized # remove the vmdk-stream-converter comment and replace with # # Disk DescriptorFile. This is needed for Virtualbox # remove the comments from vmdk-stream-converter which causes # VirtualBox and others to fail VMDK validation - - sed -e 's|# Description file.*|# Disk DescriptorFile|' \ + sed -i -e 's|# Description file.*|# Disk DescriptorFile|' \ -e '/# Believe this is random*/d' \ -e '/# Indicates no parent/d' \ -e '/# The Disk Data Base/d' \ - -e 's|ddb.comment.*|ddb.toolsVersion = "2147483647"|' \ - "${descriptor}" > "${newdescriptor}" + ${newdescriptor} - # The header is cannot be bigger than 1024 - expr $(stat --format=%s ${newdescriptor}) \< 1024 > /dev/null 2>&1 || { - echo "descriptor is too large, VMDK will be invalid!"; exit 1; } + # add newline to newdescriptor + echo "" >> $newdescriptor + + # add required tools version + echo -n 'ddb.toolsVersion = "2147483647"' >> $newdescriptor + + echo "Cat'ing modified descriptor for debugging." + cat $newdescriptor + + # diff original descriptor and new descriptor for debugging + # diff exits 1 if difference. pipefail not set so piping diff + # to cat prints diff and swallows exit 1 + echo "Printing diff of original and new descriptors." + diff --text $descriptor $newdescriptor | cat + + # The header must be 1024 or less before padding + if ! expr $(stat --format=%s ${newdescriptor}) \< 1025 > /dev/null 2>&1; then + echo "descriptor is too large, VMDK will be invalid!"; + exit 1 + fi + + # reset newdescriptor to be 1024 + truncate --no-create --size=1K $newdescriptor # Overwrite the vmdk header with our new, modified one dd conv=notrunc,nocreat \ diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary index 77f24e7e..dc87a361 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary @@ -33,6 +33,7 @@ install_grub() { chroot mountpoint apt-get -qqy update chroot mountpoint apt-get -qqy install grub-ieee1275 chroot mountpoint apt-get -qqy remove --purge grub-legacy-ec2 + chroot mountpoint apt-get autoremove --purge --assume-yes # set the kernel commandline to use hvc0 mkdir -p mountpoint/etc/default/grub.d diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary index 98c08f81..4bb4ba13 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary @@ -97,11 +97,13 @@ install_grub() { efi_target=arm-efi ;; amd64) - chroot mountpoint apt-get install -qqy grub-efi-amd64-signed shim-signed + chroot mountpoint apt-get install -qqy grub-pc shim-signed efi_target=x86_64-efi ;; esac + chroot mountpoint apt-get autoremove --purge --assume-yes + # This call to rewrite the debian package manifest is added here to capture # grub-efi packages that otherwise would not make it into the base # manifest. filesystem.packages is moved into place via symlinking to diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image.binary index 5884fe61..74d30aaa 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image.binary @@ -136,6 +136,7 @@ fi if [ "$ARCH" = "s390x" ]; then # Do ZIPL install bits chroot mountpoint apt-get -qqy install s390-tools sysconfig-hardware + chroot mountpoint apt-get autoremove --purge --assume-yes # Write out cloudy zipl.conf for future kernel updates cat << EOF > mountpoint/etc/zipl.conf diff --git a/live-build/ubuntu-cpc/hooks.d/base/wsl.binary b/live-build/ubuntu-cpc/hooks.d/base/wsl.binary index 05f51e30..8ce28140 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/wsl.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/wsl.binary @@ -35,6 +35,7 @@ cp -a rootfs.dir $rootfs_dir setup_mountpoint $rootfs_dir env DEBIAN_FRONTEND=noninteractive chroot $rootfs_dir apt-get -y -qq install ubuntu-wsl +env DEBIAN_FRONTEND=noninteractive chroot $rootfs_dir apt-get autoremove --purge --assume-yes create_manifest $rootfs_dir livecd.ubuntu-cpc.wsl.rootfs.manifest teardown_mountpoint $rootfs_dir