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.pm18
1 files changed, 15 insertions, 3 deletions
diff --git a/perl-install/fs/get.pm b/perl-install/fs/get.pm
index 8e49e91fa..cbdf093dd 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;
@@ -22,7 +22,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 {
@@ -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);
@@ -144,7 +153,10 @@ sub is_same_hd {
} else {
$hd1->{device_LABEL} && $hd2->{device_LABEL} && $hd1->{device_LABEL} eq $hd2->{device_LABEL}
|| $hd1->{device_UUID} && $hd2->{device_UUID} && $hd1->{device_UUID} eq $hd2->{device_UUID}
- || $hd1->{device} && $hd2->{device} && $hd1->{device} eq $hd2->{device};
+ || $hd1->{device} && $hd2->{device} && $hd1->{device} eq $hd2->{device}
+ || $hd1->{device} && $hd2->{device_alias} && $hd1->{device} eq $hd2->{device_alias}
+ || $hd1->{device_alias} && $hd2->{device} && $hd1->{device_alias} eq $hd2->{device}
+ || $hd1->{device_alias} && $hd2->{device_alias} && $hd1->{device_alias} eq $hd2->{device_alias};
}
}