Toolchain: Exit Build*.sh scripts if executed as root

This commit is contained in:
Kenneth Myhra 2023-04-24 20:24:22 +02:00 committed by Andrew Kaster
parent 9ef3704ce8
commit f5cb46e316
Notes: sideshowbarker 2024-07-17 21:26:19 +09:00
9 changed files with 48 additions and 3 deletions

View File

@ -5,6 +5,11 @@ set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# shellcheck source=/dev/null
. "${DIR}/../Meta/shell_include.sh"
exit_if_running_as_root "Do not run BuildCMake.sh as root, parts of your Toolchain directory will become root-owned"
PREFIX_DIR="$DIR/Local/cmake"
BUILD_DIR="$DIR/Build/cmake"
TARBALLS_DIR="$DIR/Tarballs"

View File

@ -5,6 +5,11 @@ set -eo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# shellcheck source=/dev/null
. "${DIR}/../Meta/shell_include.sh"
exit_if_running_as_root "Do not run BuildClang.sh as root, parts of your Toolchain directory will become root-owned"
echo "$DIR"
PREFIX="$DIR/Local/clang/"

View File

@ -3,6 +3,12 @@ set -e
# This file will need to be run in bash.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# shellcheck source=/dev/null
. "${DIR}/../Meta/shell_include.sh"
exit_if_running_as_root "Do not run BuildFuseExt2.sh as root, parts of your Toolchain directory will become root-owned"
export PATH="/usr/local/opt/m4/bin:$PATH"
die() {

View File

@ -1,14 +1,19 @@
#!/usr/bin/env bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# shellcheck source=/dev/null
. "${DIR}/../Meta/shell_include.sh"
exit_if_running_as_root "Do not run BuildGDB.sh as root, parts of your Toolchain directory will become root-owned"
GDB_VERSION="13.1"
GDB_MD5SUM="4aaad768ff2585464173c091947287ec"
GDB_NAME="gdb-$GDB_VERSION"
GDB_PKG="${GDB_NAME}.tar.xz"
GDB_BASE_URL="https://ftp.gnu.org/gnu/gdb"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ARCH=${1:-"x86_64"}
TARGET="$ARCH-pc-serenity"
PREFIX="$DIR/Local/$ARCH-gdb"

View File

@ -2,11 +2,15 @@
set -eo pipefail
# This file will need to be run in bash, for now.
# === CONFIGURATION AND SETUP ===
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# shellcheck source=/dev/null
. "${DIR}/../Meta/shell_include.sh"
exit_if_running_as_root "Do not run BuildIt.sh as root, your Build directory will become root-owned"
echo "$DIR"
ARCH=${ARCH:-"x86_64"}

View File

@ -6,6 +6,11 @@ set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# shellcheck source=/dev/null
. "${DIR}/../Meta/shell_include.sh"
exit_if_running_as_root "Do not run BuildMold.sh as root, parts of your Toolchain directory will become root-owned"
NPROC="nproc"
SYSTEM_NAME="$(uname -s)"

View File

@ -5,6 +5,11 @@ set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# shellcheck source=/dev/null
. "${DIR}/../Meta/shell_include.sh"
exit_if_running_as_root "Do not run BuildPython.sh as root, parts of your Toolchain directory will become root-owned"
PREFIX_DIR="$DIR/Local/python"
BUILD_DIR="$DIR/Build/python"
TARBALLS_DIR="$DIR/Tarballs"

View File

@ -5,6 +5,11 @@ set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# shellcheck source=/dev/null
. "${DIR}/../Meta/shell_include.sh"
exit_if_running_as_root "Do not run BuildQemu.sh as root, parts of your Toolchain directory will become root-owned"
echo "$DIR"
PREFIX="$DIR/Local/qemu"

View File

@ -5,6 +5,11 @@ set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# shellcheck source=/dev/null
. "${DIR}/../Meta/shell_include.sh"
exit_if_running_as_root "Do not run BuildRuby.sh as root, parts of your Toolchain directory will become root-owned"
PREFIX_DIR="$DIR/Local/ruby"
BUILD_DIR="$DIR/Build/ruby"
TARBALLS_DIR="$DIR/Tarballs"