From 0fa38e4a4a5dd286d4340f667e8c6aa34a799aca Mon Sep 17 00:00:00 2001 From: joshua stein Date: Wed, 15 Jan 2020 14:45:39 -0600 Subject: [PATCH] Build: use $SUDO_[UG]ID in build-image-* instead of relying on makeall --- Kernel/build-image-grub.sh | 2 +- Kernel/build-image-qemu.sh | 2 +- Kernel/makeall.sh | 6 ------ 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Kernel/build-image-grub.sh b/Kernel/build-image-grub.sh index 3e3d4d314f..70e12c5429 100755 --- a/Kernel/build-image-grub.sh +++ b/Kernel/build-image-grub.sh @@ -23,7 +23,7 @@ echo "using grub-install at ${grub}" echo "setting up disk image..." dd if=/dev/zero of=_disk_image bs=1M count="${DISK_SIZE:-600}" status=none || die "couldn't create disk image" -chown 1000:1000 _disk_image || die "couldn't adjust permissions on disk image" +chown "$SUDO_UID":"$SUDO_GID" _disk_image || die "couldn't adjust permissions on disk image" echo "done" printf "creating loopback device... " diff --git a/Kernel/build-image-qemu.sh b/Kernel/build-image-qemu.sh index 41b9e35710..75ba9f070e 100755 --- a/Kernel/build-image-qemu.sh +++ b/Kernel/build-image-qemu.sh @@ -16,7 +16,7 @@ if [ "$(uname -s)" = "Darwin" ]; then fi echo "setting up disk image..." qemu-img create _disk_image "${DISK_SIZE:-600}"m || die "couldn't create disk image" -chown "$build_user":"$build_group" _disk_image || die "couldn't adjust permissions on disk image" +chown "$SUDO_UID":"$SUDO_GID" _disk_image || die "couldn't adjust permissions on disk image" echo "done" printf "creating new filesystem... " diff --git a/Kernel/makeall.sh b/Kernel/makeall.sh index 2782b23223..0bf6b4fa03 100755 --- a/Kernel/makeall.sh +++ b/Kernel/makeall.sh @@ -4,12 +4,6 @@ set -e script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P) cd "$script_path" -# Get user and group details for setting qemu disk image ownership -build_user=$(id -u) -build_group=$(id -g) -export build_user -export build_group - fast_mode= while [ "$1" != "" ]; do case $1 in