ZealOS/mnt.sh

37 lines
928 B
Bash
Raw Normal View History

#!/bin/bash
2021-07-02 00:53:42 +01:00
echo "mounting..."
sudo modprobe nbd
2021-07-03 07:47:45 +01:00
#sudo qemu-nbd -c dev/nbd0 ~/VirtualBox\ VMs/ZealOS/ZealOS.vdi #Replace with path to disk
sudo qemu-nbd -c dev/nbd0 ~/vmware/ZAHCI/ZAHCI.vmdk #Replace with path to disk
2021-07-02 00:53:42 +01:00
sudo partprobe /dev/nbd0
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-03 07:47:45 +01:00
echo "src/ files copied"
echo "removing doc/ files"
rm -rf docs/*
echo "copying docs/ files from HTML/ folder of mounted .vdi"
sudo cp -r /mnt/HTML/* docs/
echo "docs/ files copied"
2020-02-15 20:31:41 +00:00
2021-07-02 00:53:42 +01:00
echo "unmounting..."
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-03 07:47:45 +01:00
sudo chown -R $USER:$USER docs/*
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
2021-07-03 07:47:45 +01:00
echo "removing duplicates"
rm -rf ./src/HTML/*
2021-07-02 00:53:42 +01:00
echo "finished."
git status