From f8b27f1f8db6a70cc9925a2a00c3c68cecea2ea2 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 20 May 2020 13:24:05 -0400 Subject: [PATCH] Add autoconsole to ubunntu install Have the installed system use serial console. --- .../ubuntu20.04/profiles/default/scripts/post.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh b/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh index 48a63b43..966981db 100755 --- a/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh +++ b/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh @@ -24,4 +24,15 @@ curl -f https://$mgr/confluent-public/os/$profile/scripts/firstboot.sh > /target chmod +x /target/etc/confluent/firstboot.sh cp /tmp/allnodes /target/root/.shosts cp /tmp/allnodes /target/etc/ssh/shosts.equiv +textcons=$(grep ^textconsole: /etc/confluent/confluent.deploycfg |awk '{print $2}') +if [ "$textcons" = "true" ] && ! grep console= /proc/cmdline > /dev/null; then + cons="" + if [ -f /custom-installation/autocons.info ]; then + cons=$(cat /custom-installation/autocons.info) + fi + if [ ! -z "$cons" ]; then + sed -e 's/GRUB_CMDLINE_LINUX="\([^"]*\)"/GRUB_CMDLINE_LINUX="\1 console='${cons#/dev/}'"/' /target/etc/default/grub + chroot /target update-grub + fi +fi