Commit f0443bd
authored
Update program_console_speed() in rc.local #22458 (#1811)
This is the double commit of
sonic-net/sonic-buildimage#22458
#### Why I did it
The --keep-baud option in agetty allows it to cycle through a set of
baud rates (like 115200,57600,38400,9600) when it receives a break
signal. This feature helps ensure that agetty can seamlessly adjust to
different terminal speeds, enhancing compatibility across various
setups.
Challenges with the sed Command:
Our current sed command (program_console_speed in rc.local ) is intended
to update the baud rates in the serial-getty@.service based on the
CONSOLE_SPEED variable. However, the command is not working as planned
because the pattern --keep-baud .* %I doesn't match when %I isn't part
of the file's content.
#### How I did it
To make the sed command more effective, we can simplify the matching
pattern to focus solely on the baud rate list:
sed -i "s|\-\-keep\-baud .* -| $CONSOLE_SPEED -|g"
/lib/systemd/system/serial-getty@.service
This adjustment should ensure that the command correctly updates the
baud rate settings.
#### How to verify it
Verify serial-getty@.service before and after modifying rc.local
Before update
===========
ExecStart=-/sbin/agetty -o '-p -- \\u' --keep-baud
115200,57600,38400,9600 - $TERM
After Update
==========
ExecStart=-/sbin/agetty -o '-p -- \\u' 115200 - $TERM
#### Tested branch (Please provide the tested image version)
202501
Note: sonic-net/sonic-buildimage#245061 parent 415f5a8 commit f0443bd
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
| 201 | + | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| |||
0 commit comments