ZealOS/build/sync_vm.sh

30 lines
774 B
Bash
Raw Normal View History

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 repo --> VM
2021-11-01 00:04:05 +00:00
# (copy src/ to VM. Kernel code changes won't be reflected in VM until running BootHDIns; to recompile kernel.)
# Run this script inside build/ directory
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
sudo mount /dev/nbd0p1 /mnt
echo "Merging with src/"
sudo cp -r ../src/* /mnt/
sudo sync
echo "Files copied, unmounting"
sudo umount /mnt
sudo qemu-nbd -d /dev/nbd0
sudo rm /mnt/* -r
sudo sync
echo "finished."
git status