Skip to content

Commit

Permalink
Modify scripts to use bash arrays
Browse files Browse the repository at this point in the history
This makes it easier to comment out and replace the various arguments.

All the scripts were checked with shellcheck.
  • Loading branch information
zimbatm authored and kholia committed Aug 23, 2020
1 parent ca9e6f3 commit 238f0bc
Show file tree
Hide file tree
Showing 9 changed files with 197 additions and 164 deletions.
55 changes: 29 additions & 26 deletions OpenCore-BS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,32 @@ CPU_THREADS="4"
REPO_PATH="./"
OVMF_DIR="."

# This causes high cpu usage on the *host* side
# qemu-system-x86_64 -enable-kvm -m 3072 -cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,hypervisor=off,vmx=on,kvm=off,$MY_OPTIONS\


qemu-system-x86_64 -enable-kvm -m "$ALLOCATED_RAM" -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,$MY_OPTIONS\
-machine q35 -usb \
-smp "$CPU_THREADS",cores="$CPU_CORES",sockets="$CPU_SOCKETS" \
-device usb-ehci,id=ehci \
-device usb-kbd,bus=ehci.0 \
-device usb-mouse,bus=ehci.0 \
-device nec-usb-xhci,id=xhci \
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
-drive if=pflash,format=raw,readonly,file="$REPO_PATH/$OVMF_DIR/OVMF_CODE.fd" \
-drive if=pflash,format=raw,file="$REPO_PATH/$OVMF_DIR/OVMF_VARS-1024x768.fd" \
-smbios type=2 \
-device ich9-intel-hda -device hda-duplex \
-device ich9-ahci,id=sata \
-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=$REPO_PATH/'OpenCore-BS/OpenCore.qcow2' \
-device ide-hd,bus=sata.2,drive=OpenCoreBoot \
-device ide-hd,bus=sata.3,drive=InstallMedia \
-drive id=InstallMedia,if=none,file=$REPO_PATH/BaseSystem-BS.img,format=raw \
-drive id=MacHDD,if=none,file=$REPO_PATH/mac_hdd_ng.img,format=qcow2 \
-device ide-hd,bus=sata.4,drive=MacHDD \
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
-monitor stdio \
-vga vmware
# shellcheck disable=SC2054
args=(
# This causes high cpu usage on the *host* side
# -enable-kvm -m 3072 -cpu # Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,hypervisor=off,vmx=on,kvm=off,"$MY_OPTIONS"
-enable-kvm -m "$ALLOCATED_RAM" -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,"$MY_OPTIONS"
-machine q35 -usb
-smp "$CPU_THREADS",cores="$CPU_CORES",sockets="$CPU_SOCKETS"
-device usb-ehci,id=ehci
-device usb-kbd,bus=ehci.0
-device usb-mouse,bus=ehci.0
-device nec-usb-xhci,id=xhci
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
-drive if=pflash,format=raw,readonly,file="$REPO_PATH/$OVMF_DIR/OVMF_CODE.fd"
-drive if=pflash,format=raw,file="$REPO_PATH/$OVMF_DIR/OVMF_VARS-1024x768.fd"
-smbios type=2
-device ich9-intel-hda -device hda-duplex
-device ich9-ahci,id=sata
-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file="$REPO_PATH/OpenCore-BS/OpenCore.qcow2"
-device ide-hd,bus=sata.2,drive=OpenCoreBoot
-device ide-hd,bus=sata.3,drive=InstallMedia
-drive id=InstallMedia,if=none,file="$REPO_PATH/BaseSystem-BS.img",format=raw
-drive id=MacHDD,if=none,file="$REPO_PATH/mac_hdd_ng.img",format=qcow2
-device ide-hd,bus=sata.4,drive=MacHDD
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27
-monitor stdio
-vga vmware
)

qemu-system-x86_64 "${args[@]}"
55 changes: 29 additions & 26 deletions OpenCore-Boot-CD.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,32 @@ CPU_THREADS="4"
REPO_PATH="./"
OVMF_DIR="."

# This causes high cpu usage on the *host* side
# qemu-system-x86_64 -enable-kvm -m 3072 -cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,hypervisor=off,vmx=on,kvm=off,$MY_OPTIONS\


