Author: eelco
Date: Fri Sep 10 17:15:35 2010
New Revision: 23730
URL: https://svn.nixos.org/websvn/nix/?rev=23730&sc=1

Log:
* Support booting Xen in the Grub menu builder.

Modified:
   nixos/trunk/modules/installer/grub/grub-menu-builder.sh

Modified: nixos/trunk/modules/installer/grub/grub-menu-builder.sh
==============================================================================
--- nixos/trunk/modules/installer/grub/grub-menu-builder.sh     Fri Sep 10 
16:27:39 2010        (r23729)
+++ nixos/trunk/modules/installer/grub/grub-menu-builder.sh     Fri Sep 10 
17:15:35 2010        (r23730)
@@ -52,8 +52,8 @@
 timeout @timeout@
 GRUBEND
            if test -n "@splashImage@"; then
-               echo "splashimage $bootRoot/background.xpm.gz" >> "$1"
-           fi
+                echo "splashimage $bootRoot/background.xpm.gz" >> "$1"
+            fi
            ;;
        2)
             cp -f @grub@/share/grub/unicode.pf2 /boot/grub/unicode.pf2
@@ -154,6 +154,7 @@
 
     local kernel=$(readlink -f $path/kernel)
     local initrd=$(readlink -f $path/initrd)
+    local xen=$([ -f $path/xen.gz ] && readlink -f $path/xen.gz)
 
     if test "$path" = "$defaultConfig"; then
        cp "$kernel" /boot/nixos-kernel
@@ -181,28 +182,34 @@
     if test -n "$copyKernels"; then
         copyToKernelsDir $kernel; kernel=$result
         copyToKernelsDir $initrd; initrd=$result
+        if [ -n "$xen" ]; then copyToKernelsDir $xen; xen=$result; fi
     fi
-    
+
     local confName=$(cat $path/configuration-name 2>/dev/null || true)
     if test -n "$confName"; then
        name="$confName $3"
     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
        1)
            cat >> "$tmp" << GRUBEND
 title $name
   @extraPerEntryConfig@
-  kernel $kernel systemConfig=$(readlink -f $path) init=$(readlink -f 
$path/init) $(cat $path/kernel-params)
-  initrd $initrd
+  ${xen:+kernel $xen $xenArgs}
+  $(if [ -z "$xen" ]; then echo kernel; else echo module; fi) $kernel 
$kernelArgs
+  module $initrd
 GRUBEND
            ;;
        2)
            cat >> "$tmp" << GRUBEND
 menuentry "$name" {
   @extraPerEntryConfig@
-  linux  $kernel systemConfig=$(readlink -f $path) init=$(readlink -f 
$path/init) $(cat $path/kernel-params)
-  initrd $initrd
+  ${xen:+multiboot $xen $xenArgs}
+  $(if [ -z "$xen" ]; then echo linux; else echo module; fi) $kernel 
$kernelArgs
+  $(if [ -z "$xen" ]; then echo initrd; else echo module; fi) $initrd
 }
 GRUBEND
            ;;
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to