From fa40793dfa92d01d4c1b6f0e5d7947bfcbc94367 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 1 May 2020 22:04:32 -0400 Subject: [PATCH] Add install disk detection to ubuntu --- .../custom-installation/hooks/casper-bottom.sh | 6 ++++-- misc/ubuntu20.04deploy/custom-installation/pre.sh | 3 +++ misc/ubuntu20.04deploy/scripts/init-premount/confluent | 5 ++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/misc/ubuntu20.04deploy/custom-installation/hooks/casper-bottom.sh b/misc/ubuntu20.04deploy/custom-installation/hooks/casper-bottom.sh index bb37d4a2..fdfdda6c 100755 --- a/misc/ubuntu20.04deploy/custom-installation/hooks/casper-bottom.sh +++ b/misc/ubuntu20.04deploy/custom-installation/hooks/casper-bottom.sh @@ -38,8 +38,10 @@ else fi ipv4s=$(grep ^ipv4_server $deploycfg|awk '{print $2}') osprofile=$(cat /custom-installation/confluent/osprofile) -fcmdline='quiet autoinstall ds=nocloud-net;s=https://'${ipv4s}'/confluent-public/os/'${osprofile}'/autoinstall/' -cons=$(cat /custom-installation/autocons.info) +fcmdline="$(cat /custom-installation/confluent/cmdline.orig) autoinstall ds=nocloud-net;s=https://${ipv4s}/confluent-public/os/${osprofile}/autoinstall/" +if [ -f /custom-installation/autocons.info ]; then + cons=$(cat /custom-installation/autocons.info) +fi if [ ! -z "$cons" ]; then echo "Installation will proceed on graphics console, autoconsole cannot work during install for Ubuntu" > ${cons%,*} #fcmdline="$fcmdline console=${cons#/dev/}" diff --git a/misc/ubuntu20.04deploy/custom-installation/pre.sh b/misc/ubuntu20.04deploy/custom-installation/pre.sh index bbb049e9..072b40a4 100755 --- a/misc/ubuntu20.04deploy/custom-installation/pre.sh +++ b/misc/ubuntu20.04deploy/custom-installation/pre.sh @@ -12,3 +12,6 @@ for pubkey in /etc/ssh/ssh_host*key.pub; do echo HostCertificate $certfile >> /etc/ssh/sshd_config.d/confluent.conf done systemctl restart sshd +curl https://$mgr/confluent-public/confluent/util/getinstalldisk > /custom-installation/getinstalldisk +python3 /custom-installation/getinstalldisk +sed -i s!%%INSTALLDISK%%!/dev/$(cat /tmp/installdisk)! /autoinstall.yaml diff --git a/misc/ubuntu20.04deploy/scripts/init-premount/confluent b/misc/ubuntu20.04deploy/scripts/init-premount/confluent index bd303839..e60f19b9 100755 --- a/misc/ubuntu20.04deploy/scripts/init-premount/confluent +++ b/misc/ubuntu20.04deploy/scripts/init-premount/confluent @@ -10,6 +10,7 @@ while ! grep NODENAME /custom-installation/confluent/confluent.info; do done MGR="[$(grep MANAGER: /custom-installation/confluent/confluent.info | head -n 1 | awk '{print $2}')]" osprofile=$(sed -e 's/.*osprofile=//' -e 's/ .*//' /proc/cmdline) +cat /proc/cmdline > /custom-installation/confluent/cmdline.orig if [ -f /custom-installation/autocons.info ]; then cons=$(cat /custom-installation/autocons.info) fi @@ -19,11 +20,9 @@ fi echo "Preparing to deploy $osprofile from $MGR" echo $osprofile > /custom-installation/confluent/osprofile echo URL=http://${MGR}/confluent-public/os/$osprofile/distribution/live.iso >> /conf/param.conf -fcmdline="url=http://${MGR}/confluent-public/os/$osprofile/distribution/live.iso" +fcmdline="$(cat /custom-installation/confluent/cmdline.orig) url=http://${MGR}/confluent-public/os/$osprofile/distribution/live.iso" if [ ! -z "$cons" ]; then fcmdline="$fcmdline console=${console#/dev/}" -elif grep console= /proc/cmdline; then - fcmdline=$fcmdline" "$(sed -e s/.*console=/console=/ -e 's/ .*//' /proc/cmdline) fi echo $fcmdline > /custom-installation/confluent/fakecmdline mount -o bind /custom-installation/confluent/fakecmdline /proc/cmdline