terrabyte and petabyte workaround

This commit is contained in:
My Spaghetti
2020-11-05 14:37:27 +02:00
parent 5f13e2a80e
commit 51c272deb5
+4 -4
View File
@@ -2,7 +2,7 @@
# Push-button installer of macOS on VirtualBox
# (c) myspaghetti, licensed under GPL2.0 or higher
# url: https://github.com/myspaghetti/macos-virtualbox
# version 0.97.6
# version 0.97.7
# Dependencies: bash coreutils gzip unzip wget xxd dmg2img
# Optional features: tesseract-ocr tesseract-ocr-eng
@@ -763,7 +763,7 @@ echo "/bootinst.sh=\"${vm_name}_bootinst.txt\"" >> "${vm_name}_populate_bootable
# Partitining largest disk as APFS
# Partition second-largest disk as JHFS+
echo '# this script is executed on the macOS virtual machine' > "${vm_name}_bootinst.txt"
echo 'disks="$(diskutil list | grep -o "\*[0-9][^ ]* GB *disk[0-9]$" | grep -o "[0-9].*" | sort -gr | grep -o disk[0-9] )" && \
echo 'disks="$(diskutil list | grep -o "\*[0-9][^ ]* [GTP]B *disk[0-9]$" | sed -e "s/\.[0-9] T/000.0 T" -e "s/\.[0-9] P/000000.0 G" | grep -o "[0-9].*" | sort -gr | grep -o disk[0-9] )" && \
disks=(${disks[@]}) && \
if [ -z "${disks}" ]; then echo "Could not find disks"; fi && \
[ -n "${disks[0]}" ] && \
@@ -908,7 +908,7 @@ echo "/startosinstall.sh=\"${vm_name}_startosinstall.txt\"" >> "${vm_name}_popul
# execute script concurrently, catch SIGUSR1 when installer finishes preparing
echo '# this script is executed on the macOS virtual machine' > "${vm_name}_configure_nvram.txt"
echo 'printf '"'"'trap "exit 0" SIGUSR1; while true; do sleep 10; done;'"'"' | sh && \
disks="$(diskutil list | grep -o "[0-9][^ ]* GB *disk[0-9]$" | sort -gr | grep -o disk[0-9])" && \
disks="$(diskutil list | grep -o "[0-9][^ ]* [GTP]B *disk[0-9]$" | sed -e "s/\.[0-9] T/000.0 G/" -e "s/\.[0-9] P/000000.0 G/" | sort -gr | grep -o disk[0-9])" && \
disks=(${disks[@]}) && \
mkdir -p "/Volumes/'"${vm_name}"'/tmp/mount_efi" && \
mount_msdos /dev/${disks[0]}s1 "/Volumes/'"${vm_name}"'/tmp/mount_efi" && \
@@ -922,7 +922,7 @@ kill -SIGUSR1 ${installer_pid}' > "${vm_name}_configure_nvram.txt"
echo '# this script is executed on the macOS virtual machine' > "${vm_name}_startosinstall.txt"
echo 'background_pid="$(ps | grep '"'"' sh$'"'"' | cut -d '"'"' '"'"' -f 3)" && \
[[ "${background_pid}" =~ ^[0-9][0-9]*$ ]] && \
disks="$(diskutil list | grep -o "[0-9][^ ]* GB *disk[0-9]$" | sort -gr | grep -o disk[0-9])" && \
disks="$(diskutil list | grep -o "[0-9][^ ]* [GTP]B *disk[0-9]$" | sed -e "s/\.[0-9] T/000.0 G/" -e "s/\.[0-9] P/000000.0 G/" | sort -gr | grep -o disk[0-9])" && \
disks=(${disks[@]}) && \
[ -n "${disks[0]}" ] && \
diskutil partitionDisk "/dev/${disks[0]}" 1 GPT APFS "'"${vm_name}"'" R && \