Bug#581584: /etc/grub.d/10_hurd: generate entries for each gnumach kernel found in /boot

Justus Winter 4winter at informatik.uni-hamburg.de
Thu May 13 23:51:31 UTC 2010


Package: grub-pc
Version: 1.98-1
Severity: wishlist
Tags: patch


/etc/grub.d/10_linux generates menu entries for each kernel found in /boot and
I believe that 10_hurd should do the same for each gnumach kernel. reportbug
was so kind as to include an example configuration created using my patch.

-- Package-specific info:

*********************** BEGIN /boot/grub/device.map
(hd0)	/dev/hd0
*********************** END /boot/grub/device.map

*********************** BEGIN /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
  set saved_entry=${prev_saved_entry}
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z ${boot_once} ]; then
    saved_entry=${chosen}
    save_env saved_entry
  fi
}
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 7b000b7e-e74e-4b03-bbda-415153fb62eb
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=640x480
  insmod gfxterm
  insmod vbe
  if terminal_output gfxterm ; then true ; else
    # For backward compatibility with versions of terminal.mod that don't
    # understand terminal_output
    terminal gfxterm
  fi
fi
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 7b000b7e-e74e-4b03-bbda-415153fb62eb
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_hurd ###
menuentry "Debian GNU/Hurd using gnumach.gz" --class debian --class gnu --class os {
	insmod ext2
	set root='(hd0,1)'
	search --no-floppy --fs-uuid --set 7b000b7e-e74e-4b03-bbda-415153fb62eb
	echo		Loading GNU Mach ...
	multiboot	/boot/gnumach.gz root=device:hd0s1
	insmod ext2
	set root='(hd0,1)'
	search --no-floppy --fs-uuid --set 7b000b7e-e74e-4b03-bbda-415153fb62eb
	echo		Loading the Hurd ...
	module		/hurd/ext2fs.static ext2fs --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)'
}
menuentry "Debian GNU/Hurd using gnumach.gz (recovery mode)" {
	insmod ext2
	set root='(hd0,1)'
	search --no-floppy --fs-uuid --set 7b000b7e-e74e-4b03-bbda-415153fb62eb
	echo		Loading GNU Mach ...
	multiboot	/boot/gnumach.gz root=device:hd0s1 -s
	insmod ext2
	set root='(hd0,1)'
	search --no-floppy --fs-uuid --set 7b000b7e-e74e-4b03-bbda-415153fb62eb
	echo		Loading the Hurd ...
	module		/hurd/ext2fs.static ext2fs \
			--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)'
}
menuentry "Debian GNU/Hurd using gnumach-dde.gz" --class debian --class gnu --class os {
	insmod ext2
	set root='(hd0,1)'
	search --no-floppy --fs-uuid --set 7b000b7e-e74e-4b03-bbda-415153fb62eb
	echo		Loading GNU Mach ...
	multiboot	/boot/gnumach-dde.gz root=device:hd0s1
	insmod ext2
	set root='(hd0,1)'
	search --no-floppy --fs-uuid --set 7b000b7e-e74e-4b03-bbda-415153fb62eb
	echo		Loading the Hurd ...
	module		/hurd/ext2fs.static ext2fs --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)'
}
menuentry "Debian GNU/Hurd using gnumach-dde.gz (recovery mode)" {
	insmod ext2
	set root='(hd0,1)'
	search --no-floppy --fs-uuid --set 7b000b7e-e74e-4b03-bbda-415153fb62eb
	echo		Loading GNU Mach ...
	multiboot	/boot/gnumach-dde.gz root=device:hd0s1 -s
	insmod ext2
	set root='(hd0,1)'
	search --no-floppy --fs-uuid --set 7b000b7e-e74e-4b03-bbda-415153fb62eb
	echo		Loading the Hurd ...
	module		/hurd/ext2fs.static ext2fs \
			--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)'
}
### END /etc/grub.d/10_hurd ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
*********************** END /boot/grub/grub.cfg

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: hurd-i386 (i686-AT386)

