1
0
mirror of git://git.2f30.org/morpheus.git synced 2024-06-28 15:31:22 +00:00
morpheus/stage0

63 lines
1.0 KiB
Plaintext
Raw Normal View History

2013-09-06 08:31:51 +00:00
#!/bin/sh
2013-09-24 15:43:30 +00:00
#
# This is the stage0 script, it prepares a basic usable system
# in $root.
2013-09-06 08:31:51 +00:00
2013-09-20 14:59:53 +00:00
set -e -x
2013-09-17 14:26:52 +00:00
. ./prepare-env
2013-09-06 08:31:51 +00:00
2013-09-25 09:20:05 +00:00
if [ $(uname -m) != $arch ]; then
echo You need an $arch host to build morpheus 1>&2
exit 1
fi
rm -rf root cross morpheus.log
. ./prepare-root
2013-09-17 14:26:52 +00:00
mkdir -p src cross
2013-09-06 08:31:51 +00:00
2013-09-25 09:20:05 +00:00
# Build musl-gcc
2013-09-17 14:26:52 +00:00
./build cross-scripts/musl
2013-09-17 10:37:13 +00:00
installed_deps=
2013-09-24 15:43:30 +00:00
build_pkg_dep() {
pkg=$1; deps=$2
# Build dependencies for package in order
for d in $deps; do
install=1
for i in $installed_deps; do
if [ $i == $d ]; then
# If already installed, then skip it
install=0
break
fi
done
if [ $install -eq 1 ]; then
./build cross-scripts/$d
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-)
2013-09-25 13:12:49 +00:00
build_pkg_dep "$pkg" "$deps"
2013-09-24 15:43:30 +00:00
break
done < DEPS
2013-09-24 15:43:30 +00:00
}
build_pkg() {
build_pkg_deps $1 && ./build pkgs/$1
}
# Build stage0 packages
pkglist=$(ls pkgs)
for pkg in $pkglist; do
build_pkg $pkg
2013-09-06 08:31:51 +00:00
done