]> git.proxmox.com Git - grub2.git/commitdiff
2009-03-29 Robert Millan <rmh@aybabtu.com>
authorrobertmh <robertmh@localhost>
Sun, 29 Mar 2009 02:23:12 +0000 (02:23 +0000)
committerrobertmh <robertmh@localhost>
Sun, 29 Mar 2009 02:23:12 +0000 (02:23 +0000)
        * util/grub.d/10_linux.in (linux_entry): New function.
        Factorize generation of Linux boot entries.

ChangeLog
util/grub.d/10_linux.in

index 1c4cefc5ced0b76790ab78ed7801e05831ef2783..f1f03f3ff8a56466f7a35822fc2d6e349e7473d4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-03-29  Robert Millan  <rmh@aybabtu.com>
+
+       * util/grub.d/10_linux.in (linux_entry): New function.
+       Factorize generation of Linux boot entries.
+
 2009-03-29  Yoshinori K. Okuji  <okuji@enbug.org>
 
        Make the format of Environment Block plain text. The boot loader
index 010660f687bf598681e18c249705a35601c48ec3..c2da413809ea5b4c39433269aeae85c5cfd1750a 100644 (file)
@@ -93,6 +93,25 @@ find_latest ()
   echo "$a"
 }
 
+linux_entry ()
+{
+  cat << EOF
+menuentry "$1" {
+EOF
+  prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
+  cat << EOF
+       linux   ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro $2
+EOF
+  if test -n "${initrd}" ; then
+    cat << EOF
+       initrd  ${rel_dirname}/${initrd}
+EOF
+  fi
+  cat << EOF
+}
+EOF
+}
+
 list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do
         if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
       done`
@@ -122,37 +141,10 @@ while [ "x$list" != "x" ] ; do
     linux_root_device_thisversion=${GRUB_DEVICE}
   fi
 
-  cat << EOF
-menuentry "${OS}, linux ${version}" {
-EOF
-  prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
-  cat << EOF
-       linux   ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}
-EOF
-  if test -n "${initrd}" ; then
-    cat << EOF
-       initrd  ${rel_dirname}/${initrd}
-EOF
-  fi
-  cat << EOF
-}
-EOF
-
-  cat << EOF
-menuentry "${OS}, linux ${version} (recovery mode)" {
-EOF
-  prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
-  cat << EOF
-       linux   ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro single ${GRUB_CMDLINE_LINUX}
-EOF
-  if test -n "${initrd}" ; then
-    cat << EOF
-       initrd  ${rel_dirname}/${initrd}
-EOF
-  fi
-  cat << EOF
-}
-EOF
+  linux_entry "${OS}, linux ${version}" \
+      "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+  linux_entry "${OS}, linux ${version} (recovery mode)" \
+      "single ${GRUB_CMDLINE_LINUX}"
 
   list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
 done