Kernel: GNU-Mach 1.3.99/Hurd-0.3
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages grub-pc depends on:
ii  debconf [debconf-2.0]         1.5.32     Debian configuration management sy
ii  grub-common                   1.98-1     GRand Unified Bootloader, version 
ii  libc0.3                       2.10.2-7   Embedded GNU C Library: Shared lib
ii  ucf                           3.0025     Update Configuration File: preserv

grub-pc recommends no packages.

Versions of packages grub-pc suggests:
pn  desktop-base                  <none>     (no description available)

-- debconf information:
  grub-pc/kopt_extracted: false
  grub2/kfreebsd_cmdline:
  grub2/kfreebsd_cmdline_default: quiet
* grub-pc/install_devices:
  grub-pc/postrm_purge_boot_grub: false
  grub2/linux_cmdline_default: quiet
  grub-pc/chainload_from_menu.lst: true
* grub2/linux_cmdline:
-------------- next part --------------
--- /root/10_hurd	2010-05-12 16:42:12.000000000 +0000
+++ /etc/grub.d/10_hurd	2010-05-12 16:58:27.000000000 +0000
@@ -35,13 +35,13 @@
 
 # FIXME: add l4 here?
 kernel=
-for i in /boot/gnumach.gz /boot/gnumach ; do
+for i in /boot/gnumach.gz /boot/gnumach /boot/gnumach?*.gz ; do
   if test -e $i ; then
     basename=`basename $i`
     dirname=`dirname $i`
     rel_dirname=`make_system_path_relative_to_its_root $dirname`
     echo "Found GNU Mach: $i" >&2
-    kernel=${rel_dirname}/${basename}
+    kernels="${kernels} ${rel_dirname}/${basename}"
     at_least_one=true
   fi
 done
@@ -71,17 +71,22 @@
   exit 1
 fi
 
-cat << EOF
-menuentry "${OS}" ${CLASS} {
+for kernel in ${kernels}
+do
+  kernel_base="`basename "${kernel}"`"
+  KERNEL="using ${kernel_base}"
+
+  cat << EOF
+menuentry "${OS} ${KERNEL}" ${CLASS} {
 EOF
-prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
+  prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
 cat << EOF
 	echo		$(gettext "Loading GNU Mach ...")
 	multiboot	${kernel} root=device:${GRUB_DEVICE#/dev/}
 EOF
-save_default_entry | sed -e "s/^/\t/"
-prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/"
-cat << EOF
+  save_default_entry | sed -e "s/^/\t/"
+  prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/"
+  cat << EOF
 	echo		$(gettext "Loading the Hurd ...")
 	module		/hurd/${hurd_fs}.static ${hurd_fs} --readonly \\
 			--multiboot-command-line='\${kernel-command-line}' \\
@@ -93,17 +98,17 @@
 }
 EOF
 
-cat << EOF
-menuentry "${OS} (recovery mode)" {
+  cat << EOF
+menuentry "${OS} ${KERNEL} (recovery mode)" {
 EOF
-prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
-cat << EOF
+  prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
+  cat << EOF
 	echo		$(gettext "Loading GNU Mach ...")
 	multiboot	${kernel} root=device:${GRUB_DEVICE#/dev/} -s
 EOF
-save_default_entry | sed -e "s/^/\t/"
-prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/"
-cat << EOF
+  save_default_entry | sed -e "s/^/\t/"
+  prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/"
+  cat << EOF
 	echo		$(gettext "Loading the Hurd ...")
 	module		/hurd/${hurd_fs}.static ${hurd_fs} \\
 			--multiboot-command-line='\${kernel-command-line}' \\
@@ -114,3 +119,5 @@
 	module		/lib/ld.so.1 exec /hurd/exec '\$(exec-task=task-create)'
 }
 EOF
+
+done


More information about the Pkg-grub-devel mailing list