]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* util/grub-mkconfig_lib.in (grub_tab): New variable.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 18 Sep 2012 11:04:06 +0000 (13:04 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 18 Sep 2012 11:04:06 +0000 (13:04 +0200)
(grub_add_tab): New function.
* util/grub.d/10_hurd.in: Replace \t with $grub_tab orgrub_add_tab.
* util/grub.d/10_illumos.in: Likewise.
* util/grub.d/10_kfreebsd.in: Likewise.
* util/grub.d/10_linux.in: Likewise.
* util/grub.d/10_netbsd.in: Likewise.
* util/grub.d/10_windows.in: Likewise.
* util/grub.d/10_xnu.in: Likewise.
* util/grub.d/20_linux_xen.in: Likewise.
* util/grub.d/30_os-prober.in: Likewise.

ChangeLog
util/grub-mkconfig_lib.in
util/grub.d/10_hurd.in
util/grub.d/10_illumos.in
util/grub.d/10_kfreebsd.in
util/grub.d/10_linux.in
util/grub.d/10_netbsd.in
util/grub.d/10_windows.in
util/grub.d/10_xnu.in
util/grub.d/20_linux_xen.in
util/grub.d/30_os-prober.in

index 3752a79e7b6d26150efbae16d44e446052e834f5..32849c6e9b028ebfee4686ffd431d697086ac04b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2012-09-18  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * util/grub-mkconfig_lib.in (grub_tab): New variable.
+       (grub_add_tab): New function.
+       * util/grub.d/10_hurd.in: Replace \t with $grub_tab orgrub_add_tab.
+       * util/grub.d/10_illumos.in: Likewise.
+       * util/grub.d/10_kfreebsd.in: Likewise.
+       * util/grub.d/10_linux.in: Likewise.
+       * util/grub.d/10_netbsd.in: Likewise.
+       * util/grub.d/10_windows.in: Likewise.
+       * util/grub.d/10_xnu.in: Likewise.
+       * util/grub.d/20_linux_xen.in: Likewise.
+       * util/grub.d/30_os-prober.in: Likewise.
+
 2012-09-18  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/kern/ieee1275/cmain.c (grub_ieee1275_find_options): Set
index a9f5809b256f59dc7e8793e4ea9a8ed876138fd4..8f21eb26d5ae192fe98245c0cb1e0350db742a38 100644 (file)
@@ -347,3 +347,10 @@ grub_fmt () {
       cat
   fi
 }
+
+grub_tab="     "
+
+grub_add_tab () {
+  sed -e "s/^/$grub_tab/"
+}
+
index 45f0ad32844c332a4514d2043f44a646b15e9aba..00efd68cb315e0634839cf49af077a8863db49b5 100644 (file)
@@ -108,7 +108,7 @@ menuentry '$(echo "$OS" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnuhurd-s
 EOF
   fi
 
-  prepare_grub_to_access_device "${GRUB_DEVICE_BOOT}" | sed -e "s/^/\t/"|sed "s/^/$submenu_indentation/"
+  prepare_grub_to_access_device "${GRUB_DEVICE_BOOT}" | grub_add_tab|sed "s/^/$submenu_indentation/"
   message="$(gettext_printf "Loading GNU Mach ...")"
 
   if [ x$type = xrecovery ] ; then
@@ -122,9 +122,9 @@ EOF
 EOF
 
   if [ x$type != xrecovery ] ; then
-      save_default_entry | sed -e "s/^/\t/"| sed "s/^/$submenu_indentation/"
+      save_default_entry | grub_add_tab| sed "s/^/$submenu_indentation/"
   fi
-  prepare_grub_to_access_device "${GRUB_DEVICE}" | sed -e "s/^/\t/"| sed "s/^/$submenu_indentation/"
+  prepare_grub_to_access_device "${GRUB_DEVICE}" | grub_add_tab| sed "s/^/$submenu_indentation/"
   message="$(gettext_printf "Loading the Hurd ...")"
   if [ x$type = xrecovery ] ; then
       opts=
@@ -158,7 +158,7 @@ do
 
   if [ "x$is_first_entry" = xtrue ]; then
       hurd_entry "$kernel" simple
-      submenu_indentation="\t"
+      submenu_indentation="$grub_tab"
     
       # TRANSLATORS: %s is replaced with an OS name
       echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'gnuhurd-advanced-$(grub_get_device_id "${GRUB_DEVICE_BOOT}")' {"
index 2477466db1f56c458dc859adca4a248a083b44ac..0de616e8956b669687609c9cc789af018929defd 100644 (file)
@@ -35,8 +35,8 @@ case "${GRUB_DISTRIBUTOR}" in
 esac
 
 echo "menuentry '$(echo "$OS" | grub_quote)' ${CLASS} \$menuentry_id_option 'illumos-$(grub_get_device_id "${GRUB_DEVICE_BOOT}")' {"
-save_default_entry | sed -e "s/^/\t/"
-prepare_grub_to_access_device "${GRUB_DEVICE_BOOT}" | sed -e "s/^/\t/"
+save_default_entry | grub_add_tab
+prepare_grub_to_access_device "${GRUB_DEVICE_BOOT}" | grub_add_tab
 message="$(gettext_printf "Loading kernel of Illumos ...")"
   cat << EOF
        insmod gzio
index b0e84e2bf5691783a44b593353596ea18931e949..260dda8cb07777c12198e695d0abf0719473d129 100644 (file)
@@ -54,7 +54,7 @@ load_kfreebsd_module ()
   fi
 
   if [ -z "${prepare_module_dir_cache}" ]; then
-    prepare_module_dir_cache="$(prepare_grub_to_access_device $(grub-probe -t device "${module_dir}") | sed -e "s/^/\t/")"
+    prepare_module_dir_cache="$(prepare_grub_to_access_device $(grub-probe -t device "${module_dir}") | grub_add_tab)"
   fi
 
   printf '%s\n' "${prepare_module_dir_cache}"
@@ -91,10 +91,10 @@ kfreebsd_entry ()
       echo "menuentry '$(echo "$OS" | grub_quote)' ${CLASS} \$menuentry_id_option 'kfreebsd-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
   fi
   if [ x$type != xrecovery ] ; then
-      save_default_entry | sed -e "s/^/\t/" | sed "s/^/$submenu_indentation/"
+      save_default_entry | grub_add_tab | sed "s/^/$submenu_indentation/"
   fi
   if [ -z "${prepare_boot_cache}" ]; then
-    prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
+    prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | grub_add_tab)"
   fi
 
   printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
@@ -213,7 +213,7 @@ while [ "x$list" != "x" ] ; do
 
   if [ "x$is_first_entry" = xtrue ]; then
       kfreebsd_entry "${OS}" "${version}" simple
-      submenu_indentation="\t"
+      submenu_indentation="$grub_tab"
     
       if [ -z "$boot_device_id" ]; then
          boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
index 35f7a8371b6281dad72e291292f44f216cffc251..0724e16e726b66c84c12a888f1bfede9633d2000 100644 (file)
@@ -101,7 +101,7 @@ linux_entry ()
       echo "menuentry '$(echo "$os" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
   fi      
   if [ x$type != xrecovery ] ; then
-      save_default_entry | sed -e "s/^/\t/"
+      save_default_entry | grub_add_tab
   fi
 
   # Use ELILO's generic "efifb" when it's known to be available.
@@ -123,12 +123,12 @@ linux_entry ()
 
   if [ x$dirname = x/ ]; then
     if [ -z "${prepare_root_cache}" ]; then
-      prepare_root_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/")"
+      prepare_root_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE} | grub_add_tab)"
     fi
     printf '%s\n' "${prepare_root_cache}" | sed "s/^/$submenu_indentation/"
   else
     if [ -z "${prepare_boot_cache}" ]; then
