removed checks from prepare_macos_installation_files

This commit is contained in:
Jack
2020-02-02 08:04:21 +02:00
parent 1414395c77
commit 188d14fcbd
+22 -26
View File
@@ -2,7 +2,7 @@
# Semi-automatic installer of macOS on VirtualBox # Semi-automatic installer of macOS on VirtualBox
# (c) myspaghetti, licensed under GPL2.0 or higher # (c) myspaghetti, licensed under GPL2.0 or higher
# url: https://github.com/myspaghetti/macos-guest-virtualbox # url: https://github.com/myspaghetti/macos-guest-virtualbox
# version 0.85.4 # version 0.85.5
# Requirements: 40GB available storage on host # Requirements: 40GB available storage on host
# Dependencies: bash >= 4.3, xxd, gzip, unzip, wget, dmg2img, # Dependencies: bash >= 4.3, xxd, gzip, unzip, wget, dmg2img,
@@ -354,31 +354,30 @@ 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
if [[ ! ( -s "${macOS_release_name}_BaseSystem.chunklist" && -s "${macOS_release_name}_InstallInfo.plist" && -s "${macOS_release_name}_AppleDiagnostics.dmg" && -s "${macOS_release_name}_AppleDiagnostics.chunklist" && -s "${macOS_release_name}_BaseSystem.dmg" && -s "${macOS_release_name}_InstallESDDmg.pkg" ) ]]; then echo ""
echo "" echo "Downloading Apple macOS ${macOS_release_name} software update catalog"
echo "Downloading 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"
# if file was not downloaded correctly # if file was not downloaded correctly
if [ ! -s "${macOS_release_name}_sucatalog" ]; then if [ ! -s "${macOS_release_name}_sucatalog" ]; then
wget --debug -O /dev/null -o "${macOS_release_name}_wget.log" "${sucatalog}" wget --debug -O /dev/null -o "${macOS_release_name}_wget.log" "${sucatalog}"
echo "" echo ""
echo "Couldn't download the Apple software update catalog." echo "Couldn't download the Apple software update catalog."
if [ "$(expr match "$(cat "${macOS_release_name}_wget.log")" '.*ERROR[[:print:]]*is not trusted')" -gt "0" ]; then if [ "$(expr match "$(cat "${macOS_release_name}_wget.log")" '.*ERROR[[:print:]]*is not trusted')" -gt "0" ]; then
printf ' printf '
Make sure certificates from a certificate authority are installed. Make sure certificates from a certificate authority are installed.
Certificates are often installed through the package manager with Certificates are often installed through the package manager with
a package named '"${highlight_color}"'ca-certificates'"${default_color}" a package named '"${highlight_color}"'ca-certificates'"${default_color}"
fi fi
echo "Exiting." echo "Exiting."
exit exit
fi fi
echo "Trying to find macOS ${macOS_release_name} InstallAssistant download URL" echo "Trying to find macOS ${macOS_release_name} InstallAssistant download URL"
tac "${macOS_release_name}_sucatalog" | csplit - '/InstallAssistantAuto.smd/+1' '{*}' -f "${macOS_release_name}_sucatalog_" -s tac "${macOS_release_name}_sucatalog" | csplit - '/InstallAssistantAuto.smd/+1' '{*}' -f "${macOS_release_name}_sucatalog_" -s
for catalog in "${macOS_release_name}_sucatalog_"* "error"; do for catalog in "${macOS_release_name}_sucatalog_"* "error"; do
if [[ "${catalog}" == error ]]; then if [[ "${catalog}" == error ]]; then
rm "${macOS_release_name}_sucatalog"* rm "${macOS_release_name}_sucatalog"*
printf "Couldn't find the requested download URL in the Apple catalog. Exiting." printf "Couldn't find the requested download URL in the Apple catalog. Exiting."
@@ -396,9 +395,9 @@ if [[ ! ( -s "${macOS_release_name}_BaseSystem.chunklist" && -s "${macOS_release
rm "${macOS_release_name}_sucatalog"* rm "${macOS_release_name}_sucatalog"*
break break
fi fi
done done
echo "Downloading macOS installation files from swcdn.apple.com" echo "Downloading macOS installation files from swcdn.apple.com"
for filename in "BaseSystem.chunklist" \ for filename in "BaseSystem.chunklist" \
"InstallInfo.plist" \ "InstallInfo.plist" \
"AppleDiagnostics.dmg" \ "AppleDiagnostics.dmg" \
"AppleDiagnostics.chunklist" \ "AppleDiagnostics.chunklist" \
@@ -407,16 +406,13 @@ if [[ ! ( -s "${macOS_release_name}_BaseSystem.chunklist" && -s "${macOS_release
do wget "${urlbase}${filename}" \ do wget "${urlbase}${filename}" \
${wgetargs} \ ${wgetargs} \
--output-document "${macOS_release_name}_${filename}" --output-document "${macOS_release_name}_${filename}"
done done
fi
if [ ! -s "${macOS_release_name}_InstallESD.part00" ]; then echo ""
echo "" echo "Splitting the several-GB InstallESDDmg.pkg into 1GB parts because"
echo "Splitting 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"
fi
if [[ ! -s "ApfsDriverLoader.efi" ]]; then if [[ ! -s "ApfsDriverLoader.efi" ]]; then
echo "" echo ""