2021-10-31 09:09:00 +00:00
|
|
|
#!/bin/bash
|
2021-11-01 00:04:05 +00:00
|
|
|
|
2021-10-31 09:09:00 +00:00
|
|
|
# Sync VM --> repo
|
2021-11-01 00:04:05 +00:00
|
|
|
# (wipe src/, copy VM to src/. To copy over src/ in-place, comment out the `rm -rf ../src/*` line.)
|
|
|
|
|
2021-10-31 09:09:00 +00:00
|
|
|
sudo modprobe nbd
|
|
|
|
|
|
|
|
echo "Edit this script first to pick your VM path & file!"
|
|
|
|
exit # Comment this line out
|
|
|
|
|
|
|
|
# Uncomment ONE of the next lines and edit it to point to your VM HDD
|
2021-11-01 00:04:05 +00:00
|
|
|
# sudo qemu-nbd -c dev/nbd0 ~/VirtualBox\ VMs/ZealOS/ZealOS.vdi
|
2021-10-31 09:09:00 +00:00
|
|
|
# sudo qemu-nbd -c dev/nbd0 ~/vmware/ZealOS/ZealOS.vmdk
|
|
|
|
# sudo qemu-nbd -c dev/nbd0 ZealOS.qcow2
|
|
|
|
|
|
|
|
sudo partprobe /dev/nbd0
|
2021-11-30 05:23:02 +00:00
|
|
|
sudo mkdir /tmp/zealtmp
|
2021-11-30 02:55:13 +00:00
|
|
|
sudo mount /dev/nbd0p1 /tmp/zealtmp
|
2021-10-31 09:09:00 +00:00
|
|
|
echo "removing src/ files"
|
|
|
|
rm -rf ../src/*
|
|
|
|
echo "copying src/ files from root of mounted hdd"
|
2021-11-30 02:55:13 +00:00
|
|
|
sudo cp -r /tmp/zealtmp/* ../src/
|
2021-11-01 00:04:05 +00:00
|
|
|
sudo rm ../src/Boot/BootMHD2.BIN.C
|
2021-10-31 09:09:00 +00:00
|
|
|
echo "src/ files copied"
|
2021-11-30 05:23:02 +00:00
|
|
|
|
|
|
|
echo "copying docs/ files from HTML/ folder of mounted .vdi"
|
|
|
|
sudo cp -r /tmp/zealtmp/HTML/* ../docs/
|
|
|
|
echo "docs/ files copied"
|
|
|
|
|
2021-10-31 09:09:00 +00:00
|
|
|
echo "unmounting..."
|
2021-11-30 02:55:13 +00:00
|
|
|
sudo umount /tmp/zealtmp
|
2021-11-30 05:23:02 +00:00
|
|
|
sudo rm -rf /tmp/zealtmp
|
2021-10-31 09:09:00 +00:00
|
|
|
sudo qemu-nbd -d /dev/nbd0
|
|
|
|
echo "unmounted hdd"
|
|
|
|
echo "set perms"
|
|
|
|
sudo chown -R $USER:$USER ../src/*
|
2021-11-01 00:04:05 +00:00
|
|
|
mv ../src/Tmp/AUTO.ISO.C ./AUTO.ISO
|
2021-10-31 09:09:00 +00:00
|
|
|
echo "finished."
|
2021-11-30 05:27:25 +00:00
|
|
|
git status
|