The old procedure for gadget mode works to enable USB based networking in jessie thru bullseye, but in bookworm, the default state of the USB network (usb0) is down. Kinda defeats the purpose of enabling a USB network to access a device in a headless config, if the interface is down by default.
So the new bookworm procedure to do a headless install of a PiZero (non-W) is:
- Download, verify (GPG) and install the Imager utility
- Download and verify (GPG) the latest bookworm image
- Load the bookworm image in the Imager utility
- Use the gear button to configure userid, password, hostname, and SSH
- Edit the FAT files in the procedure to enable USB networking (gadget mode)
- On the SD next to config.txt edit firstrun.sh with the following;
Replace the line rm -f /boot/firstrun.sh in firstrun.sh with:
cat >/etc/network/interfaces.d/usb0
Source: https://www.reddit.com/r/raspberry_pi/c ... _bookworm/