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

  1. #!/bin/sh
  2. T_PX="`cat /tmp/SeTT_PX`"
  3. rm -f /tmp/SeTmount /tmp/SeTDS /tmp/SeTCDdev
  4. dialog --title "Install from the Slackware CD-ROM" \
  5. --menu "\
  6. You should be able to install directly from the Slackware \
  7. CD-ROM if you have one of the drive types listed below.  (If\
  8. this doesn't work for some reason, you can still install by\
  9. copying the a1...y1 directories to your hard drive and \
  10. installing from there, or by making floppy disks under DOS) \
  11. What type of CD-ROM drive do you have?" \
  12. 19 70 7 \
  13. "1" "SCSI (/dev/scd0 or /dev/scd1)" \
  14. "2" "Sony CDU31A (/dev/sonycd)" \
  15. "3" "Sony 531/535 (/dev/cdu535)" \
  16. "4" "Mitsumi (/dev/mcd)" \
  17. "5" "Sound Blaster Pro/Panasonic (/dev/sbpcd)" \
  18. "6" "Aztech/Orchid/Okano/Wearnes with interface card" \
  19. "7" "Most IDE-interface CD drives" 2> /tmp/cdtype
  20. if [ $? = 1 -o $? = 255 ]; then
  21.  rm -f /tmp/tmpmsg /tmp/cdtype
  22.  exit
  23. fi
  24. CD_ROM_TYPE="`cat /tmp/cdtype`"
  25. rm -f /tmp/tmpmsg /tmp/cdtype
  26. if [ "$CD_ROM_TYPE" = "1" ]; then
  27.  dialog --title "SELECT SCSI DEVICE" --menu "\
  28. Which SCSI CD-ROM are you using? (If you're not sure, \n\
  29. select /dev/scd0)" 10 60 2 \
  30. "/dev/scd0" "SCSI CD 0" \
  31. "/dev/scd1" "SCSI CD 1" 2> /tmp/whichscsi
  32.  if [ $? = 1 -o $? = 255 ]; then
  33.   rm -f /tmp/tmpmsg /tmp/cdtype /tmp/whichscsi
  34.   exit
  35.  fi
  36.  CD_DEVICE="`cat /tmp/whichscsi`"
  37.  rm -f /tmp/whichscsi
  38. elif [ "$CD_ROM_TYPE" = "2" ]; then
  39.  CD_DEVICE="/dev/sonycd"
  40. elif [ "$CD_ROM_TYPE" = "3" ]; then
  41.  CD_DEVICE="/dev/cdu535"
  42. elif [ "$CD_ROM_TYPE" = "4" ]; then
  43.  CD_DEVICE="/dev/mcd"
  44. elif [ "$CD_ROM_TYPE" = "5" ]; then
  45.  CD_DEVICE="/dev/sbpcd"
  46. elif [ "$CD_ROM_TYPE" = "6" ]; then
  47.  CD_DEVICE="/dev/aztcd"
  48. elif [ "$CD_ROM_TYPE" = "7" ]; then
  49.  dialog --title "SELECT IDE DEVICE" --menu \
  50. "Which IDE device is your CD-ROM drive connected to? \
  51. Devices hda and hdb are the possible drives on the \
  52. primary IDE interface, and hd1a and hd1b are the drives \
  53. on the secondary IDE interface. If you're not sure, we can try to \
  54. scan for your drive." \
  55. 16 70 5 \
  56. "scan" "Try to scan for your drive" \
  57. "/dev/hda" "Primary IDE drive 1 (unlikely)" \
  58. "/dev/hdb" "Primary IDE drive 2 (common)" \
  59. "/dev/hd1a" "Secondary IDE drive 1 (not uncommon)" \
  60. "/dev/hd1b" "Secondary IDE drive 2" 2> /tmp/idecd
  61.  if [ ! "`cat /tmp/idecd`" = "scan" ]; then
  62.   CD_DEVICE="`cat /tmp/idecd`"
  63.  else
  64.   for device in /dev/hda /dev/hdb /dev/hd1a /dev/hd1b ; do
  65.    dialog --infobox "Scanning $device..." 3 30
  66.    mount -o ro -t iso9660 $device /var/adm/mount 1> /dev/null 2> /dev/null
  67.    if [ $? = 0 ]; then
  68.     DRIVE_FOUND=$device
  69.     break
  70.    fi
  71.   done
  72.   umount /var/adm/mount 1> /dev/null 2> /dev/null
  73.   if [ "$DRIVE_FOUND" = "" ]; then
  74.    dialog --title "DRIVE NOT FOUND" --msgbox \
  75. "An IDE CD-ROM drive could not be found on any of the devices that were \
  76. scanned.  Please consult the BOOTING file for more information on \
  77. forcing the detection of your drive, and then reattempt installation. \
  78. If all else fails, see the SLAKWARE.FAQ for information about copying \
  79. parts of this CD to your DOS partition to allow you to install." \
  80. 12 55
  81.   else
  82.    dialog --title "IDE CD-ROM DRIVE DETECTED SUCCESSFULLY" --msgbox \
  83. "An IDE CD-ROM drive was found on device $DRIVE_FOUND." 5 65
  84.    CD_DEVICE="$DRIVE_FOUND"
  85.   fi
  86.  fi
  87. fi
  88. # The CD will be mounted automatically later on:
  89. echo "$CD_DEVICE       /cdrom        iso9660       ro   1   1" > /tmp/SeTcdfstab
  90.  
  91. while [ 0 ] ; do
  92.  dialog --title "Pick your installation method" --menu "\
  93.  You can run most of the system from the Slackware CD-ROM \
  94.  if you're short of drive space or if you just want to test Linux without \
  95.  going through a complete installation. \
  96.  If you're new to this, PLEASE read \
  97.  the help file before you make your selection. \
  98.  Which option would you like?" 16 74 5 \
  99.  "help" "Read the installation method help file" \
  100.  "slakware" "Normal installation to hard drive" \
  101.  "link2cd" "Link all files in /usr to the CD (upgradable but BIG)" \
  102.  "slaktest" "Link /usr -> /cdrom/usr (small, fast install, no upgrade)" \
  103.  "custom" "Install from a custom directory" \
  104.  2> /tmp/SeTreturn
  105.  if [ $? = 1 -o $? = 255 ]; then
  106.   rm -f /tmp/cdtype /tmp/SeTreturn
  107.   exit
  108.  fi
  109.  if [ "`cat /tmp/SeTreturn`" = "help" ]; then
  110.   dialog --title "INSTALLATION METHOD HELP" --textbox /usr/lib/setup/IMhelp \
  111.   20 74
  112.   continue
  113.  fi
  114.  break
  115. done
  116.  
  117. SLACK_SOURCE_LOCATION="`cat /tmp/SeTreturn`"
  118.  
  119. if [ "$SLACK_SOURCE_LOCATION" = "custom" ]; then
  120.  dialog --title "SELECT CUSTOM SOURCE DIRECTORY" --inputbox "Now we need \
  121.  to know \
  122.  which directory on the CD contains the Slackware sources.  This location \
  123.  may vary depending on the CD you have. You may omit the leading '/' if \
  124.  you like.  What directory are the Slackware sources in?" 11 67 \
  125.  2> /tmp/slacksource
  126.  if [ $? = 1 -o $? = 255 ]; then
  127.   rm -f /tmp/cdtype /tmp/slacksource
  128.   exit
  129.  fi
  130.  rm -f /tmp/tmpmsg
  131.  SLACK_SOURCE_LOCATION="`cat /tmp/slacksource`"
  132.  rm -f /tmp/slacksource
  133. fi
  134.  
  135. if [ -r /tmp/CDdebug ]; then # we're testing an image here @ Slackware labs,
  136.                              # and must do our own mount.
  137. echo
  138. echo "Source location -> $SLACK_SOURCE_LOCATION"
  139. echo
  140. echo "Shelling out to let you do your own mount. The command that would have"
  141. echo "been used here is:"
  142. echo
  143. echo "mount -o ro -t iso9660 $CD_DEVICE /var/adm/mount"
  144. echo
  145. echo "To test correctly, be sure to mount read-only ( -o ro )."
  146. echo
  147. echo "It addition, this line will be in /tmp/SeTcdfstab so the disk is"
  148. echo "mounted at boot time:"
  149. echo
  150. echo "$CD_DEVICE       /cdrom        iso9660       ro   1   1"
  151. echo
  152. echo "You might want to echo your own to there for testing."
  153. echo
  154. echo "When done, type 'exit' to return to the setup program."
  155. echo
  156. /bin/sh
  157. else 
  158.  while [ 0 ]; do
  159.   mount -o ro -t iso9660 $CD_DEVICE /var/adm/mount 1> /dev/null 2> /dev/null
  160.   if [ ! $? = 0 ]; then
  161.    dialog --title "MOUNT ERROR" --menu "There was an error attempting to mount the CD-ROM device." \
  162. 11 60 3 \
  163. "1" "Abort CD installation" \
  164. "2" "Attempt to mount the CD-ROM device again" \
  165. "3" "Ignore the error and continue" 2> /tmp/errordo
  166.    if [ $? = 1 -o $? = 255 ]; then
  167.     rm -f /tmp/SeTDS /tmp/SeTmount /tmp/SeTCDdev /tmp/errordo
  168.     exit;
  169.    fi
  170.    DOWHAT="`cat /tmp/errordo`"
  171.    rm -f /tmp/errordo
  172.    if [ $DOWHAT = 1 ]; then
  173.     rm -f /tmp/SeTDS /tmp/SeTmount /tmp/SeTCDdev
  174.     exit;
  175.    elif [ $DOWHAT = 3 ]; then
  176.     break;
  177.    fi
  178.   else
  179.    if [ ! -d /var/adm/mount/$SLACK_SOURCE_LOCATION ]; then
  180.     dialog --title "ERROR: DIRECTORY NOT FOUND" --msgbox "The Slackware source directory could not be found. You'll \
  181. have to reconfigure your source media before you can install." 8 60
  182.     rm -f /tmp/SeTmount /tmp/SeTDS /tmp/SeTCDdev   
  183.     exit
  184.    fi
  185.    break;
  186.   fi
  187.  done
  188. fi # debug
  189.  
  190. # since we've mounted successfully, let's refresh the link:
  191. if [ ! -d $T_PX/dev ]; then
  192.  mkdir $T_PX/dev
  193.  chown root.root $T_PX/dev
  194.  chmod 755 $T_PX/dev
  195. fi
  196. ( cd $T_PX/dev ; ln -sf $CD_DEVICE cdrom )
  197. echo "/var/adm/mount/$SLACK_SOURCE_LOCATION" > /tmp/SeTDS
  198. echo "-source_mounted" > /tmp/SeTmount
  199. echo "$CD_DEVICE" > /tmp/SeTCDdev
  200. echo "/dev/null" > /tmp/SeTsource
  201.