summaryrefslogtreecommitdiffstats
path: root/perl-install/fsedit.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-09-16 17:30:46 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-09-16 17:30:46 +0000
commit81068b4c188a82c0ae486665617f385997e619cd (patch)
tree485035ca8ecab31f9012e5b38c59c25434a0b676 /perl-install/fsedit.pm
parent1609027e73313dc16a5109e3d3f56d6b1c9b20ad (diff)
downloaddrakx-81068b4c188a82c0ae486665617f385997e619cd.tar
drakx-81068b4c188a82c0ae486665617f385997e619cd.tar.gz
drakx-81068b4c188a82c0ae486665617f385997e619cd.tar.bz2
drakx-81068b4c188a82c0ae486665617f385997e619cd.tar.xz
drakx-81068b4c188a82c0ae486665617f385997e619cd.zip
no_comment
Diffstat (limited to 'perl-install/fsedit.pm')
-rw-r--r--perl-install/fsedit.pm28
1 files changed, 28 insertions, 0 deletions
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm
index 9ff3a0c01..390ce2d7d 100644
--- a/perl-install/fsedit.pm
+++ b/perl-install/fsedit.pm
@@ -287,6 +287,34 @@ sub move {
}
}
+sub rescuept($) {
+ my ($hd) = @_;
+ my ($ext, @hd);
+
+ my $dev = devices::make($hd->{device});
+ open F, "rescuept $dev|";
+ foreach (<F>) {
+ my ($st, $si, $id) = /start=\s*(\d+),\s*size=\s*(\d+),\s*Id=\s*(\d+)/ or next;
+ my $part = { start => $st, size => $si, type => hex($id) };
+ if (isExtended($part)) {
+ $ext = $part;
+ } else {
+ push @hd, $part;
+ }
+ }
+ close F or die "rescuept failed";
+
+ partition_table_raw::zero_MBR($hd);
+ foreach (@hd) {
+ my $b = partition_table::verifyInside($_, $ext);
+ if ($b) {
+ $_->{start}--;
+ $_->{size}++;
+ }
+ partition_table::add($hd, $_, ($b ? 'Extended' : 'Primary'), 1);
+ }
+}
+
#-######################################################################################
#- Wonderful perl :(
#-######################################################################################