From bc79a1fffb44c37efe6534e6c1c3b9265bbe8f62 Mon Sep 17 00:00:00 2001 From: sickcodes Date: Mon, 29 Nov 2021 04:15:44 +0000 Subject: Shrink the Docker containers, significantly. --- Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index f57989a..9aa8bc1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -145,7 +145,7 @@ 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 @@ -226,7 +226,8 @@ RUN sudo pacman -Syy \ && sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm \ && sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm \ && rm -rf /var/tmp/.guestfs-* \ - ; libguestfs-test-tool || exit 1 + ; libguestfs-test-tool || exit 1 \ + ; rm -rf /var/tmp/.guestfs-* #### @@ -260,7 +261,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 +273,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 -- cgit v1.2.3 From e55e55229da4c15dce0523e317819cf491880a35 Mon Sep 17 00:00:00 2001 From: sickcodes Date: Mon, 29 Nov 2021 04:34:20 +0000 Subject: Use qcow for BaseSystem.img instead because it sheds 2G off image size. Add back in stock OpenCore bootdisks; size negligible after removing cache. --- Dockerfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 9aa8bc1..26d52e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -147,7 +147,9 @@ WORKDIR /home/arch/OSX-KVM ARG SHORTNAME=catalina -RUN make +RUN make \ + && qemu-img convert BaseSystem.dmg -O qcow2 -p -c BaseSystem.img \ + && rm ./BaseSystem.dmg ARG LINUX=true @@ -182,7 +184,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/OpenCore.qcow2} \' \ + && tee -a Launch.sh <<< '-drive id=OpenCoreBoot,if=none,snapshot=on,format=${BASESYSTEM_FORMAT},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 \' \ @@ -285,6 +287,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= -- cgit v1.2.3 From 4805b9169b268a282a386e5e1b4fcd4be6c7c137 Mon Sep 17 00:00:00 2001 From: sickcodes Date: Mon, 29 Nov 2021 04:41:24 +0000 Subject: Add Monterey recovery disk to `:naked`; it is backwards compatible (APFS), however Catalina's recovery image is useless on Monterey images. --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 26d52e9..6d50a67 100644 --- a/Dockerfile +++ b/Dockerfile @@ -184,10 +184,10 @@ 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=${BASESYSTEM_FORMAT},file=${BOOTDISK:-/home/arch/OSX-KVM/OpenCore/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=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} \' \ -- cgit v1.2.3 From c9b33ddb62698d8735474dafd774e232c0e15081 Mon Sep 17 00:00:00 2001 From: sickcodes Date: Mon, 29 Nov 2021 06:21:14 +0000 Subject: Rare issue regarding signatures from the arch archives. --- Dockerfile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 6d50a67..7a376e2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -222,14 +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 +# fixe ad hoc errors from using the arch museum to get libguestfs +RUN tee -a /etc/pacman.conf <<< "RemoteFileSigLevel = Optional" + 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 \ - ; rm -rf /var/tmp/.guestfs-* + && yes | sudo pacman -Scc \ + && libguestfs-test-tool || exit 1 \ + && rm -rf /var/tmp/.guestfs-* #### -- cgit v1.2.3 From 2d79f0607917859fa504a7143e7f1157be983cae Mon Sep 17 00:00:00 2001 From: sickcodes Date: Mon, 29 Nov 2021 07:19:48 +0000 Subject: `RUN sudo sed -i -e 's/^\#RemoteFileSigLevel/RemoteFileSigLevel/g' /etc/pacman.conf` --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 7a376e2..a8fe617 100644 --- a/Dockerfile +++ b/Dockerfile @@ -222,8 +222,8 @@ 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 -# fixe ad hoc errors from using the arch museum to get libguestfs -RUN tee -a /etc/pacman.conf <<< "RemoteFileSigLevel = Optional" +# 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 \ -- cgit v1.2.3