-      prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
+      prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | grub_add_tab)"
     fi
     printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
   fi
@@ -230,7 +230,7 @@ while [ "x$list" != "x" ] ; do
     linux_entry "${OS}" "${version}" simple \
     "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
 
-    submenu_indentation="\t"
+    submenu_indentation="$grub_tab"
     
     if [ -z "$boot_device_id" ]; then
        boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
index 65275d79ad4398c2fe4facb91e8b904f26373499..b76332b302019c32cae508acf18f5e91c7e8d7b3 100644 (file)
@@ -77,10 +77,10 @@ netbsd_load_fs_module ()
   prepare_grub_to_access_device $(${grub_probe} -t device "${kmodule}") | sed -e 's,^, ,'
   case "${loader}" in
     knetbsd)
-      printf "\tknetbsd_module_elf %s\n" "${kmodule_rel}"
+      printf "$grub_tabknetbsd_module_elf %s\n" "${kmodule_rel}"
       ;;
     multiboot)
-      printf "\tmodule %s\n" "${kmodule_rel}"
+      printf "$grub_tabmodule %s\n" "${kmodule_rel}"
       ;;
   esac
 }
@@ -121,11 +121,11 @@ netbsd_entry ()
   printf "%s\n" "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
   case "${loader}" in
     knetbsd)
