drakkar-lig / walt-python-packages

Home of walt-node, walt-server, walt-client and walt-common python packages.
https://walt-project.liglab.fr
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

Ease raspberry pi SD card updates and serial mode selection #97

Open eduble opened 11 months ago

eduble commented 11 months ago

We have an image rpi-sd-update, but it is not documented. Either we document it or we make its usage more friendly using a new walt sub-command.

We could add a config parameter rpi.serial indicating the mode in use for serial communication:

On rpi < 3, possible modes are "disabled" and "full". Default with current SD card files is "full". On rpi >= 3, the 3 modes are possible. Default with current SD card files is "limited". When selecting "full", a warning should be printed to the user to indicate that the bluetooth device will be disabled.

Changing this setting would send a request to walt-net-service on the node, which would modify config.txt appropriately. On rpi3+ and rpi4, if they boot without a SD card, then config.txt is on the image. So we should do some updates on tftpd redirects in order to let config.txt be served in /var/lib/walt/nodes//configs/config.txt instead; by default, it could be a symlink to ../tftp/config.txt, but if something is changed, the changes should be made on a copy. If another image is booted, we may need to redo these changes on affected nodes to reflect their configuration.

eduble commented 11 months ago

Another important setting about serial communication is the order of the parameters in cmdline.txt: console=serial0,115200 console=tty1 on current SD card files. tty1 is used to display the console on the screen. In case of several console parameters like this, linux considers the last console parameter is the main console. Some boot messages are displayed on both consoles (u-boot, linux kernel), but some (e.g., walt-init) are only displayed on the main console. Since our current SD card files select the screen as the main console, we may actually consider that this is also a limiting factor, thus even on older models (rpi < 3) the default serial mode is "limited". And, in any case, switching to "full" should reorder this to have console=serial0,115200 last.