2020-02-15 20:24:48 +00:00
|
|
|
#!/bin/bash
|
2021-07-02 00:53:42 +01:00
|
|
|
echo "mounting..."
|
2020-02-15 20:24:48 +00:00
|
|
|
sudo modprobe nbd
|
2021-07-02 00:53:42 +01:00
|
|
|
sudo qemu-nbd -c dev/nbd0 ~/VirtualBox\ VMs/ZealOS/ZealOS.vdi #Replace with path to disk
|
|
|
|
sudo partprobe /dev/nbd0
|
2020-02-15 20:24:48 +00:00
|
|
|
sudo mount /dev/nbd0p1 /mnt
|
2021-07-02 00:53:42 +01:00
|
|
|
echo "mounted .vdi"
|
2020-02-15 20:31:41 +00:00
|
|
|
|
2021-07-02 00:53:42 +01:00
|
|
|
echo "removing src/ files"
|
2020-02-15 20:31:41 +00:00
|
|
|
rm -rf src/*
|
2021-07-02 00:53:42 +01:00
|
|
|
echo "copying src/ files from root of mounted .vdi"
|
2020-02-15 20:31:41 +00:00
|
|
|
sudo cp -r /mnt/* src/
|
2021-07-02 00:53:42 +01:00
|
|
|
echo "files copied"
|
2020-02-15 20:31:41 +00:00
|
|
|
|
2021-07-02 00:53:42 +01:00
|
|
|
echo "unmounting..."
|
2020-02-15 20:24:48 +00:00
|
|
|
sudo umount /mnt
|
|
|
|
sudo qemu-nbd -d /dev/nbd0
|
2021-07-02 00:53:42 +01:00
|
|
|
echo "unmounted .vdi"
|
|
|
|
echo "set perms, update ISO."
|
2020-07-21 15:12:59 +01:00
|
|
|
sudo chown -R $USER:$USER src/*
|
2021-07-02 00:53:42 +01:00
|
|
|
rm ZealOS-*
|
|
|
|
mv src/Tmp/MyDistro.ISO.C ./ZealOS-$(date +%Y-%m-%d-%H_%M_%S).iso
|
|
|
|
echo "finished."
|
|
|
|
git status
|