From 548a44415b1809fa10562b0bd8d960b9d5b4ecf6 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 14 Oct 2009 16:14:37 +0000 Subject: remove hardcoded splashy code and use back bootloader::add_boot_splash --- lib/MDV/Draklive/Initrd.pm | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) (limited to 'lib') diff --git a/lib/MDV/Draklive/Initrd.pm b/lib/MDV/Draklive/Initrd.pm index 66e5393..fc1af8b 100644 --- a/lib/MDV/Draklive/Initrd.pm +++ b/lib/MDV/Draklive/Initrd.pm @@ -190,10 +190,9 @@ sub create_media_specific_initrd { uniq(map { list_modules::dependencies_closure($_) } @$extra_modules); create_initrd_scriptlet($live, $media, @extra_modules_closure, @additional_modules); - add_splash($live, $initrd_tree); - print "Compressing initrd\n"; compress_initrd_tree($live, $initrd_tree, $initrd); + add_splash($live, $initrd); } sub create_initrd_scriptlet { @@ -273,28 +272,17 @@ sub compress_initrd_tree { } sub add_splash { - my ($live, $initrd_tree) = @_; + my ($live, $initrd) = @_; if ($live->{system}{vga_mode} && $live->{system}{splash} ne 'no') { - my $root = $live->get_system_root(); - my $lib_prefix = $live->get_lib_prefix(); - - my $default_file = $root . "/usr/share/plymouth/themes/default.plymouth"; - if (!-e $default_file) { - warn "no default plymouth theme\n"; - return; - } - - my $plymouth_theme_name = basename(dirname(expand_symlinks($default_file))); - my $plymouth_theme_path = "/usr/share/plymouth/themes/" . $plymouth_theme_name; - print "Copying plymouth theme $plymouth_theme_name\n"; - mkdir_p($initrd_tree . "/usr/share/plymouth/themes"); - cp_af($root . $plymouth_theme_path, $initrd_tree . $plymouth_theme_path); - - my $plymouth_module_name = `grep "ModuleName *= *" $root/usr/share/plymouth/themes/$plymouth_theme_name/$plymouth_theme_name.plymouth | sed 's/ModuleName *= *//'`; - chomp $plymouth_module_name; - foreach (qw(/sbin/plymouthd /bin/plymouth /usr/share/plymouth/themes/text/text.plymouth /usr/share/plymouth/themes/details/details.plymouth /usr/share/icons/large/mandriva.png /etc/mandriva-release /usr/share/plymouth/themes/default.plymouth ), "/usr/$lib_prefix/plymouth/text.so", "/usr/$lib_prefix/plymouth/details.so", "/usr/$lib_prefix/plymouth/$plymouth_module_name.so") { - inst_initrd_file ($root, $initrd_tree, $_); + require bootloader; + my $tmp_initrd = '/tmp/initrd.gz'; + cp_f($initrd, $live->get_system_root . $tmp_initrd); + { + local $::prefix = $live->get_system_root; + bootloader::add_boot_splash($tmp_initrd, $live->{system}{vga_mode}); } + cp_f($live->get_system_root . $tmp_initrd, $initrd); + unlink($live->get_system_root . $tmp_initrd); } } -- cgit v1.2.1