summaryrefslogtreecommitdiffstats
path: root/perl-install/fs
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/fs')
-rw-r--r--perl-install/fs/format.pm4
-rw-r--r--perl-install/fs/get.pm1
-rw-r--r--perl-install/fs/mount.pm2
-rw-r--r--perl-install/fs/type.pm1
-rw-r--r--perl-install/fs/wild_device.pm7
5 files changed, 14 insertions, 1 deletions
diff --git a/perl-install/fs/format.pm b/perl-install/fs/format.pm
index 136581583..42a92335b 100644
--- a/perl-install/fs/format.pm
+++ b/perl-install/fs/format.pm
@@ -128,6 +128,10 @@ sub part_raw {
disable_forced_fsck($dev);
}
+ delete $part->{UUID_from_magic};
+ fs::type::type_subpart_from_magic($part);
+ $part->{device_UUID} = $part->{UUID_from_magic};
+
set_isFormatted($part, 1);
}
diff --git a/perl-install/fs/get.pm b/perl-install/fs/get.pm
index 0cdb55969..aa23d1c61 100644
--- a/perl-install/fs/get.pm
+++ b/perl-install/fs/get.pm
@@ -143,6 +143,7 @@ sub is_same_hd {
$s1 eq $s2;
} 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};
}
}
diff --git a/perl-install/fs/mount.pm b/perl-install/fs/mount.pm
index f22283573..950eb1715 100644
--- a/perl-install/fs/mount.pm
+++ b/perl-install/fs/mount.pm
@@ -125,7 +125,7 @@ sub umount {
sub part {
my ($part, $b_rdonly, $o_wait_message) = @_;
- log::l("mount_part: " . join(' ', map { "$_=$part->{$_}" } 'device', 'mntpoint', 'isMounted', 'real_mntpoint'));
+ log::l("mount_part: " . join(' ', map { "$_=$part->{$_}" } 'device', 'mntpoint', 'isMounted', 'real_mntpoint', 'device_UUID'));
return if $part->{isMounted} && !($part->{real_mntpoint} && $part->{mntpoint});
diff --git a/perl-install/fs/type.pm b/perl-install/fs/type.pm
index 79a89e819..40e3db41e 100644
--- a/perl-install/fs/type.pm
+++ b/perl-install/fs/type.pm
@@ -280,6 +280,7 @@ sub type_subpart_from_magic {
my $ids = call_vol_id($part);
$part->{LABEL_from_magic} = $ids->{ID_FS_LABEL} if $ids->{ID_FS_LABEL};
+ $part->{UUID_from_magic} = $ids->{ID_FS_UUID} if $ids->{ID_FS_UUID};
my $p;
if ($ids->{ID_FS_USAGE} eq 'raid') {
diff --git a/perl-install/fs/wild_device.pm b/perl-install/fs/wild_device.pm
index dea15a4d3..ebb391cdf 100644
--- a/perl-install/fs/wild_device.pm
+++ b/perl-install/fs/wild_device.pm
@@ -15,6 +15,8 @@ sub analyze {
'dev', "/dev/$dev";
} elsif ($dev =~ /^LABEL=(.*)/) {
'label', $1;
+ } elsif ($dev =~ /^UUID=(.*)/) {
+ 'uuid', $1;
} elsif ($dev eq 'none' || $dev eq 'rootfs') {
'virtual';
} elsif ($dev =~ m!^(\S+):/\w!) {
@@ -34,6 +36,8 @@ sub to_subpart {
if (my ($kind, $val) = analyze($dev)) {
if ($kind eq 'label') {
$part->{device_LABEL} = $val;
+ } elsif ($kind eq 'label') {
+ $part->{device_UUID} = $val;
} elsif ($kind eq 'dev') {
my %part = (faked_device => 0);
if (my $rdev = (stat "$::prefix$dev")[6]) {
@@ -51,6 +55,7 @@ sub to_subpart {
}
if ($keep) {
$part{device_LABEL} = $1 if $dev =~ m!^disk/by-label/(.*)!;
+ $part{device_UUID} = $1 if $dev =~ m!^disk/by-uuid/(.*)!;
$part{device_alias} = $dev;
$dev = $symlink;
}
@@ -78,6 +83,8 @@ sub from_part {
'LABEL=' . $part->{device_LABEL};
} elsif ($part->{device_alias}) {
"/dev/$part->{device_alias}";
+ } elsif ($part->{prefer_device_UUID} && $part->{device_UUID}) {
+ 'UUID=' . $part->{device_UUID};
} else {
my $faked_device = exists $part->{faked_device} ?
$part->{faked_device} :