* Add squashfs with LZ4 and LZO compression to Barebox * Add squashfs with LZO compression to U-Boot * Use squashfs for Linux kernel partition Generate a squashfs image with LZO compression for the Linux kernel partition. Adjust the boot scripts to be file system independent commands to boot from squashfs.
58 lines
1.7 KiB
Bash
Executable File
58 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
# shellcheck disable=SC2155
|
|
|
|
function create_ota_update() {
|
|
local ota_file="$(hassos_image_name raucb)"
|
|
local rauc_folder="${BINARIES_DIR}/rauc"
|
|
local boot="${BINARIES_DIR}/boot.vfat"
|
|
local kernel="${BINARIES_DIR}/kernel.img"
|
|
local rootfs="${BINARIES_DIR}/rootfs.squashfs"
|
|
local spl="${BINARIES_DIR}/spl.img"
|
|
local key="/build/key.pem"
|
|
local cert="/build/cert.pem"
|
|
local keyring="${TARGET_DIR}/etc/rauc/keyring.pem"
|
|
|
|
# Skip if no dev key is arround
|
|
if [ ! -f "${key}" ]; then
|
|
echo "Skip creating OTA update because of missing key ${key}"
|
|
return 0
|
|
fi
|
|
|
|
rm -rf "${rauc_folder}" "${ota_file}"
|
|
mkdir -p "${rauc_folder}"
|
|
|
|
cp -f "${kernel}" "${rauc_folder}/kernel.img"
|
|
cp -f "${boot}" "${rauc_folder}/boot.vfat"
|
|
cp -f "${rootfs}" "${rauc_folder}/rootfs.img"
|
|
cp -f "${BR2_EXTERNAL_HASSOS_PATH}/ota/rauc-hook" "${rauc_folder}/hook"
|
|
|
|
(
|
|
echo "[update]"
|
|
echo "compatible=$(hassos_rauc_compatible)"
|
|
echo "version=$(hassos_version)"
|
|
echo "[hooks]"
|
|
echo "filename=hook"
|
|
echo "hooks=install-check"
|
|
echo "[image.boot]"
|
|
echo "filename=boot.vfat"
|
|
echo "hooks=install"
|
|
echo "[image.kernel]"
|
|
echo "filename=kernel.img"
|
|
echo "[image.rootfs]"
|
|
echo "filename=rootfs.img"
|
|
) > "${rauc_folder}/manifest.raucm"
|
|
|
|
# SPL
|
|
if [ "${BOOT_SPL}" == "true" ]; then
|
|
cp -f "${spl}" "${rauc_folder}/spl.img"
|
|
|
|
(
|
|
echo "[image.spl]"
|
|
echo "filename=spl.img"
|
|
echo "hooks=install"
|
|
) >> "${rauc_folder}/manifest.raucm"
|
|
fi
|
|
|
|
rauc bundle -d --cert="${cert}" --key="${key}" --keyring="${keyring}" "${rauc_folder}" "${ota_file}"
|
|
}
|