qemu-system-x86_64 -enable-kvm -m "$ALLOCATED_RAM" -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,$MY_OPTIONS\
-machine q35 -usb \
-smp "$CPU_THREADS",cores="$CPU_CORES",sockets="$CPU_SOCKETS" \
-device usb-ehci,id=ehci \
-device usb-kbd,bus=ehci.0 \
-device usb-mouse,bus=ehci.0 \
-device nec-usb-xhci,id=xhci \
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
-drive if=pflash,format=raw,readonly,file="$REPO_PATH/$OVMF_DIR/OVMF_CODE.fd" \
-drive if=pflash,format=raw,file="$REPO_PATH/$OVMF_DIR/OVMF_VARS-1024x768.fd" \
-smbios type=2 \
-device ich9-intel-hda -device hda-duplex \
-device ich9-ahci,id=sata \
-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=$REPO_PATH/'OpenCore-Catalina/OpenCore.qcow2' \
-device ide-hd,bus=sata.2,drive=OpenCoreBoot \
-device ide-hd,bus=sata.3,drive=InstallMedia \
-drive id=InstallMedia,if=none,file=$REPO_PATH/os.dmg,format=raw \
-drive id=MacHDD,if=none,file=$REPO_PATH/mac_hdd_ng.img,format=qcow2 \
-device ide-hd,bus=sata.4,drive=MacHDD \
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
-monitor stdio \
-vga vmware
# shellcheck disable=SC2054
args=(
# This causes high cpu usage on the *host* side
# -enable-kvm -m 3072 -cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,hypervisor=off,vmx=on,kvm=off,$MY_OPTIONS\
-enable-kvm -m "$ALLOCATED_RAM" -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,"$MY_OPTIONS"
-machine q35 -usb
-smp "$CPU_THREADS",cores="$CPU_CORES",sockets="$CPU_SOCKETS"
-device usb-ehci,id=ehci
-device usb-kbd,bus=ehci.0
-device usb-mouse,bus=ehci.0
-device nec-usb-xhci,id=xhci
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
-drive if=pflash,format=raw,readonly,file="$REPO_PATH/$OVMF_DIR/OVMF_CODE.fd"
-drive if=pflash,format=raw,file="$REPO_PATH/$OVMF_DIR/OVMF_VARS-1024x768.fd"
-smbios type=2
-device ich9-intel-hda -device hda-duplex
-device ich9-ahci,id=sata
-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file="$REPO_PATH/OpenCore-Catalina/OpenCore.qcow2"
-device ide-hd,bus=sata.2,drive=OpenCoreBoot
-device ide-hd,bus=sata.3,drive=InstallMedia
-drive id=InstallMedia,if=none,file="$REPO_PATH/os.dmg",format=raw
-drive id=MacHDD,if=none,file="$REPO_PATH/mac_hdd_ng.img",format=qcow2
-device ide-hd,bus=sata.4,drive=MacHDD
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27
-monitor stdio
-vga vmware
)

qemu-system-x86_64 "${args[@]}"
50 changes: 27 additions & 23 deletions OpenCore-Boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,30 @@ OVMF_DIR="."
# This causes high cpu usage on the *host* side
# qemu-system-x86_64 -enable-kvm -m 3072 -cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,hypervisor=off,vmx=on,kvm=off,$MY_OPTIONS\


