Ignore:
Timestamp:
Apr 7, 2010, 2:17:08 PM (14 years ago)
Author:
Bruno Cornec
Message:
  • Adds tee to deplist
  • Fix #412 by supporting grub-install.unsupported for OpenSuSE and solving an issue with the parameter passed to grub for device which should be a device name, not a partition.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mondo/src/restore-scripts/mondo/grub-MR

    r2449 r2615  
    6969
    7070    echo -en "\
    71     device (hd$driveno) $mbrpart\n\
     71    device (hd$driveno) $mbrdev\n\
    7272    $extraline\n\
    7373    root (hd$driveno,$partno)\n\
     
    7777    log_file=/tmp/grub.output
    7878    if [ "$MNT_RESTORING" ] ; then
    79         chroot /mnt/RESTORING grub --batch < /tmp/feed.txt > $log_file
     79        chroot $MNT_RESTORING grub --batch < /tmp/feed.txt > $log_file
    8080    else
    8181        grub --batch < /tmp/feed.txt > $log_file
     
    104104
    105105echo "Now I'll use grub-install" >> $LOGFILE
    106 chroot /mnt/RESTORING grub-install $1 >> $LOGFILE
    107 res=$?
     106if [ "$MNT_RESTORING" ] ; then
     107    chroot $MNT_RESTORING grub-install $1 >> $LOGFILE
     108    res=$?
     109else
     110    grub-install $1 >> $LOGFILE
     111    res=$?
     112fi
    108113echo "grub-install returned $res" >> $LOGFILE
    109114[ "$res" -eq "0" ] && exit 0
    110115
     116# For some OpenSuSE
     117echo "Now I'll use grub-install.unsupported" >> $LOGFILE
     118if [ "$MNT_RESTORING" ] ; then
     119    chroot $MNT_RESTORING grub-install.unsupported $1 >> $LOGFILE
     120    res=$?
     121else
     122    grub-install.unsupported $1 >> $LOGFILE
     123    res=$?
     124fi
     125echo "grub-install.unsupported returned $res" >> $LOGFILE
     126[ "$res" -eq "0" ] && exit 0
     127
    111128echo "Trying a hack" >> $LOGFILE
    112 FindBootPart $1 $2
    113 mbrpart=$1
     129FindBootPart $1 $2 2>&1 | tee -a $LOGFILE
     130mbrdev=`echo $1 | sed 's/[^0-9]*\([0-9]*\)$/\1/'`
    114131if echo $bootpart | grep "/cciss/" > /dev/null ; then
    115132    partno=`basename $bootpart | cut -d'p' -f2`
     
    117134    partno=`basename $bootpart | cut -d'p' -f3`
    118135else
    119     partno=`basename $bootpart | sed s/[a-z]*//`
     136    partno=`basename $bootpart | sed 's/[a-z]*//'`
    120137fi
    121138if [ ! "$partno" ] ; then
     
    125142fi
    126143if echo $bootpart | grep "/md" > /dev/null ; then
     144    # FIXME: Why this if not used later
    127145    base=`basename $bootpart`
    128146    line=`grep $base /proc/mdstat | head -n1`
    129     echo "mbrpart was $mbrpart"
    130     mbrpart=`parted2fdisk -l | grep /dev/ | head -n1 | tr ':' ' ' | cut -d' ' -f2`
    131     echo "mbrpart is $mbrpart"
     147    echo "mbrdev was $mbrdev" 2>&1 | tee -a $LOGFILE
     148    mbrdev=`parted2fdisk -l | grep /dev/ | head -n1 | tr ':' ' ' | cut -d' ' -f2`
     149    echo "mbrdev is $mbrdev" 2>&1 | tee -a $LOGFILE
    132150    partno="0"; # cheating - FIXME   
    133151fi
    134 echo ".............Cool."
     152echo ".............Cool." 2>&1 | tee -a $LOGFILE
    135153
    136154grub=`FindPathOfRESTExe grub`
Note: See TracChangeset for help on using the changeset viewer.