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

@@ -0,0 +1,35 @@
#!/bin/sh
##
# Hooks
# Handle boot hocks
if [ "${RAUC_SLOT_CLASS}" = "boot" ]; then
BOOT_DATA=/tmp/boot-data
mkdir -p ${BOOT_DATA}
if [ "${1}" = "slot-pre-install" ]; then
cp -f ${RAUC_SLOT_MOUNT_POINT}/*.txt ${BOOT_DATA}/
elif [ "${1}" = "slot-post-install" ]; then
cp -f ${BOOT_DATA}/*.txt ${RAUC_SLOT_MOUNT_POINT}/
fi
fi
# Handle spl install
if [ "${RAUC_SLOT_CLASS}" = "spl" ]; then
DEVICE_CHILD="$(findfs LABEL="hassos-boot")"
DEVICE_ROOT="/dev/$(lsblk -no pkname ${DEVICE_CHILD})"
if sfdisk -dq ${DEVICE_ROOT} | grep -q 'label: gpt'; then
dd if=${RAUC_IMAGE_NAME} of=${DEVICE_ROOT} conv=notrunc bs=512 seek=2 skip=2
else
dd if=${RAUC_IMAGE_NAME} of=${DEVICE_ROOT} conv=notrunc bs=1 count=440
dd if=${RAUC_IMAGE_NAME} of=${DEVICE_ROOT} conv=notrunc bs=512 seek=1 skip=1
fi
fi
##
# Fixups
exit 0