home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BURKS 2
/
BURKS_AUG97.ISO
/
SLAKWARE
/
MAKEFLOP
next >
Wrap
Text File
|
1997-04-19
|
17KB
|
562 lines
#!/bin/sh
# Copyright (C) 1993 David Niemi
# The author places no restrictions on the use of this script.
#
# Partial port to HP/UX by Michel Eyckmans (MCE) <eyckmans@imec.be>.
# Only DOS formatting capability is missing.
#
# this script requires mtools (except on HP/UX). If you don't have
# it, get it from prep.ai.mit.edu: /pub/gnu or other GNU repositories.
# modified by Patrick Volkerding (volkerdi@mhd1.moorhead.msus.edu)
# and IBM RS6000 compatibility by Torben N. Rasmussen (tnr@csd.cri.dk)
# Extensive cleanup/functionality additions by John Plocher (plocher@sun.com)
# Provides interactive prompts to make disk mastering easier
# Run this script in the directory containing the directories "a" "ap" ...
# Modified for Sun compatibility by Ted Kandell (ted@cashtrade.com)
# Solaris 2.4 has a bug where the filesystem capacity for the floppy isn't reset
# unless the new floppy is labelled with fdformat
# Volume Management (vold) has a bug where the floppy device always is busy
# even if there is nothing in the drive - the solution is to kill vold
# Don't run Volume Management
# Edit this as needed
MTOOLS=/usr
# Global defaults
export PATH LD_LIBRARY_PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/ucblib:$MTOOLS/lib
PATH=$PATH:$MTOOLS/bin
format=$MTOOLS/bin/fdformat
copy=$MTOOLS/bin/cp
erase=$MTOOLS/bin/rm
eject="eject floppy"
dollar='$'
set -e # Exit on error
# Number of disks in each set
a=9
ap=5
d=13
e=8
f=3
k=6
n=6
t=9
tcl=2
x=22
xap=4
xd=4
xv=3
y=2
# Descriptions of the packages
at="Base Linux"
apt="Text based applications"
dt="Program Development/GCC c|c++|obj-C kernel source and more"
et="Emacs"
ft="FAQs"
kt="Kernel source and includes"
nt="Networking/UUCP/Mail/News"
tt="TeX"
tclt="Tcl Script Language/Tk Toolkit"
xt="XFree86 X Window System"
xapt="X Applications"
xdt="X11 Server Development"
xvt="XView (OpenLook Window Manager)"
yt="Games"
PACKAGES="a ap d e f k n t tcl x xap xd xv y"
##########################################################################
# These routines are only used on an hp/ux host
#
hpuxdosformat () {
echo "*** Warning *** No format on HP/UX, trying without !"
## The mediainit utility can do a low level format, but there
## seems to be no way to create an MS-DOS filesystem.
return 0
}
hpuxdoserase() {
# HACK: We can ignore our $* here, since we just want to remove
# everything anyway. HP/UX dos commands don't know about
# filename completion, so we have to do it the hard way.
files=`dosls $FD`
if [ "$files" != '' ]
then
dosrm -r $files
fi
}
hpuxdoswrite() {
for file in $*
do
if [ "$file" != "$FD" ]
then
echo Copying $file ...
doscp -f $file $FD`basename $file`
fi
done
return 0
}
hpuxeject(){
echo "Please eject floppy disk now"
}
#
# (End of HP/UX specific routines)
##########################################################################
##########################################################################
# These routines are only used on an aix host
#
aixdosformat () {
Echo "Formatting..."
dosformat > /dev/null << EOI
n
EOI
echo "done"
return 0
}
aixdoswrite() {
for file in $*; do
if [ "$file" != "$FD" ]; then
echo Copying $file ...
doswrite $file `basename $file` > /dev/null
fi
done
return 0
}
aixeject(){
echo "Please eject floppy disk now"
}
#
# (End of AIX specific routines)
##########################################################################
# Linux specific formatting routines:
Linuxaformat() {
fdformat /dev/fd0H1440
if [ $? = 0 ]; then
mformat a:
else
return 1;
fi
return $?
}
Linuxbformat() {
fdformat /dev/fd1H1440
if [ $? = 0 ]; then
mformat b:
else
return 1;
fi
return $?
}
##########################################################################
# Common routines
##########################################################################
Echo() {
if [ "`echo -n `" != "'-n'" ]
then
echo -n $*' '
else
echo $*' '"\c"
fi
}
##########################################################################
Prompt() { # => diskno alldone duplicate eraseit
my_IMAGE="$1"
my_default="$2"
my_disk="$3"
my_diskno="$4"
my_maxdisk="$5"
my_series="$6"
my_descrip="$7"
valid_answer="no"
my_need_help="yes"
imagename=$my_diskno
while [ "$valid_answer" = "no" ]; do
if [ "$my_need_help" = "yes" ]; then
my_need_help="no"
echo "__"
if [ -z "$my_IMAGE" ]; then
echo "[$my_disk] disk $my_diskno of $my_maxdisk (${my_descrip})"
else
echo "[$my_disk] ${my_descrip}"
fi
echo " Please insert a blank floppy and press"
echo " [q] to Quit this program"
echo " [h] to show this Help message"
echo " [f] to Format floppy and duplicate disk image"
echo " [d] to Duplicate disk image"
if [ -z "$my_IMAGE" ]; then
echo " [l] to List the contents of disk \"$my_series$my_diskno\""
echo " [sd] to Skip this Disk \"$my_series$my_diskno\""
echo " [ss] to Skip the entire \"$my_series\" Series"
else
echo " [l] to List the possible disk images"
echo " [c] to Choose a disk image"
echo " [s] to Skip this disk image"
echo " Current image: $my_diskno"
fi
fi
Echo "__Choice: [$my_default]: "
answer="invalid"
read answer junk
if [ -z "$answer" ]; then
answer="$my_default"
fi
case $answer in
q*) echo "Quitting"; exit 0 ;;
h*) my_need_help=yes;;
c*)
if [ -n "$my_IMAGE" ]; then
Echo "$disk image: [$my_diskno]: "
read imagename junk
if [ -z "$imagename" ]; then
imagename="$default_image"
fi
if [ ! -r "$imagename" ]; then
echo "ERROR: \"$imagename\" is not readable."
else
my_diskno=$imagename
fi
fi;
;;
l*)
if [ -z "$my_IMAGE" ]; then
ls -Fl $my_series$my_diskno/.??* $my_series$my_diskno/* | cut -c30-41,54-
else
ls -Fl $my_IMAGE | cut -c30-41,54-
fi
duplicate=no
alldone=no
eraseit=no
;;
sd)
if [ -z "$my_IMAGE" ]; then
alldone=yes
valid_answer=yes
else
echo "ERROR: Invalid entry. Try again"
fi
;;
ss)
if [ -z "$my_IMAGE" ]; then
diskno=$my_maxdisk;
alldone=yes
valid_answer=yes
else
echo "ERROR: Invalid entry. Try again"
fi
;;
s*)
if [ -z "$my_IMAGE" ]; then
Echo "Skip what? [d]=disk [s]=series: [d]: "
answer="invalid"
read answer junk
if [ -z "$answer" ]; then
answer="d"
fi
case $answer in