mirror of
https://github.com/home-assistant/operating-system.git
synced 2026-04-17 23:54:06 +01:00
Before update to Buildroot 2025.02, the overlays directory on Yellow was
created by rpi-firmware in a condition added confusingly in firmware bump [1].
However, this got lost during Buildroot update, and since Yellow doesn't copy
overlays from the rpi-firmware repo, the directory was never created and the
rpi-rf-mod.dtbo couldn't be copied there in pre-image build hook.
To make things more robust, create the overlays directory for rpi targets
conditionally in the hook instead of relying on rpi-firmware to create it.
[1] f1af1a0bf7
Fixes #4233
38 lines
1.1 KiB
Bash
Executable File
38 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# shellcheck disable=SC2155
|
|
|
|
function hassos_pre_image() {
|
|
local BOOT_DATA="$(path_boot_dir)"
|
|
|
|
cp -t "${BOOT_DATA}" \
|
|
"${BINARIES_DIR}/u-boot.bin" \
|
|
"${BINARIES_DIR}/boot.scr"
|
|
cp "${BINARIES_DIR}"/*.dtb "${BOOT_DATA}/"
|
|
cp -r "${BINARIES_DIR}/rpi-firmware/"* "${BOOT_DATA}/"
|
|
if [ -f "${BOARD_DIR}/config.txt" ]; then
|
|
cp "${BOARD_DIR}/config.txt" "${BOOT_DATA}/config.txt"
|
|
else
|
|
cp "${BOARD_DIR}/../config.txt" "${BOOT_DATA}/config.txt"
|
|
fi
|
|
if [ -f "${BOARD_DIR}/cmdline.txt" ]; then
|
|
cp "${BOARD_DIR}/cmdline.txt" "${BOOT_DATA}/cmdline.txt"
|
|
else
|
|
cp "${BOARD_DIR}/../cmdline.txt" "${BOOT_DATA}/cmdline.txt"
|
|
fi
|
|
if ls "${BINARIES_DIR}"/*.dtbo >/dev/null 2>&1; then
|
|
mkdir -p "${BOOT_DATA}/overlays"
|
|
cp "${BINARIES_DIR}"/*.dtbo "${BOOT_DATA}/overlays/"
|
|
fi
|
|
|
|
# Enable 64bit support
|
|
if [[ "${BOARD_ID}" =~ "64" ]]; then
|
|
sed -i "s|#arm_64bit|arm_64bit|g" "${BOOT_DATA}/config.txt"
|
|
fi
|
|
}
|
|
|
|
|
|
function hassos_post_image() {
|
|
convert_disk_image_xz
|
|
}
|
|
|