Last change
on this file since 2561 was 1341, checked in by Bruno Cornec, 17 years ago |
- Remove compare-me
- Update Logfiles for mondo scripts
- label-partitions-as-necessary is now correct
|
-
Property svn:keywords
set to
Id
-
Property svn:unix-mode
set to
755
|
File size:
1.5 KB
|
Rev | Line | |
---|
[1] | 1 | #!/bin/sh
|
---|
| 2 |
|
---|
| 3 |
|
---|
| 4 | if [ "$#" -ne "1" ] && [ "$#" -ne "2" ] ; then
|
---|
| 5 | echo "make-me-bootable <fname> (dummy)"
|
---|
| 6 | exit 1
|
---|
| 7 | fi
|
---|
| 8 |
|
---|
| 9 | dummy=$2
|
---|
| 10 | boot_drv=""
|
---|
| 11 | boot_part=""
|
---|
| 12 | root_drv=""
|
---|
| 13 | root_part=""
|
---|
| 14 |
|
---|
| 15 | HAVE_ACTIVE="false"
|
---|
[680] | 16 | for i in `cat $1 | tr -s '\t' ' ' | cut -d' ' -f1 | grep -vE "/dev/fd|none|#"` ; do
|
---|
[273] | 17 | mountpt=`grep "$i " $1 | tr -s '\t' ' ' | cut -d' ' -f2`
|
---|
| 18 | format=`grep "$i " $1 | tr -s '\t' ' ' | cut -d' ' -f3`
|
---|
[1] | 19 | drive=`echo $i | sed -e 's/[0-9]*$//' -e 's/\([0-9]\)p$/\1/'`
|
---|
| 20 | partno=`echo $i | sed -e 's/^.*[^0-9]\([0-9]*\)$/\1/'`
|
---|
| 21 |
|
---|
| 22 | if [ "$HAVE_ACTIVE" = "false" ] && [ "`parted2fdisk -l $drive | tr -s '\t' ' ' | grep "$i " | grep -v "*"`" ] ; then
|
---|
| 23 | if [ "$mountpt" = "/" ] ; then
|
---|
| 24 | root_drv=$drive
|
---|
| 25 | root_part=$partno
|
---|
| 26 | elif [ "$mountpt" = "/boot" ] ; then
|
---|
| 27 | boot_drv=$drive
|
---|
| 28 | boot_part=$partno
|
---|
| 29 | fi
|
---|
| 30 | fi
|
---|
| 31 | done
|
---|
| 32 |
|
---|
| 33 | if [ "$boot_drv" ] ; then
|
---|
| 34 | drive=$boot_drv
|
---|
| 35 | partno=$boot_part
|
---|
| 36 | elif [ "$root_drv" ] ; then
|
---|
| 37 | drive=$root_drv
|
---|
| 38 | partno=$root_part
|
---|
| 39 | else
|
---|
[911] | 40 | driveline=`grep -E '[ ]/boot[ ]' $1`
|
---|
| 41 | [ ! "$driveline" ] && driveline=`grep -E '[ ]/[ ]' $1`
|
---|
[1] | 42 | partno=`echo "$driveline" | cut -d' ' -f1 | awk -F "[a-z]" '{print $NF;}'`
|
---|
| 43 | # echo "driveline=$driveline --> partno=$partno"
|
---|
| 44 | fi
|
---|
| 45 |
|
---|
| 46 | if [ "$drive" ] ; then
|
---|
| 47 | if [ "$dummy" != "" ] ; then
|
---|
| 48 | if [ "$partno" = "0" ] || [ ! "$partno" ] ; then
|
---|
| 49 | partno="1"
|
---|
| 50 | fi
|
---|
| 51 | echo "$partno"
|
---|
| 52 | else
|
---|
| 53 | echo -en "a\n$partno\nw\n" | parted2fdisk $drive >> $LOGFILE 2>> $LOGFILE
|
---|
| 54 | fi
|
---|
| 55 | fi
|
---|
| 56 | exit 0
|
---|
Note:
See
TracBrowser
for help on using the repository browser.