diff --git a/buildroot-external/ota/manifest.raucm.gtpl b/buildroot-external/ota/manifest.raucm.gtpl index 84628f1af..932257961 100644 --- a/buildroot-external/ota/manifest.raucm.gtpl +++ b/buildroot-external/ota/manifest.raucm.gtpl @@ -11,11 +11,7 @@ hooks=install-check; [image.boot] filename=boot.vfat -{{- if eq (env "ota_compatible") "haos-yellow" }} -hooks=install;post-install; -{{- else }} hooks=install; -{{- end }} [image.kernel] filename=kernel.img diff --git a/buildroot-external/ota/rauc-hook b/buildroot-external/ota/rauc-hook index 81d662272..f366d5c7e 100755 --- a/buildroot-external/ota/rauc-hook +++ b/buildroot-external/ota/rauc-hook @@ -42,6 +42,16 @@ install_boot() { cp -f "${BOOT_TMP}"/*.txt "${BOOT_MNT}/" || true cp -f "${BOOT_TMP}"/grubenv "${BOOT_MNT}"/EFI/BOOT/ || true fi + + # Add CM5 support for Yellow. Can be removed in HAOS 15. + if [ "$RAUC_SYSTEM_COMPATIBLE" = "haos-yellow" ]; then + if ! grep -q "\[cm5\]" "${BOOT_MNT}/config.txt"; then + echo "Adding CM5 config to config.txt" + + # Remove old single device_tree config and add CM-specific ones + sed -i '/device_tree=bcm2711-rpi-cm4-ha-yellow.dtb/d; s/\[all\]/\[cm4\]\ndevice_tree=bcm2711-rpi-cm4-ha-yellow.dtb\n\n\[cm5\]\ndevice_tree=bcm2712-rpi-cm5-ha-yellow.dtb\n\n\[all\]/' "${BOOT_MNT}/config.txt" + fi + fi } install_spl() { @@ -88,25 +98,6 @@ check_grubenv() { fi } -post_install_boot() { - BOOT_MNT=/mnt/boot - - # Add CM5 support for Yellow. Can be removed in HAOS 15. Make sure manifest.raucm.gtpl is updated. - if [ "$RAUC_SYSTEM_COMPATIBLE" = "haos-yellow" ]; then - # Mount boot - if ! systemctl -q is-active mnt-boot.mount; then - systemctl start mnt-boot.mount - fi - - if ! grep -q "\[cm5\]" "${BOOT_MNT}/config.txt"; then - echo "Adding CM5 config to config.txt" - - # Remove old single device_tree config and add CM-specific ones - sed -i '/device_tree=bcm2711-rpi-cm4-ha-yellow.dtb/d; s/\[all\]/\[cm4\]\ndevice_tree=bcm2711-rpi-cm4-ha-yellow.dtb\n\n\[cm5\]\ndevice_tree=bcm2712-rpi-cm5-ha-yellow.dtb\n\n\[all\]/' "${BOOT_MNT}/config.txt" - fi - fi -} - post_install_kernel() { BOOT_MNT=/mnt/boot