home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- T_PX=/mnt
- if [ ! -r /tmp/SeTplist ]; then
- # Give warning?
- exit
- else
- PARTLIST="`cat /tmp/SeTplist`"
- fi
- #ROOT_DEVICE="`cat /tmp/SeTrootdev`"
- while [ 0 ]; do
- if [ ! "`echo "$PARTLIST" | sed -n '2 p'`" = "" ]; then # more than one:
- ONLY_ONE="false"
- else
- ONLY_ONE="true"
- fi
- echo > /tmp/tmpmsg
- echo " Device Boot Begin Start End Blocks Id System" >> /tmp/tmpmsg
- echo "$PARTLIST" >> /tmp/tmpmsg
- if [ "$ONLY_ONE" = "false" ]; then
- echo >> /tmp/tmpmsg
- echo "Which DOS partition would you like to install Linux on?" >> /tmp/tmpmsg
- dialog --title "The following partitions are available for Linux:" \
- --inputbox "`cat /tmp/tmpmsg`" 20 72 2> /tmp/rootdev
- if [ $? = 1 -o $? = 255 ]; then
- rm -f /tmp/tmpmsg
- exit
- fi
- ROOT_DEVICE="`cat /tmp/rootdev`"
- rm -f /tmp/rootdev
- else
- dialog --title "Using this partition for Linux:" \
- --msgbox "`cat /tmp/tmpmsg`" 8 72
- if [ $? = 255 ]; then
- rm -f /tmp/tmpmsg
- exit
- fi
- ROOT_DEVICE="`echo "$PARTLIST" | cut -b1-10`"
- fi
- rm -f /tmp/tmpmsg
- if [ ! -b $ROOT_DEVICE ]; then
- dialog --msgbox "Invalid device. Try again. Use a format such as: \
- /dev/hda3 or whatever the device name is." 7 50
- if [ $? = 255 ]; then
- exit
- fi
- continue;
- fi
- if fdisk -l | fgrep "DOS" | fgrep $ROOT_DEVICE 1> /dev/null 2> /dev/null ; then
- echo $ROOT_DEVICE > /tmp/SeTrootdev
- ROOT_SIZE="`fdisk -l | fgrep "$ROOT_DEVICE" | cut -b38-45 2> /dev/null`"
- mount -t umsdos $ROOT_DEVICE $T_PX 1> /dev/null 2> /dev/null
- mkdir -p $T_PX/linux/etc
- touch $T_PX/linux/etc/rc
- umssync -r99 -v- $T_PX/linux 1> /dev/null 2> /dev/null
- echo "$ROOT_DEVICE / umsdos defaults 1 1" > /tmp/SeTnative
- break;
- else # device not tagged Linux native
- dialog --title "INCORRECT PARTITION TYPE" --msgbox "The partition you have selected is not a DOS \
- partition." 10 50
- if [ $? = 255 ]; then
- exit
- fi
- continue;
- fi
- break;
- done # mounting the target root partition
-