qemu-system-x86_64 -enable-kvm -m "$ALLOCATED_RAM" -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,$MY_OPTIONS\
-machine q35 -usb \
-smp "$CPU_THREADS",cores="$CPU_CORES",sockets="$CPU_SOCKETS" \
-device usb-ehci,id=ehci \
-device usb-kbd,bus=ehci.0 \
-device usb-mouse,bus=ehci.0 \
-device nec-usb-xhci,id=xhci \
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
-drive if=pflash,format=raw,readonly,file="$REPO_PATH/$OVMF_DIR/OVMF_CODE.fd" \
-drive if=pflash,format=raw,file="$REPO_PATH/$OVMF_DIR/OVMF_VARS-1024x768.fd" \
-smbios type=2 \
-device ich9-intel-hda -device hda-duplex \
-device ich9-ahci,id=sata \
-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=$REPO_PATH/'OpenCore-Catalina/OpenCore.qcow2' \
-device ide-hd,bus=sata.2,drive=OpenCoreBoot \
-device ide-hd,bus=sata.3,drive=InstallMedia \
-drive id=InstallMedia,if=none,file=$REPO_PATH/BaseSystem.img,format=raw \
-drive id=MacHDD,if=none,file=$REPO_PATH/mac_hdd_ng.img,format=qcow2 \
-device ide-hd,bus=sata.4,drive=MacHDD \
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
-monitor stdio \
-vga vmware
# shellcheck disable=SC2054
args=(
-enable-kvm -m "$ALLOCATED_RAM" -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,"$MY_OPTIONS"
-machine q35 -usb
-smp "$CPU_THREADS",cores="$CPU_CORES",sockets="$CPU_SOCKETS"
-device usb-ehci,id=ehci
-device usb-kbd,bus=ehci.0
-device usb-mouse,bus=ehci.0
-device nec-usb-xhci,id=xhci
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
-drive if=pflash,format=raw,readonly,file="$REPO_PATH/$OVMF_DIR/OVMF_CODE.fd"
-drive if=pflash,format=raw,file="$REPO_PATH/$OVMF_DIR/OVMF_VARS-1024x768.fd"
-smbios type=2
-device ich9-intel-hda -device hda-duplex
-device ich9-ahci,id=sata
-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file="$REPO_PATH/OpenCore-Catalina/OpenCore.qcow2"
-device ide-hd,bus=sata.2,drive=OpenCoreBoot
-device ide-hd,bus=sata.3,drive=InstallMedia
-drive id=InstallMedia,if=none,file="$REPO_PATH/BaseSystem.img",format=raw
-drive id=MacHDD,if=none,file="$REPO_PATH/mac_hdd_ng.img",format=qcow2
-device ide-hd,bus=sata.4,drive=MacHDD
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27
-monitor stdio
-vga vmware
)

qemu-system-x86_64 "${args[@]}"
46 changes: 25 additions & 21 deletions boot-macOS-Catalina.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,29 @@ MY_OPTIONS="+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check"
# OVMF=./firmware
OVMF="./backup"

# This causes high cpu usage on the *host* side
# qemu-system-x86_64 -enable-kvm -m 3072 -cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,hypervisor=off,vmx=on,kvm=off,$MY_OPTIONS\
# shellcheck disable=SC2054
args=(
# This causes high cpu usage on the *host* side
# -enable-kvm -m 3072 -cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,hypervisor=off,vmx=on,kvm=off,$MY_OPTIONS
-enable-kvm -m 3072 -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,"$MY_OPTIONS"
-machine q35
-smp 4,cores=2
-usb -device usb-kbd -device usb-mouse
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
-drive if=pflash,format=raw,readonly,file="$OVMF/OVMF_CODE.fd"
-drive if=pflash,format=raw,file="$OVMF/OVMF_VARS-1024x768.fd"
-smbios type=2
-device ich9-intel-hda -device hda-duplex
-device ich9-ahci,id=sata
-drive id=Clover,if=none,snapshot=on,format=qcow2,file=./'Catalina/CloverNG.qcow2'
-device ide-hd,bus=sata.2,drive=Clover
-device ide-hd,bus=sata.3,drive=InstallMedia
-drive id=InstallMedia,if=none,file=BaseSystem.img,format=raw
-drive id=MacHDD,if=none,file=./mac_hdd_ng.img,format=qcow2
-device ide-hd,bus=sata.4,drive=MacHDD
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27
-monitor stdio
-vga vmware
)

qemu-system-x86_64 -enable-kvm -m 3072 -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,$MY_OPTIONS\
-machine q35 \
-smp 4,cores=2 \
-usb -device usb-kbd -device usb-mouse \
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
-drive if=pflash,format=raw,readonly,file=$OVMF/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=$OVMF/OVMF_VARS-1024x768.fd \
-smbios type=2 \
-device ich9-intel-hda -device hda-duplex \
-device ich9-ahci,id=sata \
-drive id=Clover,if=none,snapshot=on,format=qcow2,file=./'Catalina/CloverNG.qcow2' \
-device ide-hd,bus=sata.2,drive=Clover \
-device ide-hd,bus=sata.3,drive=InstallMedia \
-drive id=InstallMedia,if=none,file=BaseSystem.img,format=raw \
-drive id=MacHDD,if=none,file=./mac_hdd_ng.img,format=qcow2 \
-device ide-hd,bus=sata.4,drive=MacHDD \
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
-monitor stdio \
-vga vmware
qemu-system-x86_64 "${args[@]}"
39 changes: 22 additions & 17 deletions boot-macOS-HS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,25 @@

