Change handling for SPL based images (#578)

* Change handling for SPL based images

* Fix script

* Fix path for rauc-hook
This commit is contained in:
Pascal Vizeli
2020-02-10 14:52:03 +01:00
committed by GitHub
parent 66c1b016c9
commit a592fc9866
21 changed files with 37 additions and 14 deletions

View File

@@ -45,7 +45,7 @@ function size2sectors() {
function get_boot_size() {
if [ "${BOOT_SYS}" == "spl" ]; then
if [ "${BOOT_SPL}" == "true" ]; then
echo "${BOOT_SIZE[1]}"
else
echo "${BOOT_SIZE[0]}"
@@ -138,7 +138,7 @@ function _create_disk_gpt() {
# Partition layout
# SPL
if [ "${BOOT_SYS}" == "spl" ]; then
if [ "${BOOT_SPL}" == "true" ]; then
sgdisk -j 16384 "${hdd_img}"
fi
@@ -180,10 +180,13 @@ function _create_disk_gpt() {
dd if="${overlay_img}" of="${hdd_img}" conv=notrunc bs=512 seek="${overlay_offset}"
dd if="${data_img}" of="${hdd_img}" conv=notrunc bs=512 seek="${data_offset}"
# Fix boot
# Set Hyprid partition
if [ "${BOOT_SYS}" == "hyprid" ]; then
_fix_disk_hyprid
elif [ "${BOOT_SYS}" == "spl" ]; then
fi
# Write SPL
if [ "${BOOT_SPL}" == "true" ]; then
_fix_disk_spl_gpt
fi
}
@@ -255,8 +258,10 @@ function _create_disk_mbr() {
dd if="${overlay_img}" of="${hdd_img}" conv=notrunc bs=512 seek="${overlay_offset}"
dd if="${data_img}" of="${hdd_img}" conv=notrunc bs=512 seek="${data_offset}"
# Wripte SPL
_fix_disk_spl_mbr
# Write SPL
if [ "${BOOT_SPL}" == "true" ]; then
_fix_disk_spl_mbr
fi
}

View File

@@ -23,7 +23,7 @@ function create_ota_update() {
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"
cp -f "${BR2_EXTERNAL_HASSOS_PATH}/ota/rauc-hook" "${rauc_folder}/hook"
(
echo "[update]"
@@ -41,7 +41,7 @@ function create_ota_update() {
) > "${rauc_folder}/manifest.raucm"
# SPL
if [ "${BOOT_SYS}" == "spl" ]; then
if [ "${BOOT_SPL}" == "true" ]; then
cp -f "${spl}" "${rauc_folder}/spl.img"
(

View File

@@ -27,7 +27,7 @@ function _write_rauc_boot() {
) >> "${TARGET_DIR}/etc/rauc/system.conf"
# SPL
if ! [[ "${BOOT_SYS}" =~ (spl|mbr) ]]; then
if ! [ "${BOOT_SPL}" == "true" ]; then
return 0
fi
@@ -69,9 +69,9 @@ function write_rauc_config() {
function install_rauc_certs() {
if [ "${DEPLOYMENT}" == "production" ]; then
cp "${BR2_EXTERNAL_HASSOS_PATH}/misc/rel-ca.pem" "${TARGET_DIR}/etc/rauc/keyring.pem"
cp "${BR2_EXTERNAL_HASSOS_PATH}/ota/rel-ca.pem" "${TARGET_DIR}/etc/rauc/keyring.pem"
else
cp "${BR2_EXTERNAL_HASSOS_PATH}/misc/dev-ca.pem" "${TARGET_DIR}/etc/rauc/keyring.pem"
cp "${BR2_EXTERNAL_HASSOS_PATH}/ota/dev-ca.pem" "${TARGET_DIR}/etc/rauc/keyring.pem"
fi
}
@@ -87,6 +87,6 @@ function install_bootloader_config() {
# Fix MBR
if [ "${BOOT_SYS}" == "mbr" ]; then
mkdir -p "${TARGET_DIR}/usr/lib/udev/rules.d"
cp -f "${BR2_EXTERNAL_HASSOS_PATH}/misc/mbr-part.rules" "${TARGET_DIR}/usr/lib/udev/rules.d/"
cp -f "${BR2_EXTERNAL_HASSOS_PATH}/misc/mbr-part.rules" "${TARGET_DIR}/usr/lib/udev/rules.d/"
fi
}