PlainOsBuilder/build.sh

29 lines
345 B
Bash
Raw Permalink Normal View History

2023-12-20 18:18:01 +00:00
#!/bin/sh
2024-01-12 08:36:21 +00:00
if [ $(id -u) -eq 0 ]; then
2023-12-26 10:38:40 +00:00
echo "Run script without root" >&2
2023-12-26 10:36:10 +00:00
exit 1
fi
2023-12-20 18:18:01 +00:00
CC=cc
RTFS=$(pwd)/rootfs
#Tests
2024-01-12 08:54:12 +00:00
if ! env CC=$CC ./test.sh; then
2024-01-12 08:36:21 +00:00
echo "Build failed" >&2
exit 1;
fi
2023-12-20 18:18:01 +00:00
#Clean
./clean.sh
#Make rootfs
mkdir rootfs
#Build system
for i in stages/*; do
2023-12-23 17:19:18 +00:00
if ! env RTFS=$RTFS $i; then
2023-12-26 10:36:10 +00:00
echo "Build failed" >&2
2023-12-20 18:18:01 +00:00
exit 1
fi
done