home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / linux / 10156 < prev    next >
Encoding:
Text File  |  1992-09-08  |  6.8 KB  |  271 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!sol.ctr.columbia.edu!news.unomaha.edu!cwis!trussell
  3. From: trussell@cwis.unomaha.edu (Tim Russell)
  4. Subject: Re: SLS package installation
  5. Message-ID: <trussell.715939665@cwis>
  6. Sender: news@news.unomaha.edu (UNO Network News Server)
  7. Organization: University of Nebraska at Omaha
  8. References: <1992Sep8.055532.17468@coe.montana.edu>
  9. Date: Tue, 8 Sep 1992 08:07:45 GMT
  10. Lines: 259
  11.  
  12. bugs@cs.montana.edu (Dave Seelmeyer) writes:
  13.  
  14. >their job, and all is ok so far. The problem is when I want to do a full
  15. >installation (full base and X11). I have tried sysinstall -all and also
  16. >doinstall /dev/hda2. With the first, it asks to insert disk #3 in the
  17. >floppy drive and press return. Upon doing this, it repeats the message.
  18. >It will do this 3 times and return to the prompt. With the second, it
  19. >starts with the same disk #3 message and then responds with "magic match
  20. >failed" or somesuch and comes back to the prompt.
  21.  
  22.     Peter doesn't want to admit it, but apparently even his own kernel
  23. didn't get his patches right.  According to him, his kernel is supposed
  24. to be patched so it automatically figures out what kind of a filesystem
  25. it's mounting, but it doesn't work.
  26.  
  27.     Here's a fixed version of sysinstall that you can use.
  28.  
  29. #    This is a shell archive.
  30. #    Remove everything above and including the cut line.
  31. #    Then run the rest of the file through sh.
  32. #----cut here-----cut here-----cut here-----cut here----#
  33. #!/bin/sh
  34. # shar:    Shell Archiver
  35. #    Run the following text with /bin/sh to create:
  36. #    sysinstall
  37. # This archive created: Tue Sep  8 03:10:08 1992
  38. cat << \SHAR_EOF > sysinstall
  39. #
  40. # Installation of packages from floppy
  41. # requires:  tar, sed, basename, compress/zcat, mount and umount.
  42. # copywrite Softlanding Software, 1992:  Distribute and use freely.
  43.  
  44. # Er, 'copyright', that is.  :-)  Modified by Tim Russell to work.
  45.  
  46. INSTROOT=/
  47. INSTDEV=/dev/fd0
  48.  
  49. while [ 0 ]; do
  50.     if [ $# -gt 1 -a "$1" = "-instdev" ]; then
  51.         INSTDEV=$2;
  52.         shift 2;
  53.         continue;
  54.     elif [ $# -gt 1 -a "$1" = "-instroot" ]; then
  55.         INSTROOT=$2;
  56.         shift 2;
  57.         continue;
  58.     else
  59.         break;
  60.     fi
  61. done;
  62.  
  63. INSTDIR=$INSTROOT/install/installed
  64. #INSTTEST=/usr2/dist
  65. MNTDIR=/user
  66.  
  67. function MountDisk() {
  68.     declare -i MountStat
  69.     if [ "$INSTTEST" != "" ]; then
  70.         test -d $INSTTEST;
  71.         MountStat=$?
  72.         return $MountStat;
  73.     fi
  74.     if [ "$1" = "2" ]; then
  75.         FSTYPE="minix"
  76.     else
  77.         FSTYPE="msdos"
  78.     fi
  79.     for j in 1 2 3; do
  80.         echo -n "Insert disk $1 into the floppy drive then hit enter, or q to quit"
  81.         read ans;
  82.         if [ "$ans" = "q" ]; then
  83.             exit 1;
  84.         fi;
  85.         mount -t $FSTYPE $INSTDEV $MNTDIR  >& /dev/null
  86.         MountStat=$?
  87.         if [ $MountStat = 0 ]; then
  88.             return 0;
  89.         fi
  90.     done
  91.     exit 1
  92. }
  93.  
  94. function UnmountDisk() {
  95.     if [ "$INSTTEST" = "" ]; then
  96.         umount $INSTDEV > /dev/null
  97.     fi;
  98. }
  99.  
  100. function InstallPkg() {
  101.     if [ -f $1 ]; then
  102.         echo -n "installing `basename $1 .taz`..."
  103.         (cd $INSTROOT; tar -xzvf - | sed "/\/$/d" ) < $1 > $INSTDIR/`basename $1 .taz`
  104.         if [ -f /install/doinst.sh ]; then
  105.                 sh /install/doinst.sh ;
  106.             rm -rf /install/doinst.sh ;
  107.         fi
  108.         echo "done"
  109.     else
  110.         echo "$1 not found"
  111.     fi;
  112. }
  113.  
  114. function InstallDisk() {
  115.     declare -i Status;
  116.     for k in 1 2 3; do
  117.         MountDisk $1
  118.         Status=$?
  119.         if [ $Status != 0 ]; then
  120.             return 1;
  121.         fi
  122.         if [ "$INSTEST" = "" ]; then
  123.             SRCDIR=$MNTDIR
  124.         else
  125.             SRCDIR=$INSTEST/$1
  126.         fi
  127.         if [ -e $SRCDIR/disk$1 -o $1 = Disk ]; then
  128.             for FileZ in $SRCDIR/*.taz; do
  129.                 if [ $1 = Disk ]; then
  130.                     echo -n "Install $FileZ (y/n/q)?"
  131.                     read ans;
  132.                     if [ "$ans" = "Y" -o  "$ans" = "y" ]; then
  133.                         InstallPkg $FileZ;
  134.                     elif [ "$ans" = "q" -o  "$ans" = "Q" ]; then
  135.                         exit 0;
  136.                     fi
  137.                 else
  138.                         InstallPkg $FileZ;
  139.                 fi
  140.             done
  141.             UnmountDisk
  142.             return 0
  143.         else
  144.             UnmountDisk
  145.             echo -n "error: you may have inserted the wrong disk, try again (y/n)?"
  146.             read ans;
  147.             if [ "$ans" = "N" -o  "$ans" = "n" ]; then
  148.                 return 1
  149.             fi
  150.         fi;
  151.     done
  152. }
  153.  
  154. function RemovePkg() {
  155.     if [ -f $INSTDIR/$1 ]; then
  156.         (cd $INSTROOT; xargs /bin/rm -f ) < $INSTDIR/$1 
  157.         rm $INSTDIR/$1
  158.     else
  159.         echo "error: unknown package $1"
  160.     fi
  161. }
  162.  
  163. function PrintUsage() {
  164.     echo "usage: sysinstall -all                * install everything: base + X11"
  165.     echo "       sysinstall -base               * install full base: no X11"
  166.     echo "       sysinstall -mini               * install a minimal base: ~3 Meg"
  167.     echo "       sysinstall -rest               * install the rest of the base"
  168.     echo "       sysinstall -X11                * install just X11"
  169.     echo "       sysinstall -install pkg.taz    * install a specific pkg file"
  170.     echo "       sysinstall -remove pkg         * uninstall a pkg"
  171.     echo "       sysinstall -extract pkg        * collect pkg files into new pkg.taz"
  172.     echo "       sysinstall -disk               * install all pkgs on a disk"
  173.     echo "       sysinstall -disk DISKNUM       * install pkgs on disk DISKNUM"
  174.     echo "       sysinstall -mount              * mount floppy"
  175.     echo "       sysinstall -unmount            * unmount floppy"
  176.     echo "       sysinstall -instdev INSTDEV    * device to install from"
  177.     echo "       sysinstall -instroot INSTROOT  * directory to use as root"
  178. }
  179.  
  180. function InstallX11 {
  181.     for i in 11 12 13 14 15; do
  182.         InstallDisk $i;
  183.     done
  184. }
  185.  
  186. function InstallRest() {
  187.     for i in 5 6 7 8 9 10 2; do
  188.         InstallDisk $i;
  189.     done
  190. }
  191.  
  192. function InstallMini() {
  193.     for i in 3 4;  do
  194.         InstallDisk $i;
  195.     done
  196. }
  197.  
  198. function InstallBase() {
  199.     InstallMini;
  200.     InstallRest;
  201. }
  202.  
  203. function InstallAll() {
  204.     InstallBase;
  205.     InstallX11;
  206. }
  207.  
  208. function ShowInstalled() {
  209.     for i in $INSTDIR/*; do
  210.         echo "`basename $i`";
  211.     done;
  212. }
  213.  
  214. #if [ "/" != $INSTROOT ]; then
  215. #    mount $INSTROOT &> /dev/null
  216. #    MNTSTAT=$?;
  217. #    if [ $MNTSTAT != 1 ]; then
  218. #        echo "error: $INSTROOT must have a partition mounted on it.  First use:"
  219. #        echo "       mount /dev/?d?? $INSTROOT"
  220. #        echo "       For example: mount /dev/hda2 $INSTROOT"
  221. #        exit 1;
  222. #    fi
  223. #fi
  224.  
  225. if [ $# = 0 ]; then
  226.     PrintUsage;
  227. elif [ $1 = "-view" ]; then 
  228.     ShowInstalled;
  229. elif [ $1 = "-all" ]; then 
  230.     InstallAll;
  231. elif [ $1 = "-base" ]; then 
  232.     InstallBase;
  233. elif [ $1 = "-mini" ]; then 
  234.     InstallMini;
  235. elif [ $1 = "-rest" ]; then 
  236.     InstallRest;
  237. elif [ $1 = "-X11" ]; then 
  238.     InstallX11;
  239. elif [ $1 = "-remove" -a $# = 2 ]; then
  240.     RemovePkg $2
  241. elif [ $1 = "-install" -a $# = 2 ]; then
  242.     InstallPkg $2
  243. elif [ $1 = "-extract" -a $# = 2 ]; then
  244.     if [ -f $INSTDIR/$2 ]; then
  245.         (cd $INSTROOT; tar -czf - -T $INSTDIR/$2 ) > $2.taz
  246.     else
  247.         echo "$2 not found";
  248.     fi;
  249. elif [ $1 = "-disk" ]; then
  250.     if [ $# = 1 ] ; then
  251.         InstallDisk Disk
  252.     else
  253.         InstallDisk $2
  254.     fi
  255. elif [ $1 = "-mount ]; then
  256.     MountDisk;
  257. elif [ $1 = "-unmount ]; then
  258.     UnmountDisk;
  259. else
  260.     PrintUsage;
  261. fi;
  262. SHAR_EOF
  263. #    End of shell archive
  264. exit 0
  265.  
  266. --
  267.     Tim Russell                 Omaha, NE              trussell@unomaha.edu
  268. One of the richest men in the world made his billions selling a toy "operating
  269. system" that is more accurately described as a glorified bootstrap loader.
  270.                                                   -- Phil Karn
  271.