[2048] 2009-03-29 Robert Millan <[email protected]>

Robert Millan <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 2048
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2048
Author:   robertmh
Date:     2009-03-29 02:23:12 +0000 (Sun, 29 Mar 2009)
Log Message:
-----------
2009-03-29  Robert Millan  <[email protected]>

        * util/grub.d/10_linux.in (linux_entry): New function.
        Factorize generation of Linux boot entries.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/util/grub.d/10_linux.in

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-03-28 19:58:15 UTC (rev 2047)
+++ trunk/grub2/ChangeLog	2009-03-29 02:23:12 UTC (rev 2048)
@@ -1,3 +1,8 @@
+2009-03-29  Robert Millan  <[email protected]>
+
+	* util/grub.d/10_linux.in (linux_entry): New function.
+	Factorize generation of Linux boot entries.
+
 2009-03-29  Yoshinori K. Okuji  <[email protected]>
 
 	Make the format of Environment Block plain text. The boot loader

Modified: trunk/grub2/util/grub.d/10_linux.in
===================================================================
--- trunk/grub2/util/grub.d/10_linux.in	2009-03-28 19:58:15 UTC (rev 2047)
+++ trunk/grub2/util/grub.d/10_linux.in	2009-03-29 02:23:12 UTC (rev 2048)
@@ -93,6 +93,25 @@
   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 @@
     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
+  linux_entry "${OS}, linux ${version}" \
+      "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+  linux_entry "${OS}, linux ${version} (recovery mode)" \
+      "single ${GRUB_CMDLINE_LINUX}"
 
-  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
-
   list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
 done
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.