diff --git a/generate-recipe.py b/generate-recipe.py index a8f428f..5b15e81 100755 --- a/generate-recipe.py +++ b/generate-recipe.py @@ -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) diff --git a/raspi_master.yaml b/raspi_master.yaml index 6c2ae37..da51e08 100644 --- a/raspi_master.yaml +++ b/raspi_master.yaml @@ -169,3 +169,18 @@ steps: shell: | rm -f /etc/machine-id /var/lib/dbus/machine-id __TOUCH_MACHINE_ID__ + + # Insert a model filter for some families, to make sure users of Compute + # Module devices have a chance to boot our image without manual config: + - chroot: / + shell: | + if [ -n "__CM_DEV__" ] && [ -n "__CM_DTB__" ]; then + cat >> /etc/default/raspi-firmware-custom <