rc.local of Debian9 base firmware(HEAD.794/HEAD.765) can't get true console speed and set error speed to [email protected] #2341
Description
Description
After Upgrade Deb9 base sonic Network OS from HEAD.695 to HEAD.765/HEAD.794,
rc.local of HEAD.765/HEAD.794 can't got true CONSOLE SPEED
and it can't set true CONSOLE SPEED to [email protected]
GENERAL SUPPORT INFORMATION
Hardware Switch info:
Platform: x86_64-delta_ag9032v1-r0
HwSKU: Delta-ag9032v1
ASIC: broadcom
console baud rate of x86_64-delta_ag9032v1-r0 BIOS and ONIE is 115200
Deb9 Sonic firmware for the issue result
SONIC_VERSION=HEAD.695-3f37b96 -> Pass
SONIC_VERSION=HEAD.794-5d78dd0 -> Fail
SONIC_VERSION=HEAD.765 -> Fail
BUG REPORT INFORMATION
syslog of SONIC_VERSION=HEAD.794-5d78dd0's rc.local
[ 12.368714] rc.local[499]: + SONIC_VERSION=HEAD.794-5d78dd0
[ 12.765235] rc.local[499]: + program_console_speed
[ 12.785696] rc.local[499]: + cat /proc/cmdline
[ 12.802785] rc.local[499]: + cut -d+ , -f2
[ 12.817244] rc.local[499]: grep -Eo console=ttyS[0-9]+,[0-9]+
[ 12.833375] rc.local[499]: + speed=
[ 12.849170] rc.local[499]: + [ -z ]
[ 12.865201] rc.local[499]: + CONSOLE_SPEED=9600
[ 12.881178] rc.local[499]: + sed -i s|--keep-baud .* %I| 9600 %I|g /lib/systemd/system/[email protected]
we can see speed can't got CONSOL SPEED from /proc/cmdline
My Test and check
rc.local's "speed=$(cat /proc/cmdline | grep -Eo 'console=ttyS[0-9]+,[0-9]+' | cut -d "," -f2)"
can't got true CONSOLE_SPEED from /proc/cmdline
CONSOLE speed is 115200n8 in /proc/cmdline of Delta-ag9032v1
Below is my change and result
My change "speed=$(cat /proc/cmdline | grep -Eo 'console=ttyS[0-9]+,[0-9]+' | cut -d "," -f2)"
to
speed=$(cat /proc/cmdline | grep -Eo 'console=tty[0-9]+ console=ttyS+,[0-9]+' | cut -d "," -f2)
My modify and test result:
[ 14.329950] rc.local[843]: + SONIC_VERSION=HEAD.794-5d78dd0
[ 14.864563] rc.local[843]: + program_console_speed
[ 14.891207] rc.local[843]: + cat /proc/cmdline
[ 14.905861] rc.local[843]: + grep -Eo console=tty[0-9]+ console=ttyS+,[0-9]+
[ 14.926256] rc.local[843]: + cut -d , -f2
[ 14.941809] rc.local[843]: + speed=115200
[ 14.956574] rc.local[843]: + [ -z 115200 ]
[ 14.968552] rc.local[843]: + CONSOLE_SPEED=115200
[ 14.984549] rc.local[843]: sed -i s|--keep-baud .* %I| 115200 %I|g /lib/systemd/system/[email protected]
Our Switch can got and setting true CONSOLE_SPEED!!
Because ONIE and BIOS console speed is 115200, if SONIC Network OS setting error console speed on OS level, user need to change console speed after update SONIC code at every time.