mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-27 06:56:29 +00:00
Merge Yellow's RAUC post-install hook with the install hook (#3678)
As stated in the docs [1], post-install hook is not executed if the slot already has an install hook defined. Merge the post-install hook with the install hook to fix CM5 migration for Yellow. [1] https://rauc.readthedocs.io/en/latest/using.html#slot-hooks
This commit is contained in:
parent
b9e66fbfd0
commit
78cdaab597
@ -11,11 +11,7 @@ hooks=install-check;
|
|||||||
|
|
||||||
[image.boot]
|
[image.boot]
|
||||||
filename=boot.vfat
|
filename=boot.vfat
|
||||||
{{- if eq (env "ota_compatible") "haos-yellow" }}
|
|
||||||
hooks=install;post-install;
|
|
||||||
{{- else }}
|
|
||||||
hooks=install;
|
hooks=install;
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
[image.kernel]
|
[image.kernel]
|
||||||
filename=kernel.img
|
filename=kernel.img
|
||||||
|
@ -42,6 +42,16 @@ install_boot() {
|
|||||||
cp -f "${BOOT_TMP}"/*.txt "${BOOT_MNT}/" || true
|
cp -f "${BOOT_TMP}"/*.txt "${BOOT_MNT}/" || true
|
||||||
cp -f "${BOOT_TMP}"/grubenv "${BOOT_MNT}"/EFI/BOOT/ || true
|
cp -f "${BOOT_TMP}"/grubenv "${BOOT_MNT}"/EFI/BOOT/ || true
|
||||||
fi
|
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() {
|
install_spl() {
|
||||||
@ -88,25 +98,6 @@ check_grubenv() {
|
|||||||
fi
|
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() {
|
post_install_kernel() {
|
||||||
BOOT_MNT=/mnt/boot
|
BOOT_MNT=/mnt/boot
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user