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:
35
buildroot-external/ota/rauc-hook
Executable file
35
buildroot-external/ota/rauc-hook
Executable 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
|
||||
Reference in New Issue
Block a user