PlainOsBuilder/build.sh

32 lines
399 B
Bash
Raw Normal View History

2023-12-20 18:18:01 +00:00
#!/bin/sh
2023-12-26 10:36:10 +00:00
if [ $(id -u) -ne 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
2023-12-23 17:19:18 +00:00
#Add repos in 0-download-src.sh
2023-12-20 18:18:01 +00:00
CC=cc
RTFS=$(pwd)/rootfs
#Tests
for i in tests/*; do
if ! env CC=$CC $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
#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