home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / ROOTDSKS.144 / COLOR144 / usr / lib / setup / SeTconfig < prev    next >
Encoding:
Text File  |  1994-10-23  |  7.6 KB  |  235 lines

  1. #!/bin/sh
  2. T_PX="`cat /tmp/SeTT_PX`"
  3. ROOT_DEVICE="`cat /tmp/SeTrootdev`"
  4. if [ ! -d $T_PX/bin -a ! -d $T_PX/etc ]; then # if there no Linux here, exit
  5.  exit
  6. fi
  7. dialog --title "CONFIGURE YOUR SYSTEM?" --yesno "Now it's time to configure \
  8. your Linux system. If this is a new system, you must configure it now or it \
  9. will not boot correctly. Otherwise, you can back out to the main menu if \
  10. you're sure you want to skip this step. If you've installed a new kernel \
  11. image, it's important to reconfigure your system so that you can install LILO \
  12. (the Linux loader) or create a bootdisk using the new kernel. Do you want to \
  13. move on to \
  14. the CONFIGURE option?" 14 60 
  15. if [ $? = 1 -o $? = 255 ]; then
  16.  exit
  17. fi
  18. dialog --title "MAKE BOOT DISK?" --yesno "It is HIGHLY recommended that you \
  19. make a standard boot disk \
  20. for your Linux system at this time. Such a disk can be very handy if \
  21. LILO is ever improperly installed. Since the boot disk will \
  22. contain a kernel that is independent of LILO and the kernel on your \
  23. hard drive, \
  24. you'll still be able to use it to boot your system no matter what you do to \
  25. LILO or your hard drive kernel. Would you like to make a standard \
  26. boot disk?" \
  27. 14 60
  28. if [ $? = 0 ]; then
  29.  dialog --title "BOOT DISK CREATION" --yesno \
  30. "\n\
  31. Now put a formatted floppy in your boot drive. \n\
  32. This will be made into your Linux boot disk. Use this to\n\
  33. boot Linux until LILO has been configured to boot from\n\
  34. the hard drive.\n\n\
  35. Any data on the target disk will be destroyed.\n\n\
  36. "YES" creates the disk, "NO" aborts.\n" 14 62
  37.  if [ $? = 0 ]; then
  38.   dialog --title "CREATING DISK" --infobox "Creating boot disk from 'vmlinuz'..." 5 50
  39.   KERNEL="/vmlinuz"
  40.   # echo "  - writing kernel to disk: (dd if=$T_PX$KERNEL of=/dev/fd0)"
  41.   dd if=$T_PX$KERNEL of=/dev/fd0 2> /dev/null
  42.   # echo "Configuring boot disk..."
  43.   # echo -n "  - boot device: "
  44.   rdev /dev/fd0 $ROOT_DEVICE
  45.   # echo "(rdev /dev/fd0 $ROOT_DEVICE)"
  46.   # echo -n "  - video mode: "
  47.   rdev -v /dev/fd0 -1
  48.   # echo "(rdev -v /dev/fd0 -1)"
  49.   # echo -n "  - mount root read-only: "
  50.   # echo "(rdev -R /dev/fd0 1)"
  51.   rdev -R /dev/fd0 1
  52.   sync
  53.   # echo "Boot disk created."
  54.  else
  55.   dialog --title "SKIPPED BOOT DISK CREATION" --msgbox \
  56. "Boot disk creation skipped.  You'll have to use the bootkernel \n\
  57. to start your system with this command at the LILO prompt: \n\
  58. \n\
  59. mount root=`cat /tmp/SeTrootdev` ro\n\
  60. \n\
  61. Or use Loadlin to boot from MS-DOS:\n\
  62. \n\
  63. loadlin \\linux\\vmlinuz root=`cat /tmp/SeTrootdev` ro\n\
  64. \n\
  65. Or, you'll have to install LILO.  If you installed the LILO\n\
  66. package the LILO install menu will be coming up soon.\n\
  67. \n" 16 67
  68.  fi
  69. else
  70.   dialog --title "SKIPPED BOOT DISK CREATION" --msgbox \
  71. "Boot disk creation skipped.  You'll have to use the bootkernel \n\
  72. to start your system with this command at the LILO prompt: \n\
  73. \n\
  74. mount root=`cat /tmp/SeTrootdev` ro\n\
  75. \n\
  76. Or use Loadlin to boot from MS-DOS:\n\
  77. \n\
  78. loadlin \\linux\\vmlinuz root=`cat /tmp/SeTrootdev` ro\n\
  79. \n\
  80. Or, you'll have to install LILO.  If you installed the LILO\n\
  81. package the LILO install menu will be coming up soon.\n\
  82. \n" 16 67
  83. fi
  84. dialog --title "MODEM CONFIGURATION" --yesno \
  85. "\n\
  86. This part of the configuration process will create a link in /dev\n\
  87. from your callout device (cua0, cua1, cua2, cua3) to /dev/modem.\n\
  88. You can change this link later if you put your modem on a different\n\
  89. port.\n\n\
  90. Would you like to set up your modem?\n" 12 73
  91. if [ $? = 0 ]; then
  92.  dialog --title "SELECT CALLOUT DEVICE" \
  93. --menu "Please select the callout device which you would like to use \
  94. for your modem:" 12 60 4 \
  95. "cua0" "com1: under DOS" \
  96. "cua1" "com2: under DOS" \
  97. "cua2" "com3: under DOS" \
  98. "cua3" "com4: under DOS" 2> /tmp/callout
  99.  if [ $? = 1 ]; then
  100.   rm -f /tmp/callout
  101.  else
  102.   MODEM_DEVICE="`cat /tmp/callout`"
  103.   rm -f /tmp/callout
  104.   (cd $T_PX/dev; ln -sf $MODEM_DEVICE modem)
  105.  fi
  106. fi
  107.  
  108.  
  109. dialog --title "MOUSE CONFIGURATION" \
  110. --yesno "\n\
  111. This part of the configuration process will create a link in /dev\n\
  112. from your mouse device to /dev/mouse. You can change this link\n\
  113. later if the setting chosen does not work, or if you switch to a\n\
  114. different type of mouse.\n\n\
  115. Would you like to set up your mouse?" 12 70
  116. if [ $? = 0 ]; then
  117.  dialog --title "SELECT MOUSE TYPE" --menu "These mouse types are supported:" 13 60 6 \
  118. "1" "Microsoft compatible serial mouse" \
  119. "2" "C&T 82C710 or PS/2 style mouse (Auxiliary port)" \
  120. "3" "Logitech Bus Mouse" \
  121. "4" "ATI XL Bus Mouse" \
  122. "5" "Microsoft Bus Mouse" \
  123. "6" "Mouse Systems serial mouse" 2> /tmp/mtype
  124.  if [ $? = 1 ]; then
  125.   rm -f /tmp/mtype
  126.  fi
  127.  if [ -f /tmp/mtype ]; then
  128.   MOUSE_TYPE="`cat /tmp/mtype`"
  129.  else
  130.   unset MOUSE_TYPE
  131.  fi
  132.  rm -f /tmp/mtype
  133.  if [ "$MOUSE_TYPE" = "1" -o "$MOUSE_TYPE" = "6" ]; then
  134.   dialog --title "SELECT SERIAL PORT" --menu "Your mouse requires a serial port. Which one would you \
  135. like to use?" 12 60 4 \
  136. "ttyS0" "com1: under DOS" \
  137. "ttyS1" "com2: under DOS" \
  138. "ttyS2" "com3: under DOS" \
  139. "ttyS3" "com4: under DOS" 2> /tmp/mport
  140.   if [ $? = 1 ]; then
  141.    rm -f /tmp/mport
  142.   fi
  143.   if [ -f /tmp/mport ]; then
  144.    MOUSE_DEVICE="`cat /tmp/mport`"
  145.   else
  146.    unset MOUSE_DEVICE
  147.   fi
  148.   rm -f /tmp/mport
  149.   if [ "$MOUSE_TYPE" = "1" ]; then
  150.    MTYPE="ms"
  151.   else
  152.    MTYPE="msc"
  153.   fi
  154.   (cd $T_PX/dev; ln -sf $MOUSE_DEVICE mouse)
  155.  elif [ "$MOUSE_TYPE" = "2" ]; then
  156.   (cd $T_PX/dev; ln -sf psaux mouse)
  157.   MTYPE="ps2"
  158.  elif [ "$MOUSE_TYPE" = "3" ]; then
  159.   (cd $T_PX/dev; ln -sf logibm mouse)
  160.   MTYPE="logi"
  161.  elif [ "$MOUSE_TYPE" = "4" ]; then
  162.   (cd $T_PX/dev; ln -sf atibm mouse)
  163.   MTYPE="bm"
  164.  elif [ "$MOUSE_TYPE" = "5" ]; then
  165.   (cd $T_PX/dev; ln -sf inportbm mouse)
  166.   MTYPE="bm"
  167.  fi
  168. fi
  169. export MTYPE
  170.  
  171. ( cd $T_PX ; chmod 755 ./ )
  172. ( cd $T_PX ; chmod 755 ./var )
  173. if [ -d $T_PX/usr/src/linux ]; then
  174.  chmod 755 $T_PX/usr/src/linux
  175. fi
  176. if [ ! -d $T_PX/proc ]; then
  177.  mkdir $T_PX/proc
  178.  chown root.root $T_PX/proc
  179. fi
  180. if [ ! -d $T_PX/var/spool/uucp ]; then
  181.  mkdir -p $T_PX/var/spool/uucp
  182. fi
  183. chown uucp.uucp $T_PX/var/spool/uucp
  184. chmod 1777 $T_PX/var/spool/uucp
  185. if [ ! -d $T_PX/var/spool/uucppublic ]; then
  186.  mkdir -p $T_PX/var/spool/uucppublic
  187. fi
  188. chown uucp.uucp $T_PX/var/spool/uucppublic
  189. chmod 1777 $T_PX/var/spool/uucppublic
  190. chmod 1777 $T_PX/tmp
  191. if [ ! -d $T_PX/var/spool/mail ]; then
  192.  mkdir -p $T_PX/var/spool/mail
  193.  chmod 755 $T_PX/var/spool
  194.  chown root.mail $T_PX/var/spool/mail
  195.  chmod 775 $T_PX/var/spool/mail
  196. fi 
  197.  
  198. # Post installation and setup scripts added by packages.
  199. if [ -d $T_PX/var/adm/setup ]; then
  200.  for INSTALL_SCRIPTS in $T_PX/var/adm/setup/setup.*
  201.  do
  202.   SCRIPT=`basename $INSTALL_SCRIPTS`
  203.   # Here, we call each script in /var/adm/setup. Two arguments are provided:
  204.   # 1 -- the target prefix (normally /, but /mnt from the bootdisk)
  205.   # 2 -- the name of the root device.
  206.   ( cd $T_PX ; sh var/adm/setup/$SCRIPT $T_PX $ROOT_DEVICE )
  207.   if echo $SCRIPT | fgrep onlyonce 1> /dev/null 2> /dev/null; then # only run after first install
  208.    if [ ! -d $T_PX/var/adm/setup/install ]; then
  209.     mkdir $T_PX/var/adm/setup/install
  210.    fi
  211.    mv $INSTALL_SCRIPTS $T_PX/var/adm/setup/install
  212.   fi
  213.  done
  214. fi
  215.  
  216. # Load keyboard map (if any) when booting
  217. if [ -r /tmp/SeTkeymap ]; then
  218.  MAPNAME="`cat /tmp/SeTkeymap`"
  219.  if fgrep "sh /etc/rc.d/rc.keymap" $T_PX/etc/rc.d/rc.local 1> /dev/null 2> /dev/null ; then
  220.   echo >> /dev/null # ?
  221.  else
  222.   echo "# Load custom keyboard map" >> $T_PX/etc/rc.d/rc.local
  223.   echo "sh /etc/rc.d/rc.keymap" >> $T_PX/etc/rc.d/rc.local
  224.  fi
  225.  mkdir -p $T_PX/usr/lib/kbd/keytables
  226.  if [ ! -r $T_PX/usr/lib/kbd/keytables/$MAPNAME ]; then
  227.   cp /tmp/$MAPNAME $T_PX/usr/lib/kbd/keytables
  228.   chmod 755 $T_PX/usr/lib/kbd/keytables
  229.  fi
  230.  echo "#!/bin/sh" > $T_PX/etc/rc.d/rc.keymap
  231.  echo "echo 'Loading keyboard map \"$MAPNAME\"...'" >> $T_PX/etc/rc.d/rc.keymap
  232.  echo "/usr/bin/loadkeys /usr/lib/kbd/keytables/$MAPNAME" >> $T_PX/etc/rc.d/rc.keymap
  233.  chmod 755 $T_PX/etc/rc.d/rc.keymap
  234. fi
  235.