mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:38:12 +00:00
Meta: Start moving common shell definitions into a common file
This commit is contained in:
parent
9d6c4c5137
commit
2a4f81fc83
6 changed files with 25 additions and 50 deletions
15
Meta/.shell_include.sh
Executable file
15
Meta/.shell_include.sh
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
# SC2034: "Variable appears unused. Verify it or export it."
|
||||||
|
# Those are intentional here, as the file is meant to be included elsewhere.
|
||||||
|
|
||||||
|
SUDO="sudo"
|
||||||
|
|
||||||
|
if [ "$(uname -s)" = "SerenityOS" ]; then
|
||||||
|
SUDO="pls"
|
||||||
|
fi
|
||||||
|
|
||||||
|
die() {
|
||||||
|
echo "die: $*"
|
||||||
|
exit 1
|
||||||
|
}
|
|
@ -2,16 +2,9 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
SUDO="sudo"
|
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
||||||
|
|
||||||
if [ "$(uname -s)" = "SerenityOS" ]; then
|
. "${script_path}/.shell_include.sh"
|
||||||
SUDO="pls"
|
|
||||||
fi
|
|
||||||
|
|
||||||
die() {
|
|
||||||
echo "die: $*"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "$(id -u)" != 0 ]; then
|
if [ "$(id -u)" != 0 ]; then
|
||||||
set +e
|
set +e
|
||||||
|
@ -98,7 +91,6 @@ mkdir -p mnt
|
||||||
mount "${dev}${partition_number}" mnt/ || die "couldn't mount filesystem"
|
mount "${dev}${partition_number}" mnt/ || die "couldn't mount filesystem"
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|
||||||
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
|
||||||
"$script_path/build-root-filesystem.sh"
|
"$script_path/build-root-filesystem.sh"
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
|
|
|
@ -2,16 +2,9 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
SUDO="sudo"
|
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
||||||
|
|
||||||
if [ "$(uname -s)" = "SerenityOS" ]; then
|
. "${script_path}/.shell_include.sh"
|
||||||
SUDO="pls"
|
|
||||||
fi
|
|
||||||
|
|
||||||
die() {
|
|
||||||
echo "die: $*"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "$(id -u)" != 0 ]; then
|
if [ "$(id -u)" != 0 ]; then
|
||||||
set +e
|
set +e
|
||||||
|
@ -116,7 +109,6 @@ mkdir -p mnt
|
||||||
mount "${dev}${partition_number}" mnt/ || die "couldn't mount filesystem"
|
mount "${dev}${partition_number}" mnt/ || die "couldn't mount filesystem"
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|
||||||
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
|
||||||
"$script_path/build-root-filesystem.sh"
|
"$script_path/build-root-filesystem.sh"
|
||||||
|
|
||||||
if [ -z "$2" ]; then
|
if [ -z "$2" ]; then
|
||||||
|
|
|
@ -2,16 +2,9 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
SUDO="sudo"
|
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
||||||
|
|
||||||
if [ "$(uname -s)" = "SerenityOS" ]; then
|
. "${script_path}/.shell_include.sh"
|
||||||
SUDO="pls"
|
|
||||||
fi
|
|
||||||
|
|
||||||
die() {
|
|
||||||
echo "die: $*"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ ! -d "limine" ]; then
|
if [ ! -d "limine" ]; then
|
||||||
echo "limine not found, the script will now build it"
|
echo "limine not found, the script will now build it"
|
||||||
|
@ -102,7 +95,6 @@ mkdir -p mnt
|
||||||
mount "${dev}p2" mnt || die "couldn't mount root filesystem"
|
mount "${dev}p2" mnt || die "couldn't mount root filesystem"
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|
||||||
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
|
||||||
"$script_path/build-root-filesystem.sh"
|
"$script_path/build-root-filesystem.sh"
|
||||||
|
|
||||||
echo "installing limine"
|
echo "installing limine"
|
||||||
|
|
|
@ -14,16 +14,9 @@ fi
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
SUDO="sudo"
|
SCRIPT_DIR="$(dirname "${0}")"
|
||||||
|
|
||||||
if [ "$(uname -s)" = "SerenityOS" ]; then
|
. "${SCRIPT_DIR}/.shell_include.sh"
|
||||||
SUDO="pls"
|
|
||||||
fi
|
|
||||||
|
|
||||||
die() {
|
|
||||||
echo "die: $*"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
USE_FUSE2FS=0
|
USE_FUSE2FS=0
|
||||||
|
|
||||||
|
@ -66,7 +59,6 @@ else
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SCRIPT_DIR="$(dirname "${0}")"
|
|
||||||
|
|
||||||
# Prepend the toolchain qemu directory so we pick up QEMU from there
|
# Prepend the toolchain qemu directory so we pick up QEMU from there
|
||||||
PATH="$SCRIPT_DIR/../Toolchain/Local/qemu/bin:$PATH"
|
PATH="$SCRIPT_DIR/../Toolchain/Local/qemu/bin:$PATH"
|
||||||
|
|
|
@ -2,16 +2,9 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
SUDO="sudo"
|
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
||||||
|
|
||||||
if [ "$(uname -s)" = "SerenityOS" ]; then
|
. "${script_path}/.shell_include.sh"
|
||||||
SUDO="pls"
|
|
||||||
fi
|
|
||||||
|
|
||||||
die() {
|
|
||||||
echo "die: $*"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
if [ -d mnt ]; then
|
if [ -d mnt ]; then
|
||||||
|
@ -60,5 +53,4 @@ else
|
||||||
echo "done"
|
echo "done"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
|
||||||
"$script_path/build-root-filesystem.sh"
|
"$script_path/build-root-filesystem.sh"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue