#!/bin/sh

# System startup script run by init on autoboot
# or after single-user.
### WARNING !!!!!! #####
# We remove this file during execution (see EOF).
# Awful things happen if its size is > 1024B

trap : 2
trap : 3	# shouldn't be needed

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

trap "echo 'Reboot interrupted'; exit 1" 3

sysctl -w vm.swapping_enabled=0 2>&1 >/dev/null

### Special setup for one floppy PICOBSD ###
echo ""
echo "-------------------------------------------"
echo "  Please wait. The system is coming up..."
echo "-------------------------------------------"
echo ""
echo "Reading /etc from startup floppy..."
mount /dev/fd0c /start_floppy
cd /start_floppy/etc
cp -r . /etc/
cd /etc
echo "Recording userconfig (-c) changes..."
kget -incore /stand/vanilla >/start_floppy/kernel.config
umount /start_floppy
echo "Ok. (Now you can remove floppy if you like)"
echo ""
. rc
exit 0