MY_OPTIONS="+aes,+xsave,+avx,+xsaveopt,avx2,+smep"

qemu-system-x86_64 -enable-kvm -m 3072 -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,$MY_OPTIONS\
-machine pc-q35-2.9 \
-smp 4,cores=2 \
-usb -device usb-kbd -device usb-tablet \
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
-drive if=pflash,format=raw,readonly,file=OVMF_CODE.fd \
-drive if=pflash,format=raw,file=OVMF_VARS-1024x768.fd \
-smbios type=2 \
-device ich9-intel-hda -device hda-duplex \
-device ide-drive,bus=ide.2,drive=Clover \
-drive id=Clover,if=none,snapshot=on,format=qcow2,file=./'HighSierra/Clover.qcow2' \
-device ide-drive,bus=ide.1,drive=MacHDD \
-drive id=MacHDD,if=none,file=./mac_hdd.img,format=qcow2 \
-device ide-drive,bus=ide.0,drive=MacDVD \
-drive id=MacDVD,if=none,snapshot=on,media=cdrom,file=./'HighSierra-10.13.6.iso' \
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
-monitor stdio
# shellcheck disable=SC2054
args=(
-enable-kvm -m 3072 -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,"$MY_OPTIONS"
-machine pc-q35-2.9
-smp 4,cores=2
-usb -device usb-kbd -device usb-tablet
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
-drive if=pflash,format=raw,readonly,file=OVMF_CODE.fd
-drive if=pflash,format=raw,file=OVMF_VARS-1024x768.fd
-smbios type=2
-device ich9-intel-hda -device hda-duplex
-device ide-drive,bus=ide.2,drive=Clover
-drive id=Clover,if=none,snapshot=on,format=qcow2,file=./'HighSierra/Clover.qcow2'
-device ide-drive,bus=ide.1,drive=MacHDD
-drive id=MacHDD,if=none,file=./mac_hdd.img,format=qcow2
-device ide-drive,bus=ide.0,drive=MacDVD
-drive id=MacDVD,if=none,snapshot=on,media=cdrom,file=./'HighSierra-10.13.6.iso'
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:c9:18:27
-monitor stdio
)

qemu-system-x86_64 "${args[@]}"
39 changes: 22 additions & 17 deletions boot-macOS-Mojave.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,25 @@ OVMF="./backup"

MY_OPTIONS="+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check"

qemu-system-x86_64 -enable-kvm -m 3072 -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,$MY_OPTIONS\
-machine pc-q35-2.11 \
-smp 4,cores=2 \
-usb -device usb-kbd -device usb-tablet \
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
-drive if=pflash,format=raw,readonly,file=$OVMF/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=$OVMF/OVMF_VARS-1024x768.fd \
-smbios type=2 \
-device ich9-intel-hda -device hda-duplex \
-device ide-drive,bus=ide.2,drive=Clover \
-drive id=Clover,if=none,snapshot=on,format=qcow2,file=./'Mojave/Clover.qcow2' \
-device ide-drive,bus=ide.1,drive=MacHDD \
-drive id=MacHDD,if=none,file=./mac_hdd.img,format=qcow2 \
-device ide-drive,bus=ide.0,drive=MacDVD \
-drive id=MacDVD,if=none,snapshot=on,media=cdrom,file=./'Mojave-10.14.4.iso' \
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
-monitor stdio
# shellcheck disable=SC2054
args=(
-enable-kvm -m 3072 -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,"$MY_OPTIONS"
-machine pc-q35-2.11
-smp 4,cores=2
-usb -device usb-kbd -device usb-tablet
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
-drive if=pflash,format=raw,readonly,file="$OVMF/OVMF_CODE.fd"
-drive if=pflash,format=raw,file="$OVMF/OVMF_VARS-1024x768.fd"
-smbios type=2
-device ich9-intel-hda -device hda-duplex
-device ide-drive,bus=ide.2,drive=Clover
-drive id=Clover,if=none,snapshot=on,format=qcow2,file=./'Mojave/Clover.qcow2'
-device ide-drive,bus=ide.1,drive=MacHDD
-drive id=MacHDD,if=none,file=./mac_hdd.img,format=qcow2
-device ide-drive,bus=ide.0,drive=MacDVD
-drive id=MacDVD,if=none,snapshot=on,media=cdrom,file=./'Mojave-10.14.4.iso'
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27
-monitor stdio
)

