summaryrefslogtreecommitdiffstats
path: root/perl-install/fs.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-05-13 08:44:38 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-05-13 08:44:38 +0000
commite1933587d5bda45845e33ebe761fc917ca516fad (patch)
tree6c3711a00856e2c2aa9bde16a65d12367359e806 /perl-install/fs.pm
parent4f9a0847bf8627db6e513ff41491713cab21c17c (diff)
downloaddrakx-e1933587d5bda45845e33ebe761fc917ca516fad.tar
drakx-e1933587d5bda45845e33ebe761fc917ca516fad.tar.gz
drakx-e1933587d5bda45845e33ebe761fc917ca516fad.tar.bz2
drakx-e1933587d5bda45845e33ebe761fc917ca516fad.tar.xz
drakx-e1933587d5bda45845e33ebe761fc917ca516fad.zip
really handle LABEL=XXX in fstab (as used by redhat) (no xfs labels yet)
Diffstat (limited to 'perl-install/fs.pm')
-rw-r--r--perl-install/fs.pm20
1 files changed, 11 insertions, 9 deletions
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index 65c630f6c..ce31f1afc 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -20,6 +20,10 @@ use loopback;
sub read_fstab {
my ($prefix, $file, @reading_options) = @_;
+ if (member('keep_default', @reading_options)) {
+ push @reading_options, 'freq_passno', 'keep_devfs_name', 'keep_device_LABEL';
+ }
+
my %comments;
my $comment;
my @l = grep {
@@ -71,11 +75,9 @@ sub read_fstab {
if_(member('keep_freq_passno', @reading_options), freq => $freq, passno => $passno),
};
- if ($dev =~ /^LABEL=/) {
- if (my $e = find { $_->{mntpoint} eq $mntpoint } read_fstab('', '/proc/mounts')) {
- $h->{device_LABEL} = $dev;
- $dev = $h->{device} = $e->{device};
- }
+ if ($dev =~ /^LABEL=(.*)/) {
+ $h->{device_LABEL} = $1;
+ $h->{prefer_device_LABEL} = 1 if member('keep_device_LABEL', @reading_options);
}
if ($dev =~ m,^/(tmp|dev)/,) {
($h->{major}, $h->{minor}) = unmakedev((stat "$prefix$dev")[6]);
@@ -197,7 +199,7 @@ sub merge_info_from_fstab {
} else {
1;
}
- } read_fstab($prefix, '/etc/fstab', 'keep_freq_passno', 'keep_devfs_name');
+ } read_fstab($prefix, '/etc/fstab', 'keep_default');
merge_fstabs($loose, $fstab, @l);
}
@@ -205,7 +207,7 @@ sub merge_info_from_fstab {
# - when using "$loose", it does not merge in type&options from the fstab
sub get_info_from_fstab {
my ($all_hds, $prefix) = @_;
- my @l = read_fstab($prefix, '/etc/fstab', 'keep_freq_passno', 'keep_devfs_name');
+ my @l = read_fstab($prefix, '/etc/fstab', 'keep_default');
add2all_hds($all_hds, @l)
}
@@ -250,7 +252,7 @@ sub prepare_write_fstab {
my $type = type2fs($_, 'auto');
my $dev =
- $_->{device_LABEL} ? $_->{device_LABEL} :
+ $_->{prefer_device_LABEL} ? 'LABEL=' . $_->{device_LABEL} :
$_->{device_alias} ? "/dev/$_->{device_alias}" : $device;
$mntpoint =~ s/ /\\040/g;
@@ -558,7 +560,7 @@ sub get_raw_hds {
get_major_minor(@{$all_hds->{raw_hds}});
- my @fstab = read_fstab($prefix, '/etc/fstab', 'keep_freq_passno', 'keep_devfs_name');
+ my @fstab = read_fstab($prefix, '/etc/fstab', 'keep_default');
$all_hds->{nfss} = [ grep { isThisFs('nfs', $_) } @fstab ];
$all_hds->{smbs} = [ grep { isThisFs('smbfs', $_) } @fstab ];
$all_hds->{davs} = [ grep { isThisFs('davfs', $_) } @fstab ];