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

  1. #!/bin/sh
  2. T_PX=/mnt
  3. if [ ! -r /tmp/SeTplist ]; then
  4.  # Give warning?
  5.  exit
  6. else
  7.  PARTLIST="`cat /tmp/SeTplist`"
  8. fi
  9. #ROOT_DEVICE="`cat /tmp/SeTrootdev`"
  10. while [ 0 ]; do 
  11.  if [ ! "`echo "$PARTLIST" | sed -n '2 p'`" = "" ]; then # more than one:
  12.   ONLY_ONE="false"
  13.  else
  14.   ONLY_ONE="true"
  15.  fi
  16.  echo > /tmp/tmpmsg
  17.  echo "   Device Boot  Begin   Start     End  Blocks   Id  System" >> /tmp/tmpmsg
  18.  echo "$PARTLIST" >> /tmp/tmpmsg
  19.  if [ "$ONLY_ONE" = "false" ]; then
  20.   echo >> /tmp/tmpmsg
  21.   echo "Which DOS partition would you like to install Linux on?" >> /tmp/tmpmsg
  22.   dialog --title "The following partitions are available for Linux:" \
  23.   --inputbox "`cat /tmp/tmpmsg`" 20 72 2> /tmp/rootdev
  24.   if [ $? = 1 -o $? = 255 ]; then
  25.    rm -f /tmp/tmpmsg
  26.    exit
  27.   fi
  28.   ROOT_DEVICE="`cat /tmp/rootdev`"
  29.   rm -f /tmp/rootdev
  30.  else
  31.   dialog --title "Using this partition for Linux:" \
  32. --msgbox "`cat /tmp/tmpmsg`" 8 72
  33.   if [ $? = 255 ]; then
  34.    rm -f /tmp/tmpmsg
  35.    exit
  36.   fi
  37.   ROOT_DEVICE="`echo "$PARTLIST" | cut -b1-10`"
  38.  fi
  39.  rm -f /tmp/tmpmsg
  40.  if [ ! -b $ROOT_DEVICE ]; then
  41.   dialog --msgbox "Invalid device. Try again. Use a format such as: \
  42. /dev/hda3 or whatever the device name is." 7 50
  43.   if [ $? = 255 ]; then
  44.    exit
  45.   fi
  46.   continue;
  47.  fi
  48.  if fdisk -l | fgrep "DOS" | fgrep $ROOT_DEVICE 1> /dev/null 2> /dev/null ; then
  49.   echo $ROOT_DEVICE > /tmp/SeTrootdev
  50.   ROOT_SIZE="`fdisk -l | fgrep "$ROOT_DEVICE" | cut -b38-45 2> /dev/null`"
  51.   mount -t umsdos $ROOT_DEVICE $T_PX 1> /dev/null 2> /dev/null
  52.   mkdir -p $T_PX/linux/etc
  53.   touch $T_PX/linux/etc/rc
  54.   umssync -r99 -v- $T_PX/linux 1> /dev/null 2> /dev/null
  55.   echo "$ROOT_DEVICE       /        umsdos        defaults   1   1" > /tmp/SeTnative
  56.   break;
  57.  else # device not tagged Linux native
  58.   dialog --title "INCORRECT PARTITION TYPE" --msgbox "The partition you have selected is not a DOS \
  59. partition." 10 50
  60.   if [ $? = 255 ]; then
  61.    exit
  62.   fi
  63.   continue;
  64.  fi
  65.  break;
  66. done # mounting the target root partition
  67.