mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-19 03:14:03 +00:00
* Option to set the Grub background image. To
get the background image to work, you may need to set NIXOS_INSTALL_GRUB=1 when calling nixos-rebuild to force Grub to be reinstalled with splashimage support. svn path=/nixos/trunk/; revision=10071
This commit is contained in:
parent
e9a7f80681
commit
f4399a1883
@ -11,17 +11,30 @@ if test -z "$1"; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
bootMount=@bootMount@
|
||||||
|
if test -z "$bootMount"; then bootMount=/boot; fi
|
||||||
|
|
||||||
|
|
||||||
target=/boot/grub/menu.lst
|
target=/boot/grub/menu.lst
|
||||||
tmp=$target.tmp
|
tmp=$target.tmp
|
||||||
|
|
||||||
cat > $tmp << GRUBEND
|
cat > $tmp << GRUBEND
|
||||||
# Automatically generated. DO NOT EDIT THIS FILE!
|
# Automatically generated. DO NOT EDIT THIS FILE!
|
||||||
default=0
|
default 0
|
||||||
timeout=5
|
timeout 5
|
||||||
GRUBEND
|
GRUBEND
|
||||||
|
|
||||||
|
|
||||||
|
if test -n "@grubSplashImage@"; then
|
||||||
|
splashLocation=@grubSplashImage@
|
||||||
|
# !!! image in /nix/store doesn't seem to work
|
||||||
|
#if test -n "@copyKernels@"; then
|
||||||
|
cp -f $splashLocation /boot/background.xpm.gz
|
||||||
|
splashLocation=$bootMount/background.xpm.gz
|
||||||
|
#fi
|
||||||
|
echo "splashimage $splashLocation" >> $tmp
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
addEntry() {
|
addEntry() {
|
||||||
local name="$1"
|
local name="$1"
|
||||||
@ -48,9 +61,9 @@ addEntry() {
|
|||||||
fi
|
fi
|
||||||
initrd=$initrd2
|
initrd=$initrd2
|
||||||
|
|
||||||
if test -n "@bootMount@"; then
|
if test -n "$bootMount"; then
|
||||||
kernel=$(echo $kernel2 | sed -e 's^/boot^@bootMount@^')
|
kernel=$(echo $kernel2 | sed -e "s^/boot^$bootMount^")
|
||||||
initrd=$(echo $initrd2 | sed -e 's^/boot^@bootMount@^')
|
initrd=$(echo $initrd2 | sed -e "s^/boot^$bootMount^")
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -62,6 +75,7 @@ addEntry() {
|
|||||||
fi;
|
fi;
|
||||||
|
|
||||||
cat >> $tmp << GRUBEND
|
cat >> $tmp << GRUBEND
|
||||||
|
|
||||||
title $name
|
title $name
|
||||||
kernel $kernel systemConfig=$(readlink -f $path) init=$(readlink -f $path/init) $(cat $path/kernel-params)
|
kernel $kernel systemConfig=$(readlink -f $path) init=$(readlink -f $path/init) $(cat $path/kernel-params)
|
||||||
initrd $initrd
|
initrd $initrd
|
||||||
|
@ -220,6 +220,20 @@
|
|||||||
";
|
";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
grubSplashImage = mkOption {
|
||||||
|
default = pkgs.fetchurl {
|
||||||
|
url = http://www.gnome-look.org/CONTENT/content-files/36909-soft-tux.xpm.gz;
|
||||||
|
sha256 = "14kqdx2lfqvh40h6fjjzqgff1mwk74dmbjvmqphi6azzra7z8d59";
|
||||||
|
};
|
||||||
|
example = null;
|
||||||
|
description = "
|
||||||
|
Background image used for Grub. It must be a 640x480,
|
||||||
|
14-colour image in XPM format, optionally compressed with
|
||||||
|
<command>gzip</command> or <command>bzip2</command>. Set to
|
||||||
|
<literal>null</literal> to run Grub in text mode.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -318,9 +318,8 @@ rec {
|
|||||||
isExecutable = true;
|
isExecutable = true;
|
||||||
inherit (pkgs) bash;
|
inherit (pkgs) bash;
|
||||||
path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep];
|
path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep];
|
||||||
copyKernels = config.boot.copyKernels;
|
inherit (config.boot) copyKernels extraGrubEntries
|
||||||
extraGrubEntries = config.boot.extraGrubEntries;
|
grubSplashImage bootMount;
|
||||||
bootMount = config.boot.bootMount;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user