Changeset 3686 in MondoRescue for branches/3.3/mondo/src/restore-scripts
- Timestamp:
- Sep 22, 2017, 2:22:48 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mondo/src/restore-scripts/mondo/mr-make-me-bootable
r3542 r3686 6 6 7 7 if [ "$#" -ne "2" ] && [ "$#" -ne "3" ] ; then 8 9 8 echo "mr-make-me-bootable <fname> <drive> [noaction]" 9 exit 1 10 10 fi 11 11 … … 24 24 for i in `cat $1 | tr -s '\t' ' ' | cut -d' ' -f1 | grep -vE "/dev/fd|none|#"` ; do 25 25 # Warning wrong if LVM ! 26 26 drive=`echo $i | sed -e 's/[0-9]*$//' -e 's/\([0-9]\)p$/\1/'` 27 27 if [ "$drivetouse" = "$drive" ]; then 28 28 # We can continue as this is the drive we ned to work on 29 30 29 partno=`echo $i | sed -e 's/^.*[^0-9]\([0-9]*\)$/\1/'` 30 mountpt=`grep "$i " $1 | tr -s '\t' ' ' | cut -d' ' -f2` 31 31 32 33 34 35 36 37 38 39 32 if [ "$mountpt" = "/" ] ; then 33 root_drv=$drive 34 root_part=$partno 35 elif [ "$mountpt" = "/boot" ] ; then 36 boot_drv=$drive 37 boot_part=$partno 38 fi 39 fi 40 40 done 41 41 42 42 if [ "$boot_drv" ] ; then 43 44 43 drive=$boot_drv 44 partno=$boot_part 45 45 elif [ "$root_drv" ] ; then 46 47 46 drive=$root_drv 47 partno=$root_part 48 48 else 49 50 51 49 driveline=`grep -E '[ ]/boot[ ]' $1` 50 [ ! "$driveline" ] && driveline=`grep -E '[ ]/[ ]' $1` 51 partno=`echo "$driveline" | cut -d' ' -f1 | awk -F "[a-z]" '{print $NF;}'` 52 52 # echo "driveline=$driveline --> partno=$partno" 53 53 fi 54 54 55 55 if [ "$drive" ] ; then 56 57 56 if [ "$partno" = "0" ] || [ ! "$partno" ] ; then 57 partno="1" 58 58 fi 59 59 cmd="" … … 61 61 # First desactivate active partitions (coming from previous usage) 62 62 cmd="${cmd}a\n$p\n" 63 63 if [ "$dummy" != "" ] ; then 64 64 echo "Will desactivate $p on $drive" >> $LOGFILE 65 65 fi 66 66 done 67 67 # Then activate the one which should 68 68 if [ "$dummy" != "" ] ; then 69 69 echo "Would activate $partno on $drive" >> $LOGFILE 70 70 else
Note:
See TracChangeset
for help on using the changeset viewer.