* Support booting Xen in the Grub menu builder.
svn path=/nixos/trunk/; revision=23730
This commit is contained in:
parent
8f4139987e
commit
4ae4b7d47f
|
@ -52,8 +52,8 @@ default @default@
|
||||||
timeout @timeout@
|
timeout @timeout@
|
||||||
GRUBEND
|
GRUBEND
|
||||||
if test -n "@splashImage@"; then
|
if test -n "@splashImage@"; then
|
||||||
echo "splashimage $bootRoot/background.xpm.gz" >> "$1"
|
echo "splashimage $bootRoot/background.xpm.gz" >> "$1"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
cp -f @grub@/share/grub/unicode.pf2 /boot/grub/unicode.pf2
|
cp -f @grub@/share/grub/unicode.pf2 /boot/grub/unicode.pf2
|
||||||
|
@ -154,6 +154,7 @@ addEntry() {
|
||||||
|
|
||||||
local kernel=$(readlink -f $path/kernel)
|
local kernel=$(readlink -f $path/kernel)
|
||||||
local initrd=$(readlink -f $path/initrd)
|
local initrd=$(readlink -f $path/initrd)
|
||||||
|
local xen=$([ -f $path/xen.gz ] && readlink -f $path/xen.gz)
|
||||||
|
|
||||||
if test "$path" = "$defaultConfig"; then
|
if test "$path" = "$defaultConfig"; then
|
||||||
cp "$kernel" /boot/nixos-kernel
|
cp "$kernel" /boot/nixos-kernel
|
||||||
|
@ -181,28 +182,34 @@ EOF
|
||||||
if test -n "$copyKernels"; then
|
if test -n "$copyKernels"; then
|
||||||
copyToKernelsDir $kernel; kernel=$result
|
copyToKernelsDir $kernel; kernel=$result
|
||||||
copyToKernelsDir $initrd; initrd=$result
|
copyToKernelsDir $initrd; initrd=$result
|
||||||
|
if [ -n "$xen" ]; then copyToKernelsDir $xen; xen=$result; fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local confName=$(cat $path/configuration-name 2>/dev/null || true)
|
local confName=$(cat $path/configuration-name 2>/dev/null || true)
|
||||||
if test -n "$confName"; then
|
if test -n "$confName"; then
|
||||||
name="$confName $3"
|
name="$confName $3"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
local kernelArgs="systemConfig=$(readlink -f $path) init=$(readlink -f $path/init) $(cat $path/kernel-params)"
|
||||||
|
local xenArgs="loglvl=all guest_loglvl=all"
|
||||||
|
|
||||||
case "$grubVersion" in
|
case "$grubVersion" in
|
||||||
1)
|
1)
|
||||||
cat >> "$tmp" << GRUBEND
|
cat >> "$tmp" << GRUBEND
|
||||||
title $name
|
title $name
|
||||||
@extraPerEntryConfig@
|
@extraPerEntryConfig@
|
||||||
kernel $kernel systemConfig=$(readlink -f $path) init=$(readlink -f $path/init) $(cat $path/kernel-params)
|
${xen:+kernel $xen $xenArgs}
|
||||||
initrd $initrd
|
$(if [ -z "$xen" ]; then echo kernel; else echo module; fi) $kernel $kernelArgs
|
||||||
|
module $initrd
|
||||||
GRUBEND
|
GRUBEND
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
cat >> "$tmp" << GRUBEND
|
cat >> "$tmp" << GRUBEND
|
||||||
menuentry "$name" {
|
menuentry "$name" {
|
||||||
@extraPerEntryConfig@
|
@extraPerEntryConfig@
|
||||||
linux $kernel systemConfig=$(readlink -f $path) init=$(readlink -f $path/init) $(cat $path/kernel-params)
|
${xen:+multiboot $xen $xenArgs}
|
||||||
initrd $initrd
|
$(if [ -z "$xen" ]; then echo linux; else echo module; fi) $kernel $kernelArgs
|
||||||
|
$(if [ -z "$xen" ]; then echo initrd; else echo module; fi) $initrd
|
||||||
}
|
}
|
||||||
GRUBEND
|
GRUBEND
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue