Keep build menu under local user

This commit is contained in:
root
2026-04-30 15:16:24 +00:00
parent f7fd473a4c
commit a95d23c7f1
2 changed files with 18 additions and 0 deletions
+14
View File
@@ -10,6 +10,20 @@ HOST_WIN64="${HOST_WIN64:-x86_64-w64-mingw32}"
MENU_CHOICE=""
ROOT=""
if [[ "${EUID:-$(id -u)}" -eq 0 && "${ALLOW_ROOT_BUILD_MENU:-0}" != "1" ]]; then
cat >&2 <<EOF
Do not run this script with sudo.
Run it as your normal local user:
./contrib/agrarian-build-menu.sh
The script will ask for sudo only when it needs to install Ubuntu packages or
set the MinGW POSIX compiler alternatives. Repository checkout, compilation,
daemon config, and user systemd service setup run as the local user.
EOF
exit 1
fi
has_cmd() {
command -v "$1" >/dev/null 2>&1
}
+4
View File
@@ -20,6 +20,10 @@ From an existing checkout:
./contrib/agrarian-build-menu.sh
Do not run the script with `sudo`. It runs checkout, compilation, daemon config,
and the user systemd service as the current local user. It asks for sudo only
when it needs to install Ubuntu packages or set MinGW compiler alternatives.
From a fresh Ubuntu host:
sudo apt-get update