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