-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
syslinux: change serial bit rate to 115200 #58196
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
syslinux: change serial bit rate to 115200 #58196
Conversation
Prior to this commit an installation over serial via syslinux would involve: 1. setting bitrate to BIOS's bitrate (typically 115200) 2. setting bitrate to syslinux's bitrate (38400) 3. setting bitrate to stty's bitrate (115200) By changing syslinux's bitrate to 115200, an installation over serial is a smoother experience, and consistent with the GRUB2 installation which is also 115200 bps. [root@nixos:~]# stty speed 115200 baud; line = 0; -brkint ixoff iutf8 -iexten In a future commit I will add default serial terminals to the syslinux kernel lines.
I see I'm not the first person to want this: https://logs.nix.samueldr.com/nixos-on-your-router/2018-08-29#1521591; |
@@ -88,7 +88,7 @@ let | |||
# result in incorrect boot entries. | |||
|
|||
baseIsolinuxCfg = '' | |||
SERIAL 0 38400 | |||
SERIAL 0 115200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this has some goofy side effects, but +1 -- I've made this patch on my own before :)
Other OSs: |
👍
|
I tested this by:
|
I'm not very familiar with this, what is the biggest worry with this change? Different hardware? If I wanted to test this on my own, what does "observed that syslinux was available over serial at 115200n8" mean and how do I check that? |
Yes. In particular, there might be hardware which doesn't support 115200, and so upon attempting to install NixOS might result in either not being able to serial connect, or even failure. That said, other distros have chosen 115200, and pySerial reports 115200 as being well supported on all platforms:
If this patch works, then when the installer gets to the bootloader, you should see the bootloader. Prior to this patch, you would not see the bootloader. That's the entirety of the patch. If you continue the installation boot, the systemd service starting won't appear on the viewer's picocom (that is another problem to be addressed in #58198 ), but after 1-2min you'll get the usual installation root shell, which should be displayed on the viewer's picocom. |
I mostly saw 9600 (painfully slow) or 115200 baudrates in the wild. As a lot of other distros already use 115200 or switched to it, we should probably, too. So 👍 for me too :-) @samueldr do you want to add this to the 19.03 installer, too? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds good to me too then :)
Prior to this commit, installation over serial console would requiring manually having to modify the kernel modeline, as described in #58198 . This is unnecessarily fiddly, so this commit adds a syslinux boot entry that has serial enabled. GRUB already has a serial console entry: https://github.com/NixOS/nixpkgs/blob/2c07a0800a76be01a3c255f39e21877a9a389f84/nixos/modules/installer/cd-dvd/iso-image.nix#L311-L317 Why 115200 bps? This is already used in other places, e.g. #58196 I tested this change by building the image, booting the image, and observing the boot process over serial: $ cd nixos/ $ nix-build -A config.system.build.isoImage -I nixos-config=modules/installer/cd-dvd/installation-cd-minimal.nix default.nix $ sudo cp /nix/store/arcl702c3z8xlndlvnfplq9yhixjvs9k-nixos-20.09pre-git-x86_64-linux.iso/iso/nixos-20.09pre-git-x86_64-linux.iso /dev/sdb $ picocom -b 115200 /dev/ttyUSB0
Prior to this commit an installation over serial via syslinux would
involve:
By changing syslinux's bitrate to 115200, an installation over serial
is a smoother experience, and consistent with the GRUB2 installation
which is also 115200 bps.
In a future commit I will add default serial terminals to the syslinux
kernel lines.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)