#!/bin/sh
. ./config.sh
echo "Copying /etc files..."
sleep 1
cd /usr/src/etc && make distrib-dirs DESTDIR=$FREESBIEBASEDIR
cd /usr/src/etc && make distribution DESTDIR=$FREESBIEBASEDIR
echo "Installing world..."
sleep 1
cd /usr/src/ && make installworld DESTDIR=$FREESBIEBASEDIR

mkdir $FREESBIEBASEDIR/bootstrap
cp -p $FREESBIEBASEDIR/sbin/mount $FREESBIEBASEDIR/bootstrap
cp -p $FREESBIEBASEDIR/sbin/umount $FREESBIEBASEDIR/bootstrap
echo "Building new sysinstall..."
sleep 1
cd /usr/src/release/sysinstall
make clean
make 
make install

tar -cf - -C /stand . | tar xpf - -C $FREESBIEBASEDIR/stand

cd $LOCALDIR
