summaryrefslogtreecommitdiffstats
path: root/perl-install/fsedit.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-08-21 18:15:37 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-08-21 18:15:37 +0000
commite2df2b17c50af038bbfe15f5b6dd9a21c532ae5b (patch)
tree61b2e028ffcbbb85172104a24693a20cab0d30ba /perl-install/fsedit.pm
parent12eb8608ad517afff8c323e276f2f4f4e5405896 (diff)
downloaddrakx-e2df2b17c50af038bbfe15f5b6dd9a21c532ae5b.tar
drakx-e2df2b17c50af038bbfe15f5b6dd9a21c532ae5b.tar.gz
drakx-e2df2b17c50af038bbfe15f5b6dd9a21c532ae5b.tar.bz2
drakx-e2df2b17c50af038bbfe15f5b6dd9a21c532ae5b.tar.xz
drakx-e2df2b17c50af038bbfe15f5b6dd9a21c532ae5b.zip
no_comment
Diffstat (limited to 'perl-install/fsedit.pm')
-rw-r--r--perl-install/fsedit.pm25
1 files changed, 11 insertions, 14 deletions
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm
index 813eb37e8..a868493f4 100644
--- a/perl-install/fsedit.pm
+++ b/perl-install/fsedit.pm
@@ -66,7 +66,6 @@ sub hds {
eval { partition_table::read($hd, $flags->{clearall} || member($_->{device}, @{$flags->{clear} || []})) };
if ($@) {
- cdie($@) unless $flags->{eraseBadPartitions};
partition_table_raw::zero_MBR($hd);
}
member($_->{device}, @{$flags->{clear} || []}) and partition_table::remove($hd, $_)
@@ -117,14 +116,6 @@ sub hasRAID {
$b;
}
-sub get_root {
- my ($fstab, $boot) = @_;
- if ($boot) { $_->{mntpoint} eq "/boot" and return $_ foreach @$fstab; }
- $_->{mntpoint} eq "/" and return $_ foreach @$fstab;
- undef;
-}
-sub get_root_ { get_root([ get_fstab(@{$_[0]}) ], $_[1]) }
-
sub is_one_big_fat {
my ($hds) = @_;
@$hds == 1 or return;
@@ -225,12 +216,17 @@ sub suggestions_mntpoint {
#-}
-sub has_mntpoint($$) {
+sub mntpoint2part {
+ my ($mntpoint, $fstab) = @_;
+ first(grep { $mntpoint eq $_->{mntpoint} } @$fstab);
+}
+sub has_mntpoint {
my ($mntpoint, $hds) = @_;
- scalar grep {
- $mntpoint eq $_->{mntpoint} ||
- grep { $mntpoint eq $_->{mntpoint} } @{$_->{loopback} || []}
- } get_fstab(@$hds);
+ mntpoint2part($mntpoint, [ get_fstab(@$hds) ]);
+}
+sub get_root {
+ my ($fstab, $boot) = @_;
+ $boot && mntpoint2part("/boot", $fstab) || mntpoint2part("/", $fstab);
}
#- do this before modifying $part->{mntpoint}
@@ -436,6 +432,7 @@ sub verifyHds {
partition_table_raw::zero_MBR($hd);
$hd->{primary} = { normal => [ grep { $hd->{device} eq $_->{rootDevice} } @parts ] };
}
+ $ok = 1;
}
$readonly && get_fstab(@$hds) == 0 and die _("You don't have any partitions!");
$ok;