moved everything to different stages

This commit is contained in:
ag-tsotetsi
2026-03-29 12:29:46 +02:00
parent abcc7eca2a
commit c69f878094
18 changed files with 423 additions and 530 deletions

View File

@@ -15,7 +15,7 @@ umask 022
create_sysroot
bootstrap_builds() {
for build in binutils gcc linux glibc libstc++; do
for build in binutils gcc linux glibc libstdc++; do
. "stage/bootstrap/${build}.bash"
cd "$PROJDIR"
done
@@ -28,26 +28,47 @@ toolchain_builds() {
done
}
prechroot_builds() {
for build in setup bison perl python util_linux cleanup; do
. "stage/prechroot/${build}.bash"
cd "$PROJDIR"
done
}
usage() {
echo "usage: build.bash <stage> <package>"
exit 1
}
if [ $# -eq 1 ]; then
case $1 in
bootstrap)
bootstrap_builds
;;
toolchain)
toolchain_builds
;;
*)
usage
;;
esac
elif [ $# -eq 2 ]; then
. "stage/$1/$2.bash"
else
usage
fi
check_in_run() {
if [[ $# -ge 1 && $# -le 2 ]]; then
case $1 in
bootstap|toolchain)
if [ $# -eq 1 ]; then
"${1}_builds"
else
. "stage/$1/$2.bash"
fi
;;
prechroot|hroot)
if [ $# -eq 1 ]; then
do_mount
"${1}_builds"
do_unmount
else
do_mount
. "stage/$1/$2.bash"
do_unmount
fi
;;
*)
usage
;;
esac
else
usage
fi
}
check_in_run "$@"