diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/MDV/Draklive/Initrd.pm | 2 | ||||
-rw-r--r-- | lib/MDV/Draklive/Loopback.pm | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/MDV/Draklive/Initrd.pm b/lib/MDV/Draklive/Initrd.pm index 93642dc..35f95e2 100644 --- a/lib/MDV/Draklive/Initrd.pm +++ b/lib/MDV/Draklive/Initrd.pm @@ -139,7 +139,7 @@ sub create_media_specific_initrd { nls_modules($live), $media->get_media_fs_module, @{$media->get_media_setting('extra_modules') || []}, - (map { @{$loop_types{$_}{modules} || []} } uniq(map { $_->{type} } @{$live->{mount}{dirs} || []})), + (map { MDV::Draklive::Loopback::get_loop_modules($live, $_) } uniq(map { $_->{type} } @{$live->{mount}{dirs} || []})), ($live->{mount}{overlay} ? @{$MDV::Draklive::Overlay::overlay{$live->{mount}{overlay}}{modules} || []} : ()); my @additional_modules = map { if_(m!([^/]+)\.ko(?:\.gz)?!, list_modules::filename2modname($1)) } @{$live->{system}{additional_modules}}; diff --git a/lib/MDV/Draklive/Loopback.pm b/lib/MDV/Draklive/Loopback.pm index ebcc8be..6fb592d 100644 --- a/lib/MDV/Draklive/Loopback.pm +++ b/lib/MDV/Draklive/Loopback.pm @@ -122,4 +122,13 @@ our %loop_types; }, ); +sub get_loop_modules { + my ($live, $type) = @_; + my $modules = $loop_types{$_}{modules}; + my $type = ref $modules; + return $type eq 'CODE' ? $modules->($live) : + $type eq 'ARRAY' ? @$modules : + (); +} + 1; |