raspberrypi / linux

Kernel source tree for Raspberry Pi-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://forums.raspberrypi.com/
Other
11.05k stars 4.97k forks source link

Network booting with sshswitch will fail unless to enable ssh unless /boot is a separate mount point #6315

Closed faceless2 closed 1 month ago

faceless2 commented 1 month ago

Describe the bug

I've been scripting headless setups for Raspbian for some time; mounting the image, copying the files to a partition, modifying a few files like /etc/hostname, setting $MNT/boot/userconf.txt and touch $MNT/boot/ssh to enable SSH on first boot.

On upgrading to bookworm this is no longer working; sshswitch.service is failing. The reason for this is /usr/lib/raspberrypi-sys-mods/sshswitch executes /usr/lib/raspberrypi-sys-mods/get_fw_loc, and that fails because it can't find the mountpoint for /boot or /boot/firmware

The reason it can't find a mountpoint is that there isn't one - I'm PXE booting, the whole thing is just a single partition at / and /boot is just a subdirectory. Surely this is valid? It was under bullseye.

It seems quite brittle and unnecessarily complicated given /usr/lib/raspberrypi-sys-mods/sshswitch is just checking for the presence of/boot/ssh OR /boot/firmware/ssh regardless of mountpoint, which is what the documentation says it does.

If neither is found as a mountpoint, can /usr/lib/raspberrypi-sys-mods/get_fw_loc just check for the presence of the directory?

Steps to reproduce the behaviour

As described. This is a network boot issue.

Device (s)

Raspberry Pi 3 Mod. B+

System

2024-07-04-raspios-bookworm

Logs

No response

Additional context

No response

XECDesign commented 1 month ago

Thanks! The next image should have the fix.