From 0bc655c8b88c9a2c92db66dc8b259c56ec53ee49 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 7 Jan 2004 16:08:41 +0000 Subject: pass --splash to mkinitrd (so that make-boot-splash doesn't rely on lilo.conf or menu.lst) --- perl-install/Xconfig/resolution_and_depth.pm | 5 +++++ perl-install/any.pm | 2 +- perl-install/bootloader.pm | 13 +++++++++---- 3 files changed, 15 insertions(+), 5 deletions(-) (limited to 'perl-install') diff --git a/perl-install/Xconfig/resolution_and_depth.pm b/perl-install/Xconfig/resolution_and_depth.pm index 5efac6ae5..8c095a64b 100644 --- a/perl-install/Xconfig/resolution_and_depth.pm +++ b/perl-install/Xconfig/resolution_and_depth.pm @@ -44,6 +44,11 @@ my @bios_vga_modes = ( { bios => 794, X => 1280, Y => 1024, Depth => 16 }, ); +sub from_bios { + my ($bios) = @_; + find { $_->{bios} == $bios } @bios_vga_modes; +} + sub size2default_resolution { my ($size) = @_; #- size in inch diff --git a/perl-install/any.pm b/perl-install/any.pm index 07afd58c8..8592edc43 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -361,7 +361,7 @@ if_(arch() !~ /sparc|ppc|ia64/, $e->{label} = "$prefix-$nb"; } $Modify->($e) or return; - push @{$b->{entries}}, $e; + bootloader::add_entry($b, $e); $e; }; diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 6e86c0bef..25c352e5f 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -52,14 +52,19 @@ sub get_label { } sub mkinitrd { - my ($kernelVersion, $initrdImage) = @_; + my ($kernelVersion, $initrdImage, $o_vga) = @_; $::testing || -e "$::prefix/$initrdImage" and return 1; my $loop_boot = loopback::prepare_boot(); + my $o_resolution = $o_vga && do { + require Xconfig::resolution_and_depth; + my $res = Xconfig::resolution_and_depth::from_bios($o_vga); + $res && $res->{X}; + }; modules::load('loop'); - if (!run_program::rooted($::prefix, "mkinitrd", "-v", "-f", $initrdImage, "--ifneeded", $kernelVersion)) { + if (!run_program::rooted($::prefix, "mkinitrd", "-v", "-f", $initrdImage, "--ifneeded", $kernelVersion, if_($o_resolution, '--splash' => $o_resolution))) { unlink("$::prefix/$initrdImage"); die "mkinitrd failed"; } @@ -278,7 +283,7 @@ sub add_kernel { symlinkf("vmlinuz-$version", "$::prefix/boot/vmlinuz$ext") ? $ext : "-$version"); my $initrd = "/boot/initrd-$version.img"; - mkinitrd($version, $initrd) or undef $initrd; + mkinitrd($version, $initrd, $v->{vga}) or undef $initrd; if ($initrd && $ext ne "-$version") { $initrd = "/boot/initrd$ext.img"; symlinkf("initrd-$version.img", "$::prefix$initrd") or cp_af("$::prefix/boot/initrd-$version.img", "$::prefix$initrd"); @@ -384,7 +389,7 @@ sub configure_entry { if ($specific_version) { $entry->{initrd} or $entry->{initrd} = "/boot/initrd-$specific_version.img"; - mkinitrd($specific_version, $entry->{initrd}) or undef $entry->{initrd}; + mkinitrd($specific_version, $entry->{initrd}, $entry->{vga}) or undef $entry->{initrd}; } } $entry; -- cgit v1.2.1