&& tee -a Launch.sh <<<'-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=${BOOTDISK:-/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2} \'\
&& tee -a Launch.sh <<<'-device ide-hd,bus=sata.2,drive=OpenCoreBoot \'\
&& tee -a Launch.sh <<<'-device ide-hd,bus=sata.3,drive=InstallMedia \'\
&& tee -a Launch.sh <<<'-drive id=InstallMedia,if=none,file=/home/arch/OSX-KVM/BaseSystem.img,format=raw \' \
&& tee -a Launch.sh <<<'-drive id=InstallMedia,if=none,file=/home/arch/OSX-KVM/BaseSystem.img,format=${BASESYSTEM_FORMAT} \' \
&& tee -a Launch.sh <<<'-drive id=MacHDD,if=none,file=${IMAGE_PATH:-/home/arch/OSX-KVM/mac_hdd_ng.img},format=${IMAGE_FORMAT:-qcow2} \'\
&& tee -a Launch.sh <<<'-device ide-hd,bus=sata.4,drive=MacHDD \'\
&& tee -a Launch.sh <<<'-netdev user,id=net0,hostfwd=tcp::${INTERNAL_SSH_PORT:-10022}-:22,hostfwd=tcp::${SCREEN_SHARE_PORT:-5900}-:5900,${ADDITIONAL_PORTS} \'\
# RUN git clone --recurse-submodules --depth 1 --branch "${BRANCH}" "${REPO}"
RUN git clone --recurse-submodules --depth 1 --branch "${BRANCH}""${REPO}"
RUN touch Launch.sh \
&& chmod +x ./Launch.sh \
&& tee -a Launch.sh <<<'#!/bin/bash'\
&& tee -a Launch.sh <<<'set -eux'\
&& tee -a Launch.sh <<<'sudo chown $(id -u):$(id -g) /dev/kvm 2>/dev/null || true'\
&& tee -a Launch.sh <<<'sudo chown -R $(id -u):$(id -g) /dev/snd 2>/dev/null || true'\
&& tee -a Launch.sh <<<'[[ "${RAM}" = max ]] && export RAM="$(("$(head -n1 /proc/meminfo | tr -dc "[:digit:]") / 1000000"))"'\
&& tee -a Launch.sh <<<'[[ "${RAM}" = half ]] && export RAM="$(("$(head -n1 /proc/meminfo | tr -dc "[:digit:]") / 2000000"))"'\
&& tee -a Launch.sh <<<'sudo chown -R $(id -u):$(id -g) /dev/snd 2>/dev/null || true'\
&& tee -a Launch.sh <<<'exec qemu-system-x86_64 -m ${RAM:-2}000 \'\
&& tee -a Launch.sh <<<'-cpu ${CPU:-Penryn},${CPUID_FLAGS:-vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check,}${BOOT_ARGS} \'\
&& tee -a Launch.sh <<<'-machine q35,${KVM-"accel=kvm:tcg"} \'\
&& tee -a Launch.sh <<<'-smp ${CPU_STRING:-${SMP:-4},cores=${CORES:-4}} \'\
&& tee -a Launch.sh <<<'-usb -device usb-kbd -device usb-tablet \'\
&& tee -a Launch.sh <<<'-device isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal\(c\)AppleComputerInc \'\
&& tee -a Launch.sh <<<'-drive if=pflash,format=raw,readonly=on,file=/home/arch/OSX-KVM/OVMF_CODE.fd \'\
&& tee -a Launch.sh <<<'-drive if=pflash,format=raw,file=/home/arch/OSX-KVM/OVMF_VARS-1024x768.fd \'\
&& tee -a Launch.sh <<<'-smbios type=2 \'\
&& tee -a Launch.sh <<<'-audiodev ${AUDIO_DRIVER:-alsa},id=hda -device ich9-intel-hda -device hda-duplex,audiodev=hda \'\
&& tee -a Launch.sh <<<'-device ich9-ahci,id=sata \'\
&& tee -a Launch.sh <<<'-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=${BOOTDISK:-/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2} \'\
&& tee -a Launch.sh <<<'-device ide-hd,bus=sata.2,drive=OpenCoreBoot \'\
&& tee -a Launch.sh <<<'-device ide-hd,bus=sata.3,drive=InstallMedia \'\
&& tee -a Launch.sh <<<'-drive id=InstallMedia,if=none,file=/home/arch/OSX-KVM/BaseSystem.img,format=${BASESYSTEM_FORMAT} \'\
&& tee -a Launch.sh <<<'-drive id=MacHDD,if=none,file=${IMAGE_PATH:-/home/arch/OSX-KVM/mac_hdd_ng.img},format=${IMAGE_FORMAT:-qcow2} \'\
&& tee -a Launch.sh <<<'-device ide-hd,bus=sata.4,drive=MacHDD \'\
&& tee -a Launch.sh <<<'-netdev user,id=net0,hostfwd=tcp::${INTERNAL_SSH_PORT:-10022}-:22,hostfwd=tcp::${SCREEN_SHARE_PORT:-5900}-:5900,${ADDITIONAL_PORTS} \'\
&& tee -a Launch.sh <<<'-device ${NETWORKING:-vmxnet3},netdev=net0,id=net0,mac=${MAC_ADDRESS:-52:54:00:09:49:17} \'\