summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rwxr-xr-xMeta/build-image-qemu.sh3
-rwxr-xr-xMeta/sync.sh6
3 files changed, 3 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fb1e821d68..af6e0b1c19 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,7 +13,7 @@ set(CMAKE_INSTALL_MESSAGE NEVER)
enable_testing()
add_custom_target(image
- COMMAND ${CMAKE_COMMAND} -E env "SERENITY_ROOT=${CMAKE_SOURCE_DIR}" ${CMAKE_SOURCE_DIR}/Meta/sync.sh
+ COMMAND ${CMAKE_COMMAND} -E env "SERENITY_ROOT=${CMAKE_SOURCE_DIR}" ${CMAKE_SOURCE_DIR}/Meta/build-image-qemu.sh
BYPRODUCTS ${CMAKE_BINARY_DIR}/_disk_image
USES_TERMINAL
)
diff --git a/Meta/build-image-qemu.sh b/Meta/build-image-qemu.sh
index b26fb1838e..578a56c4b1 100755
--- a/Meta/build-image-qemu.sh
+++ b/Meta/build-image-qemu.sh
@@ -8,8 +8,9 @@ die() {
}
if [ "$(id -u)" != 0 ]; then
- die "this script needs to run as root"
+ exec sudo -E -- "$0" "$@" || die "this script needs to run as root"
fi
+
if [ "$(uname -s)" = "Darwin" ]; then
export PATH="/usr/local/opt/e2fsprogs/bin:$PATH"
export PATH="/usr/local/opt/e2fsprogs/sbin:$PATH"
diff --git a/Meta/sync.sh b/Meta/sync.sh
deleted file mode 100755
index bc6f26b205..0000000000
--- a/Meta/sync.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-set -e
-
-script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
-
-sudo -E PATH="$PATH" "$script_path/build-image-qemu.sh"