absolute paths which might be good in general

This commit is contained in:
img2tab
2019-03-09 03:13:31 +00:00
committed by GitHub
parent 3c141f9476
commit dba7f499e9
+8 -8
View File
@@ -2,7 +2,7 @@
# One-key semi-automatic installer of macOS on VirtualBox # One-key semi-automatic installer of macOS on VirtualBox
# (c) img2tab, licensed under GPL2.0 or higher # (c) img2tab, licensed under GPL2.0 or higher
# url: https://github.com/img2tab/macos-guest-virtualbox # url: https://github.com/img2tab/macos-guest-virtualbox
# version 0.44 # version 0.45
# Requirements: 33.5GB available storage on host # Requirements: 33.5GB available storage on host
# Dependencies: bash>=4.0, unzip, wget, dmg2img, # Dependencies: bash>=4.0, unzip, wget, dmg2img,
@@ -104,7 +104,7 @@ if [ -z "$(dmg2img -d 2>/dev/null)" ]; then
if [ -z "$(cygcheck -V 2>/dev/null)" ]; then if [ -z "$(cygcheck -V 2>/dev/null)" ]; then
echo "Please install the package dmg2img." echo "Please install the package dmg2img."
exit exit
else elif [ -z "$(${PWD}/dmg2img -d 2>/dev/null)" ]; then
echo "Locally installing dmg2img" echo "Locally installing dmg2img"
wget -c "http://vu1tur.eu.org/tools/dmg2img-1.6.6-win32.zip" \ wget -c "http://vu1tur.eu.org/tools/dmg2img-1.6.6-win32.zip" \
-O "dmg2img-1.6.6-win32.zip" --quiet -O "dmg2img-1.6.6-win32.zip" --quiet
@@ -170,7 +170,7 @@ or http://swscan.apple.com/content/catalogs/others/
fi fi
echo "Downloaded BaseSystem.dmg. Converting to BaseSystem.img" echo "Downloaded BaseSystem.dmg. Converting to BaseSystem.img"
dmg2img "BaseSystem.dmg" "BaseSystem.img" dmg2img "BaseSystem.dmg" "BaseSystem.img"
VBoxManage convertfromraw --format VDI "BaseSystem.img" "BaseSystem.vdi" VBoxManage convertfromraw --format VDI "${PWD}/BaseSystem.img" "${PWD}/BaseSystem.vdi"
rm "BaseSystem.dmg" "BaseSystem.img" rm "BaseSystem.dmg" "BaseSystem.img"
fi fi
} }
@@ -186,7 +186,7 @@ elif [ "${storagesize}" -lt 22000 ]; then
else else
echo "Creating ${vmname} target system virtual disk image." echo "Creating ${vmname} target system virtual disk image."
VBoxManage createmedium --size="${storagesize}" \ VBoxManage createmedium --size="${storagesize}" \
--filename "${vmname}.vdi" \ --filename "${PWD}/${vmname}.vdi" \
--variant standard 2>/dev/tty --variant standard 2>/dev/tty
fi fi
} }
@@ -198,7 +198,7 @@ if [ -r "Install ${vmname}.vdi" ]; then
else else
echo "Creating ${vmname} installation media virtual disk image." echo "Creating ${vmname} installation media virtual disk image."
VBoxManage createmedium --size=8000 \ VBoxManage createmedium --size=8000 \
--filename "Install ${vmname}.vdi" \ --filename "${PWD}/Install ${vmname}.vdi" \
--variant fixed 2>/dev/tty --variant fixed 2>/dev/tty
fi fi
} }
@@ -208,11 +208,11 @@ fi
function attach_initial_storage() { function attach_initial_storage() {
VBoxManage storagectl "${vmname}" --add sata --name SATA --hostiocache on VBoxManage storagectl "${vmname}" --add sata --name SATA --hostiocache on
VBoxManage storageattach "${vmname}" --storagectl SATA --port 0 \ VBoxManage storageattach "${vmname}" --storagectl SATA --port 0 \
--type hdd --nonrotational on --medium "${vmname}.vdi" --type hdd --nonrotational on --medium "${PWD}/${vmname}.vdi"
VBoxManage storageattach "${vmname}" --storagectl SATA --port 1 \ VBoxManage storageattach "${vmname}" --storagectl SATA --port 1 \
--type hdd --nonrotational on --medium "Install ${vmname}.vdi" --type hdd --nonrotational on --medium "${PWD}/Install ${vmname}.vdi"
VBoxManage storageattach "${vmname}" --storagectl SATA --port 2 \ VBoxManage storageattach "${vmname}" --storagectl SATA --port 2 \
--type hdd --nonrotational on --medium BaseSystem.vdi --type hdd --nonrotational on --medium "${PWD}/BaseSystem.vdi"
} }
# Configure the VM # Configure the VM