even further echo cleanup

This commit is contained in:
Jack
2020-05-13 06:44:19 +03:00
parent a0355f6d29
commit 371b8765f1
+10 -10
View File
@@ -272,7 +272,7 @@ if [[ -z "${vbox_version}" || -z "${vbox_version:2:1}" ]]; then
exit exit
elif [[ ! ( "${vbox_version:0:1}" -gt 5 elif [[ ! ( "${vbox_version:0:1}" -gt 5
|| "${vbox_version:0:3}" =~ 5\.2 ) ]]; then || "${vbox_version:0:3}" =~ 5\.2 ) ]]; then
echo $'\n'"Please make sure VirtualBox version 5.2 or higher is installed." echo -e "\nPlease make sure VirtualBox version 5.2 or higher is installed."
echo "Exiting." echo "Exiting."
exit exit
elif [[ "${vbox_version:0:1}" = 5 ]]; then elif [[ "${vbox_version:0:1}" = 5 ]]; then
@@ -325,7 +325,7 @@ if [[ "${macOS_release_name:0:1}" =~ [Cc] ]]; then
"${vbox_version}" =~ ^6\.1\.[4-9] || "${vbox_version}" =~ ^6\.1\.[4-9] ||
"${vbox_version}" =~ ^6\.1\.[123][0-9] || "${vbox_version}" =~ ^6\.1\.[123][0-9] ||
"${vbox_version}" =~ ^6\.[2-9] ) ]]; then "${vbox_version}" =~ ^6\.[2-9] ) ]]; then
echo $'\n'"macOS Catalina requires VirtualBox version 6.1.4 or higher." echo -e "\nmacOS Catalina requires VirtualBox version 6.1.4 or higher."
echo "Exiting." echo "Exiting."
exit exit
fi fi
@@ -399,7 +399,7 @@ fi
function prepare_macos_installation_files() { function prepare_macos_installation_files() {
print_dimly "stage: prepare_macos_installation_files" print_dimly "stage: prepare_macos_installation_files"
# Find the correct download URL in the Apple catalog # Find the correct download URL in the Apple catalog
echo $'\n'"Downloading Apple macOS ${macOS_release_name} software update catalog" echo -e "\nDownloading Apple macOS ${macOS_release_name} software update catalog"
wget "${sucatalog}" \ wget "${sucatalog}" \
${wgetargs} \ ${wgetargs} \
--output-document="${macOS_release_name}_sucatalog" --output-document="${macOS_release_name}_sucatalog"
@@ -449,13 +449,13 @@ for filename in "BaseSystem.chunklist" \
--output-document "${macOS_release_name}_${filename}" --output-document "${macOS_release_name}_${filename}"
done done
echo $'\n'"Splitting the several-GB InstallESDDmg.pkg into 1GB parts because" echo -e "\nSplitting the several-GB InstallESDDmg.pkg into 1GB parts because"
echo "VirtualBox hasn't implemented UDF/HFS VISO support yet and macOS" echo "VirtualBox hasn't implemented UDF/HFS VISO support yet and macOS"
echo "doesn't support ISO 9660 Level 3 with files larger than 2GB." echo "doesn't support ISO 9660 Level 3 with files larger than 2GB."
split --verbose -a 2 -d -b 1000000000 "${macOS_release_name}_InstallESDDmg.pkg" "${macOS_release_name}_InstallESD.part" split --verbose -a 2 -d -b 1000000000 "${macOS_release_name}_InstallESDDmg.pkg" "${macOS_release_name}_InstallESD.part"
if [[ ! -s "ApfsDriverLoader.efi" ]]; then if [[ ! -s "ApfsDriverLoader.efi" ]]; then
echo $'\n'"Downloading open-source APFS EFI drivers used for VirtualBox 6.0 and 5.2" echo -e "\nDownloading open-source APFS EFI drivers used for VirtualBox 6.0 and 5.2"
[[ "${vbox_version:0:1}" -gt 6 || ( "${vbox_version:0:1}" = 6 && "${vbox_version:2:1}" -ge 1 ) ]] && echo "...even though VirtualBox version 6.1 or higher is detected." [[ "${vbox_version:0:1}" -gt 6 || ( "${vbox_version:0:1}" = 6 && "${vbox_version:2:1}" -ge 1 ) ]] && echo "...even though VirtualBox version 6.1 or higher is detected."
wget 'https://github.com/acidanthera/AppleSupportPkg/releases/download/2.0.4/AppleSupport-v2.0.4-RELEASE.zip' \ wget 'https://github.com/acidanthera/AppleSupportPkg/releases/download/2.0.4/AppleSupport-v2.0.4-RELEASE.zip' \
${wgetargs} \ ${wgetargs} \
@@ -580,8 +580,8 @@ for %a run (1 5)
endif endif
endfor' >> "${vm_name}_startup.nsh" endfor' >> "${vm_name}_startup.nsh"
echo $'\n'"Creating VirtualBox 6 virtual ISO containing the" echo -e "\nCreating VirtualBox 6 virtual ISO containing the"
echo "installation files from swcdn.apple.com"$'\n' echo -e "installation files from swcdn.apple.com\n"
pseudouuid="$(od -tx -N16 /dev/urandom | xxd -r | xxd -p)" pseudouuid="$(od -tx -N16 /dev/urandom | xxd -r | xxd -p)"
pseudouuid="${pseudouuid:0:8}-${pseudouuid:8:4}-${pseudouuid:12:4}-${pseudouuid:16:4}-${pseudouuid:20:12}" pseudouuid="${pseudouuid:0:8}-${pseudouuid:8:4}-${pseudouuid:12:4}-${pseudouuid:16:4}-${pseudouuid:20:12}"
echo "--iprt-iso-maker-file-marker-bourne-sh ${pseudouuid} echo "--iprt-iso-maker-file-marker-bourne-sh ${pseudouuid}
@@ -629,7 +629,7 @@ print_dimly "stage: create_basesystem_vdi"
if [[ -s "${macOS_release_name}_BaseSystem.vdi" ]]; then if [[ -s "${macOS_release_name}_BaseSystem.vdi" ]]; then
echo "${macOS_release_name}_BaseSystem.vdi bootstrap virtual disk image exists." echo "${macOS_release_name}_BaseSystem.vdi bootstrap virtual disk image exists."
elif [[ ! -s "${macOS_release_name}_BaseSystem.dmg" ]]; then elif [[ ! -s "${macOS_release_name}_BaseSystem.dmg" ]]; then
echo $'\n'"Could not find ${macOS_release_name}_BaseSystem.dmg; exiting." echo -e "\nCould not find ${macOS_release_name}_BaseSystem.dmg; exiting."
exit exit
else else
local failed='' local failed=''
@@ -873,9 +873,9 @@ echo "The VM will boot from the populated installer base system virtual disk."
prompt_lang_utils prompt_lang_utils
prompt_terminal_ready prompt_terminal_ready
add_another_terminal add_another_terminal
echo $'\n'"The second open Terminal in the virtual machine copies EFI and NVRAM files" echo -e "\nThe second open Terminal in the virtual machine copies EFI and NVRAM files"
echo "to the target EFI system partition when the installer finishes preparing." echo "to the target EFI system partition when the installer finishes preparing."
echo $'\n'"After the installer finishes preparing and the EFI and NVRAM files are copied," echo -e "\nAfter the installer finishes preparing and the EFI and NVRAM files are copied,"
echo "macOS will install and run when booting the target disk."$'\n' echo "macOS will install and run when booting the target disk."$'\n'
# run script concurrently, catch SIGUSR1 when installer finishes preparing # run script concurrently, catch SIGUSR1 when installer finishes preparing
kbstring='disks="$(diskutil list | grep -o "[0-9][^ ]* GB *disk[0-9]$" | sort -gr | grep -o disk[0-9])" && '\ kbstring='disks="$(diskutil list | grep -o "[0-9][^ ]* GB *disk[0-9]$" | sort -gr | grep -o disk[0-9])" && '\