summaryrefslogtreecommitdiffstats
path: root/perl-install/fs/wild_device.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-08-31 16:33:16 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-08-31 16:33:16 +0000
commita6ba2f19bd2dd6d99185cb0f5ba0dd97baaf130d (patch)
treecd7cedd073f1494500f4f69a63f0f63e9af673a7 /perl-install/fs/wild_device.pm
parentb18b20791cfce5c52a8fb20f2579449b6500da24 (diff)
downloaddrakx-a6ba2f19bd2dd6d99185cb0f5ba0dd97baaf130d.tar
drakx-a6ba2f19bd2dd6d99185cb0f5ba0dd97baaf130d.tar.gz
drakx-a6ba2f19bd2dd6d99185cb0f5ba0dd97baaf130d.tar.bz2
drakx-a6ba2f19bd2dd6d99185cb0f5ba0dd97baaf130d.tar.xz
drakx-a6ba2f19bd2dd6d99185cb0f5ba0dd97baaf130d.zip
- support for UUID (including UUID=xxx in fstab)
(not by default for now)
Diffstat (limited to 'perl-install/fs/wild_device.pm')
-rw-r--r--perl-install/fs/wild_device.pm7
1 files changed, 7 insertions, 0 deletions
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} :