diff options
| -rw-r--r-- | Dockerfile | 30 | ||||
| -rw-r--r-- | Dockerfile.auto | 12 | ||||
| -rw-r--r-- | Dockerfile.naked | 238 | ||||
| -rw-r--r-- | Dockerfile.naked-auto | 11 | ||||
| -rw-r--r-- | custom/config-nopicker-custom.plist | 689 | ||||
| -rwxr-xr-x | custom/generate-specific-bootdisk.sh | 21 | ||||
| -rwxr-xr-x | custom/generate-unique-machine-values.sh | 27 | ||||
| -rwxr-xr-x | custom/opencore-image-ng.sh | 28 |
8 files changed, 908 insertions, 148 deletions
@@ -145,9 +145,11 @@ WORKDIR /home/arch/OSX-KVM # RUN wget https://raw.githubusercontent.com/kholia/OSX-KVM/master/fetch-macOS-v2.py -ARG SHORTNAME +ARG SHORTNAME=catalina -RUN make +RUN make \ + && qemu-img convert BaseSystem.dmg -O qcow2 -p -c BaseSystem.img \ + && rm ./BaseSystem.dmg ARG LINUX=true @@ -185,7 +187,7 @@ RUN touch Launch.sh \ && 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} \' \ @@ -220,13 +222,18 @@ ENV KERNEL_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-5.12 ENV KERNEL_HEADERS_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-headers-5.12.14.arch1-1-x86_64.pkg.tar.zst ENV LIBGUESTFS_PACKAGE_URL=https://archive.archlinux.org/packages/l/libguestfs/libguestfs-1.44.1-6-x86_64.pkg.tar.zst +# fix ad hoc errors from using the arch museum to get libguestfs +RUN sudo sed -i -e 's/^\#RemoteFileSigLevel/RemoteFileSigLevel/g' /etc/pacman.conf + RUN sudo pacman -Syy \ && sudo pacman -Rns linux --noconfirm \ ; sudo pacman -S mkinitcpio --noconfirm \ - && sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm \ - && sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm \ + && sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm || exit 1 \ + && sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm || exit 1 \ && rm -rf /var/tmp/.guestfs-* \ - ; libguestfs-test-tool || exit 1 + && yes | sudo pacman -Scc \ + && libguestfs-test-tool || exit 1 \ + && rm -rf /var/tmp/.guestfs-* #### @@ -260,7 +267,8 @@ RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \ --mac-address "${STOCK_MAC_ADDRESS}" \ --width "${STOCK_WIDTH}" \ --height "${STOCK_HEIGHT}" \ - --output-bootdisk "${STOCK_BOOTDISK}" || exit 1 + --output-bootdisk "${STOCK_BOOTDISK}" || exit 1 \ + ; rm -rf /var/tmp/.guestfs-* RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \ --master-plist-url="${STOCK_MASTER_PLIST_URL_NOPICKER}" \ @@ -271,7 +279,8 @@ RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \ --mac-address "${STOCK_MAC_ADDRESS}" \ --width "${STOCK_WIDTH}" \ --height "${STOCK_HEIGHT}" \ - --output-bootdisk "${STOCK_BOOTDISK_NOPICKER}" || exit 1 + --output-bootdisk "${STOCK_BOOTDISK_NOPICKER}" || exit 1 \ + ; rm -rf /var/tmp/.guestfs-* ### symlink the old directory as upstream has renamed a directory. Symlinking purely for backwards compatability! RUN ln -s /home/arch/OSX-KVM/OpenCore /home/arch/OSX-KVM/OpenCore-Catalina || true @@ -282,6 +291,11 @@ RUN ln -s /home/arch/OSX-KVM/OpenCore /home/arch/OSX-KVM/OpenCore-Catalina || tr # for example, -e ADDITIONAL_PORTS=hostfwd=tcp::23-:23, ENV ADDITIONAL_PORTS= +# since the Makefile uses raw, and raw uses the full disk amount +# we want to use a compressed qcow2 +# ENV BASESYSTEM_FORMAT=raw +ENV BASESYSTEM_FORMAT=qcow2 + # add additional QEMU boot arguments ENV BOOT_ARGS= diff --git a/Dockerfile.auto b/Dockerfile.auto index f9ee9b9..aae6e2f 100644 --- a/Dockerfile.auto +++ b/Dockerfile.auto @@ -104,16 +104,22 @@ ENV KERNEL_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-5.12 ENV KERNEL_HEADERS_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-headers-5.12.14.arch1-1-x86_64.pkg.tar.zst ENV LIBGUESTFS_PACKAGE_URL=https://archive.archlinux.org/packages/l/libguestfs/libguestfs-1.44.1-6-x86_64.pkg.tar.zst +# fix ad hoc errors from using the arch museum to get libguestfs +RUN sudo sed -i -e 's/^\#RemoteFileSigLevel/RemoteFileSigLevel/g' /etc/pacman.conf + RUN sudo pacman -Syy \ && sudo pacman -Rns linux --noconfirm \ ; sudo pacman -S mkinitcpio --noconfirm \ - && sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm \ - && sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm \ + && sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm || exit 1 \ + && sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm || exit 1 \ && rm -rf /var/tmp/.guestfs-* \ - ; libguestfs-test-tool || exit 1 + && yes | sudo pacman -Scc \ + && libguestfs-test-tool || exit 1 \ + && rm -rf /var/tmp/.guestfs-* #### + WORKDIR /home/arch/OSX-KVM RUN mkdir -p ~/.ssh \ diff --git a/Dockerfile.naked b/Dockerfile.naked index fe9c5a7..3d5e2ef 100644 --- a/Dockerfile.naked +++ b/Dockerfile.naked @@ -30,22 +30,22 @@ # docker run -it --device /dev/kvm -p 50922:10022 -v ${PWD}/mac_hdd_ng.img:/image -e "DISPLAY=${DISPLAY:-:0.0}" -v /tmp/.X11-unix:/tmp/.X11-unix docker-osx:naked # -FROM sickcodes/docker-osx:latest +FROM archlinux:base-devel +LABEL maintainer='https://twitter.com/sickcodes <https://sick.codes>' -MAINTAINER 'https://twitter.com/sickcodes' <https://sick.codes> +SHELL ["/bin/bash", "-c"] -USER root - -WORKDIR /root - -RUN rm -f /home/arch/OSX-KVM/mac_hdd_ng.img +# change disk size here or add during build, e.g. --build-arg VERSION=10.14.5 --build-arg SIZE=50G +ARG SIZE=200G # OPTIONAL: Arch Linux server mirrors for super fast builds # set RANKMIRRORS to any value other that nothing, e.g. -e RANKMIRRORS=true ARG RANKMIRRORS ARG MIRROR_COUNTRY=US ARG MIRROR_COUNT=10 -RUN if [[ "${RANKMIRRORS}" ]]; then { pacman -Sy wget --noconfirm || pacman -Syu wget --noconfirm ; } \ + +RUN if [[ "${RANKMIRRORS}" ]]; then \ + { pacman -Sy wget --noconfirm || pacman -Syu wget --noconfirm ; } \ ; wget -O ./rankmirrors "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/rankmirrors" \ ; wget -O- "https://www.archlinux.org/mirrorlist/?country=${MIRROR_COUNTRY:-US}&protocol=https&use_mirror_status=on" \ | sed -e 's/^#Server/Server/' -e '/^#/d' \ @@ -57,11 +57,40 @@ RUN if [[ "${RANKMIRRORS}" ]]; then { pacman -Sy wget --noconfirm || pacman -Syu && cat /etc/pacman.d/mirrorlist \ ; fi +# This fails on hub.docker.com, useful for debugging in cloud +# RUN [[ $(egrep -c '(svm|vmx)' /proc/cpuinfo) -gt 0 ]] || { echo KVM not possible on this host && exit 1; } + +# RUN tee -a /etc/pacman.conf <<< '[community-testing]' \ +# && tee -a /etc/pacman.conf <<< 'Include = /etc/pacman.d/mirrorlist' + +RUN pacman -Syu git zip vim nano alsa-utils openssh --noconfirm \ + && ln -s /bin/vim /bin/vi \ + && useradd arch -p arch \ + && tee -a /etc/sudoers <<< 'arch ALL=(ALL) NOPASSWD: ALL' \ + && mkdir /home/arch \ + && chown arch:arch /home/arch \ + && yes | sudo pacman -Scc + +# allow ssh to container +RUN mkdir -m 700 /root/.ssh \ + && touch /root/.ssh/authorized_keys \ + && chmod 644 /root/.ssh/authorized_keys \ + && tee -a /etc/ssh/sshd_config <<< 'AllowTcpForwarding yes' \ + && tee -a /etc/ssh/sshd_config <<< 'PermitTunnel yes' \ + && tee -a /etc/ssh/sshd_config <<< 'X11Forwarding yes' \ + && tee -a /etc/ssh/sshd_config <<< 'PasswordAuthentication yes' \ + && tee -a /etc/ssh/sshd_config <<< 'PermitRootLogin yes' \ + && tee -a /etc/ssh/sshd_config <<< 'PubkeyAuthentication yes' \ + && tee -a /etc/ssh/sshd_config <<< 'HostKey /etc/ssh/ssh_host_rsa_key' \ + && tee -a /etc/ssh/sshd_config <<< 'HostKey /etc/ssh/ssh_host_ecdsa_key' \ + && tee -a /etc/ssh/sshd_config <<< 'HostKey /etc/ssh/ssh_host_ed25519_key' + # For taking screenshots of the Xfvb screen, useful during development. ARG SCROT +# the following code only runs if --build-arg SCROT=true is used RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr sshpass --noconfirm \ - && if [[ "${SCROT}" ]]; then \ + && if [[ "${SCROT}" == true ]]; then \ pacman -Syu scrot base-devel --noconfirm \ && git clone --recurse-submodules --depth 1 https://github.com/stolk/imcat.git \ && cd imcat \ @@ -81,6 +110,102 @@ USER arch ENV USER arch +# download OSX-KVM +# RUN git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git /home/arch/OSX-KVM +RUN git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git /home/arch/OSX-KVM + +WORKDIR /home/arch/OSX-KVM + +RUN touch enable-ssh.sh \ + && chmod +x ./enable-ssh.sh \ + && tee -a enable-ssh.sh <<< '[[ -f /etc/ssh/ssh_host_rsa_key ]] || \' \ + && tee -a enable-ssh.sh <<< '[[ -f /etc/ssh/ssh_host_ed25519_key ]] || \' \ + && tee -a enable-ssh.sh <<< '[[ -f /etc/ssh/ssh_host_ed25519_key ]] || \' \ + && tee -a enable-ssh.sh <<< 'sudo /usr/bin/ssh-keygen -A' \ + && tee -a enable-ssh.sh <<< 'nohup sudo /usr/bin/sshd -D &' + +# QEMU CONFIGURATOR +# set optional ram at runtime -e RAM=16 +# set optional cores at runtime -e SMP=4 -e CORES=2 +# add any additional commands in QEMU cli format -e EXTRA="-usb -device usb-host,hostbus=1,hostaddr=8" + +# default env vars, RUNTIME ONLY, not for editing in build time. + +# RUN yes | sudo pacman -Syu qemu libvirt dnsmasq virt-manager bridge-utils edk2-ovmf netctl libvirt-dbus --overwrite --noconfirm + +RUN yes | sudo pacman -Syu bc qemu libvirt dnsmasq virt-manager bridge-utils openresolv jack ebtables edk2-ovmf netctl libvirt-dbus wget --overwrite --noconfirm \ + && yes | sudo pacman -Scc + +WORKDIR /home/arch/OSX-KVM + +# we still want a recovery disk, monterey is backwards compatible (APFS), however, the Catalina and below are not (HFS+). +ARG SHORTNAME=monterey + +RUN make \ + && qemu-img convert BaseSystem.dmg -O qcow2 -p -c BaseSystem.img \ + && rm ./BaseSystem.dmg + +ARG LINUX=true + +# required to use libguestfs inside a docker container, to create bootdisks for docker-osx on-the-fly +RUN if [[ "${LINUX}" == true ]]; then \ + sudo pacman -Syu linux libguestfs --noconfirm \ + && yes | sudo pacman -Scc \ + ; fi + +# optional --build-arg to change branches for testing +ARG BRANCH=master +ARG REPO='https://github.com/sickcodes/Docker-OSX.git' +# 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} \' \ + && tee -a Launch.sh <<< '-monitor stdio \' \ + && tee -a Launch.sh <<< '-boot menu=on \' \ + && tee -a Launch.sh <<< '-vga vmware \' \ + && tee -a Launch.sh <<< '${EXTRA:-}' + +# docker exec containerid mv ./Launch-nopicker.sh ./Launch.sh +# This is now a legacy command. +# You can use -e BOOTDISK=/bootdisk with -v ./bootdisk.img:/bootdisk + +### LEGACY CODE +RUN grep -v InstallMedia ./Launch.sh > ./Launch-nopicker.sh \ + && chmod +x ./Launch-nopicker.sh \ + && sed -i -e s/OpenCore\.qcow2/OpenCore\-nopicker\.qcow2/ ./Launch-nopicker.sh +### + +USER arch + +ENV USER arch + #### libguestfs versioning # 5.13+ problem resolved by building the qcow2 against 5.12 using libguestfs-1.44.1-6 @@ -92,16 +217,66 @@ ENV KERNEL_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-5.12 ENV KERNEL_HEADERS_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-headers-5.12.14.arch1-1-x86_64.pkg.tar.zst ENV LIBGUESTFS_PACKAGE_URL=https://archive.archlinux.org/packages/l/libguestfs/libguestfs-1.44.1-6-x86_64.pkg.tar.zst +# fix ad hoc errors from using the arch museum to get libguestfs +RUN sudo sed -i -e 's/^\#RemoteFileSigLevel/RemoteFileSigLevel/g' /etc/pacman.conf + RUN sudo pacman -Syy \ && sudo pacman -Rns linux --noconfirm \ ; sudo pacman -S mkinitcpio --noconfirm \ - && sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm \ - && sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm \ + && sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm || exit 1 \ + && sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm || exit 1 \ && rm -rf /var/tmp/.guestfs-* \ - ; libguestfs-test-tool || exit 1 + && yes | sudo pacman -Scc \ + && libguestfs-test-tool || exit 1 \ + && rm -rf /var/tmp/.guestfs-* #### +# These are hardcoded serials for non-iMessage related research +# Overwritten by using GENERATE_UNIQUE=true +# Upstream removed nopicker, so we are adding it back in, at build time +# Once again, this is just for the Docker build so there is a default nopicker image there + +# libguestfs verbose +ENV LIBGUESTFS_DEBUG=1 +ENV LIBGUESTFS_TRACE=1 + +ARG STOCK_DEVICE_MODEL=iMacPro1,1 +ARG STOCK_SERIAL=C02TM2ZBHX87 +ARG STOCK_BOARD_SERIAL=C02717306J9JG361M +ARG STOCK_UUID=007076A6-F2A2-4461-BBE5-BAD019F8025A +ARG STOCK_MAC_ADDRESS=00:0A:27:00:00:00 +ARG STOCK_WIDTH=1920 +ARG STOCK_HEIGHT=1080 +ARG STOCK_MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist +ARG STOCK_MASTER_PLIST_URL_NOPICKER=https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-nopicker-custom.plist +ARG STOCK_BOOTDISK=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2 +ARG STOCK_BOOTDISK_NOPICKER=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2 + +RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \ + --master-plist-url="${STOCK_MASTER_PLIST_URL}" \ + --model "${STOCK_DEVICE_MODEL}" \ + --serial "${STOCK_SERIAL}" \ + --board-serial "${STOCK_BOARD_SERIAL}" \ + --uuid "${STOCK_UUID}" \ + --mac-address "${STOCK_MAC_ADDRESS}" \ + --width "${STOCK_WIDTH}" \ + --height "${STOCK_HEIGHT}" \ + --output-bootdisk "${STOCK_BOOTDISK}" || exit 1 \ + ; rm -rf /var/tmp/.guestfs-* + +RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \ + --master-plist-url="${STOCK_MASTER_PLIST_URL_NOPICKER}" \ + --model "${STOCK_DEVICE_MODEL}" \ + --serial "${STOCK_SERIAL}" \ + --board-serial "${STOCK_BOARD_SERIAL}" \ + --uuid "${STOCK_UUID}" \ + --mac-address "${STOCK_MAC_ADDRESS}" \ + --width "${STOCK_WIDTH}" \ + --height "${STOCK_HEIGHT}" \ + --output-bootdisk "${STOCK_BOOTDISK_NOPICKER}" || exit 1 \ + ; rm -rf /var/tmp/.guestfs-* + WORKDIR /home/arch/OSX-KVM @@ -115,15 +290,13 @@ RUN mkdir -p ~/.ssh \ && tee -a ~/.ssh/config <<< ' StrictHostKeyChecking no' \ && tee -a ~/.ssh/config <<< ' UserKnownHostsFile=/dev/null' -#### - -# symlink the old directory, for redundancy +### symlink the old directory as upstream has renamed a directory. Symlinking purely for backwards compatability! RUN ln -s /home/arch/OSX-KVM/OpenCore /home/arch/OSX-KVM/OpenCore-Catalina || true - #### #### SPECIAL RUNTIME ARGUMENTS BELOW - +# env -e ADDITIONAL_PORTS with a comma +# for example, -e ADDITIONAL_PORTS=hostfwd=tcp::23-:23, ENV ADDITIONAL_PORTS= # add additional QEMU boot arguments @@ -131,13 +304,13 @@ ENV BOOT_ARGS= ENV BOOTDISK= -# edit the CPU that is beign emulated +# edit the CPU that is being emulated ENV CPU=Penryn +ENV CPUID_FLAGS='vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check,' -ENV DISPLAY=:99 - -ENV HEADLESS=false +ENV DISPLAY=:0.0 +# Deprecated ENV ENV=/env # Boolean for generating a bootdisk with new random serials. @@ -168,9 +341,26 @@ ENV RAM=3 ENV WIDTH=1920 ENV HEIGHT=1080 -# libguestfs verbose -ENV LIBGUESTFS_DEBUG=1 -ENV LIBGUESTFS_TRACE=1 +VOLUME ["/tmp/.X11-unix"] + +# check if /image is a disk image or a directory. This allows you to optionally use -v disk.img:/image +# NOPICKER is used to skip the disk selection screen +# GENERATE_UNIQUE is used to generate serial numbers on boot. +# /env is a file that you can generate and save using -v source.sh:/env +# the env file is a file that you can carry to the next container which will supply the serials numbers. +# GENERATE_SPECIFIC is used to either accept the env serial numbers OR you can supply using: + # -e DEVICE_MODEL="iMacPro1,1" \ + # -e SERIAL="C02TW0WAHX87" \ + # -e BOARD_SERIAL="C027251024NJG36UE" \ + # -e UUID="5CCB366D-9118-4C61-A00A-E5BAF3BED451" \ + # -e MAC_ADDRESS="A8:5C:2C:9A:46:2F" \ + +# the output will be /bootdisk. +# /bootdisk is a useful persistent place to store the 15Mb serial number bootdisk. + +# if you don't set any of the above: +# the default serial numbers are already contained in ./OpenCore/OpenCore.qcow2 +# And the default serial numbers CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \ ; sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \ diff --git a/Dockerfile.naked-auto b/Dockerfile.naked-auto index 13edc0a..43dfdc5 100644 --- a/Dockerfile.naked-auto +++ b/Dockerfile.naked-auto @@ -84,13 +84,18 @@ ENV KERNEL_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-5.12 ENV KERNEL_HEADERS_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-headers-5.12.14.arch1-1-x86_64.pkg.tar.zst ENV LIBGUESTFS_PACKAGE_URL=https://archive.archlinux.org/packages/l/libguestfs/libguestfs-1.44.1-6-x86_64.pkg.tar.zst +# fix ad hoc errors from using the arch museum to get libguestfs +RUN sudo sed -i -e 's/^\#RemoteFileSigLevel/RemoteFileSigLevel/g' /etc/pacman.conf + RUN sudo pacman -Syy \ && sudo pacman -Rns linux --noconfirm \ ; sudo pacman -S mkinitcpio --noconfirm \ - && sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm \ - && sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm \ + && sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm || exit 1 \ + && sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm || exit 1 \ && rm -rf /var/tmp/.guestfs-* \ - ; libguestfs-test-tool || exit 1 + && yes | sudo pacman -Scc \ + && libguestfs-test-tool || exit 1 \ + && rm -rf /var/tmp/.guestfs-* #### diff --git a/custom/config-nopicker-custom.plist b/custom/config-nopicker-custom.plist index 6602df5..7310c06 100644 --- a/custom/config-nopicker-custom.plist +++ b/custom/config-nopicker-custom.plist @@ -11,11 +11,51 @@ <array> <dict> <key>Comment</key> - <string>add DTGP method</string> + <string>My custom DSDT</string> <key>Enabled</key> - <true/> + <false/> <key>Path</key> - <string>SSDT-DTGP.aml</string> + <string>DSDT.aml</string> + </dict> + <dict> + <key>Comment</key> + <string>My custom SSDT</string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>SSDT-1.aml</string> + </dict> + <dict> + <key>Comment</key> + <string>Read the comment in dsl sample</string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>SSDT-ALS0.aml</string> + </dict> + <dict> + <key>Comment</key> + <string>Read the comment in dsl sample</string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>SSDT-AWAC-DISABLE.aml</string> + </dict> + <dict> + <key>Comment</key> + <string>Read the comment in dsl sample</string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>SSDT-BRG0.aml</string> + </dict> + <dict> + <key>Comment</key> + <string>Read the comment in dsl sample</string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>SSDT-EC-USBX.aml</string> </dict> <dict> <key>Comment</key> @@ -27,11 +67,19 @@ </dict> <dict> <key>Comment</key> - <string>USB 2.0 Injection</string> + <string>Read the comment in dsl sample</string> <key>Enabled</key> - <true/> + <false/> <key>Path</key> - <string>SSDT-EHCI.aml</string> + <string>SSDT-EHCx-DISABLE.aml</string> + </dict> + <dict> + <key>Comment</key> + <string>Read the comment in dsl sample</string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>SSDT-IMEI.aml</string> </dict> <dict> <key>Comment</key> @@ -41,6 +89,78 @@ <key>Path</key> <string>SSDT-PLUG.aml</string> </dict> + <dict> + <key>Comment</key> + <string>Read the comment in dsl sample</string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>SSDT-PMC.aml</string> + </dict> + <dict> + <key>Comment</key> + <string>Read the comment in dsl sample</string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>SSDT-PNLF.aml</string> + </dict> + <dict> + <key>Comment</key> + <string>Read the comment in dsl sample</string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>SSDT-PNLFCFL.aml</string> + </dict> + <dict> + <key>Comment</key> + <string>Read the comment in dsl sample</string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>SSDT-RTC0-RANGE.aml</string> + </dict> + <dict> + <key>Comment</key> + <string>Read the comment in dsl sample</string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>SSDT-RTC0.aml</string> + </dict> + <dict> + <key>Comment</key> + <string>Read the comment in dsl sample</string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>SSDT-SBUS-MCHC.aml</string> + </dict> + <dict> + <key>Comment</key> + <string>Read the comment in dsl sample</string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>SSDT-UNC.aml</string> + </dict> + <dict> + <key>Comment</key> + <string>add DTGP method</string> + <key>Enabled</key> + <true/> + <key>Path</key> + <string>SSDT-DTGP.aml</string> + </dict> + <dict> + <key>Comment</key> + <string>USB 2.0 Injection</string> + <key>Enabled</key> + <true/> + <key>Path</key> + <string>SSDT-EHCI.aml</string> + </dict> </array> <key>Delete</key> <array> @@ -76,14 +196,18 @@ <key>Patch</key> <array> <dict> + <key>Base</key> + <string></string> + <key>BaseSkip</key> + <integer>0</integer> <key>Comment</key> - <string>_Q11 to XQ11</string> + <string>Replace one byte sequence with another</string> <key>Count</key> - <integer>1</integer> + <integer>0</integer> <key>Enabled</key> <false/> <key>Find</key> - <data>X1ExMQ==</data> + <data>ESIzRA==</data> <key>Limit</key> <integer>0</integer> <key>Mask</key> @@ -91,7 +215,7 @@ <key>OemTableId</key> <data></data> <key>Replace</key> - <data>WFExMQ==</data> + <data>RDMiEQ==</data> <key>ReplaceMask</key> <data></data> <key>Skip</key> @@ -102,14 +226,18 @@ <data></data> </dict> <dict> + <key>Base</key> + <string>\_SB.PCI0.LPCB.HPET</string> + <key>BaseSkip</key> + <integer>0</integer> <key>Comment</key> - <string>_Q12 to XQ12</string> + <string>HPET _CRS to XCRS</string> <key>Count</key> <integer>1</integer> <key>Enabled</key> <false/> <key>Find</key> - <data>X1ExMg==</data> + <data>X0NSUw==</data> <key>Limit</key> <integer>0</integer> <key>Mask</key> @@ -117,7 +245,7 @@ <key>OemTableId</key> <data></data> <key>Replace</key> - <data>WFExMg==</data> + <data>WENSUw==</data> <key>ReplaceMask</key> <data></data> <key>Skip</key> @@ -139,6 +267,8 @@ <key>ResetHwSig</key> <false/> <key>ResetLogoStatus</key> + <true/> + <key>SyncTableIds</key> <false/> </dict> </dict> @@ -148,6 +278,8 @@ <array/> <key>Quirks</key> <dict> + <key>AllowRelocationBlock</key> + <false/> <key>AvoidRuntimeDefrag</key> <true/> <key>DevirtualiseMmio</key> @@ -162,6 +294,8 @@ <true/> <key>EnableWriteUnprotector</key> <true/> + <key>ForceBooterSignature</key> + <false/> <key>ForceExitBootServices</key> <false/> <key>ProtectMemoryRegions</key> @@ -201,12 +335,7 @@ </dict> </dict> <key>Delete</key> - <dict> - <key>PciRoot(0x0)/Pci(0x1b,0x0)</key> - <array> - <string>MaximumBootBeepVolume</string> - </array> - </dict> + <dict/> </dict> <key>Kernel</key> <dict> @@ -216,17 +345,35 @@ <key>Arch</key> <string>Any</string> <key>BundlePath</key> - <string>VoodooHDA.kext</string> + <string>Lilu.kext</string> <key>Comment</key> - <string></string> + <string>Patch engine</string> <key>Enabled</key> <true/> <key>ExecutablePath</key> - <string>Contents/MacOS/VoodooHDA</string> + <string>Contents/MacOS/Lilu</string> <key>MaxKernel</key> <string></string> <key>MinKernel</key> + <string>8.0.0</string> + <key>PlistPath</key> + <string>Contents/Info.plist</string> + </dict> + <dict> + <key>Arch</key> + <string>Any</string> + <key>BundlePath</key> + <string>VirtualSMC.kext</string> + <key>Comment</key> + <string>SMC emulator</string> + <key>Enabled</key> + <false/> + <key>ExecutablePath</key> + <string>Contents/MacOS/VirtualSMC</string> + <key>MaxKernel</key> <string></string> + <key>MinKernel</key> + <string>8.0.0</string> <key>PlistPath</key> <string>Contents/Info.plist</string> </dict> @@ -234,17 +381,35 @@ <key>Arch</key> <string>x86_64</string> <key>BundlePath</key> - <string>Lilu.kext</string> + <string>WhateverGreen.kext</string> <key>Comment</key> - <string>Patch engine</string> + <string>Video patches</string> <key>Enabled</key> <true/> <key>ExecutablePath</key> - <string>Contents/MacOS/Lilu</string> + <string>Contents/MacOS/WhateverGreen</string> + <key>MaxKernel</key> + <string></string> + <key>MinKernel</key> + <string>10.0.0</string> + <key>PlistPath</key> + <string>Contents/Info.plist</string> + </dict> + <dict> + <key>Arch</key> + <string>Any</string> + <key>BundlePath</key> + <string>AppleALC.kext</string> + <key>Comment</key> + <string>Audio patches</string> + <key>Enabled</key> + <true/> + <key>ExecutablePath</key> + <string>Contents/MacOS/AppleALC</string> <key>MaxKernel</key> <string></string> <key>MinKernel</key> - <string>12.0.0</string> + <string>8.0.0</string> <key>PlistPath</key> <string>Contents/Info.plist</string> </dict> @@ -252,17 +417,17 @@ <key>Arch</key> <string>x86_64</string> <key>BundlePath</key> - <string>VirtualSMC.kext</string> + <string>IntelMausi.kext</string> <key>Comment</key> - <string>SMC emulator</string> + <string>Intel Ethernet LAN</string> <key>Enabled</key> <false/> <key>ExecutablePath</key> - <string>Contents/MacOS/VirtualSMC</string> + <string>Contents/MacOS/IntelMausi</string> <key>MaxKernel</key> <string></string> <key>MinKernel</key> - <string>12.0.0</string> + <string>13.0.0</string> <key>PlistPath</key> <string>Contents/Info.plist</string> </dict> @@ -270,37 +435,131 @@ <key>Arch</key> <string>x86_64</string> <key>BundlePath</key> - <string>WhateverGreen.kext</string> + <string>Legacy_USB3.kext</string> <key>Comment</key> - <string>Video patches</string> + <string>XHC ports configuration</string> + <key>Enabled</key> + <false/> + <key>ExecutablePath</key> + <string></string> + <key>MaxKernel</key> + <string></string> + <key>MinKernel</key> + <string>15.0.0</string> + <key>PlistPath</key> + <string>Contents/Info.plist</string> + </dict> + <dict> + <key>Arch</key> + <string>x86_64</string> + <key>BundlePath</key> + <string>MCEReporterDisabler.kext</string> + <key>Comment</key> + <string>AppleMCEReporter disabler</string> <key>Enabled</key> <true/> <key>ExecutablePath</key> - <string>Contents/MacOS/WhateverGreen</string> + <string></string> <key>MaxKernel</key> <string></string> <key>MinKernel</key> - <string>12.0.0</string> + <string>19.0.0</string> <key>PlistPath</key> <string>Contents/Info.plist</string> </dict> <dict> + <key>Arch</key> + <string>x86_64</string> <key>BundlePath</key> - <string>AGPMInjector.kext</string> + <string>VoodooPS2Controller.kext</string> <key>Comment</key> <string></string> <key>Enabled</key> - <true/> + <false/> <key>ExecutablePath</key> + <string>Contents/MacOS/VoodooPS2Controller</string> + <key>MaxKernel</key> + <string></string> + <key>MinKernel</key> + <string>15.0.0</string> + <key>PlistPath</key> + <string>Contents/Info.plist</string> + </dict> + <dict> + <key>Arch</key> + <string>x86_64</string> + <key>BundlePath</key> + <string>VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Keyboard.kext</string> + <key>Comment</key> <string></string> + <key>Enabled</key> + <false/> + <key>ExecutablePath</key> + <string>Contents/MacOS/VoodooPS2Keyboard</string> <key>MaxKernel</key> <string></string> <key>MinKernel</key> + <string>15.0.0</string> + <key>PlistPath</key> + <string>Contents/Info.plist</string> + </dict> + <dict> + <key>Arch</key> + <string>x86_64</string> + <key>BundlePath</key> + <string>VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Mouse.kext</string> + <key>Comment</key> <string></string> + <key>Enabled</key> + <false/> + <key>ExecutablePath</key> + <string>Contents/MacOS/VoodooPS2Mouse</string> + <key>MaxKernel</key> + <string></string> + <key>MinKernel</key> + <string>15.0.0</string> <key>PlistPath</key> <string>Contents/Info.plist</string> </dict> <dict> + <key>Arch</key> + <string>x86_64</string> + <key>BundlePath</key> + <string>VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Trackpad.kext</string> + <key>Comment</key> + <string></string> + <key>Enabled</key> + <false/> + <key>ExecutablePath</key> + <string>Contents/MacOS/VoodooPS2Trackpad</string> + <key>MaxKernel</key> + <string></string> + <key>MinKernel</key> + <string>15.0.0</string> + <key>PlistPath</key> + <string>Contents/Info.plist</string> + </dict> + <dict> + <key>Arch</key> + <string>x86_64</string> + <key>BundlePath</key> + <string>VoodooPS2Controller.kext/Contents/PlugIns/VoodooInput.kext</string> + <key>Comment</key> + <string></string> + <key>Enabled</key> + <false/> + <key>ExecutablePath</key> + <string>Contents/MacOS/VoodooInput</string> + <key>MaxKernel</key> + <string></string> + <key>MinKernel</key> + <string>15.0.0</string> + <key>PlistPath</key> + <string>Contents/Info.plist</string> + </dict> + <dict> + <key>Arch</key> + <string>x86_64</string> <key>BundlePath</key> <string>USBPorts.kext</string> <key>Comment</key> @@ -320,9 +579,9 @@ <key>Arch</key> <string>x86_64</string> <key>BundlePath</key> - <string>MCEReporterDisabler.kext</string> + <string>AGPMInjector.kext</string> <key>Comment</key> - <string>AppleMCEReporter disabler</string> + <string></string> <key>Enabled</key> <true/> <key>ExecutablePath</key> @@ -330,7 +589,7 @@ <key>MaxKernel</key> <string></string> <key>MinKernel</key> - <string>19.0.0</string> + <string></string> <key>PlistPath</key> <string>Contents/Info.plist</string> </dict> @@ -362,6 +621,12 @@ <data> ////AAAAAAAAAAAAAAAAAA== </data> + <key>DummyPowerManagement</key> + <true/> + <key>MaxKernel</key> + <string></string> + <key>MinKernel</key> + <string></string> </dict> <key>Force</key> <array> @@ -371,13 +636,13 @@ <key>BundlePath</key> <string>System/Library/Extensions/IONetworkingFamily.kext</string> <key>Comment</key> - <string>Patch engine</string> + <string></string> <key>Enabled</key> <false/> - <key>Identifier</key> - <string>com.apple.iokit.IONetworkingFamily</string> <key>ExecutablePath</key> <string>Contents/MacOS/IONetworkingFamily</string> + <key>Identifier</key> + <string>com.apple.iokit.IONetworkingFamily</string> <key>MaxKernel</key> <string>13.99.99</string> <key>MinKernel</key> @@ -389,17 +654,19 @@ <key>Patch</key> <array> <dict> + <key>Arch</key> + <string>x86_64</string> <key>Base</key> - <string>_cpu_topology_sort</string> + <string></string> <key>Comment</key> - <string>algrey - cpu_topology_sort -disable _x86_validate_topology</string> + <string>algrey - cpuid_set_cpufamily - force CPUFAMILY_INTEL_PENRYN</string> <key>Count</key> <integer>1</integer> <key>Enabled</key> <true/> <key>Find</key> <data> - 6AAA//8= + MduAPQAAAAAGdQA= </data> <key>Identifier</key> <string>kernel</string> @@ -407,15 +674,15 @@ <integer>0</integer> <key>Mask</key> <data> - /wAA//8= + /////wAAAP///wA= </data> <key>MaxKernel</key> - <string>20.99.99</string> + <string>20.3.99</string> <key>MinKernel</key> <string>17.0.0</string> <key>Replace</key> <data> - Dx9EAAA= + u7xP6njpXQAAAJA= </data> <key>ReplaceMask</key> <data> @@ -424,17 +691,19 @@ <integer>0</integer> </dict> <dict> + <key>Arch</key> + <string>x86_64</string> <key>Base</key> <string></string> <key>Comment</key> - <string>algrey - cpuid_set_cpufamily - force CPUFAMILY_INTEL_PENRYN</string> + <string>algrey - thenickdude - cpuid_set_cpufamily - force CPUFAMILY_INTEL_PENRYN (Big Sur 11.3 and newer)</string> <key>Count</key> <integer>1</integer> <key>Enabled</key> <true/> <key>Find</key> <data> - MduAPQAAAAAGdQA= + MdKzAYA9AAAAAAZ1 </data> <key>Identifier</key> <string>kernel</string> @@ -442,15 +711,15 @@ <integer>0</integer> <key>Mask</key> <data> - /////wAAAP///wA= + ////////AAAAAP// </data> <key>MaxKernel</key> - <string>20.99.99</string> + <string>21.99.99</string> <key>MinKernel</key> - <string>17.0.0</string> + <string>20.4.0</string> <key>Replace</key> <data> - u7xP6njpXQAAAJA= + urxP6nizAJCQkJDr </data> <key>ReplaceMask</key> <data> @@ -477,18 +746,26 @@ <true/> <key>DisableRtcChecksum</key> <false/> - <key>DummyPowerManagement</key> - <true/> + <key>ExtendBTFeatureFlags</key> + <false/> <key>ExternalDiskIcons</key> <false/> + <key>ForceSecureBootScheme</key> + <true/> <key>IncreasePciBarSize</key> <false/> <key>LapicKernelPanic</key> <false/> + <key>LegacyCommpage</key> + <false/> <key>PanicNoKextDump</key> <false/> <key>PowerTimeoutKernelPanic</key> <false/> + <key>ProvideCurrentCpuInfo</key> + <true/> + <key>SetApfsTrimTimeout</key> + <integer>-1</integer> <key>ThirdPartyDrives</key> <false/> <key>XhciPortLimit</key> @@ -496,10 +773,12 @@ </dict> <key>Scheme</key> <dict> + <key>CustomKernel</key> + <false/> <key>FuzzyMatch</key> <true/> <key>KernelArch</key> - <string>x86_64</string> + <string>Auto</string> <key>KernelCache</key> <string>Auto</string> </dict> @@ -516,12 +795,18 @@ <string>Auto</string> <key>HideAuxiliary</key> <false/> + <key>LauncherOption</key> + <string>Disabled</string> + <key>LauncherPath</key> + <string>Default</string> <key>PickerAttributes</key> - <integer>1</integer> + <integer>17</integer> <key>PickerAudioAssist</key> <false/> <key>PickerMode</key> <string>External</string> + <key>PickerVariant</key> + <string>Auto</string> <key>PollAppleHotKeys</key> <true/> <key>ShowPicker</key> @@ -529,7 +814,7 @@ <key>TakeoffDelay</key> <integer>0</integer> <key>Timeout</key> - <integer>0</integer> + <integer>45</integer> </dict> <key>Debug</key> <dict> @@ -557,13 +842,15 @@ <key>AllowNvramReset</key> <true/> <key>AllowSetDefault</key> - <false/> + <true/> + <key>AllowToggleSip</key> + <true/> <key>ApECID</key> <integer>0</integer> <key>AuthRestart</key> <false/> - <key>BootProtect</key> - <string>None</string> + <key>BlacklistAppleUpdate</key> + <true/> <key>DmgLoading</key> <string>Signed</string> <key>EnablePassword</key> @@ -594,10 +881,36 @@ <string>Not signed for security reasons</string> <key>Enabled</key> <true/> + <key>Flavour</key> + <string>OpenShell:UEFIShell:Shell</string> <key>Name</key> <string>UEFI Shell</string> <key>Path</key> <string>OpenShell.efi</string> + <key>RealPath</key> + <false/> + <key>TextMode</key> + <false/> + </dict> + <dict> + <key>Arguments</key> + <string></string> + <key>Auxiliary</key> + <true/> + <key>Comment</key> + <string>Memory testing utility</string> + <key>Enabled</key> + <false/> + <key>Flavour</key> + <string>MemTest</string> + <key>Name</key> + <string>memtest86</string> + <key>Path</key> + <string>memtest86/BOOTX64.efi</string> + <key>RealPath</key> + <true/> + <key>TextMode</key> + <false/> </dict> <dict> <key>Arguments</key> @@ -607,11 +920,17 @@ <key>Comment</key> <string>Perform shutdown</string> <key>Enabled</key> - <true/> + <false/> + <key>Flavour</key> + <string>Auto</string> <key>Name</key> <string>Shutdown</string> <key>Path</key> <string>ResetSystem.efi</string> + <key>RealPath</key> + <false/> + <key>TextMode</key> + <false/> </dict> </array> </dict> @@ -633,6 +952,8 @@ </dict> <key>7C436110-AB2A-4BBB-A880-FE41995C9F82</key> <dict> + <key>ForceDisplayRotationInEFI</key> + <integer>0</integer> <key>SystemAudioVolume</key> <data>Rg==</data> <key>boot-args</key> @@ -643,6 +964,8 @@ <data>ZwAAAA==</data> <key>prev-lang:kbd</key> <data>ZW4tVVM6MA==</data> + <key>run-efi-updater</key> + <string>No</string> </dict> </dict> <key>Delete</key> @@ -659,6 +982,7 @@ <key>7C436110-AB2A-4BBB-A880-FE41995C9F82</key> <array> <string>boot-args</string> + <string>ForceDisplayRotationInEFI</string> </array> </dict> <key>LegacyEnable</key> @@ -679,6 +1003,8 @@ <string>bluetoothInternalControllerInfo</string> <string>flagstate</string> <string>fmm-computer-name</string> + <string>fmm-mobileme-token-FMM</string> + <string>fmm-mobileme-token-FMM-BridgeHasAccount</string> <string>nvda_drv</string> <string>prev-lang:kbd</string> </array> @@ -698,16 +1024,24 @@ <dict> <key>Automatic</key> <true/> + <key>CustomMemory</key> + <false/> <key>Generic</key> <dict> - <key>AdviseWindows</key> + <key>AdviseFeatures</key> + <false/> + <key>MaxBIOSVersion</key> <false/> <key>MLB</key> <string>{{BOARD_SERIAL}}</string> + <key>ProcessorType</key> + <integer>0</integer> <key>ROM</key> <data>{{ROM}}</data> <key>SpoofVendor</key> <true/> + <key>SystemMemoryStatus</key> + <string>Auto</string> <key>SystemProductName</key> <string>{{DEVICE_MODEL}}</string> <key>SystemSerialNumber</key> @@ -723,6 +1057,8 @@ <true/> <key>UpdateSMBIOSMode</key> <string>Create</string> + <key>UseRawUuidEncoding</key> + <false/> </dict> <key>UEFI</key> <dict> @@ -733,13 +1069,30 @@ <key>GlobalConnect</key> <false/> <key>HideVerbose</key> - <false/> - <key>JumpstartHotPlug</key> <true/> + <key>JumpstartHotPlug</key> + <false/> <key>MinDate</key> - <integer>0</integer> + <integer>-1</integer> <key>MinVersion</key> - <integer>0</integer> + <integer>-1</integer> + </dict> + <key>AppleInput</key> + <dict> + <key>AppleEvent</key> + <string>Builtin</string> + <key>CustomDelays</key> + <false/> + <key>GraphicsInputMirroring</key> + <true/> + <key>KeyInitialDelay</key> + <integer>50</integer> + <key>KeySubsequentDelay</key> + <integer>5</integer> + <key>PointerSpeedDiv</key> + <integer>1</integer> + <key>PointerSpeedMul</key> + <integer>1</integer> </dict> <key>Audio</key> <dict> @@ -754,7 +1107,11 @@ <key>MinimumVolume</key> <integer>20</integer> <key>PlayChime</key> + <string>Auto</string> + <key>ResetTrafficClass</key> <false/> + <key>SetupDelay</key> + <integer>0</integer> <key>VolumeAmplifier</key> <integer>0</integer> </dict> @@ -762,20 +1119,166 @@ <true/> <key>Drivers</key> <array> - <string>VBoxHfs.efi</string> + <dict> + <key>Arguments</key> + <string></string> + <key>Comment</key> + <string>HFS+ Driver</string> + <key>Enabled</key> + <true/> + <key>Path</key> + <string>OpenHfsPlus.efi</string> + </dict> + <dict> + <key>Arguments</key> + <string></string> + <key>Comment</key> + <string></string> + <key>Enabled</key> + <true/> + <key>Path</key> <string>OpenRuntime.efi</string> + </dict> + <dict> + <key>Arguments</key> + <string></string> + <key>Comment</key> + <string></string> + <key>Enabled</key> + <true/> + <key>Path</key> <string>OpenCanopy.efi</string> - <string>#AudioDxe.efi</string> - <string>#OpenUsbKbDxe.efi</string> - <string>#UsbMouseDxe.efi</string> - <string>#Ps2KeyboardDxe.efi</string> - <string>#Ps2MouseDxe.efi</string> - <string>#HiiDatabase.efi</string> - <string>#NvmExpressDxe.efi</string> - <string>#XhciDxe.efi</string> - <string>#ExFatDxe.efi</string> - <string>#PartitionDxe.efi</string> - <string>#CrScreenshotDxe.efi</string> + </dict> + <dict> + <key>Arguments</key> + <string></string> + <key>Comment</key> + <string></string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>AudioDxe.efi</string> + </dict> + <dict> + <key>Arguments</key> + <string></string> + <key>Comment</key> + <string></string> + <key>Enabled</key> + <true/> + <key>Path</key> + <string>OpenPartitionDxe.efi</string> + </dict> + <dict> + <key>Arguments</key> + <string></string> + <key>Comment</key> + <string></string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>OpenUsbKbDxe.efi</string> + </dict> + <dict> + <key>Arguments</key> + <string></string> + <key>Comment</key> + <string></string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>UsbMouseDxe.efi</string> + </dict> + <dict> + <key>Arguments</key> + <string></string> + <key>Comment</key> + <string></string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>Ps2KeyboardDxe.efi</string> + </dict> + <dict> + <key>Arguments</key> + <string></string> + <key>Comment</key> + <string></string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>Ps2MouseDxe.efi</string> + </dict> + <dict> + <key>Arguments</key> + <string></string> + <key>Comment</key> + <string></string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>HiiDatabase.efi</string> + </dict> + <dict> + <key>Arguments</key> + <string></string> + <key>Comment</key> + <string></string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>NvmExpressDxe.efi</string> + </dict> + <dict> + <key>Arguments</key> + <string></string> + <key>Comment</key> + <string></string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>XhciDxe.efi</string> + </dict> + <dict> + <key>Arguments</key> + <string></string> + <key>Comment</key> + <string></string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>ExFatDxe.efi</string> + </dict> + <dict> + <key>Arguments</key> + <string></string> + <key>Comment</key> + <string></string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>CrScreenshotDxe.efi</string> + </dict> + <dict> + <key>Arguments</key> + <string></string> + <key>Comment</key> + <string></string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>ext4_x64.efi</string> + </dict> + <dict> + <key>Arguments</key> + <string></string> + <key>Comment</key> + <string></string> + <key>Enabled</key> + <false/> + <key>Path</key> + <string>OpenLinuxBoot.efi</string> + </dict> </array> <key>Input</key> <dict> @@ -783,8 +1286,6 @@ <false/> <key>KeyForgetThreshold</key> <integer>5</integer> - <key>KeyMergeThreshold</key> - <integer>2</integer> <key>KeySupport</key> <true/> <key>KeySupportMode</key> @@ -806,6 +1307,10 @@ <string></string> <key>DirectGopRendering</key> <false/> + <key>ForceResolution</key> + <false/> + <key>GopPassThrough</key> + <string>Disabled</string> <key>IgnoreTextInGraphics</key> <false/> <key>ProvideConsoleGop</key> @@ -831,7 +1336,7 @@ <false/> <key>AppleDebugLog</key> <false/> - <key>AppleEvent</key> + <key>AppleEg2Info</key> <false/> <key>AppleFramebufferInfo</key> <false/> @@ -854,7 +1359,7 @@ <key>DeviceProperties</key> <false/> <key>FirmwareVolume</key> - <false/> + <true/> <key>HashServices</key> <false/> <key>OSInfo</key> @@ -864,20 +1369,30 @@ </dict> <key>Quirks</key> <dict> + <key>ActivateHpetSupport</key> + <false/> + <key>DisableSecurityPolicy</key> + <false/> + <key>EnableVectorAcceleration</key> + <true/> <key>ExitBootServicesDelay</key> <integer>0</integer> + <key>ForceOcWriteFlash</key> + <{{THINKPAD}}/> + <key>ForgeUefiSupport</key> + <false/> <key>IgnoreInvalidFlexRatio</key> <false/> <key>ReleaseUsbOwnership</key> <false/> + <key>ReloadOptionRoms</key> + <false/> <key>RequestBootVarRouting</key> <true/> <key>TscSyncTimeout</key> <integer>0</integer> <key>UnblockFsConnect</key> - <true/> - <key>ConnectDrivers</key> - <true/> + <false/> </dict> </dict> </dict> diff --git a/custom/generate-specific-bootdisk.sh b/custom/generate-specific-bootdisk.sh index 386c13b..5095399 100755 --- a/custom/generate-specific-bootdisk.sh +++ b/custom/generate-specific-bootdisk.sh @@ -30,10 +30,11 @@ Optional options: --master-plist <filename> Same as above. --output-bootdisk <filename> Optionally change the bootdisk filename --output-plist <filename> Optionally change the output plist filename + --thinkpad Sets ForceOcWriteFlash to true --help, -h, help Display this help and exit Placeholders: {{DEVICE_MODEL}}, {{SERIAL}}, {{BOARD_SERIAL}}, {{UUID}}, - {{ROM}}, {{WIDTH}}, {{HEIGHT}} + {{ROM}}, {{WIDTH}}, {{HEIGHT}}, {{THINKPAD}} Example: ./generate-specific-bootdisk.sh \\ @@ -183,6 +184,12 @@ while (( "$#" )); do shift ;; + + --thinkpad ) + export THINKPAD=true + shift + ;; + *) echo "Invalid option ${1}. Running with default values..." shift @@ -193,12 +200,12 @@ done download_qcow_efi_folder () { - export EFI_FOLDER=./OpenCore-Catalina/EFI + export EFI_FOLDER=./OpenCore/EFI export RESOURCES_FOLDER=./resources/OcBinaryData/Resources # check if we are inside OSX-KVM already # if not, download OSX-KVM locally - [ -d ./OpenCore-Catalina/EFI/ ] || { + [ -d ./OpenCore/EFI/ ] || { [ -d ./OSX-KVM/ ] || git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git export EFI_FOLDER="./OSX-KVM/${EFI_FOLDER}" } @@ -233,6 +240,13 @@ generate_bootdisk () { wget -O "${MASTER_PLIST:=./config-nopicker-custom.plist}" "${MASTER_PLIST_URL}" fi + if [[ "${THINKPAD}" == true ]]; then + echo "Thinkpads: setting ForceOcWriteFlash to true" + export THINKPAD=true + else + export THINKPAD=false + fi + [ -e ./opencore-image-ng.sh ] \ || { wget "${OPENCORE_IMAGE_MAKER_URL}" \ && chmod +x opencore-image-ng.sh ; } @@ -252,6 +266,7 @@ generate_bootdisk () { -e s/\{\{ROM\}\}/"${ROM}"/g \ -e s/\{\{WIDTH\}\}/"${WIDTH:-1920}"/g \ -e s/\{\{HEIGHT\}\}/"${HEIGHT:-1080}"/g \ + -e s/\{\{THINKPAD\}\}/"${THINKPAD:-false}"/g \ "${MASTER_PLIST}" > ./tmp.config.plist || exit 1 else cat <<EOF && exit 1 diff --git a/custom/generate-unique-machine-values.sh b/custom/generate-unique-machine-values.sh index 1cdd707..a88bc75 100755 --- a/custom/generate-unique-machine-values.sh +++ b/custom/generate-unique-machine-values.sh @@ -30,6 +30,7 @@ General options: --create-envs, --envs Create all corresponding sourcable envs --create-plists, --plists Create all corresponding config.plists --create-bootdisks, --bootdisks Create all corresponding bootdisks [SLOW] + --thinkpad Toggles ForceOcWriteFlash to true --help, -h, help Display this help and exit Additional options only if you are creating ONE serial set: @@ -38,7 +39,7 @@ Additional options only if you are creating ONE serial set: Custom plist placeholders: {{DEVICE_MODEL}}, {{SERIAL}}, {{BOARD_SERIAL}}, - {{UUID}}, {{ROM}}, {{WIDTH}}, {{HEIGHT}} + {{UUID}}, {{ROM}}, {{WIDTH}}, {{HEIGHT}}, {{THINKPAD}} Example: ./generate-unique-machine-values.sh --count 1 --plists --bootdisks --envs @@ -202,9 +203,14 @@ while (( "$#" )); do export CREATE_ENVS=1 shift ;; + + --thinkpad ) + export THINKPAD=true + shift + ;; *) - echo "Invalid option. Running with default values..." + echo "Invalid option ${1}. Running with default values..." shift ;; esac @@ -226,12 +232,12 @@ download_vendor_mac_addresses () { download_qcow_efi_folder () { - export EFI_FOLDER=./OpenCore-Catalina/EFI + export EFI_FOLDER=./OpenCore/EFI export RESOURCES_FOLDER=./resources/OcBinaryData/Resources # check if we are inside OSX-KVM already # if not, download OSX-KVM locally - [ -d ./OpenCore-Catalina/EFI/ ] || { + [ -d ./OpenCore/EFI/ ] || { [ -d ./OSX-KVM/ ] || git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git export EFI_FOLDER="./OSX-KVM/${EFI_FOLDER}" } @@ -313,6 +319,7 @@ export UUID="${UUID}" export MAC_ADDRESS="${MAC_ADDRESS}" export WIDTH="${WIDTH}" export HEIGHT="${HEIGHT}" +export THINKPAD="${THINKPAD}" EOF fi @@ -333,10 +340,17 @@ EOF wget -O "${MASTER_PLIST:=./config-nopicker-custom.plist}" "${MASTER_PLIST_URL}" fi + if [[ "${THINKPAD}" == true ]]; then + echo "Thinkpads: setting ForceOcWriteFlash to true" + export THINKPAD=true + else + export THINKPAD=false + fi + mkdir -p "${OUTPUT_DIRECTORY}/plists" source "${OUTPUT_ENV_FILE}" - ROM_VALUE="${MAC_ADDRESS//\:/}" - ROM_VALUE="${ROM_VALUE,,}" + ROM="${MAC_ADDRESS//\:/}" + ROM="${ROM,,}" sed -e s/\{\{DEVICE_MODEL\}\}/"${DEVICE_MODEL}"/g \ -e s/\{\{SERIAL\}\}/"${SERIAL}"/g \ -e s/\{\{BOARD_SERIAL\}\}/"${BOARD_SERIAL}"/g \ @@ -344,6 +358,7 @@ EOF -e s/\{\{ROM\}\}/"${ROM}"/g \ -e s/\{\{WIDTH\}\}/"${WIDTH}"/g \ -e s/\{\{HEIGHT\}\}/"${HEIGHT}"/g \ + -e s/\{\{THINKPAD\}\}/"${THINKPAD}"/g \ "${MASTER_PLIST}" > "${OUTPUT_DIRECTORY}/plists/${SERIAL}.config.plist" || exit 1 fi diff --git a/custom/opencore-image-ng.sh b/custom/opencore-image-ng.sh index 5743b05..c25be41 100755 --- a/custom/opencore-image-ng.sh +++ b/custom/opencore-image-ng.sh @@ -133,26 +133,26 @@ fish part-add /dev/sda p 302048 -2048 fish part-set-gpt-type /dev/sda 1 C12A7328-F81F-11D2-BA4B-00A0C93EC93B fish part-set-bootable /dev/sda 1 true fish mkfs vfat /dev/sda1 label:EFI -fish mkfs vfat /dev/sda2 label:OpenCoreBoo +fish mkfs vfat /dev/sda2 label:OpenCore fish mount /dev/sda2 / fish mkdir /ESP fish mount /dev/sda1 /ESP msg "copy files to disk image" cp -v "$cfg" $WORK/config.plist -fish mkdir /ESP/EFI -fish mkdir /ESP/EFI/OC -fish mkdir /ESP/EFI/OC/Kexts -fish mkdir /ESP/EFI/OC/ACPI -fish mkdir /ESP/EFI/OC/Resources -fish mkdir /ESP/EFI/OC/Tools -fish copy-in $WORK/EFI/BOOT /ESP/EFI -fish copy-in $WORK/EFI/OC/OpenCore.efi /ESP/EFI/OC -fish copy-in $WORK/EFI/OC/Drivers /ESP/EFI/OC/ -fish copy-in $WORK/EFI/OC/Kexts /ESP/EFI/OC/ -fish copy-in $WORK/EFI/OC/ACPI /ESP/EFI/OC/ -fish copy-in $WORK/EFI/OC/Resources /ESP/EFI/OC/ -fish copy-in $WORK/EFI/OC/Tools /ESP/EFI/OC/ +fish mkdir /ESP/EFI +fish mkdir /ESP/EFI/OC +fish mkdir /ESP/EFI/OC/Kexts +fish mkdir /ESP/EFI/OC/ACPI +fish mkdir /ESP/EFI/OC/Resources +fish mkdir /ESP/EFI/OC/Tools +fish copy-in $WORK/EFI/BOOT /ESP/EFI +fish copy-in $WORK/EFI/OC/OpenCore.efi /ESP/EFI/OC +fish copy-in $WORK/EFI/OC/Drivers /ESP/EFI/OC/ +fish copy-in $WORK/EFI/OC/Kexts /ESP/EFI/OC/ +fish copy-in $WORK/EFI/OC/ACPI /ESP/EFI/OC/ +fish copy-in $BASE/resources/OcBinaryData/Resources /ESP/EFI/OC/ +fish copy-in $WORK/EFI/OC/Tools /ESP/EFI/OC/ # Note fish copy-in startup.nsh / |