From d12ac8a1ba001f9bcdefefb7ea2ac6094f6fcc2e Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 18 May 2020 16:07:38 -0400 Subject: [PATCH] Try to adjust suse autoconsole behavior --- .../suse15/initramfs/opt/confluent/bin/suseagent | 9 ++++++++- .../ubuntu20.04/initramfs/conf/conf.d/confluent | 2 +- .../initramfs/custom-installation/hooks/casper-bottom.sh | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/confluent_osdeploy/suse15/initramfs/opt/confluent/bin/suseagent b/confluent_osdeploy/suse15/initramfs/opt/confluent/bin/suseagent index 18abd1a2..0fb582d8 100755 --- a/confluent_osdeploy/suse15/initramfs/opt/confluent/bin/suseagent +++ b/confluent_osdeploy/suse15/initramfs/opt/confluent/bin/suseagent @@ -12,7 +12,7 @@ autocons="" if ! grep console /proc/cmdline > /dev/null; then autocons=$(/opt/confluent/bin/autocons) if [ ! -z "$autocons" ]; then - echo "ConsoleDevice: ${autocons%,*}" >> /etc/linuxrc.d/01-confluent + echo "Serial console detected from firmmware: $autocons" > ${autocons%,*} fi fi cd /sys/class/net @@ -40,6 +40,13 @@ echo "NetDevice: $bootif" >> /etc/linuxrc.d/01-confluent /opt/confluent/bin/clortho $nodename $mgr > /tmp/confluent.apikey mgr="[$mgr]" curl -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $(cat /tmp/confluent.apikey)" https://$mgr/confluent-api/self/deploycfg > /tmp/confluent.deploycfg +textconsole=$(grep ^textconsole: /tmp/confluent.deploycfg) +textconsole=${textconsole#textconsole: } +if [ "$textconsole" = "true" ] && ! grep console= /proc/cmdline > /dev/null && [ ! -z "$autocons" ]; then + cat /proc/cmdline |sed -e s'/$/ 'console=${autocons#*/dev/}/ /> /etc/fakecmdline + mount -o bind /etc/fakecmdline /proc/cmdline + echo "ConsoleDevice: ${autocons%,*}" >> /etc/linuxrc.d/01-confluent +fi tz=$(grep timezone: /tmp/confluent.deploycfg | awk '{print $2}') echo "${tz}" > /tmp/timezone diff --git a/confluent_osdeploy/ubuntu20.04/initramfs/conf/conf.d/confluent b/confluent_osdeploy/ubuntu20.04/initramfs/conf/conf.d/confluent index cb014c8b..8d11e9f5 100644 --- a/confluent_osdeploy/ubuntu20.04/initramfs/conf/conf.d/confluent +++ b/confluent_osdeploy/ubuntu20.04/initramfs/conf/conf.d/confluent @@ -2,7 +2,7 @@ if ! grep console= /proc/cmdline > /dev/null; then /opt/confluent/bin/autocons > /custom-installation/autocons.info cons=$(cat /custom-installation/autocons.info) if [ ! -z "$cons" ]; then - echo "Auto-detected serial console on $cons, please wait" > ${cons%,*} + echo "Auto-detected serial console: $cons" > ${cons%,*} fi fi echo /scripts/init-premount/confluent >> /scripts/init-premount/ORDER diff --git a/confluent_osdeploy/ubuntu20.04/initramfs/custom-installation/hooks/casper-bottom.sh b/confluent_osdeploy/ubuntu20.04/initramfs/custom-installation/hooks/casper-bottom.sh index 8b3c825c..e858b5cd 100755 --- a/confluent_osdeploy/ubuntu20.04/initramfs/custom-installation/hooks/casper-bottom.sh +++ b/confluent_osdeploy/ubuntu20.04/initramfs/custom-installation/hooks/casper-bottom.sh @@ -43,7 +43,7 @@ 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%,*} + echo "Installation will proceed on graphics console, autoconsole not supported for Ubuntu" > ${cons%,*} #fcmdline="$fcmdline console=${cons#/dev/}" fi echo $fcmdline > /custom-installation/confluent/fakecmdline