Skip to content
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