Blame SOURCES/0048-Fix-some-coverity-concerns.patch

903092
From 916d5770b5c8fb87503a99f98c13a5232a7dafbf Mon Sep 17 00:00:00 2001
903092
From: Peter Jones <pjones@redhat.com>
903092
Date: Thu, 10 Sep 2015 10:13:15 -0400
903092
Subject: [PATCH] Fix some coverity concerns...
903092
903092
While checking on coverity's concern with kwcmp() having a loop it
903092
really didn't need, I discovered another problem with the fix here that
903092
made spaces not work right in grub2 variable assignment.  So here's a
903092
new version of the fix, and yet another test case.
903092
903092
Resolves: rhbz#1152550
903092
903092
Signed-off-by: Peter Jones <pjones@redhat.com>
903092
---
903092
 grubby.c                 | 204 ++++++++++++++++++++++++++++++++++++-----------
903092
 test.sh                  |   6 ++
903092
 test/grub2.17            | 156 ++++++++++++++++++++++++++++++++++++
903092
 test/results/add/g2-1.17 | 170 +++++++++++++++++++++++++++++++++++++++
903092
 4 files changed, 490 insertions(+), 46 deletions(-)
903092
 create mode 100644 test/grub2.17
903092
 create mode 100644 test/results/add/g2-1.17
903092
903092
diff --git a/grubby.c b/grubby.c
903092
index d66c1c5..2a6eedb 100644
903092
--- a/grubby.c
903092
+++ b/grubby.c
903092
@@ -751,28 +751,30 @@ static char *sdupprintf(const char *format, ...)
903092
 static inline int
903092
 kwcmp(struct keywordTypes *kw, const char * label, int case_insensitive)
903092
 {
903092
-    int kwl = strlen(kw->key);
903092
-    int ll = strlen(label);
903092
-    int rc;
903092
-    int (*snc)(const char *s1, const char *s2, size_t n) =
903092
-           case_insensitive ? strncasecmp : strncmp;
903092
-    int (*sc)(const char *s1, const char *s2) =
903092
-           case_insensitive ? strcasecmp : strcmp;
903092
-
903092
-    rc = snc(kw->key, label, kwl);
903092
-    if (rc)
903092
-       return rc;
903092
-
903092
-    for (int i = kwl; i < ll; i++) {
903092
-       if (isspace(label[i]))
903092
-           return 0;
903092
-       if (kw->separatorChar && label[i] == kw->separatorChar)
903092
-           return 0;
903092
-       else if (kw->nextChar && label[i] == kw->nextChar)
903092
-           return 0;
903092
-       return sc(kw->key+kwl, label+kwl);
903092
-    }
903092
-    return 0;
903092
+	int kwl = strlen(kw->key);
903092
+	int ll = strlen(label);
903092
+	int rc;
903092
+	int (*snc)(const char *s1, const char *s2, size_t n) =
903092
+		case_insensitive ? strncasecmp : strncmp;
903092
+	int (*sc)(const char *s1, const char *s2) =
903092
+		case_insensitive ? strcasecmp : strcmp;
903092
+
903092
+	if (kwl > ll)
903092
+		return ll - kwl;
903092
+
903092
+	rc = snc(kw->key, label, kwl);
903092
+	if (rc)
903092
+		return rc;
903092
+
903092
+	if (!label[kwl])
903092
+		return 0;
903092
+	if (isspace(label[kwl]))
903092
+		return 0;
903092
+	if (kw->separatorChar && label[kwl] == kw->separatorChar)
903092
+		return 0;
903092
+	if (kw->nextChar && label[kwl] == kw->nextChar)
903092
+		return 0;
903092
+	return sc(kw->key+kwl, label+kwl);
903092
 }
903092
 
