From eb066bcd3428ce0a9655e3489e6ae84fa86d6324 Mon Sep 17 00:00:00 2001 From: "Gerd v. Egidy" Date: Sun, 11 Dec 2022 22:26:24 +0100 Subject: [PATCH 1/2] activate serial console in grub/UEFI, change baud rate to 115200 Before this patch a serial console was only enabled in syslinux for traditional BIOS, not in grub / UEFI. In traditional BIOS the baud rate was 38400 before. Today 38400 is rarely used anymore and most modern devices using a serial console default to 115200, which is the highest baudrate possible with the original UART-ICs. Modern UART-ICs usually support higher baudrates too, but they need a special driver for that. So 115200 is often used because of the wider compatibility. In grub and syslinux a serial console can fully work in parallel to the regular console. So enabling it doesn't change anything when nothing is connected to the serial console or no serial port is installed at all. This commit only touches the bootloaders, not the boot entries. --- efiboot/grub/grubsrcd.cfg | 6 ++++++ syslinux/sysresccd_head.cfg | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/efiboot/grub/grubsrcd.cfg b/efiboot/grub/grubsrcd.cfg index 69c4a51..e5b6403 100644 --- a/efiboot/grub/grubsrcd.cfg +++ b/efiboot/grub/grubsrcd.cfg @@ -20,6 +20,12 @@ if loadfont /boot/grub/font.pf2 ; then terminal_output gfxterm fi +# enable serial console with common settings (ttyS0, 115200 Baud, 8n1) +# this works in parallel to regular console +serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1 +terminal_input --append serial +terminal_output --append serial + menuentry "Boot SystemRescue using default options" { set gfxpayload=keep linux /%INSTALL_DIR%/boot/%ISO_ARCH%/vmlinuz archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% %DEFAULT_KERNEL_PARAM% diff --git a/syslinux/sysresccd_head.cfg b/syslinux/sysresccd_head.cfg index 8c7ec00..231f348 100644 --- a/syslinux/sysresccd_head.cfg +++ b/syslinux/sysresccd_head.cfg @@ -1,4 +1,4 @@ -SERIAL 0 38400 +SERIAL 0 115200 UI boot/syslinux/vesamenu.c32 MENU TITLE SYSTEM-RESCUE %ISO_VERSION% %ISO_ARCH% (www.system-rescue.org) MENU BACKGROUND #c000a8a8 From 881801198171bc5f2e6c1b3094f9e8ad91c6e780 Mon Sep 17 00:00:00 2001 From: "Gerd v. Egidy" Date: Sun, 11 Dec 2022 22:44:14 +0100 Subject: [PATCH 2/2] add bootloader entries for booting with a serial console --- efiboot/grub/grubsrcd.cfg | 6 ++++++ syslinux/sysresccd_sys.cfg | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/efiboot/grub/grubsrcd.cfg b/efiboot/grub/grubsrcd.cfg index e5b6403..efea210 100644 --- a/efiboot/grub/grubsrcd.cfg +++ b/efiboot/grub/grubsrcd.cfg @@ -50,6 +50,12 @@ menuentry "Boot SystemRescue using basic display drivers (nomodeset)" { initrd /%INSTALL_DIR%/boot/intel_ucode.img /%INSTALL_DIR%/boot/amd_ucode.img /%INSTALL_DIR%/boot/%ISO_ARCH%/sysresccd.img } +menuentry "Boot SystemRescue with serial console (ttyS0,115200n8)" { + set gfxpayload=keep + linux /%INSTALL_DIR%/boot/%ISO_ARCH%/vmlinuz archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% %DEFAULT_KERNEL_PARAM% console=tty0 console=ttyS0,115200n8 + initrd /%INSTALL_DIR%/boot/intel_ucode.img /%INSTALL_DIR%/boot/amd_ucode.img /%INSTALL_DIR%/boot/%ISO_ARCH%/sysresccd.img +} + menuentry "Boot SystemRescue, do not activate md raid or lvm (nomdlvm)" { set gfxpayload=keep linux /%INSTALL_DIR%/boot/%ISO_ARCH%/vmlinuz archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% %DEFAULT_KERNEL_PARAM% nomdlvm diff --git a/syslinux/sysresccd_sys.cfg b/syslinux/sysresccd_sys.cfg index a1a9ed7..9773291 100644 --- a/syslinux/sysresccd_sys.cfg +++ b/syslinux/sysresccd_sys.cfg @@ -36,6 +36,15 @@ LINUX boot/%ISO_ARCH%/vmlinuz INITRD boot/intel_ucode.img,boot/amd_ucode.img,boot/%ISO_ARCH%/sysresccd.img APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% %DEFAULT_KERNEL_PARAM% nomodeset +LABEL sysresccd-serial +TEXT HELP +Use a serial console. +ENDTEXT +MENU LABEL Boot SystemRescue with serial console (ttyS0,115200n8) +LINUX boot/%ISO_ARCH%/vmlinuz +INITRD boot/intel_ucode.img,boot/amd_ucode.img,boot/%ISO_ARCH%/sysresccd.img +APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% %DEFAULT_KERNEL_PARAM% console=tty0 console=ttyS0,115200n8 + LABEL sysresccd-nomdlvm TEXT HELP Do not activate md raid or lvm to prevent any unwanted disk writes,