From e2df2b17c50af038bbfe15f5b6dd9a21c532ae5b Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 21 Aug 2000 18:15:37 +0000 Subject: no_comment --- perl-install/fsedit.pm | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'perl-install/fsedit.pm') 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; -- cgit v1.2.1