summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <blino@mageia.org>2011-04-16 13:59:46 +0000
committerOlivier Blin <blino@mageia.org>2011-04-16 13:59:46 +0000
commit344dfb77c34a340b568055254b11f6a7da84d6f3 (patch)
treeb4c9bc84e16ee101eafc90b48fab865ccad199ee
parentdb8e3100a243fe668ee604a145b2030fc53a4b0b (diff)
downloaddrakiso-344dfb77c34a340b568055254b11f6a7da84d6f3.tar
drakiso-344dfb77c34a340b568055254b11f6a7da84d6f3.tar.gz
drakiso-344dfb77c34a340b568055254b11f6a7da84d6f3.tar.bz2
drakiso-344dfb77c34a340b568055254b11f6a7da84d6f3.tar.xz
drakiso-344dfb77c34a340b568055254b11f6a7da84d6f3.zip
make easier to use DrakX modules from chroot
-rw-r--r--lib/MDV/Draklive/Initrd.pm18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/MDV/Draklive/Initrd.pm b/lib/MDV/Draklive/Initrd.pm
index e869cbf..bedb362 100644
--- a/lib/MDV/Draklive/Initrd.pm
+++ b/lib/MDV/Draklive/Initrd.pm
@@ -14,14 +14,14 @@ 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 require_module_in_chroot {
+ my ($live, $module) = @_;
+ my $chroot_module = cat_($live->get_system_root . "/usr/lib/libDrakX/$module.pm");
+ $chroot_module =~ s/^package $module;\B/package ${module}_chroot;/;
+ my $tmp_module = $live->get_system_root . "/tmp/${module}_chroot.pm";
+ output_p($tmp_module, $chroot_module);
+ require $tmp_module;
+ unlink $tmp_module;
}
sub nls_modules {
@@ -75,7 +75,7 @@ sub create_initrd_for_media {
sub create_media_specific_initrd {
my ($live, $media, $root, $initrd, $kernel) = @_;
- require_list_modules_chroot($live);
+ require_module_in_chroot($live, "list_modules");
my $lib_prefix = $live->get_lib_prefix;
my $initrd_tree = $live->get_builddir . $live->{prefix}{build}{initrd} . '/' . $media->{storage};