From 258f6b455d14aeb449260b668a9d16478a48ac5c Mon Sep 17 00:00:00 2001 From: sickcodes Date: Fri, 26 Feb 2021 06:42:57 +0000 Subject: [PATCH] Fix /env permissions for persistence after GENERATE_UNIQUE. Fix the following warning by chowning /dev/kvm earlier "libguestfs: warning: current user is not a member of the KVM group (group ID 108). This user cannot access /dev/kvm, so libguestfs may run very slowly. It is recommended that you 'chmod 0666 /dev/kvm' or add the current user to the KVM group (you might need to log out and log in again)." --- Dockerfile | 2 +- Dockerfile.auto | 4 ++-- Dockerfile.naked | 2 +- custom/generate-unique-machine-values.sh | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index f1f9f88..77445c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -264,7 +264,7 @@ VOLUME ["/tmp/.X11-unix"] # the default serial numbers are already contained in ./OpenCore-Catalina/OpenCore.qcow2 # And the default serial numbers -CMD sudo chown "$(id -u)":"$(id -g)" "${IMAGE_PATH}" "${BOOTDISK}" 2>/dev/null || true \ +CMD sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \ ; case "$(file --brief /image)" in \ QEMU\ QCOW2\ Image* ) export IMAGE_PATH=/image \ ;; \ diff --git a/Dockerfile.auto b/Dockerfile.auto index 06ac9a7..15f6339 100644 --- a/Dockerfile.auto +++ b/Dockerfile.auto @@ -140,9 +140,9 @@ ENV TERMS_OF_USE=i_agree ENV BOILERPLATE="By using this Dockerfile, you hereby agree that you are a security reseacher or developer and agree to use this Dockerfile to make the world a safer place. Examples include: making your apps safer, finding your mobile phone, compiling security products, etc. You understand that Docker-OSX is an Open Source project, which is released to the public under the GNU Pulic License version 3 and above. You acknowledge that the Open Source project is absolutely unaffiliated with any third party, in any form whatsoever. Any trademarks or intelectual property which happen to be mentioned anywhere in or around the project are owned by their respective owners. By using this Dockerfile, you agree to agree to the EULA of each piece of upstream or downstream software. The following code is released for the sole purpose of security research, under the GNU Public License version 3. If you are concerned about the licensing, please note that this project is not AGPL. A copy of the license is available online: https://github.com/sickcodes/Docker-OSX/blob/master/LICENSE. In order to use the following Dockerfile you must read and understand the terms. Once you have read the terms, use the -e TERMS_OF_USE=i_agree or -e TERMS_OF_USE=i_disagree" CMD echo "${BOILERPLATE}" \ - && [[ "${TERMS_OF_USE}" = i_agree ]] || exit 1 \ + ; [[ "${TERMS_OF_USE}" = i_agree ]] || exit 1 \ ; echo "Disk is being copied between layers... Please wait a minute..." \ - && sudo chown "$(id -u)":"$(id -g)" "${IMAGE_PATH}" "${BOOTDISK}" 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=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2 \ diff --git a/Dockerfile.naked b/Dockerfile.naked index 0ebc65e..5c17c93 100644 --- a/Dockerfile.naked +++ b/Dockerfile.naked @@ -111,7 +111,7 @@ ENV IMAGE_PATH=/image ENV NOPICKER=true -CMD sudo chown "$(id -u)":"$(id -g)" "${IMAGE_PATH}" "${BOOTDISK}" 2>/dev/null || true \ +CMD sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \ ; [[ "${DISPLAY}" = ':99' ]] && { \ nohup Xvfb :99 -screen 0 1920x1080x16 \ & until [[ "$(xrandr --query 2>/dev/null)" ]]; do sleep 1 ; done \ diff --git a/custom/generate-unique-machine-values.sh b/custom/generate-unique-machine-values.sh index 18bdc5f..6692e29 100755 --- a/custom/generate-unique-machine-values.sh +++ b/custom/generate-unique-machine-values.sh @@ -259,7 +259,7 @@ EOF [[ -e "${TSV_SERIAL_SETS_FILE}" ]] && \ - cat <(printf "DEVICE_MODEL\tSERIAL\BOARD_SERIAL\tUUID\tMAC_ADDRESS\n") "${TSV_SERIAL_SETS_FILE}" + cat <(printf "DEVICE_MODEL\tSERIAL\tBOARD_SERIAL\tUUID\tMAC_ADDRESS\n") "${TSV_SERIAL_SETS_FILE}" }