[2680] 2009-11-02 Samuel Thibault <[email protected]>

Robert Millan <[email protected]> Mon, 02 Nov 2009 21:01:16 +0000
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 2680
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2680
Author:   robertmh
Date:     2009-11-02 21:01:14 +0000 (Mon, 02 Nov 2009)
Log Message:
-----------
2009-11-02  Samuel Thibault  <[email protected]>

        * util/grub.d/30_os-prober.in: Add GNU/Hurd support

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/util/grub.d/30_os-prober.in

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-11-02 19:32:12 UTC (rev 2679)
+++ trunk/grub2/ChangeLog	2009-11-02 21:01:14 UTC (rev 2680)
@@ -1,5 +1,9 @@
 2009-11-02  Samuel Thibault  <[email protected]>
 
+	* util/grub.d/30_os-prober.in: Add GNU/Hurd support
+
+2009-11-02  Samuel Thibault  <[email protected]>
+
 	* util/grub.d/10_hurd.in: Drop /dev/ prefix from root device path before
 	giving it to GNU Mach.
 

Modified: trunk/grub2/util/grub.d/30_os-prober.in
===================================================================
--- trunk/grub2/util/grub.d/30_os-prober.in	2009-11-02 19:32:12 UTC (rev 2679)
+++ trunk/grub2/util/grub.d/30_os-prober.in	2009-11-02 21:01:14 UTC (rev 2680)
@@ -159,7 +159,28 @@
 EOF
     ;;
     hurd|*)
-      echo "  ${LONGNAME} is not yet supported by grub-mkconfig." >&2
+      cat << EOF
+menuentry "${LONGNAME} (on ${DEVICE})" {
+EOF
+      prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
+      grub_device="`${grub_probe} --device ${DEVICE} --target=drive`"
+      mach_device="`echo "${grub_device}" | tr -d '()' | tr , s`"
+      grub_fs="`${grub_probe} --device ${DEVICE} --target=fs`"
+      case "${grub_fs}" in
+	*fs)	hurd_fs="${grub_fs}" ;;
+	*)	hurd_fs="${grub_fs}fs" ;;
+      esac
+      cat << EOF
+	multiboot /boot/gnumach.gz root=device:${mach_device}
+	module /hurd/${hurd_fs}.static ${hurd_fs} --readonly \\
+			--multiboot-command-line='\${kernel-command-line}' \\
+			--host-priv-port='\${host-port}' \\
+			--device-master-port='\${device-port}' \\
+			--exec-server-task='\${exec-task}' -T typed '\${root}' \\
+			'\$(task-create)' '\$(task-resume)'
+	module /lib/ld.so.1 exec /hurd/exec '\$(exec-task=task-create)'
+}
+EOF
     ;;
   esac
 done