qemu-system-x86_64 "${args[@]}"
43 changes: 24 additions & 19 deletions boot-macOS-NG.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,27 @@ MY_OPTIONS="+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check"
# OVMF=./firmware
OVMF="./backup"

qemu-system-x86_64 -enable-kvm -m 3072 -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,$MY_OPTIONS\
-machine q35 \
-smp 4,cores=2 \
-usb -device usb-kbd -device usb-tablet \
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
-drive if=pflash,format=raw,readonly,file=$OVMF/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=$OVMF/OVMF_VARS-1024x768.fd \
-smbios type=2 \
-device ich9-intel-hda -device hda-duplex \
-device ich9-ahci,id=sata \
-drive id=Clover,if=none,snapshot=on,format=qcow2,file=./'Mojave/CloverNG.qcow2' \
-device ide-hd,bus=sata.2,drive=Clover \
-device ide-hd,bus=sata.3,drive=InstallMedia \
-drive id=InstallMedia,if=none,file=BaseSystem.img,format=raw \
-drive id=MacHDD,if=none,file=./mac_hdd_ng.img,format=qcow2 \
-device ide-hd,bus=sata.4,drive=MacHDD \
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
-monitor stdio \
-vga vmware
# shellcheck disable=SC2054
args=(
-enable-kvm -m 3072 -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,"$MY_OPTIONS"
-machine q35
-smp 4,cores=2
-usb -device usb-kbd -device usb-tablet
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
-drive if=pflash,format=raw,readonly,file="$OVMF/OVMF_CODE.fd"
-drive if=pflash,format=raw,file="$OVMF/OVMF_VARS-1024x768.fd"
-smbios type=2
-device ich9-intel-hda -device hda-duplex
-device ich9-ahci,id=sata
-drive id=Clover,if=none,snapshot=on,format=qcow2,file=./'Mojave/CloverNG.qcow2'
-device ide-hd,bus=sata.2,drive=Clover
-device ide-hd,bus=sata.3,drive=InstallMedia
-drive id=InstallMedia,if=none,file=BaseSystem.img,format=raw
-drive id=MacHDD,if=none,file=./mac_hdd_ng.img,format=qcow2
-device ide-hd,bus=sata.4,drive=MacHDD
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27
-monitor stdio
-vga vmware
)

qemu-system-x86_64 "${args[@]}"
34 changes: 19 additions & 15 deletions boot-passthrough.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
#!/usr/bin/env bash

# shellcheck disable=SC2054
args=(
-enable-kvm -m 3072 -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on
-machine pc-q35-2.9
-smp 4,cores=2
-vga none
-device vfio-pci,host=01:00.0,bus=pcie.0,multifunction=on
-device vfio-pci,host=01:00.1,bus=pcie.0
-usb -device usb-kbd -device usb-tablet
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
-drive if=pflash,format=raw,readonly,file=OVMF_CODE.fd
-drive if=pflash,format=raw,file=OVMF_VARS.fd
-smbios type=2
-device ide-drive,bus=ide.2,drive=MacHDD
-drive id=MacHDD,if=none,file=./mac_hdd.img
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:c9:18:27
-monitor stdio
)

qemu-system-x86_64 -enable-kvm -m 3072 -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on \
-machine pc-q35-2.9 \
-smp 4,cores=2 \
-vga none \
-device vfio-pci,host=01:00.0,bus=pcie.0,multifunction=on \
-device vfio-pci,host=01:00.1,bus=pcie.0 \
-usb -device usb-kbd -device usb-tablet \
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
-drive if=pflash,format=raw,readonly,file=OVMF_CODE.fd \
-drive if=pflash,format=raw,file=OVMF_VARS.fd \
-smbios type=2 \
-device ide-drive,bus=ide.2,drive=MacHDD \
-drive id=MacHDD,if=none,file=./mac_hdd.img \
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
-monitor stdio
qemu-system-x86_64 "${args[@]}"
Empty file modified notes-for-self.md
100755 → 100644
Empty file.

0 comments on commit 238f0bc

Please sign in to comment.