From 20be55473f3cb8018aabeab4be998beeed1ad87e Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Mon, 23 Aug 2021 16:24:24 +0000 Subject: [PATCH] coreos-base/oem-azure: refactor grub.cfg to apply console override only on PC We always want the 'flatcar.autologin' parameter, but the ttyS0 setting is x86 PC specific. Move the generic part to linux_append variable and hide the generic part behind a check for grub_platform. For EFI platforms the default grub.cfg has the correct arch specific console configuration. The console specification for grub itself is needed in either case Signed-off-by: Jeremi Piotrowski --- .../coreos-base/oem-azure-pro/files/grub.cfg | 7 ++++++- .../coreos-overlay/coreos-base/oem-azure/files/grub.cfg | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure-pro/files/grub.cfg b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure-pro/files/grub.cfg index 5e5449f25a..9fa2f0e55c 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure-pro/files/grub.cfg +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure-pro/files/grub.cfg @@ -2,8 +2,13 @@ set oem_id="azure" +set linux_append="flatcar.autologin" + # Azure only has a serial console. -set linux_console="console=ttyS0,115200n8 earlyprintk=ttyS0,115200 flatcar.autologin" serial com0 --speed=115200 --word=8 --parity=no terminal_input serial_com0 terminal_output serial_com0 + +if [ "$grub_platform" = "pc" ]; then + set linux_console="console=ttyS0,115200n8 earlyprintk=ttyS0,115200" +fi diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/files/grub.cfg b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/files/grub.cfg index 5e5449f25a..9fa2f0e55c 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/files/grub.cfg +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/files/grub.cfg @@ -2,8 +2,13 @@ set oem_id="azure" +set linux_append="flatcar.autologin" + # Azure only has a serial console. -set linux_console="console=ttyS0,115200n8 earlyprintk=ttyS0,115200 flatcar.autologin" serial com0 --speed=115200 --word=8 --parity=no terminal_input serial_com0 terminal_output serial_com0 + +if [ "$grub_platform" = "pc" ]; then + set linux_console="console=ttyS0,115200n8 earlyprintk=ttyS0,115200" +fi