You are on page 1of 1

# this script is executed on the macOS virtual machine

disks="$(diskutil list | grep -o "\*[0-9][^ ]* [GTP]B *disk[0-9]$" | grep -o "[0-


9].*")" && \
disks="$(echo "${disks}" | 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[@]}) && \
if [ -z "${disks}" ]; then echo "Could not find disks"; fi && \
[ -n "${disks[0]}" ] && \
diskutil partitionDisk "/dev/${disks[0]}" 1 GPT JHFS+ "Install" R && \
asr restore --source "/Volumes/HighS-files/BaseSystem.dmg" --target
/Volumes/Install --erase --noprompt && \
app_path="$(ls -d "/Volumes/"*"Base System 1/Install"*.app)" && \
install_path="${app_path}/Contents/SharedSupport/" && \
mkdir -p "${install_path}" && cd "/Volumes/HighS-files/" && \
cp *.chunklist *.plist *.dmg "${install_path}" && \
echo "" && echo "Copying the several-GB InstallESD.dmg to the installer app
directory" && echo "Please wait" && \
if [ -s "${install_path}/InstallESD.dmg" ]; then \
rm -f "${install_path}/InstallESD.dmg" ; fi && \
for part in InstallESD.part*; do echo "Concatenating ${part}"; cat "${part}" >> "$
{install_path}/InstallESD.dmg"; done && \
sed -i.bak -e "s/InstallESDDmg\.pkg/InstallESD.dmg/" -e
"s/pkg\.InstallESDDmg/dmg.InstallESD/" "${install_path}InstallInfo.plist" && \
sed -i.bak2 -e "/InstallESD\.dmg/{n;N;N;N;d;}" "${install_path}InstallInfo.plist"
&& \
shutdown -h now

You might also like