Changeset 2013 in MondoRescue for branches/2.2.7/mindi/mindi


Ignore:
Timestamp:
Sep 5, 2008, 8:55:11 PM (16 years ago)
Author:
Bruno Cornec
Message:

Fix Labelled swap to support 2.6.12 kernel on FC3 which skip only 16 bytes and not 105 to find the label. May need further fixes for other kernels.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.7/mindi/mindi

    r2010 r2013  
    916916partition_size partition_format outstring partition_number \
    917917partition_mountpt c_p lwm_info psz lvm_dev unofficial_outstring \
    918 absolute_partition old_partition_fmt current_lvolume
     918absolute_partition old_partition_fmt current_lvolume uname skip
    919919
    920920    echo "Your raw fstab file looks like this:" >> $LOGFILE
     
    10321032            # SWAP only
    10331033            if [ "x$actual_dev" = "x" -a  _"`echo $current_partition | /bin/grep -iE 'LABEL=SWAP|LABEL=SW-'`" != _"" ]; then
     1034                    skip=""
     1035                    uname="`uname -r`"
     1036                    [ "`echo $uname | grep "2.4.[0-9]"`" != "" ] && skip=16
     1037                    # 2.6.12 needs 16 (FC3)
     1038                    [ "`echo $uname | grep "2.6.[0-1]"`" != "" ] && skip=16
     1039                    # 2.6.19 and upper needs 1052
     1040                    [ "`echo $uname | grep "2.6.19"`" != "" ] && skip=1052
     1041                    [ "`echo $uname | grep "2.6.[2-9]"`" != "" ] && skip=1052
     1042                    if [ $skip = "" ]; then
     1043                        Die "Your kernel is too old. I don't know how to support labelled swap spaces with it"
     1044                    fi
    10341045                    for try_dev in `tail +2 /proc/swaps | cut -d' ' -f1`
    10351046                    do
    10361047                        # Location of the swap label for kernel 2.6
    1037                         try_dev_label=`dd bs=1 count=16 skip=1052 if=$try_dev 2> /dev/null`
     1048                        try_dev_label=`dd bs=1 count=16 skip=$skip if=$try_dev 2> /dev/null`
    10381049                        if [ "x$try_dev_label" = "x$redhat_label" ]; then
    10391050                            actual_dev=$try_dev
     
    17831794    lines=`grep -vx " *#.*" $lfiles | grep -vx "" | wc -l`
    17841795    ParseModprobeForIncludes $includefile
    1785     lines=${lines}+`wc -l $includefile`
     1796    lines=$(($lines+`wc -l $includefile`))
    17861797    cat $lfiles $includefile | GenerateGiantDependencyList $needlist $lines
    17871798    res=$?
Note: See TracChangeset for help on using the changeset viewer.