#!/bin/ash # (C) 2004 Robert Shingledecker URL="ibiblio.org/pub/Linux/distributions/damnsmall/current" PROTOCOL="ftp" clear echo "DSL poorman's Install and Boot Floppy via Net" echo echo "No responsibilty for data loss or hardware damage." echo echo "You must have created and formatted two empty and unmounted Linux partitions." echo "1. One large enough to hold the downloaded iso." echo "2. The other large enough for poorman's install." echo echo "You must also have a no bad sectors unmounted floppy inserted into drive." echo echo -n "Are you ready to being (y/..): " read ANS if test "$ANS" != "y"; then exit 1 fi echo -n "Enter the partition to hold the iso (eg: hda1): " read SOURCE if test "$SOURCE"; then; else echo "no source partition entered." exit 1 fi echo -n "Enter the partition to install into (eg: hda2): " read TARGET if test "$TARGET"; then; else echo "no target partition entered." exit 1 fi mke2fs /dev/$SOURCE mkdir /mnt/$SOURCE mount -t ext2 /dev/$SOURCE /mnt/$SOURCE cd /mnt/$SOURCE echo echo "Standby fetching the iso..." wget "$PROTOCOL://$URL/current" if test "$?" -eq 1; then echo "Could not get iso file at this time." echo "Try again later." exit 1 fi mke2fs /dev/$TARGET mkdir /mnt/$TARGET mount -t ext2 /dev/$TARGET /mnt/$TARGET mkdir /mnt/iso mount /mnt/$SOURCE/current /mnt/iso -t iso9660 -o loop=/dev/loop0 echo echo "Installing the compressed image..." cp -r /mnt/iso/KNOPPIX /mnt/$TARGET cp -r /mnt/iso/boot /mnt/$TARGET rm -f "/mnt/$SOURCE/current" echo echo "Creating the boot floppy..." wget "$PROTOCOL://$URL/boot-0.8.0.img" if test "$?" -eq 1; then echo "Error trying to get the boot floppy." echo "Try again later." exit 1 fi dd if=boot-0.8.0.img of=/dev/fd0 if test "$?" -eq 1; then echo "Error trying to create the boot floppy." echo "Try again later." exit 1 fi rm -f "boot-0.8.0.img" echo "DSL installation complete." rm -f "/mnt/$SOURCE/current" echo "Standby for reboot..." reboot