903092
 static enum lineType_e preferredLineType(enum lineType_e type,
903092
@@ -1034,6 +1036,123 @@ static int lineWrite(FILE * out, struct singleLine *line,
903092
 	return 0;
903092
 }
903092
 
903092
+static int mergeElements(struct singleLine *line, int left, int right)
903092
+{
903092
+	struct lineElement *elements = alloca(sizeof (line->elements[0]) *
903092
+					      line->numElements);
903092
+	int i, j;
903092
+	size_t itemsize = 0;
903092
+	size_t newNumElements = 0;
903092
+	char *newitem;
903092
+	char *newindent = NULL;
903092
+
903092
+	if (right >= line->numElements)
903092
+		right = line->numElements - 1;
903092
+
903092
+	if (!elements)
903092
+		return -1;
903092
+	for (i = 0; i < left; i++) {
903092
+		elements[i] = line->elements[i];
903092
+		newNumElements++;
903092
+	}
903092
+	for (; i <= right; i++) {
903092
+		itemsize += strlen(line->elements[i].item);
903092
+		if (line->elements[i].indent && line->elements[i].indent[0]) {
903092
+			if (i != right)
903092
+				itemsize += strlen(line->elements[i].indent);
903092
+		}
903092
+	}
903092
+	newitem = calloc (itemsize+1, 1);
903092
+	if (!newitem)
903092
+		return -1;
903092
+	for (i = left; i <= right; i++) {
903092
+		strcat(newitem, line->elements[i].item);
903092
+		if (line->elements[i].indent) {
903092
+			if (i != right) {
903092
+				strcat(newitem, line->elements[i].indent);
903092
+				free(line->elements[i].indent);
903092
+			} else {
903092
+				newindent = line->elements[i].indent;
903092
+			}
903092
+		} else {
903092
+			newindent = strdup("");
903092
+		}
903092
+	}
903092
+	newNumElements++;
903092
+	elements[left].item = newitem;
903092
+	elements[left].indent = newindent;
903092
+	if (left+1 < line->numElements && right+1 < line->numElements) {
903092
+		for (j = left+1, i = right+1; i < line->numElements; i++) {
903092
+			elements[j++] = line->elements[i];
903092
+			newNumElements++;
903092
+		}
903092
+	}
903092
+	memcpy(line->elements, elements,
903092
+	       sizeof (line->elements[i]) * newNumElements);
903092
+	line->numElements = newNumElements;
903092
+	return 0;
903092
+}
903092
+
903092
+static int emptyElement(struct lineElement *element)
903092
+{
903092
+	if (element->item && strlen(element->item) > 0)
903092
+		return 0;
903092
+	if (element->indent && strlen(element->indent) > 0)
903092
+		return 0;
903092
+	return 1;
903092
+}
903092
+
903092
+static int splitElement(struct singleLine *line, int element, int splitchar)
903092
+{
903092
+	struct lineElement split[2] = {{0,0},{0,0}};
903092
+	struct lineElement *elements = NULL;
903092
+	int saved_errno;
903092
+	int i, j;
903092
+
903092
+	elements = calloc(line->numElements + 1, sizeof (line->elements[0]));
903092
+	if (!elements)
903092
+		return -1;
903092
+
903092
+	split[0].item = strndup(line->elements[element].item, splitchar);
903092
+	if (!split[0].item)
903092
+		goto err;
903092
+	split[0].indent = strndup(&line->elements[element].item[splitchar], 1);
903092
+	if (!split[0].indent)
903092
+		goto err;
903092
+	split[1].item = strdup(&line->elements[element].item[splitchar+1]);
903092
+	if (!split[1].item)
903092
+		goto err;
903092
+	split[1].indent = line->elements[element].indent;
903092
+
903092
+	for (i = j = 0; i < line->numElements; i++) {
903092
+		if (i != element) {
903092
+			memcpy(&elements[j++], &line->elements[i],
903092
+			       sizeof(line->elements[i]));
903092
+		} else {
903092
+			memcpy(&elements[j++], &split[0], sizeof(split[0]));
903092
+			memcpy(&elements[j++], &split[1], sizeof(split[1]));
903092
+			free(line->elements[i].item);
903092
+		}
903092
+	}
903092
+	free(line->elements);
903092
+	line->elements = elements;
903092
+	line->numElements++;
903092
+
903092
+	return 0;
903092
+err:
903092
+	saved_errno = errno;
903092
+	if (split[0].item)
903092
+		free(split[0].item);
903092
+	if (split[0].indent)
903092
+		free(split[0].indent);
903092
+	if (split[1].item)
903092
+		free(split[1].item);
903092
+	if (elements)
903092
+		free(elements);
903092
+	errno = saved_errno;
903092
+	return -1;
903092
+}
903092
+
903092
 /* we've guaranteed that the buffer ends w/ \n\0 */
903092
 static int getNextLine(char **bufPtr, struct singleLine *line,
903092
 		       struct configFileInfo *cfi)
903092
@@ -1208,34 +1327,27 @@ static int getNextLine(char **bufPtr, struct singleLine *line,
903092
 			 * yet a third way to avoid rhbz# XXX FIXME :/
903092
 			 */
903092
 			char *eq;
903092
-			int l;
903092
-			int numElements = line->numElements;
903092
-			struct lineElement *newElements;
903092
+			int rc;
903092
+			rc = mergeElements(line, 2, line->numElements);
903092
+			if (rc < 0)
903092
+				return rc;
903092
 			eq = strchr(line->elements[1].item, '=');
903092
 			if (!eq)
903092
 				return 0;
903092
-			l = eq - line->elements[1].item;
903092
-			if (eq[1] != 0)
903092
-				numElements++;
903092
-			newElements = calloc(numElements,sizeof (*newElements));
903092
-			memcpy(&newElements[0], &line->elements[0],
903092
-			       sizeof (newElements[0]));
903092
-			newElements[1].item =
903092
-				strndup(line->elements[1].item, l);
903092
-			newElements[1].indent = "=";
903092
-			*(eq++) = '\0';
903092
-			newElements[2].item = strdup(eq);
903092
-			free(line->elements[1].item);
903092
-			if (line->elements[1].indent)
903092
-				newElements[2].indent = line->elements[1].indent;
903092
-			for (int i = 2; i < line->numElements; i++) {
903092
-				newElements[i+1].item = line->elements[i].item;
903092
-				newElements[i+1].indent =
903092
-					line->elements[i].indent;
903092
+			rc = splitElement(line, 1, eq-line->elements[1].item);
903092
+			if (rc < 0)
903092
+				return rc;
903092
+			/* now make sure we haven't got any bogus elements at
903092
+			 * the end that don't mean anything.
903092
+			 */
903092
+			while (line->numElements > 1 &&
903092
+			       emptyElement(
903092
+					&line->elements[line->numElements-1])) {
903092
+				rc = mergeElements(line, line->numElements-2,
903092
+						   line->numElements-1);
903092
+				if (rc < 0)
903092
+					return rc;
903092
 			}
903092
-			free(line->elements);
903092
-			line->elements = newElements;
903092
-			line->numElements = numElements;
903092
 		}
903092
 	}
903092
 
903092
diff --git a/test.sh b/test.sh
903092
index ba466a5..d488333 100755
903092
--- a/test.sh
903092
+++ b/test.sh
903092
@@ -551,6 +551,12 @@ if [ "$testgrub2" == "y" ]; then
903092
         --copy-default --title 'Red Hat Enterprise Linux Server' \
903092
         --args=root=/dev/mapper/foo--
903092
 
903092
+    # the same, but for: set foo = " bar=1,2 "
903092
+    grub2Test grub2.17 add/g2-1.17 \
903092
+        --boot-filesystem=/boot --add-kernel=/boot/vmlinuz-foo \
903092
+        --copy-default --title 'Red Hat Enterprise Linux Server' \
903092
+        --args=root=/dev/mapper/foo--
903092
+
903092
     testing="GRUB2 add initrd"
903092
     grub2Test grub2.2 add/g2-1.4 --update-kernel=/boot/new-kernel.img \
903092
         --initrd=/boot/new-initrd --boot-filesystem=/boot/
903092
diff --git a/test/grub2.17 b/test/grub2.17
903092
new file mode 100644
903092
index 0000000..bd8c9c5
903092
--- /dev/null
903092
+++ b/test/grub2.17
903092
@@ -0,0 +1,156 @@
903092
+#
903092
+# DO NOT EDIT THIS FILE
903092
+#
903092
+# It is automatically generated by grub2-mkconfig using templates
903092
+# from /etc/grub.d and settings from /etc/default/grub
903092
+#
903092
+
903092
+### BEGIN /etc/grub.d/00_header ###
903092
+set pager=1
903092
+
903092
+if [ -s $prefix/grubenv ]; then
903092
+  load_env
903092
+fi
903092
+if [ "${next_entry}" ] ; then
903092
+   set default="${next_entry}"
903092
+   set next_entry=
903092
+   save_env next_entry
903092
+   set boot_once=true
903092
+else
903092
+   set default="${saved_entry}"
903092
+fi
903092
+
903092
+if [ x"${feature_menuentry_id}" = xy ]; then
903092
+  menuentry_id_option="--id"
903092
+else
903092
+  menuentry_id_option=""
903092
+fi
903092
+
903092
+export menuentry_id_option
903092
+
903092
+if [ "${prev_saved_entry}" ]; then
903092
+  set saved_entry="${prev_saved_entry}"
903092
+  save_env saved_entry
903092
+  set prev_saved_entry=
903092
+  save_env prev_saved_entry
903092
+  set boot_once=true
903092
+fi
903092
+
903092
+function savedefault {
903092
+  if [ -z "${boot_once}" ]; then
903092
+    saved_entry="${chosen}"
903092
+    save_env saved_entry
903092
+  fi
903092
+}
903092
+
903092
+function load_video {
903092
+  if [ x$feature_all_video_module = xy ]; then
903092
+    insmod all_video
903092
+  else
903092
+    insmod efi_gop
903092
+    insmod efi_uga
903092
+    insmod ieee1275_fb
903092
+    insmod vbe
903092
+    insmod vga
903092
+    insmod video_bochs
903092
+    insmod video_cirrus
903092
+  fi
903092
+}
903092
+
903092
+serial --speed=115200
903092
+terminal_input serial console
903092
+terminal_output serial console
903092
+if [ x$feature_timeout_style = xy ] ; then
903092
+  set timeout_style=menu
903092
+  set timeout=5
903092
+# Fallback normal timeout code in case the timeout_style feature is
903092
+# unavailable.
903092
+else
903092
+  set timeout=5
903092
+fi
903092
+### END /etc/grub.d/00_header ###
903092
+
903092
+### BEGIN /etc/grub.d/00_tuned ###
903092
+set  tuned_params= " isolcpus=1,3 "
903092
+### END /etc/grub.d/00_tuned ###
903092
+
903092
+### BEGIN /etc/grub.d/01_users ###
903092
+if [ -f ${prefix}/user.cfg ]; then
903092
+  source ${prefix}/user.cfg
903092
+  if [ -n ${GRUB2_PASSWORD} ]; then
903092
+    set superusers="root"
903092
+    export superusers
903092
+    password_pbkdf2 root ${GRUB2_PASSWORD}
903092
+  fi
903092
+fi
903092
+### END /etc/grub.d/01_users ###
903092
+
903092
+### BEGIN /etc/grub.d/10_linux ###
903092
+menuentry 'Red Hat Enterprise Linux Server (3.10.0-297.el7.x86_64) 7.2 (Maipo)' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-296.el7.x86_64-advanced-ae7b3742-9092-4432-9f7f-8abdbf0dc3db' {
903092
+	load_video
903092
+	set gfxpayload=keep
903092
+	insmod gzio
903092
+	insmod part_msdos
903092
+	insmod xfs
903092
+	set root='hd0,msdos1'
903092
+	if [ x$feature_platform_search_hint = xy ]; then
903092
+	  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  cae02b39-f239-4d26-9032-674d261c93d8
903092
+	else
903092
+	  search --no-floppy --fs-uuid --set=root cae02b39-f239-4d26-9032-674d261c93d8
903092
+	fi
903092
+	linux16 /vmlinuz-3.10.0-297.el7.x86_64 root=/dev/mapper/rhel_hp--dl380pgen8--02--vm--10-root ro crashkernel=auto rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/root rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/swap console=ttyS0,115200n81  $tuned_params LANG=en_US.UTF-8
903092
+}
903092
+menuentry 'Red Hat Enterprise Linux Server (3.10.0-296.el7.x86_64) 7.2 (Maipo)' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-296.el7.x86_64-advanced-ae7b3742-9092-4432-9f7f-8abdbf0dc3db' {
903092
+	load_video
903092
+	set gfxpayload=keep
903092
+	insmod gzio
903092
+	insmod part_msdos
903092
+	insmod xfs
903092
+	set root='hd0,msdos1'
903092
+	if [ x$feature_platform_search_hint = xy ]; then
903092
+	  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  cae02b39-f239-4d26-9032-674d261c93d8
903092
+	else
903092
+	  search --no-floppy --fs-uuid --set=root cae02b39-f239-4d26-9032-674d261c93d8
903092
+	fi
903092
+	linux16 /vmlinuz-3.10.0-296.el7.x86_64 root=/dev/mapper/rhel_hp--dl380pgen8--02--vm--10-root ro crashkernel=auto rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/root rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/swap console=ttyS0,115200n81  $tuned_params
903092
+	initrd16 /initramfs-3.10.0-296.el7.x86_64.img
903092
+}
903092
+menuentry 'Red Hat Enterprise Linux Server (0-rescue-cc21b92886f9ebbd3ed5a494639b7fd7) 7.2 (Maipo)' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-cc21b92886f9ebbd3ed5a494639b7fd7-advanced-ae7b3742-9092-4432-9f7f-8abdbf0dc3db' {
903092
+	load_video
903092
+	insmod gzio
903092
+	insmod part_msdos
903092
+	insmod xfs
903092
+	set root='hd0,msdos1'
903092
+	if [ x$feature_platform_search_hint = xy ]; then
903092
+	  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  cae02b39-f239-4d26-9032-674d261c93d8
903092
+	else
903092
+	  search --no-floppy --fs-uuid --set=root cae02b39-f239-4d26-9032-674d261c93d8
903092
+	fi
903092
+	linux16 /vmlinuz-0-rescue-cc21b92886f9ebbd3ed5a494639b7fd7 root=/dev/mapper/rhel_hp--dl380pgen8--02--vm--10-root ro crashkernel=auto rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/root rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/swap console=ttyS0,115200n81  $tuned_params
903092
+	initrd16 /initramfs-0-rescue-cc21b92886f9ebbd3ed5a494639b7fd7.img
903092
+}
903092
+if [ "x$default" = 'Red Hat Enterprise Linux Server (3.10.0-296.el7.x86_64) 7.2 (Maipo)' ]; then default='Advanced options for Red Hat Enterprise Linux Server>Red Hat Enterprise Linux Server (3.10.0-296.el7.x86_64) 7.2 (Maipo)'; fi;
903092
+### END /etc/grub.d/10_linux ###
903092
+
903092
+### BEGIN /etc/grub.d/20_linux_xen ###
903092
+### END /etc/grub.d/20_linux_xen ###
903092
+
903092
+### BEGIN /etc/grub.d/20_ppc_terminfo ###
903092
+### END /etc/grub.d/20_ppc_terminfo ###
903092
+
903092
+### BEGIN /etc/grub.d/30_os-prober ###
903092
+### END /etc/grub.d/30_os-prober ###
903092
+
903092
+### BEGIN /etc/grub.d/40_custom ###
903092
+# This file provides an easy way to add custom menu entries.  Simply type the
903092
+# menu entries you want to add after this comment.  Be careful not to change
903092
+# the 'exec tail' line above.
903092
+### END /etc/grub.d/40_custom ###
903092
+
903092
+### BEGIN /etc/grub.d/41_custom ###
903092
+if [ -f  ${config_directory}/custom.cfg ]; then
903092
+  source ${config_directory}/custom.cfg
903092
+elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
903092
+  source $prefix/custom.cfg;
903092
+fi
903092
+### END /etc/grub.d/41_custom ###
903092
diff --git a/test/results/add/g2-1.17 b/test/results/add/g2-1.17
903092
new file mode 100644
903092
index 0000000..afb151d
903092
--- /dev/null
903092
+++ b/test/results/add/g2-1.17
903092
@@ -0,0 +1,170 @@
903092
+#
903092
+# DO NOT EDIT THIS FILE
903092
+#
903092
+# It is automatically generated by grub2-mkconfig using templates
903092
+# from /etc/grub.d and settings from /etc/default/grub
903092
+#
903092
+
903092
+### BEGIN /etc/grub.d/00_header ###
903092
+set pager=1
903092
+
903092
+if [ -s $prefix/grubenv ]; then
903092
+  load_env
903092
+fi
903092
+if [ "${next_entry}" ] ; then
903092
+   set default="${next_entry}"
903092
+   set next_entry=
903092
+   save_env next_entry
903092
+   set boot_once=true
903092
+else
903092
+   set default="${saved_entry}"
903092
+fi
903092
+
903092
+if [ x"${feature_menuentry_id}" = xy ]; then
903092
+  menuentry_id_option="--id"
903092
+else
903092
+  menuentry_id_option=""
903092
+fi
903092
+
903092
+export menuentry_id_option
903092
+
903092
+if [ "${prev_saved_entry}" ]; then
903092
+  set saved_entry="${prev_saved_entry}"
903092
+  save_env saved_entry
903092
+  set prev_saved_entry=
903092
+  save_env prev_saved_entry
903092
+  set boot_once=true
903092
+fi
903092
+
903092
+function savedefault {
903092
+  if [ -z "${boot_once}" ]; then
903092
+    saved_entry="${chosen}"
903092
+    save_env saved_entry
903092
+  fi
903092
+}
903092
+
903092
+function load_video {
903092
+  if [ x$feature_all_video_module = xy ]; then
903092
+    insmod all_video
903092
+  else
903092
+    insmod efi_gop
903092
+    insmod efi_uga
903092
+    insmod ieee1275_fb
903092
+    insmod vbe
903092
+    insmod vga
903092
+    insmod video_bochs
903092
+    insmod video_cirrus
903092
+  fi
903092
+}
903092
+
903092
+serial --speed=115200
903092
+terminal_input serial console
903092
+terminal_output serial console
903092
+if [ x$feature_timeout_style = xy ] ; then
903092
+  set timeout_style=menu
903092
+  set timeout=5
903092
+# Fallback normal timeout code in case the timeout_style feature is
903092
+# unavailable.
903092
+else
903092
+  set timeout=5
903092
+fi
903092
+### END /etc/grub.d/00_header ###
903092
+
903092
+### BEGIN /etc/grub.d/00_tuned ###
903092
+set  tuned_params= " isolcpus=1,3 "
903092
+### END /etc/grub.d/00_tuned ###
903092
+
903092
+### BEGIN /etc/grub.d/01_users ###
903092
+if [ -f ${prefix}/user.cfg ]; then
903092
+  source ${prefix}/user.cfg
903092
+  if [ -n ${GRUB2_PASSWORD} ]; then
903092
+    set superusers="root"
903092
+    export superusers
903092
+    password_pbkdf2 root ${GRUB2_PASSWORD}
903092
+  fi
903092
+fi
903092
+### END /etc/grub.d/01_users ###
903092
+
903092
+### BEGIN /etc/grub.d/10_linux ###
903092
+menuentry 'Red Hat Enterprise Linux Server' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-296.el7.x86_64-advanced-ae7b3742-9092-4432-9f7f-8abdbf0dc3db' {
903092
+	load_video
903092
+	set gfxpayload=keep
903092
+	insmod gzio
903092
+	insmod part_msdos
903092
+	insmod xfs
903092
+	set root='hd0,msdos1'
903092
+	if [ x$feature_platform_search_hint = xy ]; then
903092
+	  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  cae02b39-f239-4d26-9032-674d261c93d8
903092
+	else
903092
+	  search --no-floppy --fs-uuid --set=root cae02b39-f239-4d26-9032-674d261c93d8
903092
+	fi
903092
+	linux16 /vmlinuz-foo root=/dev/mapper/foo-- ro crashkernel=auto rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/root rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/swap console=ttyS0,115200n81  $tuned_params LANG=en_US.UTF-8
903092
+}
903092
+menuentry 'Red Hat Enterprise Linux Server (3.10.0-297.el7.x86_64) 7.2 (Maipo)' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-296.el7.x86_64-advanced-ae7b3742-9092-4432-9f7f-8abdbf0dc3db' {
903092
+	load_video
903092
+	set gfxpayload=keep
903092
+	insmod gzio
903092
+	insmod part_msdos
903092
+	insmod xfs
903092
+	set root='hd0,msdos1'
903092
+	if [ x$feature_platform_search_hint = xy ]; then
903092
+	  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  cae02b39-f239-4d26-9032-674d261c93d8
903092
+	else
903092
+	  search --no-floppy --fs-uuid --set=root cae02b39-f239-4d26-9032-674d261c93d8
903092
+	fi
903092
+	linux16 /vmlinuz-3.10.0-297.el7.x86_64 root=/dev/mapper/rhel_hp--dl380pgen8--02--vm--10-root ro crashkernel=auto rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/root rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/swap console=ttyS0,115200n81  $tuned_params LANG=en_US.UTF-8
903092
+}
903092
+menuentry 'Red Hat Enterprise Linux Server (3.10.0-296.el7.x86_64) 7.2 (Maipo)' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-296.el7.x86_64-advanced-ae7b3742-9092-4432-9f7f-8abdbf0dc3db' {
903092
+	load_video
903092
+	set gfxpayload=keep
903092
+	insmod gzio
903092
+	insmod part_msdos
903092
+	insmod xfs
903092
+	set root='hd0,msdos1'
903092
+	if [ x$feature_platform_search_hint = xy ]; then
903092
+	  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  cae02b39-f239-4d26-9032-674d261c93d8
903092
+	else
903092
+	  search --no-floppy --fs-uuid --set=root cae02b39-f239-4d26-9032-674d261c93d8
903092
+	fi
903092
+	linux16 /vmlinuz-3.10.0-296.el7.x86_64 root=/dev/mapper/rhel_hp--dl380pgen8--02--vm--10-root ro crashkernel=auto rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/root rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/swap console=ttyS0,115200n81  $tuned_params
903092
+	initrd16 /initramfs-3.10.0-296.el7.x86_64.img
903092
+}
903092
+menuentry 'Red Hat Enterprise Linux Server (0-rescue-cc21b92886f9ebbd3ed5a494639b7fd7) 7.2 (Maipo)' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-cc21b92886f9ebbd3ed5a494639b7fd7-advanced-ae7b3742-9092-4432-9f7f-8abdbf0dc3db' {
903092
+	load_video
903092
+	insmod gzio
903092
+	insmod part_msdos
903092
+	insmod xfs
903092
+	set root='hd0,msdos1'
903092
+	if [ x$feature_platform_search_hint = xy ]; then
903092
+	  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  cae02b39-f239-4d26-9032-674d261c93d8
903092
+	else
903092
+	  search --no-floppy --fs-uuid --set=root cae02b39-f239-4d26-9032-674d261c93d8
903092
+	fi
903092
+	linux16 /vmlinuz-0-rescue-cc21b92886f9ebbd3ed5a494639b7fd7 root=/dev/mapper/rhel_hp--dl380pgen8--02--vm--10-root ro crashkernel=auto rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/root rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/swap console=ttyS0,115200n81  $tuned_params
903092
+	initrd16 /initramfs-0-rescue-cc21b92886f9ebbd3ed5a494639b7fd7.img
903092
+}
903092
+if [ "x$default" = 'Red Hat Enterprise Linux Server (3.10.0-296.el7.x86_64) 7.2 (Maipo)' ]; then default='Advanced options for Red Hat Enterprise Linux Server>Red Hat Enterprise Linux Server (3.10.0-296.el7.x86_64) 7.2 (Maipo)'; fi;
903092
+### END /etc/grub.d/10_linux ###
903092
+
903092
+### BEGIN /etc/grub.d/20_linux_xen ###
903092
+### END /etc/grub.d/20_linux_xen ###
903092
+
903092
+### BEGIN /etc/grub.d/20_ppc_terminfo ###
903092
+### END /etc/grub.d/20_ppc_terminfo ###
903092
+
903092
+### BEGIN /etc/grub.d/30_os-prober ###
903092
+### END /etc/grub.d/30_os-prober ###
903092
+
903092
+### BEGIN /etc/grub.d/40_custom ###
903092
+# This file provides an easy way to add custom menu entries.  Simply type the
903092
+# menu entries you want to add after this comment.  Be careful not to change
903092
+# the 'exec tail' line above.
903092
+### END /etc/grub.d/40_custom ###
903092
+
903092
+### BEGIN /etc/grub.d/41_custom ###
903092
+if [ -f  ${config_directory}/custom.cfg ]; then
903092
+  source ${config_directory}/custom.cfg
903092
+elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
903092
+  source $prefix/custom.cfg;
903092
+fi
903092
+### END /etc/grub.d/41_custom ###
903092
-- 
903092
2.4.3
903092