#!/bin/sh

tar -xf busybox-1.25.1-patched_guess_fstype.tar.gz
cd busybox-1.25.1-patched_guess_fstype

cp -f ../BBconfig-V1.25.1-static .config

make
make install
sync

echo 'installing busybox...'
cp -f _install/bin/busybox /usr/bin/

ln -snf ../bin/busybox /usr/sbin/init
mv -f /usr/sbin/init.sh /usr/sbin/init.shORIG

ln -snf busybox /usr/bin/xz
ln -snf busybox /usr/bin/unxz


echo 'export PATH="/bin:/sbin"
ulimit -c 0
umask 022
export USER=root
export LOGNAME=root
export TERM=linux
export TEXTDOMAINDIR=/usr/share/locale' > /etc/profile
sync

echo
echo 'recommend now exit from rootfs, then chroot back in.'
