RPi-Distro / pi-gen

Tool used to create the official Raspberry Pi OS images
BSD 3-Clause "New" or "Revised" License
2.52k stars 1.58k forks source link

Custom dtbo files during firstboot #776

Closed knachte closed 2 months ago

knachte commented 2 months ago

I'm trying to include some custom dtbo's to be able to access the TPM module on the devices we use in a custom raspberrypi-sys-mods/firstboot script (the one that generates the ssh keys). However it seems that the dtbo's are not loaded as there is no /dev/TPM* present.

I've added the following to /boot/firmware/config.txt:

dtoverlay=iotg-rpi4/iotg-rpi4-tpm
dtoverlay=iotg-rpi4/iotg-rpi4-eeprom
dtoverlay=iotg-rpi4/iotg-rpi4-rtc
dtoverlay=iotg-rpi4/iotg-rpi4-gpio-exp

as the files are located in /boot/firmware/overlays/iotg-rpi4

Is there something in place during the first boot that prevents loading of the dtbo files, as they seem to be loading correctly the next boot when you can login to the system for the first time.

XECDesign commented 2 months ago

The overlay is loaded by the firmware well before linux starts, so there's nothing pi-gen could possibly do to prevent it.

Maybe what you're seeing is that the appropriate module isn't loaded at that point?