From e6fcfd86dbbb9854ceefe82b49b957edfa19c52b Mon Sep 17 00:00:00 2001 From: sickcodes Date: Sun, 31 Oct 2021 00:09:09 +0000 Subject: [PATCH] libguestfs games --- Dockerfile | 33 ++++++++++++++++++--------------- Dockerfile.auto | 18 +++++++----------- Dockerfile.monterey | 17 ++++++++--------- Dockerfile.naked | 18 +++++++----------- Dockerfile.naked-auto | 18 +++++++----------- 5 files changed, 47 insertions(+), 57 deletions(-) diff --git a/Dockerfile b/Dockerfile index d7c18a0..01d2887 100644 --- a/Dockerfile +++ b/Dockerfile @@ -166,6 +166,13 @@ 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' @@ -230,17 +237,13 @@ 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 -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 pacman -U "${KERNEL_HEADERS_PACKAGE_URL}" --noconfirm \ - ; sudo pacman -S mkinitcpio --noconfirm \ - ; sudo libguestfs-test-tool \ - ; sudo rm -rf /var/tmp/.guestfs-* \ - ; fi +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 \ + && rm -rf /var/tmp/.guestfs-* \ + ; libguestfs-test-tool || exit 1 #### @@ -249,6 +252,10 @@ RUN if [[ "${LINUX}" == true ]]; then \ # 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 @@ -335,10 +342,6 @@ 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 diff --git a/Dockerfile.auto b/Dockerfile.auto index c2666b7..f9ee9b9 100644 --- a/Dockerfile.auto +++ b/Dockerfile.auto @@ -104,17 +104,13 @@ 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 -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 pacman -U "${KERNEL_HEADERS_PACKAGE_URL}" --noconfirm \ - ; sudo pacman -S mkinitcpio --noconfirm \ - ; sudo libguestfs-test-tool \ - ; sudo rm -rf /var/tmp/.guestfs-* \ - ; fi +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 \ + && rm -rf /var/tmp/.guestfs-* \ + ; libguestfs-test-tool || exit 1 #### diff --git a/Dockerfile.monterey b/Dockerfile.monterey index e09b577..0edba12 100644 --- a/Dockerfile.monterey +++ b/Dockerfile.monterey @@ -125,17 +125,16 @@ 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 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 -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 -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 \ + && rm -rf /var/tmp/.guestfs-* \ + ; libguestfs-test-tool || exit 1 #### diff --git a/Dockerfile.naked b/Dockerfile.naked index 34f5adc..fe9c5a7 100644 --- a/Dockerfile.naked +++ b/Dockerfile.naked @@ -92,17 +92,13 @@ 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 -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 pacman -U "${KERNEL_HEADERS_PACKAGE_URL}" --noconfirm \ - ; sudo pacman -S mkinitcpio --noconfirm \ - ; sudo libguestfs-test-tool \ - ; sudo rm -rf /var/tmp/.guestfs-* \ - ; fi +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 \ + && rm -rf /var/tmp/.guestfs-* \ + ; libguestfs-test-tool || exit 1 #### diff --git a/Dockerfile.naked-auto b/Dockerfile.naked-auto index 99d4b28..13edc0a 100644 --- a/Dockerfile.naked-auto +++ b/Dockerfile.naked-auto @@ -84,17 +84,13 @@ 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 -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 pacman -U "${KERNEL_HEADERS_PACKAGE_URL}" --noconfirm \ - ; sudo pacman -S mkinitcpio --noconfirm \ - ; sudo libguestfs-test-tool \ - ; sudo rm -rf /var/tmp/.guestfs-* \ - ; fi +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 \ + && rm -rf /var/tmp/.guestfs-* \ + ; libguestfs-test-tool || exit 1 ####