a5bd9f6
From 5bf54ea7bf0fc7d1c2b9806a57566ad25179d07c Mon Sep 17 00:00:00 2001
a5bd9f6
From: =?UTF-8?q?Gr=C3=A9goire=20Sutre?= <gregoire.sutre@gmail.com>
a5bd9f6
Date: Sun, 28 Oct 2012 11:55:22 +0100
a5bd9f6
Subject: [PATCH 053/364] Fix ordering and tab indentation of NetBSD boot menu
a5bd9f6
 entries.
a5bd9f6
a5bd9f6
---
a5bd9f6
 ChangeLog                |  5 +++++
a5bd9f6
 util/grub.d/10_netbsd.in | 12 ++++++------
a5bd9f6
 2 files changed, 11 insertions(+), 6 deletions(-)
a5bd9f6
a5bd9f6
diff --git a/ChangeLog b/ChangeLog
a5bd9f6
index c7b07bb..caea96d 100644
a5bd9f6
--- a/ChangeLog
a5bd9f6
+++ b/ChangeLog
a5bd9f6
@@ -1,3 +1,8 @@
a5bd9f6
+2012-10-28  Grégoire Sutre  <gregoire.sutre@gmail.com>
a5bd9f6
+
a5bd9f6
+	* util/grub.d/10_netbsd.in: Fix tab indentation and make sure
a5bd9f6
+	that /netbsd appears first (when it exists).
a5bd9f6
+
a5bd9f6
 2012-10-12  Colin Watson  <cjwatson@ubuntu.com>
a5bd9f6
 
a5bd9f6
 	* grub-core/commands/configfile.c (GRUB_MOD_INIT): Correct
a5bd9f6
diff --git a/util/grub.d/10_netbsd.in b/util/grub.d/10_netbsd.in
a5bd9f6
index b76332b..dead5c1 100644
a5bd9f6
--- a/util/grub.d/10_netbsd.in
a5bd9f6
+++ b/util/grub.d/10_netbsd.in
a5bd9f6
@@ -74,13 +74,13 @@ netbsd_load_fs_module ()
a5bd9f6
   fi
a5bd9f6
 
a5bd9f6
   kmodule_rel=$(make_system_path_relative_to_its_root "$kmodule") || return
a5bd9f6
-  prepare_grub_to_access_device $(${grub_probe} -t device "${kmodule}") | sed -e 's,^,	,'
a5bd9f6
+  prepare_grub_to_access_device $(${grub_probe} -t device "${kmodule}") | sed -e 's,^,	,' | sed "s/^/$submenu_indentation/"
a5bd9f6
   case "${loader}" in
a5bd9f6
     knetbsd)
a5bd9f6
-      printf "$grub_tabknetbsd_module_elf %s\n" "${kmodule_rel}"
a5bd9f6
+      printf "${grub_tab}knetbsd_module_elf %s\n" "${kmodule_rel}" | sed "s/^/$submenu_indentation/"
a5bd9f6
       ;;
a5bd9f6
     multiboot)
a5bd9f6
-      printf "$grub_tabmodule %s\n" "${kmodule_rel}"
a5bd9f6
+      printf "${grub_tab}module %s\n" "${kmodule_rel}" | sed "s/^/$submenu_indentation/"
a5bd9f6
       ;;
a5bd9f6
   esac
a5bd9f6
 }
a5bd9f6
@@ -121,11 +121,11 @@ netbsd_entry ()
a5bd9f6
   printf "%s\n" "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
a5bd9f6
   case "${loader}" in
a5bd9f6
     knetbsd)
a5bd9f6
-      printf "$grub_tabknetbsd %s -r %s %s\n" \
a5bd9f6
+      printf "${grub_tab}knetbsd %s -r %s %s\n" \
a5bd9f6
         "${kernel}" "${kroot_device}" "${GRUB_CMDLINE_NETBSD} ${args}" | sed "s/^/$submenu_indentation/"
a5bd9f6
       ;;
a5bd9f6
     multiboot)
a5bd9f6
-      printf "$grub_tabmultiboot %s %s root=%s %s\n" \
a5bd9f6
+      printf "${grub_tab}multiboot %s %s root=%s %s\n" \
a5bd9f6
         "${kernel}" "${kernel}" "${kroot_device}" "${GRUB_CMDLINE_NETBSD} ${args}" | sed "s/^/$submenu_indentation/"
a5bd9f6
       ;;
a5bd9f6
   esac
a5bd9f6
@@ -147,7 +147,7 @@ pattern="^ELF[^,]*executable.*statically linked"
a5bd9f6
 submenu_indentation=""
a5bd9f6
 
a5bd9f6
 is_first_entry=true
a5bd9f6
-for k in $(ls -t /netbsd*) ; do
a5bd9f6
+for k in /netbsd $(ls -t /netbsd?* 2>/dev/null) ; do
a5bd9f6
   if ! grub_file_is_not_garbage "$k" ; then
a5bd9f6
     continue
a5bd9f6
   fi
a5bd9f6
-- 
a5bd9f6
1.8.1.4
a5bd9f6