initial commit

Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
2026-04-16 18:18:52 -04:00
commit 4df50a5373
12 changed files with 340 additions and 0 deletions
+60
View File
@@ -0,0 +1,60 @@
#!/bin/sh
#
# Copyright (c) 2026, Mirocom Laboratories
# All rights reserved.
#
# The following sources are CONFIDENTIAL and PROPRIETARY
# property of Mirocom Laboratories. Unauthorized copying,
# use, distrubution or modification of this file, in whole
# and in part, is strictly prohibited without the prior written
# consent from Mirocom Laboratories.
#
#
# Check if a list of programs are installed on the system
#
# <@>: List of programs to check
#
check_deps() {
for dep in $@; do
printf "Checking if $dep is installed... "
which $dep &>/dev/null
if [ $? -ne 0 ]; then
echo "no"
echo "Please install $dep!"
exit 1
fi
echo "yes"
done
}
#
# Obtain the Mirocom gcc toolchain
#
get_toolchain() {
if [ ! -d var/cc/toolchain ]; then
git clone https://git.mirocom.org/Mirocom/mirocom-toolchain --depth=1 var/cc/toolchain
cd var/cc/toolchain
tar -xzvf toolchain.tar.gz
mv public/* .; rm -rf public/
cd ../../../
fi
}
#
# Obtain all deps
#
get_deps() {
get_toolchain
}
# Make sure everything is installed
check_deps \
git \
make \
gcc \
xorriso
# Obtain all the deps we need
get_deps
+44
View File
@@ -0,0 +1,44 @@
#!/bin/sh
#
# Copyright (c) 2026, Mirocom Laboratories
# All rights reserved.
#
# The following sources are CONFIDENTIAL and PROPRIETARY
# property of Mirocom Laboratories. Unauthorized copying,
# use, distribution or modification of this file, in whole
# and in part, is strictly prohibited without the prior written
# consent from Mirocom Laboratories.
#
TARGET=x86_64-pc-mirocom
MAKE=make
mkdir -p var/
mkdir -p var/cc/root/usr/include/
mkdir -p var/cc/root/usr/bin/
# Don't build again if the lock exists
if [ -f var/cc/.lock ]; then
echo "var/cc/.lock exists, skipping toolchain build"
exit 1
fi
pushd var/cc/toolchain
bash build.sh
mkdir -p gcc
pushd gcc
# Configure gcc
../gcc-patched/configure --target=$TARGET \
--prefix=$(pwd) --with-sysroot=$(pwd)/../../root/ \
--disable-nls --enable-languages=c --disable-multilib
# Build gcc
$MAKE all-gcc
$MAKE install-gcc
# Lock the directory
popd
popd
touch var/cc/.lock