RPi-Distro / raspi-config

Configuration tool for the Raspberry Pi
Other
570 stars 209 forks source link

serial port set incorrectly #255

Open marcone opened 1 month ago

marcone commented 1 month ago

tl;dr: choosing the same serial port options in raspi-config can result in two different behaviors, depending on how exactly you go about choosing the options in raspi-config.

  1. Flash a current Raspberry Pi OS image (I used "Raspberry Pi OS Lite (32-bit)" for Raspberry Pi Zero, which as of the day I'm writing this installs an image with kernel 6.6.31 and raspi-config version 20240625). Connect an appropriate serial debug adapter to your device so you can monitor uart output with your favorite terminal emulator (I used Putty on Windows 10, connected to the Pi via a USB to serial adapter). Boot the device. Note that no serial output appears by default. (this is expected)

  2. After booting and logging in for the first time, run sudo raspi-config. Navigate to "Interface Options", then "Serial Port". It will ask you if you want a login shell on the serial port. Answer "yes". At this point it will show an informational dialog telling you that "The serial login shell is enabled" and "The serial interface is enabled". Select "OK". This takes you back to the main menu. Select "Finish". Note that this simply exits raspi-config, it does not ask if you want to reboot.

  3. Reboot manually. Note that kernel boot logs are now shown on the serial port, however they end as soon as systemd-journald starts, and no systemd logs are shown on the serial port. A login prompt will show on the serial port shortly after the kernel boot logs end.

  4. Log in again and run raspi-config again. Go to "Interface Options", then "Serial Port". It will again ask you if you want to enable a login shell on the serial port. Answer "No" this time. It will then ask you if you want the serial interface to be enabled. Answer "Yes". An information dialog appears informing you of you choices. Select "OK" to go back to the main menu. Without exiting raspi-config, choose "Interface Options" and "Serial Port" again. This time, answer "Yes" to the login shell question (same as in step 2 above). The same informational dialog as in step 2 appears, informing you serial login and serial interface are enabled. Select "OK" to go back to the main menu, then select "Finish". Note that this time, raspi-config does ask you if you want to reboot. (this is different from what happened in step 2 above, even though we selected the same options) Select "yes" to reboot.

  5. We again get kernel boot logs, however after systemd-journald starts, we also see systemd logs appear on the serial output, and we continue to see kernel logs also. This is different behavior from what happened after (2), even though in both cases we chose the same options in raspi-config.

I believe that the behavior should be the same after (2) and (5), since the same serial port options were chosen in both cases. I also believe that the behavior shown after (5) is the desired behavior, however if that is not the case, then there should be additional options in raspi-config that allow enabling the behavior from (5)

marcone commented 1 month ago

Same with raspi-config version 20240708, which is what I get when I let it update itself.