diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-11-25 13:13:34 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-11-25 13:13:34 +0000 |
commit | 77594868b1cb9b5c6cf7656cdcd5da08a5b2d457 (patch) | |
tree | 76e7cd6a07c50e8f84ea7e279a201f6d6c1fa3fa /perl-install/fsedit.pm | |
parent | 00197645126e48aa71d8e2d0508bd25d627f8b02 (diff) | |
download | drakx-77594868b1cb9b5c6cf7656cdcd5da08a5b2d457.tar drakx-77594868b1cb9b5c6cf7656cdcd5da08a5b2d457.tar.gz drakx-77594868b1cb9b5c6cf7656cdcd5da08a5b2d457.tar.bz2 drakx-77594868b1cb9b5c6cf7656cdcd5da08a5b2d457.tar.xz drakx-77594868b1cb9b5c6cf7656cdcd5da08a5b2d457.zip |
moving partitions never really worked and is disabled since years
Diffstat (limited to 'perl-install/fsedit.pm')
-rw-r--r-- | perl-install/fsedit.pm | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm index b790de23d..bd93e49b0 100644 --- a/perl-install/fsedit.pm +++ b/perl-install/fsedit.pm @@ -560,62 +560,6 @@ sub undo { } -sub move { - my ($hd, $part, $hd2, $sector2) = @_; - - die 'TODO'; # doesn't work for the moment - my $part1 = { %$part }; - my $part2 = { %$part }; - $part2->{start} = $sector2; - $part2->{size} += $hd2->cylinder_size - 1; - partition_table::remove($hd, $part); - { - local ($part2->{notFormatted}, $part2->{isFormatted}); #- do not allow partition::add to change this - partition_table::add($hd2, $part2); - } - - return if $part2->{notFormatted} && !$part2->{isFormatted} || $::testing; - - local (*F, *G); - sysopen F, $hd->{file}, 0 or die ''; - sysopen G, $hd2->{file}, 2 or die N("Error opening %s for writing: %s", $hd2->{file}, $!); - - my $base = $part1->{start}; - my $base2 = $part2->{start}; - my $step = 10; - if ($hd eq $hd2) { - $base == $base2 and return; - $step = min($step, abs($base2 - $base)); - - if ($base < $base2) { - $base += $part1->{size} - $step; - $base2 += $part1->{size} - $step; - $step = -$step; - } - } - - my $f = sub { - $base < 0 and $base2 += -$base, $base = 0; - $base2 < 0 and $base += -$base2, $base2 = 0; - c::lseek_sector(fileno(F), $base, 0) or die "seeking to sector $base failed on drive $hd->{device}"; - c::lseek_sector(fileno(G), $base2, 0) or die "seeking to sector $base2 failed on drive $hd2->{device}"; - - my $buf; - sysread F, $buf, $SECTORSIZE * abs($_[0]) or die ''; - syswrite G, $buf; - }; - - for (my $i = 0; $i < $part1->{size} / abs($step); $i++, $base += $step, $base2 += $step) { - print "$base $base2\n"; - &$f($step); - } - if (my $v = ($part1->{size} % abs($step)) * sign($step)) { - $base += $v; - $base2 += $v; - &$f($v); - } -} - sub change_type { my ($type, $hd, $part) = @_; $type->{pt_type} != $part->{pt_type} || $type->{fs_type} ne $part->{fs_type} or return; |