Changeset 2533 in MondoRescue


Ignore:
Timestamp:
Jan 8, 2010, 3:55:41 PM (15 years ago)
Author:
Bruno Cornec
Message:

r3753@localhost: bruno | 2010-01-08 14:25:33 +0100

  • First attempt to support device exclusion at restore time through a new boot param excludedevs
  • Fix a bug preventing execution of the pre script in init
Location:
branches/2.2.9/mindi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi/README.bootparam

    r2484 r2533  
    2626donteject
    2727    mondorestore will not eject the CD; this is useful if, for instance, your PC's case has a concealed CD-ROM drive
     28
     29excludedevs="dev1 dev2"
     30    Exclude those evices from retoration process (no LVM action done suc has pvcreate, and no partitioning. Those devices are removed from /tmp/mountlist.txt and /tmp/i-want-my-lvm)
    2831
    2932forcemods="mod1 mod2"
  • branches/2.2.9/mindi/rootfs/sbin/init

    r2498 r2533  
    400400            vgscan
    401401        fi
     402
     403        # Exclude devices we may not want
     404        rm -f /tmp/restorevgs
     405        for d in $EXCLUDE_DEVS ; do
     406            echo " == $d"
     407            EXCLUDE_VGS=`grep " $d" /tmp/i-want-my-lvm | grep vgcreate | awk '{print $4}'`
     408            vg=`echo $EXCLUDE_VGS | sed "s/ /|/g"`
     409            if [ "$vg" != "" ]; then
     410                re=" $d|$vg"
     411            else
     412                re=" $d"
     413            fi
     414            # Remove VGs from i-want-my-lvm
     415            grep -Ev "$re" /tmp/i-want-my-lvm > /tmp/i-want-my-lvm.new
     416            mv /tmp/i-want-my-lvm.new /tmp/i-want-my-lvm
     417            # Prepare  script to restore the VG exluded here if needed
     418            for v in $EXCLUDE_VGS; do
     419                echo "vgcfgrestore $v" >> /tmp/restorevgs
     420                # Remove LVs from mountlist
     421                EXCLUDE_LVS=`grep " $v" /tmp/i-want-my-lvm | grep lvcreate | sed "s/^.*-n \([^ ][^ ]*\) .*$/$1/"`
     422                for l in $EXCLUDE_LVS; do
     423                    grep -Ev "/dev/$v/$l" /tmp/mountlist.txt > /tmp/mountlist.txt.new
     424                    mv /tmp/mountlist.txt.new /tmp/mountlist.txt
     425                done
     426            done
     427        done
     428
    402429        grep -E "^#.*vgchange" /tmp/i-want-my-lvm | sed "s/^#[ ]*//" > /tmp/start-lvm
    403430        chmod +x /tmp/start-lvm
     
    701728    export FORCE_MODS=" "
    702729fi
     730if [ "`grep -i excludedevs /proc/cmdline`" ]; then
     731    export EXCLUDE_DEVS="`cat /proc/cmdline | sed 's~.*excludedevs=\"\(.*\)\".*~\1~'` mondonone"
     732else
     733    export EXCLUDE_DEVS=" "
     734fi
    703735
    704736echo "Activating a potential USB keyboard/mouse"
     
    860892    # start-netfs moved it under /tmp as the NFS share is already unmounted
    861893    if [ "`echo $pre | grep -E '^/tmp/isodir'`" ]; then
    862         post=`echo $pre | sed 's|^/tmp/isodir|/tmp|'`
     894        pre=`echo $pre | sed 's|^/tmp/isodir|/tmp|'`
    863895    fi
    864896    if [ -x $pre ]; then
Note: See TracChangeset for help on using the changeset viewer.