2021-06-14 14:41:07 +00:00
cp bin/kernel img/boot/exe
2020-09-29 01:03:48 +00:00
echo "Performing post-build actions:"
2020-09-29 00:36:05 +00:00
echo "Creating raw img file for writing to a drive:"
2021-06-14 14:41:07 +00:00
mkdir -p bin/img
./tools/mkbootimg/mkbootimg.exe chroma.json bin/img/chroma.img # for linux remove the .exe
2020-09-29 00:36:05 +00:00
echo "Checking for VirtualBox management tools"
2021-06-16 20:05:16 +00:00
if [ -x " $( command -v VBoxManage) " ] && [ $# -eq 0 ] ; then
2020-09-29 00:36:05 +00:00
echo " VBoxManage found.. integrating."
echo " Clearing VirtualBox cache:"
VBoxManage storageattach Chroma --port 0 --storagectl AHCI --medium none # removing a drive in virtualbox = attaching nothing
2021-06-14 14:41:07 +00:00
VBoxManage closemedium disk --delete "`pwd`/bin/img/chroma.vdi" # remove the existing .vdi image from the registry so we can overwrite it
2020-09-29 00:36:05 +00:00
echo " Creating new VirtualBox VDI image:"
2021-06-14 14:41:07 +00:00
VBoxManage convertfromraw bin/img/chroma.img --format VDI bin/img/chroma.vdi # generate the new vdi from the img
2020-09-29 00:36:05 +00:00
echo " Attaching image to the VM."
2021-06-14 14:41:07 +00:00
VBoxManage storageattach Chroma --port 0 --storagectl AHCI --type hdd --medium "`pwd`/bin/img/chroma.vdi" # attach the new vdi to the vm so we can run it
2020-09-29 00:36:05 +00:00
echo " VirtualBox integrations complete. You may execute run.sh to run your VirtualBox VM."
2021-06-16 20:05:16 +00:00
else
echo " VBoxManage not found or skipped."
2020-09-29 00:36:05 +00:00
fi