From 861c0230c7209e79c063b5a27734f61a26818583 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 21 Sep 2021 10:03:29 -0400 Subject: [PATCH] Reorder ubuntu to first in post Ubuntu tends to install itself as behind network device. Amend to match other OSes and avoid network boot. --- .../ubuntu20.04/profiles/default/scripts/post.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh b/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh index 64dee5f7..e00b681f 100755 --- a/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh +++ b/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh @@ -63,6 +63,13 @@ echo "Port 2222" >> /etc/ssh/sshd_config echo "Match LocalPort 22" >> /etc/ssh/sshd_config echo " ChrootDirectory /target" >> /etc/ssh/sshd_config kill -HUP $(cat /run/sshd.pid) +if [ -e /sys/firmware/efi ]; then + bootnum=$(efibootmgr | grep ubuntu | sed -e 's/ .*//' -e 's/\*//' -e s/Boot//) + currboot=$(efibootmgr | grep ^BootOrder: | awk '{print $2}') + nextboot=$(echo $currboot| awk -F, '{print $1}') + [ "$nextboot" = "$bootnum" ] || efibootmgr -o $bootnum,$currboot + efibootmgr -D +fi cat /target/etc/confluent/tls/*.pem > /target/etc/confluent/ca.pem cat /target/etc/confluent/tls/*.pem > /etc/confluent/ca.pem chroot /target bash -c "source /etc/confluent/functions; run_remote_python syncfileclient"