#!/bin/sh
/bin/mount -a
/bin/hostname cqureap

/bin/echo "Remounting rootfs read-write"
/bin/mount -o rw,remount /

/bin/echo "Installing packages"
/bin/mount -tvfat -o ro /dev/fd0 /mnt

# override the /etc of the rootfs
# with the /etc on the floppy
cp -R /mnt/etc/* /etc 2> /dev/null

for pkg in `ls /mnt/*.tgz`
do
	/sbin/pkgadd $pkg
done

cp /mnt/cqureap.conf /etc 2> /dev/null

# unmount the floppy
/bin/umount /dev/fd0

echo "Updating modules dependencies ..."
/sbin/depmod -a

/etc/rc.d/rc.pcmcia start
echo "Waiting 5 seconds for pcmcia to finnish..."
sleep 5
/etc/rc.d/rc.cqureap

PATH=/bin:/sbin:/usr/bin:/usr/local/bin
export PATH
