diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-12-29 18:34:27 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-12-29 18:34:27 +0000 |
commit | ec593e18cf024fe09356a5ea41d4ac3e4be078a7 (patch) | |
tree | d1181cf535d8ee9c71c5a7571db68d2c4bd16323 /perl-install/devices.pm | |
parent | 7bd82322043b89f018d428dc76338ffc96774ec7 (diff) | |
download | drakx-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)
Diffstat (limited to 'perl-install/devices.pm')
-rw-r--r-- | perl-install/devices.pm | 12 |
1 files changed, 12 insertions, 0 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 ($_) = @_; |