-      printf "\tknetbsd %s -r %s %s\n" \
+      printf "$grub_tabknetbsd %s -r %s %s\n" \
         "${kernel}" "${kroot_device}" "${GRUB_CMDLINE_NETBSD} ${args}" | sed "s/^/$submenu_indentation/"
       ;;
     multiboot)
-      printf "\tmultiboot %s %s root=%s %s\n" \
+      printf "$grub_tabmultiboot %s %s root=%s %s\n" \
         "${kernel}" "${kernel}" "${kroot_device}" "${GRUB_CMDLINE_NETBSD} ${args}" | sed "s/^/$submenu_indentation/"
       ;;
   esac
@@ -159,7 +159,7 @@ for k in $(ls -t /netbsd*) ; do
 
   if [ "x$is_first_entry" = xtrue ]; then
       netbsd_entry "knetbsd"   "$k" simple "${GRUB_CMDLINE_NETBSD_DEFAULT}"
-    submenu_indentation="\t"
+    submenu_indentation="$grub_tab"
     
     if [ -z "$boot_device_id" ]; then
        boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
index e5839cd29f48af37e3724876e403330532037574..9025914f6cf55c3ae4d4da176b4dc2d4ea2d38a1 100644 (file)
@@ -45,7 +45,7 @@ get_os_name_from_boot_ini ()
     sort | uniq | wc -l`" = 1 || return 1
 
   # Search 'default=PARTITION'
-  get_os_name_from_boot_ini_part=`sed -n 's,^default=,,p' "$1" | sed 's,\\\\,/,g;s,[ \t\r]*$,,;1q'`
+  get_os_name_from_boot_ini_part=`sed -n 's,^default=,,p' "$1" | sed 's,\\\\,/,g;s,[ $grub_tab\r]*$,,;1q'`
   test -n "$get_os_name_from_boot_ini_part" || return 1
 
   # Search 'PARTITION="NAME" ...'
@@ -87,8 +87,8 @@ for drv in $drives ; do
 menuentry '$(echo "$OS" | grub_quote)' \$menuentry_id_option '$osid-$(grub_get_device_id "${dev}")' {
 EOF
 
-  save_default_entry | sed -e 's,^,\t,'
-  prepare_grub_to_access_device "$dev" | sed 's,^,\t,'
+  save_default_entry | sed -e 's,^,$grub_tab,'
+  prepare_grub_to_access_device "$dev" | sed 's,^,$grub_tab,'
   test -z "$needmap" || cat <<EOF
        drivemap -s (hd0) \$root
 EOF
index 55a9546f3e3bcb967fbee3b2958278e8aac87feb..4270385f3d1785f6cd6631358ead6ff118c53b06 100644 (file)
@@ -39,8 +39,8 @@ osx_entry() {
         cat << EOF
 menuentry '$(echo "Darwin/Mac OS X $bitstr $onstr" | grub_quote)' --class osx --class darwin --class os \$menuentry_id_option 'osprober-xnu-$2-$(grub_get_device_id "${GRUB_DEVICE}")'  {
 EOF
-       save_default_entry | sed -e "s/^/       /"
-       prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/     /"
+       save_default_entry | grub_add_tab
+       prepare_grub_to_access_device ${GRUB_DEVICE} | grub_add_tab
        cat << EOF
         load_video
         set do_resume=0
index 33f159220e1409e0cecd45b5f7f72352666bb384..d4d01100e90f17c60f181f01c2ffe9234d45dbce 100644 (file)
@@ -110,11 +110,11 @@ linux_entry ()
       echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'xen-gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
   fi
   if [ x$type != xrecovery ] ; then
-      save_default_entry | sed -e "s/^/\t/" | sed "s/^/$submenu_indentation/"
+      save_default_entry | grub_add_tab | sed "s/^/$submenu_indentation/"
   fi
 
   if [ -z "${prepare_boot_cache}" ]; then
-    prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
+    prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | grub_add_tab)"
   fi
   printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
   xmessage="$(gettext_printf "Loading Xen %s ..." ${xen_version})"
@@ -236,7 +236,7 @@ while [ "x${xen_list}" != "x" ] ; do
            linux_entry "${OS}" "${version}" "${xen_version}" simple \
                "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
 
-           submenu_indentation="\t\t"
+           submenu_indentation="$grub_tab$grub_tab"
     
            if [ -z "$boot_device_id" ]; then
                boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
index bcc6c2524ded3b002cd7db2f7294d291608cb6e3..bf47dc3b6d0db99ed083c7fd97025ead8e37cb8f 100644 (file)
@@ -54,8 +54,8 @@ osx_entry() {
         cat << EOF
 menuentry '$(echo "${LONGNAME} $bitstr $onstr" | grub_quote)' --class osx --class darwin --class os \$menuentry_id_option 'osprober-xnu-$2-$(grub_get_device_id "${DEVICE}")'  {
 EOF
-       save_default_entry | sed -e "s/^/\t/"
-       prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
+       save_default_entry | grub_add_tab
+       prepare_grub_to_access_device ${DEVICE} | grub_add_tab
        cat << EOF
         load_video
         set do_resume=0
@@ -126,8 +126,8 @@ for OS in ${OSPROBED} ; do
       cat << EOF
 menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows --class os \$menuentry_id_option 'osprober-chain-$(grub_get_device_id "${DEVICE}")' {
 EOF
-      save_default_entry | sed -e "s/^/\t/"
-      prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
+      save_default_entry | grub_add_tab
+      prepare_grub_to_access_device ${DEVICE} | grub_add_tab
 
       case ${LONGNAME} in
        Windows\ Vista*|Windows\ 7*|Windows\ Server\ 2008*)
@@ -181,14 +181,14 @@ EOF
        used_osprober_linux_ids="$used_osprober_linux_ids 'osprober-gnulinux-$LKERNEL-${recovery_params}-$counter-$boot_device_id'"
 
        if [ -z "${prepare_boot_cache}" ]; then
-         prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | sed -e "s/^/\t/")"
+         prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | grub_add_tab)"
        fi
 
        if [ "x$is_first_entry" = xtrue ]; then
             cat << EOF
 menuentry '$(echo "$OS" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' {
 EOF
-           save_default_entry | sed -e "s/^/\t/"
+           save_default_entry | grub_add_tab
            printf '%s\n' "${prepare_boot_cache}"
            cat <<  EOF
        linux ${LKERNEL} ${LPARAMS}
@@ -208,8 +208,8 @@ EOF
         cat << EOF
        menuentry '$(echo "$title" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-$LKERNEL-${recovery_params}-$boot_device_id' {
 EOF
-       save_default_entry | sed -e "s/^/\t\t/"
-       printf '%s\n' "${prepare_boot_cache}" | sed -e "s/^/\t/"
+       save_default_entry | sed -e "s/^/$grub_tab$grub_tab/"
+       printf '%s\n' "${prepare_boot_cache}" | grub_add_tab
        cat <<  EOF
                linux ${LKERNEL} ${LPARAMS}
 EOF
@@ -243,8 +243,8 @@ EOF
       cat << EOF
 menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class hurd --class gnu --class os \$menuentry_id_option 'osprober-gnuhurd-/boot/gnumach.gz-false-$(grub_get_device_id "${DEVICE}")' {
 EOF
-      save_default_entry | sed -e "s/^/\t/"
-      prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
+      save_default_entry | grub_add_tab
+      prepare_grub_to_access_device ${DEVICE} | grub_add_tab
       grub_device="`${grub_probe} --device ${DEVICE} --target=drive`"
       mach_device="`echo "${grub_device}" | sed -e 's/(\(hd.*\),msdos\(.*\))/\1s\2/'`"
       grub_fs="`${grub_probe} --device ${DEVICE} --target=fs`"