Red Bear OS — microkernel OS in Rust, based on Redox
Derivative of Redox OS (https://www.redox-os.org) adding: - AMD GPU driver (amdgpu) via LinuxKPI compat layer - ext4 filesystem support (ext4d scheme daemon) - ACPI fixes for AMD bare metal (x2APIC, DMAR, IVRS, MCFG) - Custom branding (hostname, os-release, boot identity) Build system is full upstream Redox with RBOS overlay in local/. Patches for kernel, base, and relibc are symlinked from local/patches/ and protected from make clean/distclean. Custom recipes live in local/recipes/ with symlinks into the recipes/ search path. Build: make all CONFIG_NAME=redbear-full Sync: ./local/scripts/sync-upstream.sh
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Alternative script for the build system Makefiles
|
||||
|
||||
###########################################################################
|
||||
# #
|
||||
# Build the system, with a specified processor type and filesystem config #
|
||||
# #
|
||||
###########################################################################
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "build.sh: Invoke make for a particular architecture and configuration."
|
||||
echo "Usage:"
|
||||
echo "./build.sh [-X | -A | -5 | -R | -a ARCH] [-c CONFIG] [-f FILESYSTEM_CONFIG] TARGET..."
|
||||
echo " -X Equivalent to -a x86_64."
|
||||
echo " -A Equivalent to -a aarch64."
|
||||
echo " -5 Equivalent to -a i586."
|
||||
echo " -6 Equivalent to -a i586 (deprecated, use -5 instead)."
|
||||
echo " -R Equivalent to -a riscv64gc."
|
||||
echo " -a ARCH: Processor Architecture. Normally one of x86_64, aarch64 or"
|
||||
echo " i686. ARCH is not checked, so you can add a new architecture."
|
||||
echo " Defaults to the directory containing the FILESYSTEM_CONFIG file,"
|
||||
echo " or x86_64 if no FILESYSTEM_CONFIG is specified."
|
||||
echo " -c CONFIG: The name of the config, e.g. desktop, server or demo."
|
||||
echo " Determines the name of the image, build/ARCH/CONFIG/harddrive.img"
|
||||
echo " e.g. build/x86_64/desktop/harddrive.img"
|
||||
echo " Determines the name of FILESYSTEM_CONFIG if none is specified."
|
||||
echo " Defaults to the basename of FILESYSTEM_CONFIG, or 'desktop'"
|
||||
echo " if FILESYSTEM_CONFIG is not specified."
|
||||
echo " -f FILESYSTEM_CONFIG:"
|
||||
echo " The config file to use. It can be in any location."
|
||||
echo " However, if the file is not in a directory named x86_64, aarch64"
|
||||
echo " or i686, you must specify the architecture."
|
||||
echo " If -f is not specified, FILESYSTEM_CONFIG is set to"
|
||||
echo " config/ARCH/CONFIG.toml"
|
||||
echo " If you specify both CONFIG and FILESYSTEM_CONFIG, it is not"
|
||||
echo " necessary that they match, but it is recommended."
|
||||
echo " Examples: ./build.sh -c demo live - make build/x86_64/demo/rbos-live.iso"
|
||||
echo " ./build.sh -6 qemu - make build/i686/desktop/harddrive.img and"
|
||||
echo " and run it in qemu"
|
||||
echo " NOTE: If you do not change ARCH or CONFIG very often, edit mk/config.mk"
|
||||
echo " and set ARCH and FILESYSTEM_CONFIG. You only need to use this"
|
||||
echo " script when you want to override them."
|
||||
}
|
||||
|
||||
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
|
||||
usage
|
||||
exit
|
||||
fi
|
||||
|
||||
defaultarch="x86_64"
|
||||
defaultname="desktop"
|
||||
ARCH=""
|
||||
CONFIG_NAME=""
|
||||
FILESYSTEM_CONFIG=""
|
||||
|
||||
while getopts ":c:f:a:dhXA6" opt
|
||||
do
|
||||
case "$opt" in
|
||||
a) ARCH="$OPTARG";;
|
||||
c) CONFIG_NAME="$OPTARG";;
|
||||
f) FILESYSTEM_CONFIG="$OPTARG";;
|
||||
X) ARCH="x86_64";;
|
||||
A) ARCH="aarch64";;
|
||||
R) ARCH="riscv64gc";;
|
||||
5) ARCH="i586";;
|
||||
6) ARCH="i586";;
|
||||
h) usage;;
|
||||
\?) echo "Unknown option -$OPTARG, try -h for help"; exit;;
|
||||
:) echo "-$OPTARG requires a value"; exit;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND -1))
|
||||
|
||||
if [ -z "$ARCH" ] && [ -n "$FILESYSTEM_CONFIG" ]; then
|
||||
dirname=`dirname "$FILESYSTEM_CONFIG"`
|
||||
ARCH=`basename $dirname`
|
||||
case "$ARCH" in
|
||||
x86_64) : ;;
|
||||
aarch64) : ;;
|
||||
riscv64gc) : ;;
|
||||
i586) : ;;
|
||||
\?) ARCH=""; echo "Unknown Architecture, please specify x86_64, aarch64, riscv64gc or i586";;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [ -z "$config_name" ] && [ -n "$FILESYSTEM_CONFIG" ]; then
|
||||
CONFIG_NAME=`basename "$FILESYSTEM_CONFIG" .toml`
|
||||
fi
|
||||
|
||||
if [ -z "$ARCH" ]; then
|
||||
ARCH="$defaultarch"
|
||||
fi
|
||||
|
||||
if [ -z "$CONFIG_NAME" ]; then
|
||||
CONFIG_NAME="$defaultname"
|
||||
fi
|
||||
|
||||
if [ -z "$FILESYSTEM_CONFIG" ]; then
|
||||
FILESYSTEM_CONFIG="config/$ARCH/$CONFIG_NAME.toml"
|
||||
fi
|
||||
|
||||
export ARCH CONFIG_NAME FILESYSTEM_CONFIG
|
||||
make $@
|
||||
Reference in New Issue
Block a user