PlainOsBuilder/build.sh
2024-01-12 11:54:12 +03:00

29 lines
345 B
Bash
Executable File

#!/bin/sh
if [ $(id -u) -eq 0 ]; then
echo "Run script without root" >&2
exit 1
fi
CC=cc
RTFS=$(pwd)/rootfs
#Tests
if ! env CC=$CC ./test.sh; then
echo "Build failed" >&2
exit 1;
fi
#Clean
./clean.sh
#Make rootfs
mkdir rootfs
#Build system
for i in stages/*; do
if ! env RTFS=$RTFS $i; then
echo "Build failed" >&2
exit 1
fi
done