From 6c3450475a65e26fc1f0a2fd9fefb6c6e81102e6 Mon Sep 17 00:00:00 2001 From: ag-tsotetsi Date: Sat, 7 Feb 2026 13:53:52 +0200 Subject: [PATCH] starter code --- build.bash | 19 +++++++++++++++++++ config/.gitkeep | 0 config/global.env | 10 ++++++++++ config/utilities.bash | 18 ++++++++++++++++++ 4 files changed, 47 insertions(+) create mode 100755 build.bash delete mode 100644 config/.gitkeep create mode 100644 config/global.env create mode 100644 config/utilities.bash diff --git a/build.bash b/build.bash new file mode 100755 index 0000000..c176ddc --- /dev/null +++ b/build.bash @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -euxo pipefail +umask 022 + +. config/global.env +. config/utilities.bash + + +if [ ! -d $SYSROOT ]; then + create_sysroot +fi + + +STAGE=$1 +PKG=$2 + + +. build/$PKG/build.bash $STAGE diff --git a/config/.gitkeep b/config/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/config/global.env b/config/global.env new file mode 100644 index 0000000..0c197e4 --- /dev/null +++ b/config/global.env @@ -0,0 +1,10 @@ + +export SYSROOT=$PWD/sysroot +export MAKEFLAGS=-j$(nproc) +export LC_ALL=POSIX +export TARGET=x86_64-axe-linux-gnu +export SOURCES=$PWD/sources +export BUILD=$PWD/build +export PATH=$SYSROOT/cross/bin:/usr/bin:/usr/sbin +export CONFIG_SITE=$SYSROOT/usr/share/config.site +export PROJECTDIR=$PWD \ No newline at end of file diff --git a/config/utilities.bash b/config/utilities.bash new file mode 100644 index 0000000..db0ba66 --- /dev/null +++ b/config/utilities.bash @@ -0,0 +1,18 @@ + + +fetch() { + wget -N -c --show-progress -q -P $SOURCES $1 +} + + +create_sysroot() { + mkdir -p $SYSROOT/{etc,cross,usr} + mkdir -p $SYSROOT/usr/{bin,sbin,lib,include} + + for directory in bin sbin lib; do + ln -fs usr/$directory $SYSROOT/$directory + done + + ln -fs lib $SYSROOT/usr/lib64 + ln -fs usr/lib64 $SYSROOT/lib64 +} \ No newline at end of file