From 2f09dfd201afe95e421c02334f2dc8f27197ccab Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Tue, 10 Sep 2024 13:19:37 -0400 Subject: [PATCH] Add my helper scripts --- helper_scripts/build_os.sh | 34 +++++++++++++++++++++++++++ helper_scripts/build_sys.sh | 18 ++++++++++++++ helper_scripts/clang-format-helper.sh | 15 ++++++++++++ 3 files changed, 67 insertions(+) create mode 100755 helper_scripts/build_os.sh create mode 100755 helper_scripts/build_sys.sh create mode 100755 helper_scripts/clang-format-helper.sh diff --git a/helper_scripts/build_os.sh b/helper_scripts/build_os.sh new file mode 100755 index 0000000..f684873 --- /dev/null +++ b/helper_scripts/build_os.sh @@ -0,0 +1,34 @@ +#!/bin/sh +set -e + +if [ "$1" = "" ]; then + echo "argument cannot be empty" + exit 1 +fi + +cd "$(dirname $0)" +PARENT_DIR="$(pwd)" + +rm -fr "${1}_build" os161-ostree || true +cp -r "${1}" "${1}_build" +cd "${1}_build" + +./configure --ostree="${PARENT_DIR}/os161-ostree" + +TARGET_KERNEL=DUMBVM + +cd kern/conf +./config $TARGET_KERNEL +cd ../compile/$TARGET_KERNEL +#-j`nproc` does not affect output of bmake +bmake depend -j`nproc` +bmake -j`nproc` +bmake install +cd ../../.. + +bmake -j`nproc` +bmake depend -j`nproc` +bmake install + +cd .. +cp -v sys161.conf os161-ostree/ diff --git a/helper_scripts/build_sys.sh b/helper_scripts/build_sys.sh new file mode 100755 index 0000000..316091e --- /dev/null +++ b/helper_scripts/build_sys.sh @@ -0,0 +1,18 @@ +#!/bin/sh +set -e +VER="2.0.8" + +rm -fr sys161-"$VER" sys161 || true + +tar xvf sys161-"$VER".tar.zst + +mkdir sys161 + +cd sys161-"$VER" + +#fix build with newer compilers +sed -i 's/uint64_t extra_selecttime/extern uint64_t extra_selecttime/' include/onsel.h + +./configure --prefix=../../sys161 mipseb +bmake +bmake install diff --git a/helper_scripts/clang-format-helper.sh b/helper_scripts/clang-format-helper.sh new file mode 100755 index 0000000..ca62946 --- /dev/null +++ b/helper_scripts/clang-format-helper.sh @@ -0,0 +1,15 @@ +#!/bin/sh +set -e + +if [ "$1" = "" ]; then + echo "argument cannot be empty" + exit 1 +fi + +cd $1 + +echo "IncludeBlocks: Preserve +SortIncludes: Never" > .clang-format +find . -type f \( -iname \*.c -o -iname \*.h \) | xargs clang-format -i + +