1
0
mirror of git://git.2f30.org/morpheus.git synced 2024-06-25 05:58:33 +00:00
morpheus/stage0
2013-09-16 11:23:49 +01:00

46 lines
893 B
Bash
Executable File

#!/bin/sh
# Export important variables for the build scripts
top=$(pwd)
root=$top/root
nprocs=4
mirror=http://dl.2f30.org/morpheus-pkgs
export top root nprocs mirror
./clean
# Create directory hierarchy
mkdir -p src cross
mkdir -p $root/{bin,boot,dev,etc,home,root,var,share,tmp,sys,proc}
mkdir -p $root/dev/shm
mkdir -p $root/share/man
mkdir -p $root/var/run
pushd $root/
if [ -e sbin ]; then
unlink sbin
fi
ln -s /bin sbin
popd
./build cross-scripts/musl-0.9.13
./build cross-scripts/libevent-2.0.21
./build cross-scripts/ncurses-5.9
./build cross-scripts/zlib-1.2.8
PATH=$top/cross/bin:$PATH
export PATH
# Build stage0 packages
pkglist=$(ls pkgs)
for pkg in $pkglist; do
./build pkgs/$pkg
done
# Strip all executables
find $root/bin -executable -type f -exec strip {} \; &>/dev/null
pushd $root
find . | cpio --quiet -H newc -o | gzip -9 -n > ../morpheus.img
popd
echo OK!