diff --git a/installer/geninstaller b/installer/geninstaller index 7042e324..e15b6996 100755 --- a/installer/geninstaller +++ b/installer/geninstaller @@ -100,33 +100,6 @@ local-hostname: ubuntu-server-installer EOF } -userdata_write_file() { - local path=${1}; shift; - local owner=${1}; shift; - local permissions=${1}; shift; - local encoding=${1}; shift; - case $encoding in - none) - echo "- content: |" - for x in "$@"; do - sed 's,^, ,' "$x" || return - done - ;; - b64) - echo "- encoding: $encoding" - echo " content: |" - base64 "$@" | sed 's,^, ,' - ;; - *) - log "ERROR: unsupported encoding $encoding" - return 1; - ;; - esac - echo " path: $path" - echo " owner: $owner" - echo " permissions: '$permissions'" -} - usage() { cat << EOF @@ -321,20 +294,8 @@ generate_seed() { log "Failed to write meta-data into $seed"; return 1; } - log "Writing seed user-data (curtin)" - # remove the old seed; copy in the base template and - # append the curtin-cmd file - rm -f ${seed}/user-data && - cp $installer_user_data $seed/user-data && - - if [ "${OFFLINE}" == "no" ]; then - log "Enabling cloud-init package installation" - local packages="" - for pkg in ${INSTALLER_DEPS[@]}; do - packages="$packages - $pkg\n" - done - sed -i "s/#packages/packages:\n$packages/" ${seed}/user-data - fi + log "Writing seed user-data" + rm -f ${seed}/user-data && cp $installer_user_data $seed/user-data return 0 } @@ -598,6 +559,26 @@ generate_img() { return 1; } + log "Configuring netplan" + sudo mkdir -p ${mnt}/etc/netplan + cat < /dev/null +network: + version: 2 + ethernets: + all-en: + match: + name: "en*" + dhcp4: true + all-eth: + match: + name: "eth*" + dhcp4: true +EOF + sudo mkdir -p ${mnt}/etc/cloud/cloud.cfg.d + cat < /dev/null +network: {config: disabled} +EOF + _RETVAL="$installimg"; return 0; } diff --git a/installer/resources/grub/grub.cfg b/installer/resources/grub/grub.cfg index 3f15da94..cc8d126a 100644 --- a/installer/resources/grub/grub.cfg +++ b/installer/resources/grub/grub.cfg @@ -68,12 +68,12 @@ done # Create menuentry for installer menuentry "Boot Installer - Graphical Console" { set root=(hd0,msdos2) - linux /vmlinuz ip=dhcp ro root=LABEL=cloudimg-rootfs overlayroot=device:dev=LABEL=overlay-rootfs net.ifnames=0 console=ttyS0 console=tty0 quiet splash + linux /vmlinuz ro root=LABEL=cloudimg-rootfs overlayroot=device:dev=LABEL=overlay-rootfs net.ifnames=0 console=ttyS0 console=tty0 quiet splash initrd /initrd.img } menuentry "Boot Installer - Serial Console" { set root=(hd0,msdos2) - linux /vmlinuz ip=dhcp ro root=LABEL=cloudimg-rootfs overlayroot=device:dev=LABEL=overlay-rootfs net.ifnames=0 console=tty0 console=ttyS0 + linux /vmlinuz ro root=LABEL=cloudimg-rootfs overlayroot=device:dev=LABEL=overlay-rootfs net.ifnames=0 console=tty0 console=ttyS0 initrd /initrd.img }