diff options
Diffstat (limited to 'lib/MDV/Draklive/Initrd.pm')
-rw-r--r-- | lib/MDV/Draklive/Initrd.pm | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/MDV/Draklive/Initrd.pm b/lib/MDV/Draklive/Initrd.pm index b2c4060..3bc4713 100644 --- a/lib/MDV/Draklive/Initrd.pm +++ b/lib/MDV/Draklive/Initrd.pm @@ -13,6 +13,16 @@ my %module_to_config = ( sd_mod => 'BLK_DEV_SD', ); +sub require_list_modules_chroot { + my ($live) = @_; + my $chroot_list_modules = cat_($live->get_system_root . "/usr/lib/libDrakX/list_modules.pm"); + $chroot_list_modules =~ s/^package list_modules;\B/package list_modules_chroot;/; + my $tmp_list_modules = $live->get_system_root . "/tmp/list_modules_chroot.pm"; + output_p($tmp_list_modules, $chroot_list_modules); + require $tmp_list_modules; + unlink $tmp_list_modules; +} + sub nls_modules { my ($live) = @_; my $fs = $live->{media}->get_media_setting('fs'); @@ -64,6 +74,8 @@ sub create_initrd_for_media { sub create_media_specific_initrd { my ($live, $media, $root, $initrd, $kernel) = @_; + require_list_modules_chroot($live); + my $lib_prefix = find { glob($root . $_ . '/libc.so.*') } qw(/lib64 /lib); $lib_prefix or die 'unable to find system libraries in /lib or /lib64'; @@ -126,9 +138,9 @@ sub create_media_specific_initrd { list_modules::load_dependencies($kernel_root . "/modules.dep", $root); my ($storage_modules, $skipped) = partition { list_modules::modname2filename($_) } - uniq(map { modules::cond_mapping_24_26($_) } list_modules::category2modules($media->get_media_setting('modules'))); + uniq(map { modules::cond_mapping_24_26($_) } list_modules_chroot::category2modules($media->get_media_setting('modules'))); my ($extra_modules, $extra_missing) = partition { list_modules::modname2filename($_) } - list_modules::category2modules($media->get_media_setting('media_modules')), + list_modules_chroot::category2modules($media->get_media_setting('media_modules')), nls_modules($live), $media->get_media_fs_module, @{$media->get_media_setting('extra_modules') || []}, |