summaryrefslogtreecommitdiffstats
path: root/perl-install/devices.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/devices.pm')
-rw-r--r--perl-install/devices.pm12
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 ($_) = @_;