From ed80c570d284d006d1fb4fd2adfcac6c3b6087f8 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 14 Oct 2009 16:25:21 +0000 Subject: handle initrd in chroot (to further factorize) --- lib/MDV/Draklive/Initrd.pm | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/MDV/Draklive/Initrd.pm b/lib/MDV/Draklive/Initrd.pm index b2375b0..78bde95 100644 --- a/lib/MDV/Draklive/Initrd.pm +++ b/lib/MDV/Draklive/Initrd.pm @@ -274,17 +274,26 @@ sub compress_initrd_tree { sub add_splash { my ($live, $initrd) = @_; if ($live->{system}{vga_mode} && $live->{system}{splash} ne 'no') { - my $tmp_initrd = '/tmp/initrd.gz'; - cp_f($initrd, $live->get_system_root . $tmp_initrd); + my $chroot_initrd; + if ($initrd !~ m,^/boot/,) { + $chroot_initrd = '/tmp/initrd.gz'; + cp_f($initrd, $live->get_system_root . $chroot_initrd); + } else { + $chroot_initrd = $initrd; + } + { local $::prefix = $live->get_system_root; #- also calls switch-themes -u (through make-boot-splash) #- which will regenerate gfxboot current link require bootloader; - bootloader::add_boot_splash($tmp_initrd, $live->{system}{vga_mode}); + bootloader::add_boot_splash($chroot_initrd, $live->{system}{vga_mode}); + } + + if ($chroot_initrd ne $initrd) { + cp_f($live->get_system_root . $chroot_initrd, $initrd); + unlink($live->get_system_root . $chroot_initrd); } - cp_f($live->get_system_root . $tmp_initrd, $initrd); - unlink($live->get_system_root . $tmp_initrd); } } -- cgit v1.2.1