mirror of
git://git.2f30.org/morpheus.git
synced 2024-06-16 12:58:34 +00:00
Clean up the stage0 script
This commit is contained in:
parent
80b5cccb10
commit
e2efb538de
36
stage0
36
stage0
@ -1,4 +1,7 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This is the stage0 script, it prepares a basic usable system
|
||||
# in $root.
|
||||
|
||||
set -e -x
|
||||
|
||||
@ -8,18 +11,11 @@ rm -rf root cross morpheus.log
|
||||
|
||||
mkdir -p src cross
|
||||
|
||||
# Deps list
|
||||
./build cross-scripts/musl
|
||||
|
||||
# Build stage0 packages
|
||||
installed_deps=
|
||||
pkglist=$(ls pkgs)
|
||||
for pkg in $pkglist; do
|
||||
while read line; do
|
||||
if [ $(echo $line | cut -d' ' -f1) != $pkg ]; then
|
||||
continue
|
||||
fi
|
||||
deps=$(echo $line | cut -d' ' -f2-)
|
||||
build_pkg_dep() {
|
||||
pkg=$1; deps=$2
|
||||
# Build dependencies for package in order
|
||||
for d in $deps; do
|
||||
install=1
|
||||
@ -35,6 +31,26 @@ for pkg in $pkglist; do
|
||||
installed_deps="$installed_deps $d"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
build_pkg_deps() {
|
||||
pkg=$1
|
||||
while read line; do
|
||||
if [ $(echo $line | cut -d' ' -f1) != $pkg ]; then
|
||||
continue
|
||||
fi
|
||||
deps=$(echo $line | cut -d' ' -f2-)
|
||||
build_pkg_dep $pkg $deps
|
||||
break
|
||||
done < DEPS
|
||||
./build pkgs/$pkg
|
||||
}
|
||||
|
||||
build_pkg() {
|
||||
build_pkg_deps $1 && ./build pkgs/$1
|
||||
}
|
||||
|
||||
# Build stage0 packages
|
||||
pkglist=$(ls pkgs)
|
||||
for pkg in $pkglist; do
|
||||
build_pkg $pkg
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user