diff options
author | Olivier Blin <oblin@mandriva.com> | 2009-09-14 14:12:10 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2009-09-14 14:12:10 +0000 |
commit | 23ccb1853b5d62db5a14dba3134a9b4a55f97271 (patch) | |
tree | 9d6d2464ff1c8d340d599f84a8697d0c3e930ade /lib/MDV | |
parent | bdb5e033cf476b35f63927df8fd59b477893f285 (diff) | |
download | drakiso-23ccb1853b5d62db5a14dba3134a9b4a55f97271.tar drakiso-23ccb1853b5d62db5a14dba3134a9b4a55f97271.tar.gz drakiso-23ccb1853b5d62db5a14dba3134a9b4a55f97271.tar.bz2 drakiso-23ccb1853b5d62db5a14dba3134a9b4a55f97271.tar.xz drakiso-23ccb1853b5d62db5a14dba3134a9b4a55f97271.zip |
add hack to use modules list from chroot
Diffstat (limited to 'lib/MDV')
-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') || []}, |