This commit is contained in:
Your Name 2024-05-31 18:07:40 +03:00
parent 00cc9d8cc2
commit 52cff7c957
9 changed files with 9 additions and 7 deletions

1
FHS
View File

@ -6,3 +6,4 @@
* /usr/ - users
* /mnt/ - mounted devices
* /kernel - Kernel
* /var - trash

4
final.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
chown -R root:root rootfs
chmod ao+s rootfs/bin/login rootfs/bin/su

0
stages/0-download-src.sh Executable file → Normal file
View File

0
stages/1-libc.sh Executable file → Normal file
View File

0
stages/2-cross-compiler.sh Executable file → Normal file
View File

0
stages/3-micro-utils.sh Executable file → Normal file
View File

2
stages/4-host-compiler.sh Executable file → Normal file
View File

@ -3,7 +3,7 @@ echo "* Build host compiler" >&2
cd tcc
./configure --extra-cflags="-Os -s" --prefix=$RTFS/ --elfinterp=/lib/libc.so --config-musl --config-bcheck=no --enable-static --cc=$RTFS/bin/tcc
./configure --extra-cflags="-Os -s" --prefix=$RTFS/ --elfinterp=/lib/libc.so --config-musl --config-bcheck=no --enable-static --cc=$RTFS/bin/tcc --crtprefix=/lib --libpaths=/lib:/lib/tcc --sysincludepaths=/include
make -j $(nproc)
make install

0
stages/99-cleanup.sh Executable file → Normal file
View File

View File

@ -22,20 +22,17 @@ if ! makeinfo -h > /dev/null; then
fi
#C
out_name=$(mktemp XXXXXX)
echo -e "#include <stdio.h>\nint main(void){return 0;}" > test.c
$CC test.c -o $out_name
chmod +x $out_name
$CC test.c
rm test.c
if ! ./$out_name; then
echo "[FAILED] Fix c compiler or headers..."
rm $out_name
rm a.out
exit 1
rm $out_name
fi
rm a.out
exit 0