summaryrefslogtreecommitdiffstats
path: root/perl-install/fs.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-08-07 13:14:05 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-08-07 13:14:05 +0000
commit7035a4a50596f24acfbaf7da10a79a7baf0df07f (patch)
tree7387b635296b01a25d5e0ad273a041e351308598 /perl-install/fs.pm
parent70b2d01bf505dc6da579a3f8ed36e1daff862c96 (diff)
downloaddrakx-backup-do-not-use-7035a4a50596f24acfbaf7da10a79a7baf0df07f.tar
drakx-backup-do-not-use-7035a4a50596f24acfbaf7da10a79a7baf0df07f.tar.gz
drakx-backup-do-not-use-7035a4a50596f24acfbaf7da10a79a7baf0df07f.tar.bz2
drakx-backup-do-not-use-7035a4a50596f24acfbaf7da10a79a7baf0df07f.tar.xz
drakx-backup-do-not-use-7035a4a50596f24acfbaf7da10a79a7baf0df07f.zip
"LABEL=xxx" in fstab handling
Diffstat (limited to 'perl-install/fs.pm')
-rw-r--r--perl-install/fs.pm16
1 files changed, 12 insertions, 4 deletions
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index c684bf7be..f3b2c1733 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -71,9 +71,15 @@ sub read_fstab {
if_($all_options, freq => $freq, passno => $passno),
};
- ($h->{major}, $h->{minor}) = unmakedev((stat "$prefix$dev")[6]);
-
+ if ($dev =~ /^LABEL=/) {
+ if (my ($e) = grep { $_->{mntpoint} eq $mntpoint } read_fstab('', '/proc/mounts')) {
+ $h->{device_LABEL} = $dev;
+ $dev = $h->{device} = $e->{device};
+ }
+ }
if ($dev =~ m,/(tmp|dev)/,) {
+ ($h->{major}, $h->{minor}) = unmakedev((stat "$prefix$dev")[6]);
+
my $symlink = readlink("$prefix$dev");
$dev =~ s,/(tmp|dev)/,,;
@@ -211,7 +217,7 @@ sub prepare_write_fstab {
isLoopback($_) ?
($_->{mntpoint} eq '/' ? "/initrd/loopfs" : "$_->{loopback_device}{mntpoint}") . $_->{loopback_file} :
do {
- my $dir = $_->{device} =~ m|^/| ? '' : '/dev/';
+ my $dir = $_->{device} =~ m!^(/|LABEL=)! ? '' : '/dev/';
eval { devices::make("$prefix$dir$_->{device}") };
"$dir$_->{device}";
};
@@ -244,7 +250,9 @@ sub prepare_write_fstab {
my $type = type2fs($_);
- my $dev = $_->{device_alias} ? "/dev/$_->{device_alias}" : $device;
+ my $dev =
+ $_->{device_LABEL} ? $_->{device_LABEL} :
+ $_->{device_alias} ? "/dev/$_->{device_alias}" : $device;
$mntpoint =~ s/ /\\040/g;
$dev =~ s/ /\\040/g;