diff --git a/debian/changelog b/debian/changelog index bdfced4c..ed333d87 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,33 @@ +livecd-rootfs (2.440) zesty; urgency=medium + + [ Steve Langasek ] + * live-build/ubuntu-cpc/functions: don't call sleep as part of + umount_settle; udevadm settle is synchronous and there's no reason to + sleep after it. + * live-build/ubuntu-cpc/functions: umount_partition: don't call + umount_settle for each submount; just unmount them one by one and + settle at the end. + * Support passing IMAGE_TARGETS in the environment, to limit which images + are output as part of a build; particularly useful for ubuntu-cpc builds + which output multiple image types. + + [ Nishanth Aravamudan ] + * live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot: generate iSCSI + Initiator Name at first iscsid run for cloud images to ensure it is + unique (LP: #1444992). + + [ Brian Murray ] + * Fix the OVF's metadata to include Ubuntu specific identifiers and + descriptions instead of the generic Linux ones. Thanks to Chris Glass. + (LP: #1656293) + * Add replace_grub_root_with_label function thereby consolidating multiple + uses of the same calls to sed. Thanks to Dan Watkins. + + [ Adam Conrad ] + * Set device_tree_address for the new kernel in the RPi bootloader config.txt + + -- Adam Conrad Thu, 23 Mar 2017 11:39:22 -0600 + livecd-rootfs (2.439) zesty; urgency=medium * Fix the manifest generation in OVA files so that ovf files don't have diff --git a/live-build/auto/config b/live-build/auto/config index 8a5e64b9..9782a75d 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -641,6 +641,7 @@ cat > /boot/firmware/config.txt << EOM # Some settings may impact device functionality. See link above for details kernel=uboot.bin +device_tree_address=0x02000000 # enable i2c dtparam=i2c_arm=on diff --git a/live-build/ubuntu-cpc/functions b/live-build/ubuntu-cpc/functions index 576c1a2e..c7ff023b 100644 --- a/live-build/ubuntu-cpc/functions +++ b/live-build/ubuntu-cpc/functions @@ -115,7 +115,6 @@ umount_settle() { # Unmount device, and let it settle umount $1 udevadm settle - sleep 3 } umount_partition() { @@ -123,9 +122,10 @@ umount_partition() { mv resolv.conf.tmp "$mountpoint/etc/resolv.conf" for submnt in proc sys dev/pts dev tmp; do - umount_settle $mountpoint/$submnt + umount $mountpoint/$submnt done - umount_settle $mountpoint + umount $mountpoint + udevadm settle if [ -n "${rootfs_dev_mapper}" -a -b "${rootfs_dev_mapper}" ]; then # buildd's don't have /etc/mtab symlinked @@ -249,4 +249,11 @@ convert_to_qcow2() { qemu-img info "$destination" } +replace_grub_root_with_label() { + # When update-grub is run, it will detect the disks in the build system. + # Instead, we want grub to use the cloudimg-rootfs labelled disk + CHROOT_ROOT="$1" + sed -i -e "s,root=[^ ]\+,root=LABEL=cloudimg-rootfs," \ + "$CHROOT_ROOT/boot/grub/grub.cfg" +} diff --git a/live-build/ubuntu-cpc/hooks/032-root-squashfs.binary b/live-build/ubuntu-cpc/hooks/032-root-squashfs.binary index e338a05f..63a00894 100755 --- a/live-build/ubuntu-cpc/hooks/032-root-squashfs.binary +++ b/live-build/ubuntu-cpc/hooks/032-root-squashfs.binary @@ -3,6 +3,15 @@ # # Generate a squashfs root and manifest +case $IMAGE_TARGETS in + ""|*squashfs*) + ;; + *) + echo "Skipping squashfs build" + exit 0 + ;; +esac + if [ -n "$SUBARCH" ]; then echo "Skipping rootfs build for subarch flavor build" exit 0 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 bcce19d7..04a3c7df 100755 --- a/live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary +++ b/live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary @@ -105,7 +105,7 @@ EOF chroot mountpoint dpkg-divert --local --rename /etc/grub.d/30_os-prober chroot mountpoint update-grub - sed -i "s,root=.* ,root=LABEL=cloudimg-rootfs ,g" mountpoint/boot/grub/grub.cfg + replace_grub_root_with_label mountpoint chroot mountpoint dpkg-divert --remove --local --rename /etc/grub.d/30_os-prober chroot mountpoint apt-get -y clean 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 d8c6cd3a..1f6b35a7 100755 --- a/live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary +++ b/live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary @@ -52,7 +52,7 @@ EOF chroot mountpoint dpkg-divert --local --rename /etc/grub.d/30_os-prober chroot mountpoint update-grub - sed -i "s,root=.* ,root=LABEL=cloudimg-rootfs ,g" mountpoint/boot/grub/grub.cfg + replace_grub_root_with_label mountpoint chroot mountpoint dpkg-divert --remove --local --rename /etc/grub.d/30_os-prober umount_partition mountpoint diff --git a/live-build/ubuntu-cpc/hooks/040-qcow2-image.binary b/live-build/ubuntu-cpc/hooks/040-qcow2-image.binary index 39c41066..f9ab7e62 100755 --- a/live-build/ubuntu-cpc/hooks/040-qcow2-image.binary +++ b/live-build/ubuntu-cpc/hooks/040-qcow2-image.binary @@ -1,5 +1,14 @@ #!/bin/bash -ex +case $IMAGE_TARGETS in + ""|*qcow2*) + ;; + *) + echo "Skipping qcow2 image build" + exit 0 + ;; +esac + case $ARCH:$SUBARCH in # Not sure if any other cloud images use subarch for something that # should take qcow2 format, so only skipping this on raspi2 for now. diff --git a/live-build/ubuntu-cpc/hooks/040-vmdk-image.binary b/live-build/ubuntu-cpc/hooks/040-vmdk-image.binary index ac4f1c36..9a71f7ff 100755 --- a/live-build/ubuntu-cpc/hooks/040-vmdk-image.binary +++ b/live-build/ubuntu-cpc/hooks/040-vmdk-image.binary @@ -9,6 +9,15 @@ case $ARCH in exit 0;; esac +case ${IMAGE_TARGETS:-} in + ""|*vmdk*) + ;; + *) + echo "Skipping VMDK image build" + exit 0 + ;; +esac + . /build/config/functions if [ -e binary/boot/disk-uefi.ext4 ]; then diff --git a/live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary b/live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary index 3b50a268..801808c0 100755 --- a/live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary +++ b/live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary @@ -9,11 +9,33 @@ # # For this step, we re-use the VMDK's made in 040-vmdk-image.binary + +# Switch on $ARCH to determine which ID and description to use in the produced +# OVF. We have fancy Ubuntu-specific IDs in the OVF specification, we might as +# well use them. case $ARCH in - amd64|i386) ;; - *) echo "OVA images are not supported for $ARCH yet."; - exit 0;; + amd64) + ovf_id=94 + ovf_os_type="ubuntu64Guest" + ovf_desc_bits=64 ;; + i386) + ovf_id=93 + ovf_os_type="ubuntu32Guest" + ovf_desc_bits=32 ;; + *) + echo "OVA images are not supported for $ARCH yet."; + exit 0;; +esac + +case ${IMAGE_TARGETS:-} in + ""|*vmdk*) + ;; + *) + echo "Skipping OVA image build" + exit 0 + ;; esac + cur_d=${PWD} my_d=$(dirname $(readlink -f ${0})) @@ -57,7 +79,10 @@ sed -i "${ovf}" \ -e "s/@@NUM_CPUS@@/2/g" \ -e "s/@@VERSION@@/${version}/g" \ -e "s/@@DATE@@/${serial_stamp}/g" \ - -e "s/@@MEM_SIZE@@/1024/g" + -e "s/@@MEM_SIZE@@/1024/g" \ + -e "s/@@OVF_ID@@/${ovf_id}/g" \ + -e "s/@@OVF_OS_TYPE@@/${ovf_os_type}/g" \ + -e "s/@@OVF_DESC_BITS@@/${ovf_desc_bits}/g" # Get the checksums vmdk_sha256=$(sha256sum ${vmdk_f} | cut -d' ' -f1) diff --git a/live-build/ubuntu-cpc/hooks/042-vagrant.binary b/live-build/ubuntu-cpc/hooks/042-vagrant.binary index aa524a09..3f962bd8 100755 --- a/live-build/ubuntu-cpc/hooks/042-vagrant.binary +++ b/live-build/ubuntu-cpc/hooks/042-vagrant.binary @@ -15,14 +15,33 @@ # some packages in it, convert it to a vmdk, and then assemble the vagrant # box. +case $IMAGE_TARGETS in + ""|*vagrant*) + ;; + *) + echo "Skipping Vagrant image build" + exit 0 + ;; +esac + cur_d=${PWD} my_d=$(dirname $(readlink -f ${0})) +# Switch on $ARCH to determine which ID and description to use in the produced +# OVF. We have fancy Ubuntu-specific IDs in the OVF specification, we might as +# well use them. case $ARCH in - amd64|i386) ;; - *) - echo "Vagrant images are not supported for $ARCH" - exit 0 + amd64) + ovf_id=94 + ovf_os_type="ubuntu64Guest" + ovf_desc_bits=64 ;; + i386) + ovf_id=93 + ovf_os_type="ubuntu32Guest" + ovf_desc_bits=32 ;; + *) + echo "Vagrant images are not supported for $ARCH yet." + exit 0;; esac . /build/config/functions @@ -172,7 +191,10 @@ sed -i "${ovf}" \ -e "s/@@NUM_CPUS@@/2/g" \ -e "s/@@VERSION@@/${version}/g" \ -e "s/@@DATE@@/${serial_stamp}/g" \ - -e "s/@@MEM_SIZE@@/1024/g" + -e "s/@@MEM_SIZE@@/1024/g" \ + -e "s/@@OVF_ID@@/${ovf_id}/g" \ + -e "s/@@OVF_OS_TYPE@@/${ovf_os_type}/g" \ + -e "s/@@OVF_DESC_BITS@@/${ovf_desc_bits}/g" ovf_sha256=$(sha256sum ${ovf} | cut -d' ' -f1) diff --git a/live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot b/live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot new file mode 100755 index 00000000..ba9b51e6 --- /dev/null +++ b/live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot @@ -0,0 +1,9 @@ +#!/bin/bash +# +# Set InitiatorName to be runtime generated when iscsid first starts, so +# that each cloud image gets a unique value +# + +if [ -f /etc/iscsi/initiatorname.iscsi ]; then + echo "GenerateName=yes" > /etc/iscsi/initiatorname.iscsi +fi diff --git a/live-build/ubuntu-cpc/hooks/ovf/ubuntu-ova-v1-cloudcfg-vmdk.tmpl b/live-build/ubuntu-cpc/hooks/ovf/ubuntu-ova-v1-cloudcfg-vmdk.tmpl index f91b75b2..f2975610 100644 --- a/live-build/ubuntu-cpc/hooks/ovf/ubuntu-ova-v1-cloudcfg-vmdk.tmpl +++ b/live-build/ubuntu-cpc/hooks/ovf/ubuntu-ova-v1-cloudcfg-vmdk.tmpl @@ -18,8 +18,9 @@ A virtual machine @@NAME@@ - + The kind of installed guest operating system + Ubuntu Linux (@@OVF_DESC_BITS@@-bit) diff --git a/live-build/ubuntu-cpc/hooks/ovf/ubuntu-ova-v1-vmdk.tmpl b/live-build/ubuntu-cpc/hooks/ovf/ubuntu-ova-v1-vmdk.tmpl index 0eaa85a4..7f0b85e0 100644 --- a/live-build/ubuntu-cpc/hooks/ovf/ubuntu-ova-v1-vmdk.tmpl +++ b/live-build/ubuntu-cpc/hooks/ovf/ubuntu-ova-v1-vmdk.tmpl @@ -16,8 +16,9 @@ A virtual machine @@NAME@@ - + The kind of installed guest operating system + Ubuntu Linux (@@OVF_DESC_BITS@@-bit)