Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[console] use fixed console baud rate #1734

Merged
merged 1 commit into from
Nov 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions files/image_config/platform/rc.local
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,19 @@ process_reboot_cause() {
echo "Unexpected reboot" > $REBOOT_CAUSE_FILE
}

program_console_speed()
{
speed=$(cat /proc/cmdline | grep -Eo 'console=ttyS[0-9]+,[0-9]+' | cut -d "," -f2)
if [ -z "$speed" ]; then
CONSOLE_SPEED=9600
else
CONSOLE_SPEED=$speed
fi

sed -i "s|\-\-keep\-baud .* %I| $CONSOLE_SPEED %I|g" /lib/systemd/system/serial-getty@.service
systemctl daemon-reload
}

#### Begin Main Body ####

# Set up previous and next reboot cause files
Expand Down Expand Up @@ -209,6 +222,8 @@ fi

. /host/machine.conf

program_console_speed

if [ -f $FIRST_BOOT_FILE ]; then

echo "First boot detected. Performing first boot tasks..."
Expand Down