diff options
Diffstat (limited to 'Dockerfile')
| -rw-r--r-- | Dockerfile | 58 |
1 files changed, 32 insertions, 26 deletions
@@ -166,13 +166,6 @@ RUN [[ "${VERSION%%.*}" -ge 11 ]] && { wget "${FETCH_MAC_OS_RAW}" \ WORKDIR /home/arch/OSX-KVM -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 \ - ; fi - # optional --build-arg to change branches for testing ARG BRANCH=master ARG REPO='https://github.com/sickcodes/Docker-OSX.git' @@ -199,7 +192,7 @@ RUN touch Launch.sh \ && 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-Catalina/OpenCore.qcow2} \' \ + && 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=qcow2 \' \ @@ -215,27 +208,38 @@ RUN touch Launch.sh \ # 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 -# 5.13 problem -ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux +#### libguestfs versioning -ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1 +# 5.13+ problem resolved by building the qcow2 against 5.12 using libguestfs-1.44.1-6 +ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux +ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1 ENV SUPERMIN_KERNEL_VERSION=5.12.14-arch1-1 +ENV KERNEL_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-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 + +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 -U "${KERNEL_PACKAGE_URL}" --noconfirm \ + ; sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm \ + ; sudo libguestfs-test-tool \ + ; sudo rm -rf /var/tmp/.guestfs-* \ + ; fi -RUN sudo pacman -Rns linux --noconfirm \ - ; sudo pacman -Syy \ - ; sudo pacman -S mkinitcpio --noconfirm \ - ; sudo pacman -U https://archive.archlinux.org/packages/l/linux/linux-5.12.14.arch1-1-x86_64.pkg.tar.zst --noconfirm \ - ; sudo rm -rf /var/tmp/.guestfs-* \ - ; libguestfs-test-tool +#### # These are hardcoded serials for non-iMessage related research # Overwritten by using GENERATE_UNIQUE=true @@ -251,8 +255,8 @@ 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-Catalina/OpenCore.qcow2 -ARG STOCK_BOOTDISK_NOPICKER=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2 +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}" \ @@ -265,7 +269,6 @@ RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \ --height "${STOCK_HEIGHT}" \ --output-bootdisk "${STOCK_BOOTDISK}" - RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \ --master-plist-url="${STOCK_MASTER_PLIST_URL_NOPICKER}" \ --model "${STOCK_DEVICE_MODEL}" \ @@ -277,8 +280,11 @@ RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \ --height "${STOCK_HEIGHT}" \ --output-bootdisk "${STOCK_BOOTDISK_NOPICKER}" -#### SPECIAL RUNTIME ARGUMENTS BELOW +### 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= @@ -348,16 +354,16 @@ VOLUME ["/tmp/.X11-unix"] # /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-Catalina/OpenCore.qcow2 +# 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 \ ; [[ "${NOPICKER}" == true ]] && { \ sed -i '/^.*InstallMedia.*/d' Launch.sh \ - && export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2}" \ + && export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2}" \ ; } \ - || export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \ + || export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \ ; [[ "${GENERATE_UNIQUE}" == true ]] && { \ ./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \ --master-plist-url="${MASTER_PLIST_URL}" \ @@ -366,7 +372,7 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/n --bootdisks \ --width "${WIDTH:-1920}" \ --height "${HEIGHT:-1080}" \ - --output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \ + --output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \ --output-env "${ENV:=/env}" \ || exit 1 ; } \ ; [[ "${GENERATE_SPECIFIC}" == true ]] && { \ @@ -380,7 +386,7 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/n --mac-address "${MAC_ADDRESS}" \ --width "${WIDTH:-1920}" \ --height "${HEIGHT:-1080}" \ - --output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \ + --output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \ || exit 1 ; } \ ; ./enable-ssh.sh && /bin/bash -c ./Launch.sh |