From 3b1047fbc2b3410c201dba15759765e9c3a2c443 Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Fri, 7 Feb 2020 22:11:54 +0000 Subject: [PATCH] Configure a better nocloud datasource for subiquity cloud-init. --- debian/changelog | 6 ++++++ .../ubuntu-server/hooks/032-installer-squashfs.binary | 8 ++++++++ .../includes.binary/overlay/etc/cloud/cloud.cfg | 5 +++++ .../overlay/var/lib/cloud/seed/nocloud/meta-data | 0 .../overlay/var/lib/cloud/seed/nocloud/user-data | 0 5 files changed, 19 insertions(+) create mode 100644 live-build/ubuntu-server/includes.binary/overlay/var/lib/cloud/seed/nocloud/meta-data create mode 100644 live-build/ubuntu-server/includes.binary/overlay/var/lib/cloud/seed/nocloud/user-data diff --git a/debian/changelog b/debian/changelog index b5e07c40..ce0ec646 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.641) UNRELEASED; urgency=medium + + * Configure a better nocloud datasource for subiquity cloud-init. + + -- Dimitri John Ledkov Fri, 07 Feb 2020 22:11:26 +0000 + livecd-rootfs (2.640) focal; urgency=medium * Although the request flavour to install is oem-20.04, it really is diff --git a/live-build/ubuntu-server/hooks/032-installer-squashfs.binary b/live-build/ubuntu-server/hooks/032-installer-squashfs.binary index 59da66d9..d4b72679 100755 --- a/live-build/ubuntu-server/hooks/032-installer-squashfs.binary +++ b/live-build/ubuntu-server/hooks/032-installer-squashfs.binary @@ -64,6 +64,14 @@ EOF chroot $INSTALLER_ROOT apt-get -y install lupin-casper # Install linux-firmware for kernel to upload into hardware. chroot $INSTALLER_ROOT apt-get -y install linux-firmware + +# Make sure NoCloud is last +values=$(echo get cloud-init/datasources | chroot $INSTALLER_ROOT debconf-communicate | sed 's/^0 //;s/NoCloud, //;s/None/NoCloud, None/') +printf "%s\t%s\t%s\t%s\n" \ + cloud-init cloud-init/datasources multiselect "$values" | + chroot $INSTALLER_ROOT debconf-set-selections +chroot $INSTALLER_ROOT dpkg-reconfigure --frontend=noninteractive cloud-init + if [ `dpkg --print-architecture` = s390x ]; then chroot $INSTALLER_ROOT apt-get -y install s390-tools-zkey openssh-server rm $INSTALLER_ROOT/etc/netplan/00-installer-config.yaml diff --git a/live-build/ubuntu-server/includes.binary/overlay/etc/cloud/cloud.cfg b/live-build/ubuntu-server/includes.binary/overlay/etc/cloud/cloud.cfg index f737c9e0..577ff057 100644 --- a/live-build/ubuntu-server/includes.binary/overlay/etc/cloud/cloud.cfg +++ b/live-build/ubuntu-server/includes.binary/overlay/etc/cloud/cloud.cfg @@ -23,6 +23,9 @@ chpasswd: # This is the initial network config. # It can be overwritten by cloud-init or subiquity. network: + ## until https://bugs.launchpad.net/cloud-init/+bug/1861460 is fixed + config: disabled + ## version: 2 ethernets: all-en: @@ -34,6 +37,8 @@ network: name: "eth*" dhcp4: true +final_message: "## template: jinja\nCloud-init v. {{version}} finished at {{timestamp}}. Datasource {{datasource}}. Up {{uptime}} seconds\n\n\nWelcome to Ubuntu Server Installer!\n\nAbove you will find SSH host keys and a random password set for the `installer` user. You can use these credentials to ssh-in and complete the installation. If you provided SSH keys in the cloud-init datasource, they were also provisioned to the installer user.\n\nIf you have access to the graphical console, like TTY1 or HMC ASCII terminal you can complete the installation there too." + # Example datasource config # datasource: # Ec2: diff --git a/live-build/ubuntu-server/includes.binary/overlay/var/lib/cloud/seed/nocloud/meta-data b/live-build/ubuntu-server/includes.binary/overlay/var/lib/cloud/seed/nocloud/meta-data new file mode 100644 index 00000000..e69de29b diff --git a/live-build/ubuntu-server/includes.binary/overlay/var/lib/cloud/seed/nocloud/user-data b/live-build/ubuntu-server/includes.binary/overlay/var/lib/cloud/seed/nocloud/user-data new file mode 100644 index 00000000..e69de29b