home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / ROOTDSKS.12 / UMSDOS12 / usr / lib / setup / INShd < prev    next >
Encoding:
Text File  |  1995-02-27  |  4.3 KB  |  150 lines

  1. #!/bin/sh
  2. while [ 0 ]; do
  3. rm -f /tmp/SeTDS /tmp/SeTmount
  4.  
  5. while [ 0 ]; do
  6.  cat << EOF > /tmp/tmpmsg
  7.  
  8. In order to install directly from the hard disk you must
  9. have a partition with a directory containing the Slackware
  10. distribution such that each disk other than the boot disk
  11. is contained in a subdirectory. For example, if the 
  12. distribution is in /stuff/slack, then you have to have
  13. directories named /stuff/slack/a1, /stuff/slack/a2, and so
  14. on each containing the files that would be on that disk.
  15. You may install from DOS, HPFS, or Linux partitions.
  16. Please enter the partition where the Slackware sources can 
  17. be found, or [enter] to see a partition list: \n
  18. EOF
  19.  dialog --title "INSTALLING FROM HARD DISK" --inputbox \
  20. "`cat /tmp/tmpmsg`" 20 70 2> /tmp/source.part
  21.  if [ $? = 1 -o $? = 255 ]; then
  22.   rm -f /tmp/source.part /tmp/tmpmsg
  23.   exit
  24.  fi
  25.  rm -f /tmp/tmpmsg
  26.  SLACK_DEVICE="`cat /tmp/source.part`"
  27.  rm -f /tmp/source.part
  28.  if [ "$SLACK_DEVICE" = "" ]; then
  29.   dialog --title "PARTITION LIST" --msgbox "`fdisk -l | fgrep -v cylind | fgrep dev 2> /dev/null`" 22 75
  30.   continue;
  31.  fi
  32.  break;
  33. done
  34.  
  35. dialog --title "SELECT SOURCE DIRECTORY" --inputbox \
  36. "\n\
  37. Now we need to know what directory on this partition \n\
  38. the Slackware sources can be found in. (The directory \n\
  39. in which the subdirectories for each disk is found) \n\
  40. NOTE: You must give the directory name relative to the \n\
  41. top of the partition.  So, for example, if you're going \n\
  42. to mount this partition under /usr, don't include the \n\
  43. '/usr'at the beginning of the pathname. \n\n\
  44. What directory are the Slackware sources in? \n" \
  45. 19 65 2> /tmp/source.dir
  46. if [ $? = 1 -o $? = 255 ]; then
  47.  rm -f /tmp/source.dir
  48.  exit
  49. fi
  50. SLACK_SOURCE_LOCATION="`cat /tmp/source.dir`"
  51. rm -f /tmp/source.dir
  52. if mount | fgrep $SLACK_DEVICE 1> /dev/null 2> /dev/null ; then
  53.  # This partition is already mounted, so we will have to
  54.  # tweak things funny.
  55.  rm -f /var/adm/mount 2> /dev/null
  56.  rmdir /var/adm/mount 2> /dev/null
  57.  PREFIX="`mount | fgrep $SLACK_DEVICE`"
  58.  PREFIX="`echo "$PREFIX" | cut -b14-`"
  59.  end_of_line="1"
  60.  while [ 0 ]; do
  61.   end_of_line="`expr $end_of_line + 1`"
  62.   if [ "`echo "$PREFIX" | cut -b$end_of_line`" = " " ]; then  # Found it!
  63.    end_of_line="`expr $end_of_line - 1`"
  64.    break;
  65.   fi
  66.  done
  67.  PREFIX="`echo "$PREFIX" | cut -b1-$end_of_line`"
  68.  ln -sf $PREFIX /var/adm/mount 
  69. else
  70.  while [ 0 ]; do
  71.   dialog --title "SELECT FILESYSTEM TYPE" --menu "What type of filesystem does your Slackware \
  72. source partition contain?" 13 65 5 \
  73. "1" "FAT (MS-DOS, DR-DOS, OS/2)" \
  74. "2" "Linux Second Extended Filesystem" \
  75. "3" "Linux Xiafs" \
  76. "4" "Linux MINIX" \
  77. "5" "OS/2 HPFS" 2> /tmp/filesys
  78.   if [ $? = 1 -o $? = 255 ]; then
  79.    rm -f /tmp/filesys
  80.    exit
  81.   fi
  82.   FILESYS="`cat /tmp/filesys`"
  83.   rm -f /tmp/filesys
  84.   if [ "$FILESYS" = "1" ]; then 
  85.    SLACK_FS_TYPE="msdos"
  86.    break;
  87.   elif [ "$FILESYS" = "2" ]; then 
  88.    SLACK_FS_TYPE="ext2"
  89.    break;
  90.   elif [ "$FILESYS" = "3" ]; then 
  91.    SLACK_FS_TYPE="xiafs"
  92.    break;
  93.   elif [ "$FILESYS" = "4" ]; then 
  94.    SLACK_FS_TYPE="minix"
  95.    break;
  96.   elif [ "$FILESYS" = "5" ]; then 
  97.    SLACK_FS_TYPE="hpfs"
  98.    break;
  99.   fi
  100.  done
  101.  if [ "$FILESYS" = "5" ]; then
  102.   mount -o ro -t $SLACK_FS_TYPE $SLACK_DEVICE /var/adm/mount 1> /dev/null 2> /dev/null
  103.  else
  104.   mount -t $SLACK_FS_TYPE $SLACK_DEVICE /var/adm/mount 1> /dev/null 2> /dev/null
  105.  fi
  106.  if [ ! $? = 0 ]; then # there was a mount error
  107.   cat << EOF > /tmp/tmpmsg
  108. There was a problem mounting your partition. Would you like to:
  109.  
  110. EOF
  111.   dialog --title "MOUNT ERROR" --menu "`cat /tmp/tmpmsg`" 10 68 2 \
  112. "Restart" "Start over" \
  113. "Ignore " "Ignore the error and continue" 2> /tmp/dowhat
  114.   if [ $? = 1 -o $? = 255 ]; then
  115.    rm -f /tmp/dowhat
  116.    exit
  117.   fi
  118.   DOWHAT="`cat /tmp/dowhat`"
  119.   rm -f /tmp/dowhat
  120.   if [ "$DOWHAT" = "Restart" ]; then
  121.    umount /var/adm/mount 2> /dev/null
  122.    continue;
  123.   fi
  124.   echo
  125.  fi # mount error
  126. fi
  127.  
  128. if [ -d /var/adm/mount/$SLACK_SOURCE_LOCATION ]; then
  129.  echo "/var/adm/mount/$SLACK_SOURCE_LOCATION" > /tmp/SeTDS
  130.  echo "-source_mounted" > /tmp/SeTmount
  131.  echo "/dev/null" > /tmp/SeTsource
  132.  exit
  133. else
  134.  cat << EOF > /tmp/tmpmsg
  135.  
  136. Sorry, but the directory $SLACK_SOURCE_LOCATION does not exist
  137. on partition $SLACK_DEVICE.
  138.  
  139. Would you like to try again?
  140. EOF
  141.  dialog --title "SOURCE DIRECTORY NOT FOUND" --yesno "`cat /tmp/tmpmsg`" 10 70
  142.  if [ $? = 1 -o $? = 255 ]; then
  143.   rm -f /tmp/tmpmsg
  144.   exit
  145.  fi
  146.  rm -r /tmp/tmpmsg
  147. fi
  148.  
  149. done
  150.