From 21073315b6a48139e2a16e94d72ba520860e1e98 Mon Sep 17 00:00:00 2001 From: CloudBuilder Date: Wed, 4 Mar 2020 22:18:25 +0000 Subject: [PATCH] Imported 2.648 No reason for CPC update specified. --- debian/changelog | 9 +++++ .../hooks/032-installer-squashfs.binary | 35 ++++--------------- .../overlay/etc/cloud/cloud.cfg | 13 +++++++ .../etc/netplan/00-installer-config.yaml | 13 ------- .../system/subiquity_autoinstall.mount | 4 --- 5 files changed, 28 insertions(+), 46 deletions(-) delete mode 100644 live-build/ubuntu-server/includes.binary/overlay/etc/netplan/00-installer-config.yaml delete mode 100644 live-build/ubuntu-server/includes.binary/overlay/usr/lib/systemd/system/subiquity_autoinstall.mount diff --git a/debian/changelog b/debian/changelog index 0af70236..5bef7141 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +livecd-rootfs (2.648) focal; urgency=medium + + * Enable cloud-init in live server installer live session on all + architectures. + * Remove code for old design for getting autoinstall.yaml. + * Add runcmd to extract autoinstall.yaml from user-data. + + -- Michael Hudson-Doyle Wed, 04 Mar 2020 16:10:35 +0100 + livecd-rootfs (2.647) focal; urgency=medium * Address snap base regression after snap-tool removal diff --git a/live-build/ubuntu-server/hooks/032-installer-squashfs.binary b/live-build/ubuntu-server/hooks/032-installer-squashfs.binary index c3b73f63..72df7f8f 100755 --- a/live-build/ubuntu-server/hooks/032-installer-squashfs.binary +++ b/live-build/ubuntu-server/hooks/032-installer-squashfs.binary @@ -50,20 +50,13 @@ JobRunningTimeoutSec=0s Wants=subiquity_config.mount EOF -AUTOINSTALL_DEVICE_UNIT='dev-disk-by\x2dlabel-autoinstall.device' -mkdir -p "$INSTALLER_ROOT/etc/systemd/system/$AUTOINSTALL_DEVICE_UNIT.d" -cat > "$INSTALLER_ROOT/etc/systemd/system/$AUTOINSTALL_DEVICE_UNIT.d/override.conf" < "$INSTALLER_ROOT"/etc/initramfs-tools/scripts/init-bottom/copy-autoinstall -#!/bin/sh -case \$1 in -prereqs) exit 0;; -esac - -[ -f /autoinstall.yaml ] && cp /autoinstall.yaml /run/initrd-autoinstall.yaml -EOF -chmod +x "$INSTALLER_ROOT"/etc/initramfs-tools/scripts/init-bottom/copy-autoinstall - teardown_mountpoint "$INSTALLER_ROOT" squashfs_f="${PWD}/livecd.${PROJECT}.installer.squashfs" 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 a0cdeb44..a738bf15 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 @@ -65,6 +65,7 @@ cloud_config_modules: # The modules that run in the 'final' stage cloud_final_modules: - scripts-per-once + - scripts-user - ssh-authkey-fingerprints - keys-to-console - phone-home @@ -116,3 +117,15 @@ system_info: primary: http://ports.ubuntu.com/ubuntu-ports security: http://ports.ubuntu.com/ubuntu-ports ssh_svcname: ssh + +runcmd: + - - "python3" + - "-c" + - | + import subprocess, sys, yaml + user_data = yaml.safe_load(subprocess.run([ + "cloud-init", "query", "userdata"], + check=True, stdout=subprocess.PIPE, encoding='utf-8').stdout) + if 'autoinstall' in user_data: + with open("/autoinstall.yaml", "w") as fp: + yaml.dump(user_data['autoinstall'], fp) diff --git a/live-build/ubuntu-server/includes.binary/overlay/etc/netplan/00-installer-config.yaml b/live-build/ubuntu-server/includes.binary/overlay/etc/netplan/00-installer-config.yaml deleted file mode 100644 index b8399cb6..00000000 --- a/live-build/ubuntu-server/includes.binary/overlay/etc/netplan/00-installer-config.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# This is the initial network config. -# It can be overwritten by cloud-init or subiquity. -network: - version: 2 - ethernets: - all-en: - match: - name: "en*" - dhcp4: true - all-eth: - match: - name: "eth*" - dhcp4: true diff --git a/live-build/ubuntu-server/includes.binary/overlay/usr/lib/systemd/system/subiquity_autoinstall.mount b/live-build/ubuntu-server/includes.binary/overlay/usr/lib/systemd/system/subiquity_autoinstall.mount deleted file mode 100644 index ae45838e..00000000 --- a/live-build/ubuntu-server/includes.binary/overlay/usr/lib/systemd/system/subiquity_autoinstall.mount +++ /dev/null @@ -1,4 +0,0 @@ -[Mount] -What=/dev/disk/by-label/autoinstall -Where=/autoinstall -Type=ext4