Changeset 1801


Ignore:
Timestamp:
Nov 15, 2007, 3:32:23 PM (12 years ago)
Author:
bruno
Message:

on ia64 now use the perl script parted2fdisk at retore time also

Location:
branches/2.2.5/mindi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mindi/install.sh

    r1774 r1801  
    9595if [ "$ARCH" = "ia64" ] ; then
    9696    (cd $local/sbin && ln -sf parted2fdisk.pl parted2fdisk)
    97     make -f Makefile.parted2fdisk DEST=$locallib/mindi install
    98     if [ -f $locallib/mindi/rootfs/sbin/parted2fdisk-$ARCH ]; then
    99         echo "Installing parted2fdisk ..."
    100         install -s -m 755 $locallib/mindi/rootfs/sbin/parted2fdisk-$ARCH $locallib/mindi/rootfs/sbin/parted2fdisk
    101         install -s -m 755 $locallib/mindi/rootfs/sbin/parted2fdisk-$ARCH $local/sbin/parted2fdisk
    102     else
    103         echo "WARNING: no parted2fdisk found, mindi will not work on this arch ($ARCH)"
    104     fi
     97    install -s -m 755 $local/sbin/parted2fdisk.pl $locallib/mindi/rootfs/sbin/parted2fdisk
    10598else
    10699    # FHS requires fdisk under /sbin
     
    109102    ( cd $locallib/mindi/rootfs/sbin && ln -sf fdisk parted2fdisk)
    110103fi
    111 # Remove left parted2fdisk
    112 rm -f $locallib/mindi/rootfs/sbin/parted2fdisk-*
    113104
    114105if [ "$PKGBUILDMINDI" != "true" ]; then
  • branches/2.2.5/mindi/parted2fdisk.pl

    r1565 r1801  
    3838my $arch;
    3939my $fake = 0;
     40my $mega = 1048576;
    4041
    4142# Determine on which arch we're running
     
    165166                        if (defined $start{$part-1}) {
    166167                            # in MB => cyl
    167                             $cylstart = sprintf("%d",$end{$part-1}*1048576/$un + 1);
     168                            $cylstart = sprintf("%d",$end{$part-1}*$mega/$un + 1);
    168169                            print FLOG "no start cyl given for creation... assuming the following $cylstart\n";
    169170                        } else {
     
    179180                        $start = 0.01;
    180181                    } else {
    181                         $start = $cylstart* $un / 1048576 +0.001;
     182                        $start = $cylstart* $un / $mega + 0.001;
    182183                    }
    183184                    # this is a size in B/KB/MB/GB
     
    205206                    print FLOG "end cyl : $cylend\n";
    206207                    # parted needs MB
    207                     $end = $cylend * $un / 1048576;
     208                    $end = $cylend * $un / $mega;
    208209                    print FLOG "n $l $part $cylstart $cylend => mkpart primary $start $end\n";
    209210                    system "$parted -s $device mkpart primary ext2 $start $end\n" if ($fake == 0);
     
    388389    # start and end are in cylinder in fdisk format
    389390    # so return in MB * 1MB / what represents 1 cyl in B
    390     $mstart = sprintf("%d",$$start{$n}*1048576/$un);
     391    $mstart = sprintf("%d",$$start{$n}*$mega/$un);
    391392    $mstart = 1 if ($mstart < 1);
    392393    $mstart = $endmax if ($mstart > $endmax);
    393     $mend = sprintf("%d",$$end{$n}*1048576/$un - 1);
     394    $mend = sprintf("%d",$$end{$n}*$mega/$un - 1);
    394395    $mend = $endmax if ($mend > $endmax);
    395396    $mend = 1 if ($mend < 1);
     
    497498my $mode;
    498499my $size;
     500my $unit;
    499501
    500502open (PARTED, "$parted -v |") || die "Unable to read from $parted";
     
    514516    $mode=1;
    515517} else {
    516     # RHEL 3 parted <= 1.6.3
     518    # RHEL 3 parted 1.6.3
     519    # RHEL 4 parted 1.6.19
    517520    $mode=0;
    518521}
     
    528531    if ($mode == 0) {
    529532        ($$start{$n},$$end{$n},$$type{$n},$void) = split(/ /,$d);
     533        $unit = 1;
    530534    } elsif ($mode == 1) {
    531535        ($$start{$n},$$end{$n},$size,$$type{$n},$void) = split(/ /,$d);
     536        $unit = $mega;
    532537    } else {
    533538        die "Undefined mode $mode";
     
    537542    $$type{$n} = "" if (not defined $$type{$n});
    538543    # Handles potential suffixes in latest parted version. Return MB
    539     $ret = decode_Bsuf($$start{$n},1048576);
     544    $ret = decode_Bsuf($$start{$n},$unit);
    540545    $$start{$n} = $ret;
    541     $ret = decode_Bsuf($$end{$n},1048576);
     546    $ret = decode_Bsuf($$end{$n},$unit);
    542547    $$end{$n} = $ret;
    543548    print FLOG "$n      $$start{$n}      $$end{$n}     $$type{$n}\n";
Note: See TracChangeset for help on using the changeset viewer.