diff --git a/build.sh b/build.sh index 4189a74..638ed27 100755 --- a/build.sh +++ b/build.sh @@ -1,10 +1,8 @@ #!/bin/sh +#Add repos in 0-download-src.sh CC=cc RTFS=$(pwd)/rootfs -mu_repo="https://git.macaw.me/8nl/micro-utils" -ml_repo="git://git.musl-libc.org/musl" -cc_repo="git://repo.or.cz/tinycc.git" #Tests for i in tests/*; do @@ -22,7 +20,7 @@ mkdir rootfs #Build system for i in stages/*; do - if ! env mu_repo=$mu_repo ml_repo=$ml_repo cc_repo=$cc_repo RTFS=$RTFS $i; then + if ! env RTFS=$RTFS $i; then echo "Build failed" exit 1 fi diff --git a/stages/0-download-src.sh b/stages/0-download-src.sh index 986b870..df6acc3 100755 --- a/stages/0-download-src.sh +++ b/stages/0-download-src.sh @@ -1,4 +1,8 @@ #!/bin/sh +mu_repo="https://git.macaw.me/8nl/micro-utils" +ml_repo="git://git.musl-libc.org/musl" +cc_repo="git://repo.or.cz/tinycc.git" +sh_repo="" echo "* Download micro-utils sources..." git clone $mu_repo src @@ -8,3 +12,6 @@ git clone $ml_repo libc echo "* Download tcc sources..." git clone $cc_repo tcc + +echo "* Download sh sources..." +git clone $sh_repo sh diff --git a/stages/3-micro-utils.sh b/stages/3-micro-utils.sh index d9187d5..987471c 100755 --- a/stages/3-micro-utils.sh +++ b/stages/3-micro-utils.sh @@ -1,9 +1,27 @@ #!/bin/sh echo " * Build micro-utils" +echo " * Make rootfs " +mkdir $RTFS/bin +mkdir $RTFS/etc +mkdir $RTFS/dev +mkdir $RTFS/sys +mkdir $RTFS/proc +mkdir $RTFS/media +mkdir -p $RTFS/usr/root +mkdir $RTFS/boot cd src +#Compile env CC="$RTFS/bin/tcc" CFLAGS="-pedantic -Os -s -Wall -I $RTFS/include -L $RTFS/lib/tcc -L $RTFS/lib" ./build.sh mv bin/* $RTFS/bin +#Install configs +mkdir $RTFS/etc +mv configs/* $RTFS/etc +echo " * You need to edit config files in /etc" + +#Install init system +mv $RTFS/bin/init $RTFS/init + cd ..