summaryrefslogtreecommitdiffstats
path: root/lib/MDV/Draklive/Initrd.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-10-29 00:33:09 +0000
committerOlivier Blin <oblin@mandriva.com>2008-10-29 00:33:09 +0000
commit1119099e57a04a6c7067c6d9e18bc8a21cf99fd7 (patch)
tree603cb148e19327772d3aaac28eee698e876b6a4f /lib/MDV/Draklive/Initrd.pm
parent87adcd0fc4069a15f4949732e5767a4e8c2b3c69 (diff)
downloaddrakiso-1119099e57a04a6c7067c6d9e18bc8a21cf99fd7.tar
drakiso-1119099e57a04a6c7067c6d9e18bc8a21cf99fd7.tar.gz
drakiso-1119099e57a04a6c7067c6d9e18bc8a21cf99fd7.tar.bz2
drakiso-1119099e57a04a6c7067c6d9e18bc8a21cf99fd7.tar.xz
drakiso-1119099e57a04a6c7067c6d9e18bc8a21cf99fd7.zip
extract create_media_specific_initrd function (for mkinitrd-draklive tool)
Diffstat (limited to 'lib/MDV/Draklive/Initrd.pm')
-rw-r--r--lib/MDV/Draklive/Initrd.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/MDV/Draklive/Initrd.pm b/lib/MDV/Draklive/Initrd.pm
index be6513b..6d2dca8 100644
--- a/lib/MDV/Draklive/Initrd.pm
+++ b/lib/MDV/Draklive/Initrd.pm
@@ -52,8 +52,12 @@ sub inst_initrd_bin {
sub create_initrd_for_media {
my ($live, $media) = @_;
+ my $initrd = $live->get_builddir . $live->{prefix}{build}{boot} . $media->get_initrd_path;
+ create_media_specific_initrd($live, $media, $live->get_system_root, $live->find_kernel, $initrd);
+}
- my $root = $live->get_system_root;
+sub create_media_specific_initrd {
+ my ($live, $media, $root, $initrd, $kernel) = @_;
my $lib_prefix = find { glob($root . $_ . '/libc.so.*') } qw(/lib64 /lib);
$lib_prefix or die 'unable to find system libraries in /lib or /lib64';
@@ -112,7 +116,6 @@ sub create_initrd_for_media {
mkdir_p($initrd_tree . "/dev/loop");
cp_af($initrd_tree . "/dev/loop$_", $initrd_tree . "/dev/loop/$_") foreach 0 .. $loop_nb;
- my $kernel = $live->find_kernel;
print "using kernel $kernel\n";
my $kernel_root = "/lib/modules/" . $kernel;
list_modules::load_dependencies($root . $kernel_root . "/modules.dep");
@@ -170,7 +173,6 @@ sub create_initrd_for_media {
uniq(map { list_modules::dependencies_closure($_) } @$extra_modules);
create_initrd_scriptlet($live, $media, @extra_modules_closure, @additional_modules);
- my $initrd = $live->get_builddir . $live->{prefix}{build}{boot} . $media->get_initrd_path;
compress_initrd_tree($live, $initrd_tree, $initrd);
add_splash($live, $initrd);
}