summaryrefslogtreecommitdiffstats
path: root/perl-install/fs/get.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/fs/get.pm')
-rw-r--r--perl-install/fs/get.pm35
1 files changed, 32 insertions, 3 deletions
diff --git a/perl-install/fs/get.pm b/perl-install/fs/get.pm
index 461984431..00c807738 100644
--- a/perl-install/fs/get.pm
+++ b/perl-install/fs/get.pm
@@ -1,4 +1,4 @@
-package fs::get; # $Id: get.pm 245972 2008-09-18 17:00:11Z pixel $
+package fs::get;
use diagnostics;
use strict;
@@ -11,6 +11,17 @@ use fs;
use common;
use log;
+
+=head1 SYNOPSYS
+
+B<fs::get>
+
+=head1 Functions
+
+=over
+
+=cut
+
sub empty_all_hds() {
{ hds => [], lvms => [], raids => [], dmcrypts => [], loopbacks => [], raw_hds => [], nfss => [], smbs => [], davs => [], special => [] };
}
@@ -22,7 +33,7 @@ sub fstab {
sub really_all_fstab {
my ($all_hds) = @_;
my @l = fstab($all_hds);
- @l, @{$all_hds->{raw_hds}}, @{$all_hds->{nfss}}, @{$all_hds->{smbs}}, @{$all_hds->{davs}};
+ @l, (grep { !$_->{is_removable} } @{$all_hds->{raw_hds}}), @{$all_hds->{nfss}}, @{$all_hds->{smbs}}, @{$all_hds->{davs}};
}
sub fstab_and_holes {
@@ -51,7 +62,12 @@ sub hds {
(@{$all_hds->{hds}}, @{$all_hds->{lvms}});
}
-#- get all normal partition including special ones as found on sparc.
+=item hds_fstab(@hds)
+
+Get all normal partition.
+
+=cut
+
sub hds_fstab {
map { partition_table::get_normal_parts($_) } @_;
}
@@ -119,6 +135,15 @@ sub has_mntpoint {
my ($mntpoint, $all_hds) = @_;
mntpoint2part($mntpoint, [ really_all_fstab($all_hds) ]);
}
+
+sub root_from_mounted() {
+ foreach (`df -P`) {
+ next if m!^[^/]!; # ignore tootfs
+ my ($fs, undef, undef, undef, undef, $mntpnt) = split(/\s+/);
+ return $fs if $mntpnt eq '/';
+ }
+}
+
sub root_ {
my ($fstab, $o_boot) = @_;
$o_boot && mntpoint2part("/boot", $fstab) || mntpoint2part("/", $fstab);
@@ -156,4 +181,8 @@ sub mntpoint_prefixed {
$::prefix . $part->{mntpoint};
}
+=back
+
+=cut
+
1;