Skip to content

[console speed] Inherit console speed from install environment #1987

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

Merged
merged 3 commits into from
Sep 1, 2018
Merged
Changes from 1 commit
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
7 changes: 6 additions & 1 deletion installer/x86_64/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ echo "onie_platform: $onie_platform"
# default console settings
CONSOLE_PORT=0x3f8
CONSOLE_DEV=0
CONSOLE_SPEED=9600

# Pick up console speed from install enviroment, if failed, set it to 9600
CONSOLE_SPEED=$(stty -F /dev/ttyS0 | grep speed | cut -d " " -f2)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not all platform use ttyS0, need to get the the console_port first, check following grep.

lgh@gulv-vm1:/data2/sonic/stretch/sonic-buildimage$ git grep CONSOLE_PORT
device/accton/x86_64-accton_as5712_54x-r0/installer.conf:CONSOLE_PORT=0x2f8
device/accton/x86_64-accton_as7116_54x-r0/installer.conf:CONSOLE_PORT=0x3f8
device/accton/x86_64-accton_as7212_54x-r0/installer.conf:CONSOLE_PORT=0x2f8
device/accton/x86_64-accton_as7312_54x-r0/installer.conf:CONSOLE_PORT=0x2f8
device/accton/x86_64-accton_as7312_54xs-r0/installer.conf:CONSOLE_PORT=0x2f8
device/accton/x86_64-accton_as7512_32x-r0/installer.conf:CONSOLE_PORT=0x2f8
device/accton/x86_64-accton_as7712_32x-r0/installer.conf:CONSOLE_PORT=0x2f8
device/accton/x86_64-accton_as7716_32x-r0/installer.conf:CONSOLE_PORT=0x3f8
device/accton/x86_64-accton_as7716_32xb-r0/installer.conf:CONSOLE_PORT=0x3f8
device/celestica/x86_64-cel_e1031-r0/installer.conf:CONSOLE_PORT=0x2f8
device/celestica/x86_64-cel_seastone-r0/installer.conf:CONSOLE_PORT=0x3f8
device/dell/x86_64-dell_s6100_c2538-r0/installer.conf:CONSOLE_PORT=0x2f8
device/dell/x86_64-dell_z9100_c2538-r0/installer.conf:CONSOLE_PORT=0x2f8
device/dell/x86_64-dellemc_z9264f_c3538-r0/installer.conf:CONSOLE_PORT=0x3f8
device/delta/x86_64-delta_ag5648-r0/installer.conf:CONSOLE_PORT=0x3f8
device/delta/x86_64-delta_ag9032v1-r0/installer.conf:CONSOLE_PORT=0x3f8
device/delta/x86_64-delta_ag9064-r0/installer.conf:CONSOLE_PORT=0x3f8
device/delta/x86_64-delta_et-6248brb-r0/installer.conf:CONSOLE_PORT=0x2f8
device/ingrasys/x86_64-ingrasys_s8810_32q-r0/installer.conf:CONSOLE_PORT=0x2f8
device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/installer.conf:CONSOLE_PORT=0x2f8
device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/installer.conf:CONSOLE_PORT=0x2f8
device/ingrasys/x86_64-ingrasys_s9100-r0/installer.conf:CONSOLE_PORT=0x2f8
device/ingrasys/x86_64-ingrasys_s9130_32x-r0/installer.conf:CONSOLE_PORT=0x3f8
device/ingrasys/x86_64-ingrasys_s9180_32x-r0/installer.conf:CONSOLE_PORT=0x3f8
device/ingrasys/x86_64-ingrasys_s9200_64x-r0/installer.conf:CONSOLE_PORT=0x3f8
device/ingrasys/x86_64-ingrasys_s9230_64x-r0/installer.conf:CONSOLE_PORT=0x3f8
device/ingrasys/x86_64-ingrasys_s9280_64x-r0/installer.conf:CONSOLE_PORT=0x3f8
device/inventec/x86_64-inventec_d7032q28b-r0/installer.conf:CONSOLE_PORT=0x2f8
device/inventec/x86_64-inventec_d7054q28b-r0/installer.conf:CONSOLE_PORT=0x3f8
device/inventec/x86_64-inventec_d7264q28b-r0/installer.conf:CONSOLE_PORT=0x3f8
device/marvell/x86_64-marvell_slm5401_54x-r0/installer.conf:CONSOLE_PORT=0x2f8
device/mitac/x86_64-mitac_ly1200_b32h0_c3-r0/installer.conf:CONSOLE_PORT=0x3f8
device/quanta/x86_64-quanta_ix1b_32x-r0/installer.conf:CONSOLE_PORT=0x2f8
device/wnc/x86_64-wnc_osw1800-r0/installer.conf:CONSOLE_PORT=0x2f8

the logic should be move below line 83.

check the console_port, if it is 0x3f8 then it is ttyS0, if it is 0x2f8, then it is ttyS1. then need to check if CONSOLE_SPEED is already defined or not, if not, then automatically set the console speed. otherwise, use the CONSOLE_SPEED setting in the installer.conf.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lguohan thanks for the comments, will do further change.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lguohan I decide to get the console speed setting from '/proc/cmdline' instead of from ttyS*, to avoid to check which ttyS is using. please see the modification in the latest commit.

if [ -z "$CONSOLE_SPEED" ]; then
CONSOLE_SPEED=9600
fi

# Get platform specific linux kernel command line arguments
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX=""
Expand Down