summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-06-20 06:01:06 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-06-20 06:01:06 +0000
commitbeff4cd64f0d64a11dd4d44bef7b2567d3a57516 (patch)
treefe4914172b883bf9d7f9e61f0440cfb34db8c59b
parent8c84f730c5e0f572d9f9c783b5bade2617576ea5 (diff)
downloaddrakx-backup-do-not-use-beff4cd64f0d64a11dd4d44bef7b2567d3a57516.tar
drakx-backup-do-not-use-beff4cd64f0d64a11dd4d44bef7b2567d3a57516.tar.gz
drakx-backup-do-not-use-beff4cd64f0d64a11dd4d44bef7b2567d3a57516.tar.bz2
drakx-backup-do-not-use-beff4cd64f0d64a11dd4d44bef7b2567d3a57516.tar.xz
drakx-backup-do-not-use-beff4cd64f0d64a11dd4d44bef7b2567d3a57516.zip
- change prototype of fs::get_major_minor()
- use it in fs::proc_partitions::compare() (not useful at the moment, but it may help in the future)
-rw-r--r--perl-install/fs.pm13
-rw-r--r--perl-install/fs/proc_partitions.pm6
-rw-r--r--perl-install/fsedit.pm2
3 files changed, 13 insertions, 8 deletions
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index ce037a7af..aa4ba93f1 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -235,10 +235,13 @@ sub add2all_hds {
}
sub get_major_minor {
- eval {
- my (undef, $major, $minor) = devices::entry($_->{device});
- ($_->{major}, $_->{minor}) = ($major, $minor);
- } foreach @_;
+ my ($fstab) = @_;
+ foreach (@$fstab) {
+ eval {
+ my (undef, $major, $minor) = devices::entry($_->{device});
+ ($_->{major}, $_->{minor}) = ($major, $minor);
+ } if !$_->{major};
+ }
}
sub merge_info_from_mtab {
@@ -406,7 +409,7 @@ sub get_raw_hds {
push @{$all_hds->{raw_hds}}, detect_devices::removables();
$_->{is_removable} = 1 foreach @{$all_hds->{raw_hds}};
- get_major_minor(@{$all_hds->{raw_hds}});
+ get_major_minor($all_hds->{raw_hds});
my @fstab = read_fstab($prefix, '/etc/fstab', 'keep_default');
$all_hds->{nfss} = [ grep { $_->{fs_type} eq 'nfs' } @fstab ];
diff --git a/perl-install/fs/proc_partitions.pm b/perl-install/fs/proc_partitions.pm
index 17484eaa8..1cb3acfd1 100644
--- a/perl-install/fs/proc_partitions.pm
+++ b/perl-install/fs/proc_partitions.pm
@@ -23,9 +23,11 @@ sub read {
my $devfs_like = any { $_->{dev} =~ m|/disc$| } @$disks;
+ fs::get_major_minor($hds);
+
my %devfs2normal = map {
- my (undef, $major, $minor) = devices::entry($_->{device});
- my $disk = find { $_->{major} == $major && $_->{minor} == $minor } @$disks;
+ my $hd = $_;
+ my $disk = find { $_->{major} == $hd->{major} && $_->{minor} == $hd->{minor} } @$disks;
$disk->{dev} => $_->{device};
} @$hds;
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm
index 555b339d0..1ca3e1f3d 100644
--- a/perl-install/fsedit.pm
+++ b/perl-install/fsedit.pm
@@ -239,7 +239,7 @@ Do you agree to lose all the partitions?
$all_hds->{lvms} = [ lvms($all_hds) ];
- fs::get_major_minor(fs::get::fstab($all_hds));
+ fs::get_major_minor([ fs::get::fstab($all_hds) ]);
$all_hds;
}