summaryrefslogtreecommitdiffstats
path: root/perl-install/fs
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
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')
-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} :