This commit is contained in:
Pascal Vizeli
2018-08-24 21:50:29 +00:00
parent 9b170812d6
commit 74ff13e25e
12 changed files with 148 additions and 111 deletions

View File

@@ -5,16 +5,30 @@
# Handle boot hocks
if [ "${RAUC_SLOT_CLASS}" = "boot" ]; then
if [ "${1}" = "slot-post-install" ]; then
/usr/lib/rauc/post-install-boot
elif [ "${1}" = "slot-pre-install" ]; then
/usr/lib/rauc/pre-install-boot
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
/usr/lib/rauc/install-spl "${RAUC_IMAGE_NAME}"
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
BACKUP_MBR="/tmp/mbr-backup.bin"
dd if=${DEVICE_ROOT} of=${BACKUP_MBR} bs=1 count=72 skip=440
dd if=${RAUC_IMAGE_NAME} of=${DEVICE_ROOT} conv=notrunc bs=512
dd if=${BACKUP_MBR} of=${DEVICE_ROOT} conv=notrunc bs=1 skip=440
fi
fi
##