This issue could equally be raised on Raspberry Pi Imager - I am raising on rpi-image-gen as I have only experienced this issues on images built with rpi-image-gen; I recognise it falls in the overlap of the venn diagram between rpi-image-gen and Raspberry Pi Imager. If, after reading through, this would be best handled in Raspberry Pi Imager, let me know and I will move it there
This was discussed in the raspberry pi forums before raising here as I am very open to the possibility this is user error rather than an actual issue. See: https://forums.raspberrypi.com/viewtopic.php?p=2363442
I have built custom images with rpi-image-gen - when creating SD cards using Raspberry Pi Imager the customizations that are made don't seem to take effect - usernames, ssh keys, hostnames, wifi settings. I have used the image.json generated by rpi-image-gen and added customizations through the Raspberry Pi Imager GUI, in this case I was unable to even see the user-data, network-config and meta-data in the BOOT partition of the SD. When using rpi-imager --cli pointing to user-data and network-config taken from a previously imaged SD using the standard Raspberry Pi build, the cloud-data, meta-dat and network-config are on the SD BOOT partition, but the booted image has the wrong hostname, does not appear on the network and I am unable to login with the user/pass I configured.
My custom image is based on trixie-minbase.yaml; the network-config and user-data cloud_init files were taken from the BOOT partition of an SD I imaged from a standard Rasperry Pi Imager Trixie image.
When using the rpi-imager --cli I used --debug, here is a snippet of the logs
Applications/Raspberry\ Pi\ Imager.app/Contents/MacOS/rpi-imager --cli --cloudinit-userdata ~/Desktop/user-data --cloudinit-networkconfig ~/Desktop/network-config-home --debug ~/rpi-image-work/artifacts/my_trixie.img /dev/disk4
...
setSrc: initFormat parameter: "cloudinit" -> _initFormat set to: "cloudinit"
...
Cloudinit: "#cloud-config\nmanage_resolv_conf: false\nhostname: MyHostName\n ..... enable_ssh: true\nssh_pwauth: false\nrpi:\n interfaces:\n serial: true\n"
initFormat parameter: "cloudinit" -> _initFormat: "cloudinit"
....
Checking customization: config= false cmdline= false firstrun= false cloudinit= true initFormat= "cloudinit" isEmpty= false
_customizeImage: _initFormat= "cloudinit" initCloud= true _cloudinit.isEmpty()= false
...
Write timing stats: writes= 199 syscall= 0 ms preHashWait= 137 ms postHashWait= 0 ms sync= 0 ms syncCount= 0 avgSize= 8192 KB
WriteProgressWatchdog: Stopped
Given the above, I assume that the customizations are being picked up - the imaging seem to complete and is verified. When I boot the Pi with the SD card though, it boots to a login prompt - however, the hostname is as was set in the config/project.yaml file in rpi-image-gen; The Pi doesn't appear on the network, I can't ssh in or login with the username/password I set in the user-data file (taken from a working raspberry pi imager generated SD card)
Thinking the rpi-image-gen was the cause, I cleared out the config/project.yaml to just point to image: trixie-minbase.yaml, removing all customizations (hostname, etc) passing the device type on the rpi-image-gen build command line (IGconf_device_layer=rpi3)
$ sudo rm -rf work/*; time ./rpi-image-gen build -S ./myProject/ -c project.yaml -- IGconf_device_layer=rpi3 IGconf_image_name=project_Pi3_v0.1
when I did this, the Pi got a random hostname - pi3-ivzytc - and otherwise everything else was the same, no network, unable to login with my username/pass, no ssh (no network of course!)
i am not sure if it's relevant, when I review the recording I made of the boot, everything is [ OK ] ... the only thing of note I have seen so far is
systemd[ 1 ]: Hostname set to <pi3-ivzytc>
systemd[ 1 ]: Failed to open libbpf, cgroup BPF features disabled: Operation not supported
Based on https://github.com/raspberrypi/rpi-imag ... formats.md - does the mention of systemd imply firstrun.sh and given I don't have a firstun.sh that might explain the issues - but everything else here is set to use cloud_init
I am using Raspberry Pi Imager 2.0.6 on an M3 Mac.
This issue could equally be raised on Raspberry Pi Imager - I am raising on rpi-image-gen as I have only experienced this issues on images built with rpi-image-gen; I recognise it falls in the overlap of the venn diagram between rpi-image-gen and Raspberry Pi Imager. If, after reading through, this would be best handled in Raspberry Pi Imager, let me know and I will move it there
This was discussed in the raspberry pi forums before raising here as I am very open to the possibility this is user error rather than an actual issue. See: https://forums.raspberrypi.com/viewtopic.php?p=2363442
I have built custom images with rpi-image-gen - when creating SD cards using Raspberry Pi Imager the customizations that are made don't seem to take effect - usernames, ssh keys, hostnames, wifi settings. I have used the image.json generated by rpi-image-gen and added customizations through the Raspberry Pi Imager GUI, in this case I was unable to even see the user-data, network-config and meta-data in the BOOT partition of the SD. When using rpi-imager --cli pointing to user-data and network-config taken from a previously imaged SD using the standard Raspberry Pi build, the cloud-data, meta-dat and network-config are on the SD BOOT partition, but the booted image has the wrong hostname, does not appear on the network and I am unable to login with the user/pass I configured.
My custom image is based on trixie-minbase.yaml; the network-config and user-data cloud_init files were taken from the BOOT partition of an SD I imaged from a standard Rasperry Pi Imager Trixie image.
When using the rpi-imager --cli I used --debug, here is a snippet of the logs
Given the above, I assume that the customizations are being picked up - the imaging seem to complete and is verified. When I boot the Pi with the SD card though, it boots to a login prompt - however, the hostname is as was set in the config/project.yaml file in rpi-image-gen; The Pi doesn't appear on the network, I can't ssh in or login with the username/password I set in the user-data file (taken from a working raspberry pi imager generated SD card)
Thinking the rpi-image-gen was the cause, I cleared out the config/project.yaml to just point to image: trixie-minbase.yaml, removing all customizations (hostname, etc) passing the device type on the rpi-image-gen build command line (IGconf_device_layer=rpi3)
when I did this, the Pi got a random hostname - pi3-ivzytc - and otherwise everything else was the same, no network, unable to login with my username/pass, no ssh (no network of course!)
i am not sure if it's relevant, when I review the recording I made of the boot, everything is [ OK ] ... the only thing of note I have seen so far is
Based on https://github.com/raspberrypi/rpi-imag ... formats.md - does the mention of systemd imply firstrun.sh and given I don't have a firstun.sh that might explain the issues - but everything else here is set to use cloud_init
I am using Raspberry Pi Imager 2.0.6 on an M3 Mac.