Files
operating-system/buildroot-external/scripts/ota.sh
Pascal Vizeli fbb45e1544 tinker: Initial support (#140)
* tinker: initial support

* Fix info

* Fix uboot defconfig

* Split kernel config

* Fix name

* Add post-image

* Init different boot

* Add SPL images

* Dynamic rauc config

* Support SPL for OTA

* Fix expand script style

* Fix SPL

* Bump build u-boot

* Cleanup

* Add cmd for scritps

* Use kernel from armbian

* Fix u-boot

* Add bluetooth support

* Fix bt

* Fix env

* Change uart debug like rpi

* move config
2018-08-03 13:21:55 +02:00

49 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
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.ext4"
local rootfs="${BINARIES_DIR}/rootfs.squashfs"
local spl="${BINARIES_DIR}/spl.img"
local key="/build/key.pem"
local cert="/build/cert.pem"
rm -rf ${rauc_folder} ${ota_file}
mkdir -p ${rauc_folder}
cp -f ${kernel} ${rauc_folder}/kernel.ext4
cp -f ${boot} ${rauc_folder}/boot.vfat
cp -f ${rootfs} ${rauc_folder}/rootfs.img
cp -f ${BR2_EXTERNAL_HASSOS_PATH}/misc/rauc-hook ${rauc_folder}/hook
(
echo "[update]"
echo "compatible=$(hassos_rauc_compatible)"
echo "version=$(hassos_version)"
echo "[hooks]"
echo "filename=hook"
echo "[image.boot]"
echo "filename=boot.vfat"
echo "hooks=pre-install;post-install"
echo "[image.kernel]"
echo "filename=kernel.ext4"
echo "[image.rootfs]"
echo "filename=rootfs.img"
) > ${rauc_folder}/manifest.raucm
# SPL
if [ "${BOOT_SYS}" != "spl" ]; 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} ${rauc_folder} ${ota_file}
}