diff options
-rw-r--r-- | perl-install/devices.pm | 12 | ||||
-rw-r--r-- | perl-install/lvm.pm | 10 |
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'); |