From 24033387a39772a42276b922f85babd7f4d66eda Mon Sep 17 00:00:00 2001 From: sickcodes Date: Fri, 29 Oct 2021 17:25:51 +0000 Subject: [PATCH] Fixes #368 Downgrade kernel for the subsystem to 5.12, and hold back libguestfs at libguestfs-1.44.1 --- Dockerfile | 43 +++++++++++++++++++++---------------------- Dockerfile.auto | 28 +++++++++++++++++++--------- Dockerfile.monterey | 25 ++++++++++++++++--------- Dockerfile.naked | 28 +++++++++++++++++++--------- Dockerfile.naked-auto | 27 ++++++++++++++++++--------- 5 files changed, 93 insertions(+), 58 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2c17de3..6225fd8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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' @@ -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 -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 +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 + +#### # These are hardcoded serials for non-iMessage related research # Overwritten by using GENERATE_UNIQUE=true @@ -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,15 +280,11 @@ RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \ --height "${STOCK_HEIGHT}" \ --output-bootdisk "${STOCK_BOOTDISK_NOPICKER}" -#### - -# 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= diff --git a/Dockerfile.auto b/Dockerfile.auto index 9629fe0..2fce725 100644 --- a/Dockerfile.auto +++ b/Dockerfile.auto @@ -92,19 +92,29 @@ USER arch ENV USER arch -# 5.13 problem -ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux -ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1 +#### libguestfs versioning + +# 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 WORKDIR /home/arch/OSX-KVM diff --git a/Dockerfile.monterey b/Dockerfile.monterey index cc72797..726b209 100644 --- a/Dockerfile.monterey +++ b/Dockerfile.monterey @@ -97,19 +97,26 @@ USER arch ENV USER arch -# 5.13 problem -ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux -ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1 +#### libguestfs versioning + +# 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 -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 +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 #### diff --git a/Dockerfile.naked b/Dockerfile.naked index bcc69cd..56aa876 100644 --- a/Dockerfile.naked +++ b/Dockerfile.naked @@ -81,19 +81,29 @@ USER arch ENV USER arch -# 5.13 problem -ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux -ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1 +#### libguestfs versioning + +# 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 WORKDIR /home/arch/OSX-KVM diff --git a/Dockerfile.naked-auto b/Dockerfile.naked-auto index bebf897..5296412 100644 --- a/Dockerfile.naked-auto +++ b/Dockerfile.naked-auto @@ -73,19 +73,28 @@ 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 WORKDIR /home/arch/OSX-KVM