Adjust support for CM3/CM4 devices.

See raspi-firmware's README.Debian for details but basically: both CM3
and CM4 in mainline have a DTB filename that's not expected by the
bootloader, so we need to tell the bootloader about the appropriate DTB
filename for those models specifically.

Do that via /etc/default/raspi-firmware-custom, adding a model filter
for some families:
 - [cm3] for raspi_3_* builds;
 - [cm4] for raspi_4_* builds.

Hint users of regular Pi devices into getting rid of those lines if they
notice them.
This commit is contained in:
Cyril Brulebois
2021-11-20 14:29:12 +01:00
parent 500ffff06c
commit c7f08c54cb
2 changed files with 27 additions and 1 deletions

View File

@@ -122,6 +122,14 @@ if suite == 'buster':
else:
touch_machine_id = ''
# Compute Module support:
if version == '3':
cm_dev, cm_dtb = 'cm3', 'bcm2837-rpi-cm3-io3.dtb'
elif version == '4':
cm_dev, cm_dtb = 'cm4', 'bcm2711-rpi-cm4-io.dtb'
else:
cm_dev, cm_dtb = '', ''
### Write results:
@@ -157,7 +165,10 @@ with open('raspi_master.yaml', 'r') as in_file:
.replace('__WIRELESS_FIRMWARE__', wireless_firmware) \
.replace('__SERIAL_CONSOLE__', serial) \
.replace('__HOST__', hostname) \
.replace('__TOUCH_MACHINE_ID__', touch_machine_id)
.replace('__TOUCH_MACHINE_ID__', touch_machine_id) \
.replace('__CM_DEV__', cm_dev) \
.replace('__CM_DTB__', cm_dtb) \
.replace('__VERSION__', version)
out_text = align_replace(out_text, '__FIX_FIRMWARE_PKG_NAME__', fix_firmware_cmds)
out_text = align_replace(out_text, '__EXTRA_ROOT_SHELL_CMDS__', extra_root_shell_cmds)