summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-12-29 18:34:27 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-12-29 18:34:27 +0000
commitec593e18cf024fe09356a5ea41d4ac3e4be078a7 (patch)
treed1181cf535d8ee9c71c5a7571db68d2c4bd16323
parent7bd82322043b89f018d428dc76338ffc96774ec7 (diff)
downloaddrakx-ec593e18cf024fe09356a5ea41d4ac3e4be078a7.tar
drakx-ec593e18cf024fe09356a5ea41d4ac3e4be078a7.tar.gz
drakx-ec593e18cf024fe09356a5ea41d4ac3e4be078a7.tar.bz2
drakx-ec593e18cf024fe09356a5ea41d4ac3e4be078a7.tar.xz
drakx-ec593e18cf024fe09356a5ea41d4ac3e4be078a7.zip
move device mapper initialisation out of lvm.pm into devices.pm (since it will be useful for other things)
-rw-r--r--perl-install/devices.pm12
-rw-r--r--perl-install/lvm.pm10
2 files changed, 13 insertions, 9 deletions
diff --git a/perl-install/devices.pm b/perl-install/devices.pm
index 316a2f0f4..5771468c8 100644
--- a/perl-install/devices.pm
+++ b/perl-install/devices.pm
@@ -64,6 +64,18 @@ sub set_loop {
$dev;
}
+sub init_device_mapper() {
+ eval { modules::load('dm-mod') };
+ make('urandom');
+ my $control = '/dev/mapper/control';
+ if (! -e $control) {
+ my ($major) = cat_('/proc/devices') =~ /(\d+) misc$/m or return;
+ my ($minor) = cat_('/proc/misc') =~ /(\d+) device-mapper$/m or return;
+ mkdir_p(dirname($control));
+ syscall_('mknod', $control, c::S_IFCHR() | 0600, makedev($major, $minor)) or die "mknod $control failed: $!";
+ }
+}
+
sub entry {
my ($type, $major, $minor);
local ($_) = @_;
diff --git a/perl-install/lvm.pm b/perl-install/lvm.pm
index 4d3950ec6..ef3ab3090 100644
--- a/perl-install/lvm.pm
+++ b/perl-install/lvm.pm
@@ -31,15 +31,7 @@ sub cylinder_size {
init() or log::l("lvm::init failed");
sub init() {
- eval { modules::load('dm-mod') };
- devices::make('urandom');
- my $control = '/dev/mapper/control';
- if (! -e $control) {
- my ($major) = cat_('/proc/devices') =~ /(\d+) misc$/m or return;
- my ($minor) = cat_('/proc/misc') =~ /(\d+) device-mapper$/m or return;
- mkdir_p(dirname($control));
- syscall_('mknod', $control, c::S_IFCHR() | 0600, makedev($major, $minor)) or die "mknod $control failed: $!";
- }
+ devices::init_device_mapper();
if ($::isInstall) {
run_program::run('lvm2', 'vgscan');
run_program::run('lvm2', 'vgchange', '-a', 'y');