#!/bin/sh
#insmod usb-storage
mknod /dev/sda b 8 0
mknod /dev/sda1 b 8 1
modprobe usb-storage



echo "ac97_codec.o fat.o sd_mod.o usb-storage.o agpgart.o isofs.o soundcore.o \
usb-uhci.o via-rhine.o cloop.o mii.o umsdos.o vfat.o ext2.o scsi_mod.o usbcore.o \
via82cxxx_audio.o" | tr ' ' '\012' | while read xx
do
cp $LINUXMODDIR/$xx root/modules/
done

if [ "$KUSBOOTHACK" == "y" ]
then
#mount /dev/sda1 usb/
dd if=vmlinuz of=/dev/sda1 bs=1k > /tmp/kernsize.mung 2>&1
rdev /dev/sda1 /dev/sda1 ; rdev -R /dev/sda1 0 


cat /tmp/kernsize.mung | while read aa; do
set $aa
let r="$1"
mmd=`echo $ddsize`
let ddsize="$r + 16384"
eval rdev -r /dev/sda1 $ddsize
eval dd if=Image.gz of=/dev/sda1 bs=1k seek=$r
break
done
else
mount /dev/sda1 usb/ ; sync
cp syslinux.cfg usb/ ; sync
cp vmlinuz usb/ ; sync
cp Image.gz usb/ ; sync
rdev usb/vmlinuz /dev/ram0 
syslinux /dev/sda1 ; sync
umount usb
fi

#cp vmlinuz usb/
#cp Image.gz usb/
#lilo -C ./lilo.usb 