* Provide a 640x480 background image for GRUB 2.

* Turn on the graphical GRUB boot screen for the installation CD.

svn path=/nixos/branches/upstart-0.6/; revision=18340
This commit is contained in:
Eelco Dolstra 2009-11-13 16:45:41 +00:00
parent 091631b433
commit 7621b40d56
5 changed files with 36 additions and 13 deletions

View File

@ -58,7 +58,7 @@ let
# The Grub image.
grubImage = pkgs.runCommand "grub_eltorito" {}
''
${pkgs.grub2}/bin/grub-mkimage -o tmp biosdisk iso9660 help linux linux16 sh chain
${pkgs.grub2}/bin/grub-mkimage -o tmp biosdisk iso9660 help linux linux16 sh chain gfxterm vbe png jpeg
cat ${pkgs.grub2}/lib/grub/*/cdboot.img tmp > $out
''; # */
@ -69,9 +69,24 @@ let
set default=0
set timeout=10
#splashimage /boot/background.xpm.gz
if loadfont /boot/grub/unicode.pf2; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
terminal_output.gfxterm
${config.boot.extraGrubEntries}
insmod png
if background_image /boot/grub/splash.png; then
set color_normal=white/black
set color_highlight=black/white
else
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
fi
fi
${config.boot.loader.grub.extraEntries}
'';
in
@ -79,6 +94,8 @@ in
{
require = options;
boot.loader.grub.version = 2;
# In stage 1 of the boot, mount the CD/DVD as the root FS by label
# so that we don't need to know its device.
fileSystems =
@ -133,8 +150,11 @@ in
{ source = config.system.build.initialRamdisk + "/initrd";
target = "/boot/initrd";
}
{ source = config.boot.grubSplashImage;
target = "/boot/background.xpm.gz";
{ source = "${pkgs.grub2}/share/grub/unicode.pf2";
target = "/boot/grub/unicode.pf2";
}
{ source = config.boot.loader.grub.splashImage;
target = "/boot/grub/splash.png";
}
{ source = config.system.build.squashfsStore;
target = "/nix-store.squashfs";
@ -159,7 +179,7 @@ in
];
# The Grub menu.
boot.extraGrubEntries =
boot.loader.grub.extraEntries =
''
menuentry "Boot from hard disk" {
set root=(hd0)

View File

@ -10,7 +10,7 @@ let
in
{
boot.extraGrubEntries =
boot.loader.grub.extraEntries =
''
menuentry "Memtest86+" {
linux16 ${memtestPath}

View File

@ -98,10 +98,7 @@ in
sha256 = "14kqdx2lfqvh40h6fjjzqgff1mwk74dmbjvmqphi6azzra7z8d59";
}
# GRUB 1.97 doesn't support gzipped XPMs.
else pkgs.fetchurl {
url = http://www.gnu.org/graphics/winkler-gnu-blue.png;
sha256 = "0y8fvxalwxyid4k438k7c21bnv728qjsb92rqfapsmpv2bcj7f6k";
};
else ./winkler-gnu-blue-640x480.png;
example = null;
description = ''
Background image used for GRUB. It must be a 640x480,

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@ -0,0 +1,6 @@
This is a resized version of
http://www.gnu.org/graphics/winkler-gnu-blue.png
by Kyle Winkler and released under the Free Art License
(http://artlibre.org/licence.php/lalgb.html).