summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2010-08-04 14:11:03 +0000
committerOlivier Blin <oblin@mandriva.com>2010-08-04 14:11:03 +0000
commit7910fa4e1b96204fc725921d84e23561c178167b (patch)
tree19bc1c8135dae5f0a0a8d5df0f137b648bc1e589
parent572eafb0a3300aa5930d152767754b0d9aa33e8a (diff)
downloaddraklive-7910fa4e1b96204fc725921d84e23561c178167b.tar
draklive-7910fa4e1b96204fc725921d84e23561c178167b.tar.gz
draklive-7910fa4e1b96204fc725921d84e23561c178167b.tar.bz2
draklive-7910fa4e1b96204fc725921d84e23561c178167b.tar.xz
draklive-7910fa4e1b96204fc725921d84e23561c178167b.zip
allow loopback modules list to be returned by sub
-rw-r--r--lib/MDV/Draklive/Initrd.pm2
-rw-r--r--lib/MDV/Draklive/Loopback.pm9
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;