#----------------------------------------------------------------------------
# /etc/boot.d/rc100.dualfloppy
#
# Creation:     2004-08-05 
# Last Update:  $Id: rc100.dualfloppy 8661 2005-05-17 13:37:55Z babel $
#----------------------------------------------------------------------------
mount_floppy ()
{
    sects_1680_flop=`echo -e -n '\x20\x0D'`
    sects_boot_flop=`dd if="$flop_dev" bs=1 skip=19 count=2 2>/dev/null`

    if [ "$sects_boot_flop" = "$sects_1680_flop" ]
    then
      flop_dev="$flop_dev"u1680
    fi
    
    mount -r $flop_dev $flop_dir -t $boot_fs
}

if [ ! "$boot" ]
then
    boot_fs=vfat
    
    flop_dev=/dev/fd0
    flop_dir=/boot
    if ! mount_floppy
    then
      stop "can't mount first boot-floppy, check drivers"
    fi
    boot_dev="$flop_dev"

    mkdir /boot1
    
    flop_dev=/dev/fd1
    flop_dir=/boot1
    if ! mount_floppy
    then
      stop "can't mount second boot-floppy, check drivers"
    fi
    dual_dev="$flop_dev"

    read_config /boot/$rcfile
    /bin/cat /boot1/$opt_archive  /boot/$opt_archive \
	| extract_opt "" "$unzip_method" "you seem to be out of ram"

    umount /boot1

    exec_scripts /opt/etc/prep

    umount /boot
fi
