Update without rebuilding the whole disk
This commit is contained in:
+5
-2
@@ -20,6 +20,8 @@ START_SECTOR=$(file disk.img | cut -d',' -f 8 | cut -d' ' -f3)
|
||||
echo "Start sector :" $START_SECTOR
|
||||
OFFSET=$((512*$START_SECTOR))
|
||||
|
||||
echo $OFFSET > diskoffset
|
||||
|
||||
losetup --offset $OFFSET -f disk.img
|
||||
LOOP=$(losetup -a | grep -v deleted | cut -d':' -f 1)
|
||||
|
||||
@@ -39,7 +41,7 @@ echo "installing grub"
|
||||
arch-chroot $CHIBRAX_MOUNT_POINT grub-install --target=i386-pc ${LOOP_ROOT} --modules=part_msdos
|
||||
arch-chroot $CHIBRAX_MOUNT_POINT grub-mkconfig -o /boot/grub/grub.cfg
|
||||
|
||||
PARTUUID=$(lsblk /dev/loop7 --fs | awk '{print $4}' | grep -v LABEL)
|
||||
PARTUUID=$(lsblk $LOOP --fs | awk '{print $4}' | grep -v LABEL)
|
||||
|
||||
echo "menuentry 'Chibrax OS' {" >> $CHIBRAX_MOUNT_POINT/boot/grub/grub.cfg
|
||||
echo " set root='hd0,msdos1'" >> $CHIBRAX_MOUNT_POINT/boot/grub/grub.cfg
|
||||
@@ -49,4 +51,5 @@ echo "}" >> $CHIBRAX_MOUNT_
|
||||
umount $CHIBRAX_MOUNT_POINT
|
||||
losetup -d $LOOP_ROOT
|
||||
losetup -d $LOOP
|
||||
chmod 755 disk.img
|
||||
#built by root but used by any, usefull to run the vm without root privileges
|
||||
chmod 757 disk.img
|
||||
Reference in New Issue
Block a user