Changeset 3437


Ignore:
Timestamp:
Aug 28, 2015, 4:08:48 PM (3 years ago)
Author:
bruno
Message:
  • Small improvement on label-partitions-as-necessary to avoid too much code duplication
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mondo/src/restore-scripts/mondo/label-partitions-as-necessary

    r3330 r3437  
    5858        elif [ "$format" = "swap" ] ; then
    5959            if [ "$opttun" = "-U" ]; then
    60                 LogIt "Creating uuid $label on swap partition $mountpt"
    61                 if [ -x "/sbin/swaplabel" ]; then
    62                     /sbin/swaplabel $opttun $label $mountpt
     60                typelabel="UUID"
     61            else
     62                typelabel="Label"
     63            fi
     64            if [ -x "/sbin/swaplabel" ]; then
     65                # Better choice
     66                command="/sbin/swaplabel $opttun $label $mountpt"
     67            else
     68                if [ "$opttun" = "-U" ]; then
     69                    LogIt "Really running dd conv=notrunc of=$mountpt obs=1 seek=1036"
     70                    echo -n "$label" | perl -ne 's/-//g;chomp;print pack "H*",$_' | dd conv=notrunc "of=$mountpt" obs=1 seek=1036
     71                    command=/bin/true
    6372                else
    64                     echo -n "$label" | perl -ne 's/-//g;chomp;print pack "H*",$_' | dd conv=notrunc "of=$mountpt" obs=1 seek=1036
     73                    command="mkswap -f $opttun $label $mountpt"
    6574                fi
    66             else
    67                 if [ -x "/sbin/swaplabel" ]; then
    68                     command="/sbin/swaplabel $opttun $label $mountpt"
    69                 else
    70                     command="mkswap $opttun $label $mountpt"
    71                 fi
    72                 LogIt "Running $command"
    73                 $command
    7475            fi
     76            LogIt "Creating $typelabel $label on swap partition $mountpt"
     77            LogIt "Running $command"
     78            $command
    7579        else
    7680            LogIt "I am NOT going to run tune2|4fs/reiserfstune: the partition is format '$format', which doesn't like tune2|4fs/reiserfstune anyway"
Note: See TracChangeset for help on using the changeset viewer.