From 9a8239f8ecac3c0c891f9c12a52da16dfb63e979 Mon Sep 17 00:00:00 2001 From: sickcodes Date: Wed, 28 Jul 2021 18:06:03 +0000 Subject: [PATCH 1/3] Remove glibc patches, introduce libguestfs test --- Dockerfile | 38 -------------------------------------- Dockerfile.auto | 29 ++++++++++++----------------- Dockerfile.naked | 28 +++++++++++----------------- 3 files changed, 23 insertions(+), 72 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7e9b1e7..a2b91c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -67,12 +67,6 @@ ARG RANKMIRRORS ARG MIRROR_COUNTRY=US ARG MIRROR_COUNT=10 -# TEMP-FIX for pacman issue -RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst \ - && curl -LO "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/${patched_glibc}" \ - && bsdtar -C / -xvf "${patched_glibc}" || echo "Everything is fine." -# TEMP-FIX for pacman issue - RUN if [[ "${RANKMIRRORS}" ]]; then \ { pacman -Sy wget --noconfirm || pacman -Syu wget --noconfirm ; } \ ; wget -O ./rankmirrors "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/rankmirrors" \ @@ -99,12 +93,6 @@ RUN pacman -Syu git zip vim nano alsa-utils openssh --noconfirm \ && mkdir /home/arch \ && chown arch:arch /home/arch -# TEMP-FIX for pacman issue -RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst \ - && curl -LO "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/${patched_glibc}" \ - && bsdtar -C / -xvf "${patched_glibc}" || echo "Everything is fine." -# TEMP-FIX for pacman issue - # allow ssh to container RUN mkdir -m 700 /root/.ssh @@ -143,15 +131,6 @@ RUN touch enable-ssh.sh \ && tee -a enable-ssh.sh <<< 'sudo /usr/bin/ssh-keygen -A' \ && tee -a enable-ssh.sh <<< 'nohup sudo /usr/bin/sshd -D &' -# TEMP-FIX for pacman issue -RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst \ - && curl -LO "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/${patched_glibc}" \ - && bsdtar -C / -xvf "${patched_glibc}" || echo "Everything is fine." -# TEMP-FIX for pacman issue - -# RUN sudo systemctl enable libvirtd.service -# RUN sudo systemctl enable virtlogd.service - # QEMU CONFIGURATOR # set optional ram at runtime -e RAM=16 # set optional cores at runtime -e SMP=4 -e CORES=2 @@ -164,12 +143,6 @@ RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst \ RUN yes | sudo pacman -Syu qemu libvirt dnsmasq virt-manager bridge-utils openresolv jack ebtables edk2-ovmf netctl libvirt-dbus wget --overwrite --noconfirm \ && yes | sudo pacman -Scc -# TEMP-FIX for pacman issue -RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst \ - && curl -LO "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/${patched_glibc}" \ - && bsdtar -C / -xvf "${patched_glibc}" || echo "Everything is fine." -# TEMP-FIX for pacman issue - WORKDIR /home/arch/OSX-KVM RUN wget https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/fetch-macOS.py @@ -199,18 +172,8 @@ 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 \ - && patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst \ - && curl -LO "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/${patched_glibc}" \ - && bsdtar -C / -xvf "${patched_glibc}" || echo "Everything is fine." \ ; fi -# TEMP-FIX for file 5.40 libguestfs issue -RUN yes | sudo pacman -U https://archive.archlinux.org/packages/f/file/file-5.39-1-x86_64.pkg.tar.zst \ - && patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst \ - && curl -LO "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/${patched_glibc}" \ - && bsdtar -C / -xvf "${patched_glibc}" || echo "Everything is fine." -# TEMP-FIX for file 5.40 libguestfs issue - # optional --build-arg to change branches for testing ARG BRANCH=master ARG REPO='https://github.com/sickcodes/Docker-OSX.git' @@ -259,7 +222,6 @@ RUN grep -v InstallMedia ./Launch.sh > ./Launch-nopicker.sh \ # 5.13 problem - ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1 diff --git a/Dockerfile.auto b/Dockerfile.auto index 9e4ac04..317bf9a 100644 --- a/Dockerfile.auto +++ b/Dockerfile.auto @@ -71,12 +71,6 @@ RUN if [[ "${RANKMIRRORS}" ]]; then \ ; fi \ ; yes | pacman -Scc -# TEMP-FIX for pacman issue -RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst \ - && curl -LO "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/${patched_glibc}" \ - && bsdtar -C / -xvf "${patched_glibc}" || echo "Everything is fine." -# TEMP-FIX for pacman issue - RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr sshpass --noconfirm \ && if [[ "${SCROT}" ]]; then \ pacman -Syu scrot base-devel --noconfirm \ @@ -94,19 +88,20 @@ RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr sshpass --noc ; fi \ ; yes | pacman -Scc -# TEMP-FIX for pacman issue -RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst \ - && curl -LO "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/${patched_glibc}" \ - && bsdtar -C / -xvf "${patched_glibc}" || echo "Everything is fine." -# TEMP-FIX for pacman issue +# 5.13 problem +ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux + +ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1 -# TEMP-FIX for file 5.40 libguestfs issue -RUN yes | sudo pacman -U https://archive.archlinux.org/packages/f/file/file-5.39-1-x86_64.pkg.tar.zst \ - && patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst \ - && curl -LO "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/${patched_glibc}" \ - && bsdtar -C / -xvf "${patched_glibc}" || echo "Everything is fine." -# TEMP-FIX for file 5.40 libguestfs issue +ENV SUPERMIN_KERNEL_VERSION=5.12.14-arch1-1 +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 \ + ; rm -rf /var/tmp/.guestfs-* \ + ; libguestfs-test-tool + USER arch WORKDIR /home/arch/OSX-KVM diff --git a/Dockerfile.naked b/Dockerfile.naked index 39373ce..8f91a4f 100644 --- a/Dockerfile.naked +++ b/Dockerfile.naked @@ -56,12 +56,6 @@ RUN if [[ "${RANKMIRRORS}" ]]; then { pacman -Sy wget --noconfirm || pacman -Syu && tee -a /etc/pacman.d/mirrorlist <<< 'Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch' \ && cat /etc/pacman.d/mirrorlist ; fi -# TEMP-FIX for pacman issue -RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst \ - && curl -LO "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/${patched_glibc}" \ - && bsdtar -C / -xvf "${patched_glibc}" || echo "Everything is fine." -# TEMP-FIX for pacman issue - # For taking screenshots of the Xfvb screen, useful during development. ARG SCROT @@ -82,19 +76,19 @@ RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr sshpass --noc ; fi \ ; yes | pacman -Scc -# TEMP-FIX for pacman issue -RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst \ - && curl -LO "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/${patched_glibc}" \ - && bsdtar -C / -xvf "${patched_glibc}" || echo "Everything is fine." -# TEMP-FIX for pacman issue +# 5.13 problem +ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux + +ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1 -# TEMP-FIX for file 5.40 libguestfs issue -RUN yes | sudo pacman -U https://archive.archlinux.org/packages/f/file/file-5.39-1-x86_64.pkg.tar.zst \ - && patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst \ - && curl -LO "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/${patched_glibc}" \ - && bsdtar -C / -xvf "${patched_glibc}" || echo "Everything is fine." -# TEMP-FIX for file 5.40 libguestfs issue +ENV SUPERMIN_KERNEL_VERSION=5.12.14-arch1-1 +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 \ + ; rm -rf /var/tmp/.guestfs-* \ + ; libguestfs-test-tool USER arch From ae32ff2cb4b3e522cc31f2e8ce292d0a5dae4f00 Mon Sep 17 00:00:00 2001 From: sickcodes Date: Wed, 28 Jul 2021 18:32:48 +0000 Subject: [PATCH 2/3] Shift supermin environment variables earlier --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index a2b91c8..87bacc2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -220,6 +220,9 @@ 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 From b96bac8cd27be8d85ecec0a53707cefb080b1538 Mon Sep 17 00:00:00 2001 From: sickcodes Date: Wed, 28 Jul 2021 18:34:48 +0000 Subject: [PATCH 3/3] Shift supermin environment variables earlier all images --- Dockerfile | 6 +----- Dockerfile.auto | 8 +++++--- Dockerfile.naked | 8 +++++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 87bacc2..1e0989f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -235,13 +235,9 @@ 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 \ - ; rm -rf /var/tmp/.guestfs-* \ + ; sudo rm -rf /var/tmp/.guestfs-* \ ; libguestfs-test-tool -USER arch - -ENV USER arch - #### SPECIAL RUNTIME ARGUMENTS BELOW # env -e ADDITIONAL_PORTS with a comma diff --git a/Dockerfile.auto b/Dockerfile.auto index 317bf9a..0a58725 100644 --- a/Dockerfile.auto +++ b/Dockerfile.auto @@ -88,6 +88,10 @@ RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr sshpass --noc ; fi \ ; yes | pacman -Scc +USER arch + +ENV USER arch + # 5.13 problem ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux @@ -99,10 +103,8 @@ 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 \ - ; rm -rf /var/tmp/.guestfs-* \ + ; sudo rm -rf /var/tmp/.guestfs-* \ ; libguestfs-test-tool - -USER arch WORKDIR /home/arch/OSX-KVM diff --git a/Dockerfile.naked b/Dockerfile.naked index 8f91a4f..481bc43 100644 --- a/Dockerfile.naked +++ b/Dockerfile.naked @@ -76,6 +76,10 @@ RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr sshpass --noc ; fi \ ; yes | pacman -Scc +USER arch + +ENV USER arch + # 5.13 problem ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux @@ -87,11 +91,9 @@ 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 \ - ; rm -rf /var/tmp/.guestfs-* \ + ; sudo rm -rf /var/tmp/.guestfs-* \ ; libguestfs-test-tool -USER arch - WORKDIR /home/arch/OSX-KVM RUN mkdir -p ~/.ssh \