Skip to content

Commit

Permalink
Update default.conf
Browse files Browse the repository at this point in the history
In default.conf describe what it means when the user specifies
USE_SERIAL_CONSOLE="yes" or USE_SERIAL_CONSOLE="no".
Fixed a false description that SERIAL_CONSOLE_DEVICE_SYSLINUX
and SERIAL_CONSOLE_DEVICE_GRUB work
when USE_SERIAL_CONSOLE is not specified as 'no'
because actually SERIAL_CONSOLE_DEVICE_SYSLINUX
and SERIAL_CONSOLE_DEVICE_GRUB work
when USE_SERIAL_CONSOLE is 'yes'.
  • Loading branch information
jsmeix committed Oct 11, 2023
1 parent 410924f commit 4783559
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions usr/share/rear/conf/default.conf
Expand Up @@ -3296,15 +3296,22 @@ SIMPLIFY_TEAMING=no
# When 'getty' or 'agetty' and 'stty' can be found
# and there is a 'console=...' option in /proc/cmdline,
# then USE_SERIAL_CONSOLE is automatically set to 'yes'.
# Specify 'yes' or 'no' or leave it empty to use ReaR's automatism:
# With USE_SERIAL_CONSOLE="no" no serial console gets set up,
# neither for the recovery system kernel nor for the recovery system bootloader.
# With USE_SERIAL_CONSOLE="yes" plus appropriate SERIAL_CONSOLE_DEVICE... settings
# serial consoles can be specified for the recovery system kernel and bootloader
# when there is no 'console=...' option in /proc/cmdline.
# By default (when empty) the below further described automatism is used:
USE_SERIAL_CONSOLE=
#
# Which serial devices should be used for serial consoles
# provided USE_SERIAL_CONSOLE is not set to 'no':
# E.g. SERIAL_CONSOLE_DEVICES="/dev/ttyS0 /dev/ttyS1"
# By default (when empty) the devices of the 'console=...' options in /proc/cmdline
# that exist as /dev/ttyS* or /dev/hvsi* character device nodes are used
# (which excludes /dev/tty0 when there is 'console=tty0' in /proc/cmdline):
SERIAL_CONSOLE_DEVICES=
#
# Serial consoles for the kernel of the recovery system
# provided USE_SERIAL_CONSOLE is not set to 'no':

This comment has been minimized.

Copy link
@pcahyna

pcahyna Oct 11, 2023

Member

does this need a similar correction as the bootloader parameter descriptions below?

This comment has been minimized.

Copy link
@jsmeix

jsmeix Oct 11, 2023

Author Member

No.

See the code in
prep/GNU/Linux/200_include_serial_console.sh
here in this pull request.

This comment has been minimized.

Copy link
@pcahyna

pcahyna Oct 11, 2023

Member

isn't it confusing though? At one spot, we check for the value not being false at another spot we check for it being true (which is not equivalent due to the ternary nature of the parameter).
If this was the former behavior, I understand the desire to not introduce a behavior change, but perhaps this is a change to consider in (backward-incompatible) ReaR 3.0 ?

This comment has been minimized.

Copy link
@jsmeix

jsmeix Oct 11, 2023

Author Member

It is what the code does.
The code does what (at least for me) seems most appropriate
for the usual cases which are
either no 'console=...' option in /proc/cmdline
or one or more 'console=...' options in /proc/cmdline

Therefore the default behaviour depends on that
so the code in prep/GNU/Linux/200_include_serial_console.sh
checks and does the kernel stuff first, and
if a 'console=...' option is set for the recovery system kernel
it sets USE_SERIAL_CONSOLE="yes" which later triggers
serial console setup for the recovery system bootloader.

This comment has been minimized.

Copy link
@jsmeix

jsmeix Oct 11, 2023

Author Member

For users who want to set up their own stuff
all should be simple and straightforward
with USE_SERIAL_CONSOLE="yes" plus
appropriate SERIAL_CONSOLE_DEVICE... settings

This comment has been minimized.

Copy link
@jsmeix

jsmeix Oct 11, 2023

Author Member

That USE_SERIAL_CONSOLE="yes" is needed for
serial console setup for the recovery system bootloader
is existing code that I do not want to change with this pull request
because this pull request is only about to
"Copy the console= kernel arguments from the original system"

# By default (when SERIAL_CONSOLE_DEVICES_KERNEL and SERIAL_CONSOLE_DEVICES are empty)
Expand All @@ -3316,22 +3323,25 @@ SERIAL_CONSOLE_DEVICES=
# When SERIAL_CONSOLE_DEVICES_KERNEL is empty but SERIAL_CONSOLE_DEVICES is specified
# then the specified SERIAL_CONSOLE_DEVICES are used for the kernel:
SERIAL_CONSOLE_DEVICES_KERNEL=
#
# Serial console for SYSLINUX/EXTLINUX when it is used as bootloader for the recovery system
# provided USE_SERIAL_CONSOLE is not set to 'no':
# provided USE_SERIAL_CONSOLE is 'yes':
# SYSLINUX supports only one serial device (because the last SYSLINUX 'serial' directive wins).
# The right /dev/ttyS* can be specified like SERIAL_CONSOLE_DEVICE_SYSLINUX="/dev/ttyS0"
# or a whole SYSLINUX 'serial' directive can be specified e.g. for /dev/ttyS1 like
# SERIAL_CONSOLE_DEVICE_SYSLINUX="serial 1 9600"
# By default (when empty) the first one of SERIAL_CONSOLE_DEVICES is used for SYSLINUX:
SERIAL_CONSOLE_DEVICE_SYSLINUX=
#
# Serial console for GRUB when it is used as bootloader for the recovery system
# provided USE_SERIAL_CONSOLE is not set to 'no':
# provided USE_SERIAL_CONSOLE is 'yes':
# GRUB supports only one serial device (because the last GRUB 'serial' command wins).
# The right /dev/ttyS* can be specified like SERIAL_CONSOLE_DEVICE_GRUB="/dev/ttyS0"
# or a whole GRUB 'serial' command can be specified e.g. for /dev/ttyS1 like
# SERIAL_CONSOLE_DEVICE_GRUB="serial --unit=1 --speed=9600"
# By default (when empty) the first one of SERIAL_CONSOLE_DEVICES is used for GRUB:
SERIAL_CONSOLE_DEVICE_GRUB=
#
# Example of the default behaviour:
# Provided USE_SERIAL_CONSOLE is not specified as 'no'
# and 'getty' or 'agetty' and 'stty' can be found,
Expand Down

0 comments on commit 4783559

Please sign in to comment.