Changeset 3368 in MondoRescue for branches/3.2/mindi


Ignore:
Timestamp:
Apr 18, 2015, 5:25:42 PM (9 years ago)
Author:
Bruno Cornec
Message:
  • White space removal for tabs
Location:
branches/3.2/mindi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi/mindi

    r3364 r3368  
    123123# Function to log on screen only
    124124LogScreen() {
    125     if [ -e /dev/stderr ] ; then
    126         echo -e "$1" >> /dev/stderr
    127     elif [ -e /usr/bin/logger ] ; then
    128         /usr/bin/logger -s $1
    129     fi
     125        if [ -e /dev/stderr ] ; then
     126        echo -e "$1" >> /dev/stderr
     127    elif [ -e /usr/bin/logger ] ; then
     128        /usr/bin/logger -s $1
     129    fi
    130130}
    131131
     
    133133LogFile() {
    134134
    135     echo -e "$1" >> $LOGFILE
    136     if [ _"$2" != _"" ]; then
    137         grep -Ev "tar: Removing \`/\'" "$2" >> $LOGFILE
    138     fi
    139     rm -f "$2"
     135    echo -e "$1" >> $LOGFILE
     136    if [ _"$2" != _"" ]; then
     137        grep -Ev "tar: Removing \`/\'" "$2" >> $LOGFILE
     138    fi
     139    rm -f "$2"
    140140}
    141141
    142142# Function to log in both screen and logfile
    143143LogAll() {
    144     LogScreen "$1"
    145     LogFile "$1" "$2"
     144    LogScreen "$1"
     145    LogFile "$1" "$2"
    146146}
    147147
     
    983983# Get PV's for an LV
    984984GetPVsForLV() {
    985   if [ -n "$1" ]; then
    986     vg=`$LVMCMD lvdisplay $1 2>/dev/null |awk '/VG Name/{print $NF;exit}'`
    987     if [ -z "$vg" ]; then
    988       return
    989     fi
    990     $LVMCMD vgdisplay -v $vg 2>/dev/null | awk '/PV Name/{print $NF}'
    991   fi
     985    if [ -n "$1" ]; then
     986        vg=`$LVMCMD lvdisplay $1 2>/dev/null |awk '/VG Name/{print $NF;exit}'`
     987        if [ -z "$vg" ]; then
     988            return
     989        fi
     990        $LVMCMD vgdisplay -v $vg 2>/dev/null | awk '/PV Name/{print $NF}'
     991    fi
    992992}
    993993
     
    13021302                partition_size=`grep -Fv "Priority" /proc/swaps | tr -s '\t' ' ' | grep -F "$current_partition " | $AWK '{print $3}'`
    13031303                [ "$partition_mountpt" != "swap" ] && partition_mountpt="swap"
    1304                 [ "$partition_format" != "swap" ] && partition_format="swap"
     1304                [ "$partition_format" != "swap" ] && partition_format="swap"
    13051305                if [ "$partition_size" = "" ] ; then
    1306                     totalsize=0
    1307                     items=0
    1308                     for i in `tr -s ' ' '\t' < /proc/swaps | grep -Fv "Filename" | cut -f3` ; do
     1306                    totalsize=0
     1307                    items=0
     1308                    for i in `tr -s ' ' '\t' < /proc/swaps | grep -Fv "Filename" | cut -f3` ; do
    13091309                        totalsize=$(($totalsize+$i))
    13101310                        items=$(($items+1))
    1311                     done
    1312                     [ "$items" -gt "0" ] && partition_size=$(($totalsize/$items)) || partition_size=0
    1313                     [ "$partition_size" -lt "125000" ] && partition_size=125000
    1314                     LogFile "INFO: I'm guessing $c_p is $(($partition_size/1024))MB"
     1311                    done
     1312                    [ "$items" -gt "0" ] && partition_size=$(($totalsize/$items)) || partition_size=0
     1313                    [ "$partition_size" -lt "125000" ] && partition_size=125000
     1314                    LogFile "INFO: I'm guessing $c_p is $(($partition_size/1024))MB"
    13151315                fi
    13161316            else
     
    15961596    # Some distro have a dmsetup conf at that point so removing it Cf: http://trac.mondorescue.org/ticket/651
    15971597    if [ "`which dmsetup`" != "" ]; then
    1598         block_id="`echo $USBPART | sed 's/\/dev\///g'`"
    1599         if [[ "`dmsetup ls | awk '{print $1}' | grep $block_id`" != "" ]]; then
    1600             LogFile "INFO: Removing $block_id from device mapper."
    1601             sleep 1
    1602             dmsetup remove $block_id
    1603         fi
    1604     fi
     1598        block_id="`echo $USBPART | sed 's/\/dev\///g'`"
     1599        if [[ "`dmsetup ls | awk '{print $1}' | grep $block_id`" != "" ]]; then
     1600            LogFile "INFO: Removing $block_id from device mapper."
     1601            sleep 1
     1602            dmsetup remove $block_id
     1603        fi
     1604    fi
    16051605    echo -en "."
    16061606    LogFile "INFO: Creating a vfat filesystem on $USBPART"
     
    19691969    dd if=/dev/zero of=$mountpoint/zero bs=1k count=16 &> /dev/null
    19701970    free_space=`df -k -P $mountpoint | tail -n1 | tr -s ' ' '\t' | cut -f4`
    1971          
     1971
    19721972    retval=0
    19731973    cp -f $kernelpath $mountpoint/vmlinuz &> /dev/null
     
    22692269    duff_kernels=""
    22702270    output=""
    2271    
     2271
    22722272    if [ "$ARCH" = "ia64" ] ; then
    22732273       root="/boot/efi/efi"
     
    27932793        umount $mountpoint || Die "Cannot unmount $tempfile"
    27942794        # log that we are done
    2795         LogFile "      ...done."
     2795        LogFile "      ...done."
    27962796    else
    27972797        Die "Filesystem $gvFileSystem not supported for initrd image. Terminating."
     
    28902890
    28912891if ! which mkfs.vfat 1> /dev/null 2> /dev/null ; then
    2892     Die "mkfs.vfat missing from your filesystem - please install your dosfstools RPM or DEB package. Perhaps your PATH environmental variable is broken, too?"
     2892    Die "mkfs.vfat missing from your filesystem - please install your dosfstools RPM or DEB package. Perhaps your PATH environmental variable is broken, too?"
    28932893fi
    28942894
  • branches/3.2/mindi/rootfs/etc/init.d/rcS

    r3328 r3368  
    371371
    372372CreateDevMakedev() {
    373   if [ -e /sbin/MAKEDEV ]; then
    374     ln -sf /sbin/MAKEDEV /dev/MAKEDEV
    375   else
    376     ln -sf /bin/true /dev/MAKEDEV
    377   fi
     373    if [ -e /sbin/MAKEDEV ]; then
     374        ln -sf /sbin/MAKEDEV /dev/MAKEDEV
     375    else
     376        ln -sf /bin/true /dev/MAKEDEV
     377    fi
    378378}
    379379
Note: See TracChangeset for help on using the changeset viewer.