Update without rebuilding the whole disk

This commit is contained in:
Marc
2021-11-26 19:06:36 +01:00
parent b24eba4e94
commit d64b9ccd25
4 changed files with 39 additions and 8 deletions
+30
View File
@@ -0,0 +1,30 @@
#!/bin/bash
# we depend on a properly build rootfs
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
if [ -z disk.img ]
then echo "Please run createLiveImage.sh first"
exit
fi
CHIBRAX_MOUNT_POINT="/tmp/chibraxMountPoint"
OFFSET=$(cat diskoffset)
losetup --offset $OFFSET -f disk.img
LOOP=$(losetup -a | grep -v deleted | cut -d':' -f 1)
echo ${LOOP} $CHIBRAX_MOUNT_POINT $OFFSET
mkdir $CHIBRAX_MOUNT_POINT -p
mount ${LOOP} $CHIBRAX_MOUNT_POINT
echo "coping rootfs"
cp rootfs/* $CHIBRAX_MOUNT_POINT -r
echo "done"
echo "finishing..."
umount $CHIBRAX_MOUNT_POINT
losetup -d $LOOP