summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/fs/get.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/perl-install/fs/get.pm b/perl-install/fs/get.pm
index 096402e6f..5582cf86e 100644
--- a/perl-install/fs/get.pm
+++ b/perl-install/fs/get.pm
@@ -119,6 +119,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);