summaryrefslogtreecommitdiffstats
path: root/perl-install/fs/wild_device.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/fs/wild_device.pm')
-rw-r--r--perl-install/fs/wild_device.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/perl-install/fs/wild_device.pm b/perl-install/fs/wild_device.pm
index 0e10f19ab..f31390d9e 100644
--- a/perl-install/fs/wild_device.pm
+++ b/perl-install/fs/wild_device.pm
@@ -76,6 +76,12 @@ sub to_subpart {
$part;
}
+sub _prefer_device_UUID {
+ my ($part) = @_;
+ $part->{prefer_device_UUID} ||
+ !$::no_uuid_by_default && $part->{device} =~ /^(hd|sd)/;
+}
+
sub from_part {
my ($prefix, $part) = @_;
@@ -83,7 +89,7 @@ sub from_part {
'LABEL=' . $part->{device_LABEL};
} elsif ($part->{device_alias}) {
"/dev/$part->{device_alias}";
- } elsif (!$part->{prefer_device} && ($part->{prefer_device_UUID} || !$::no_uuid_by_default) && $part->{device_UUID}) {
+ } elsif (!$part->{prefer_device} && $part->{device_UUID} && _prefer_device_UUID($part)) {
'UUID=' . $part->{device_UUID};
} else {
my $faked_device = exists $part->{faked_device} ?