#!/bin/sh
clear
cat<<!

Before you begin this installation, you must prepare a Linux hard-drive
partition.  Use fdisk to create a Linux native partition and mke2fs to
put a filesystem on that partition.  Then mount the partition on /hd.  
For example, assume that you have added an extra hard-disk as a slave on 
your primary IDE interface and that there is nothing of value on that drive.  
(1) fdisk /dev/hdb     (and make the first partition Linux native)
(2) mke2fs /dev/hdb1
(3) mount /dev/hdb1 /hd
-------------------------------WARNING---------------------------------------
fdisk and mke2fs are powerful commands.  If mis-used, they can wipe files on
your other partitions.  Do not use them unless you know what you are doing.
-----------------------------------------------------------------------------

The steps are similar for a master drive on the secondary IDE interface 
(/dev/hdc) and a slave drive on the secondary IDE interface (/dev/hdd).

You are now ready to begin.  Just make sure that you are using BasicLinux 
(running in a ramdisk) and that the bas-hd.tgz file is in the /tmp directory.  
If you do not have enough room in /tmp, you can overlay a ramdrive or floppy 
(for example:  mount /dev/fd0 /tmp). 

!
while true ; do
echo -n "Are you ready to start the installation? "
  read 
  case $REPLY in n|no)
    break
  esac
echo
ls /hd | grep lost+found >/dev/null
if [ $? != 0 ] ; then
  echo "Sorry, I can not find an ext2 partition on /hd."
  break
fi
ls /hd | grep i >/dev/null
if [ $? = 0 ] ; then
  echo "Sorry, the partition on /hd is not empty."
  break
fi
ls /tmp | grep bas-hd.tgz >/dev/null
if [ $? != 0 ] ; then
  echo "Sorry, I can not find a copy of bas-hd.tgz on /tmp."
  break
fi
clear
cp -a /bin  /hd
cp -a /dev  /hd
cp -a /etc  /hd
cp -a /lib  /hd
cp -a /root /hd
cp -a /sbin /hd
cp -a /usr  /hd
cp -a /var  /hd
rm /hd/bin/head
rm /hd/bin/sed
rm /hd/bin/grep
rm /hd/bin/gzip
rm /hd/bin/gunzip
rm /hd/bin/tar
mv /hd/sbin/e2fsck /hd/sbin/fsck.ext2
rm /hd/var/log/utmp
cd /hd
gzip -d < /tmp/bas-hd.tgz | tar -xvf - 
set -- `mount|grep /hd`
echo "$1   /      ext2  defaults  1  1" >>etc/fstab
cd ; umount /hd
echo
echo "Transfer complete.  The final step is to tell loadlin.exe where to find"
echo "the new BasicLinux partition.  You do this in DOS (press Ctrl-Alt-Del)."
echo "Use a DOS editor to edit BOOT.BAT.  Change /dev/ram to the name of the"
echo "new BasicLinux partition, change rw to ro, and completely remove the"
echo "initrd=baslinux.gz.  For example, if you put BasicLinux at /dev/hdb1,"  
echo "your new BOOT.BAT will look like this:"
echo "--------------------------------"
echo "loadlin zimage root=/dev/hdb1 ro" 
echo "--------------------------------"
echo
break
done

   
