1From 15f0572f2f456c2c1b700bc790d9ce7a5c13cc74 Mon Sep 17 00:00:00 2001
2From: Jackie Huang <jackie.huang@windriver.com>
3Date: Tue, 4 Aug 2015 23:54:41 -0700
4Subject: [PATCH] rename grub2-editenv to grub-editenv
5
6We don't use the name grub2-editenv for grub2.
7
8Upstream-Status: Inappropriate
9
10Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
11
12---
13 grubby.c | 4 ++--
14 test.sh  | 8 ++++----
15 2 files changed, 6 insertions(+), 6 deletions(-)
16
17diff --git a/grubby.c b/grubby.c
18index 396041a..3ceae69 100644
19--- a/grubby.c
20+++ b/grubby.c
21@@ -301,7 +301,7 @@ static char *grub2GetEnv(struct configFileInfo *info, char *name)
22 	char *ret = NULL;
23 	char *envFile = info->envFile ? info->envFile : "/boot/grub2/grubenv";
24 	int rc =
25-	    asprintf(&s, "grub2-editenv %s list | grep '^%s='", envFile, name);
26+	    asprintf(&s, "grub-editenv %s list | grep '^%s='", envFile, name);
27
28 	if (rc < 0)
29 		return NULL;
30@@ -373,7 +373,7 @@ static int grub2SetEnv(struct configFileInfo *info, char *name, char *value)
31 	if (!value)
32 		return -1;
33
34-	rc = asprintf(&s, "grub2-editenv %s set '%s=%s'", envFile, name, value);
35+	rc = asprintf(&s, "grub-editenv %s set '%s=%s'", envFile, name, value);
36 	free(value);
37 	if (rc < 0)
38 		return -1;
39diff --git a/test.sh b/test.sh
40index 33d24cf..009479c 100755
41--- a/test.sh
42+++ b/test.sh
43@@ -573,7 +573,7 @@ if [ "$testgrub2" == "y" ]; then
44         --remove-kernel=/boot/vmlinuz-2.6.38.2-9.fc15.x86_64 \
45         --boot-filesystem=/boot/
46     commandTest "saved_default output" \
47-        "grub2-editenv test/grub2-support_files/env_temp list" \
48+        "grub-editenv test/grub2-support_files/env_temp list" \
49         "saved_entry=Linux, with Fedora 2.6.38.8-32.fc15.x86_64"
50
51     # copy a stanza and add arguments as well, while using --set-index=
52@@ -627,7 +627,7 @@ if [ "$testgrub2" == "y" ]; then
53         --title='title' --initrd=/boot/new-initrd --boot-filesystem=/boot/ \
54         --copy-default
55     commandTest "saved_default output" \
56-        "grub2-editenv test/grub2-support_files/env_temp list" \
57+        "grub-editenv test/grub2-support_files/env_temp list" \
58         "saved_entry=Linux, with Fedora 2.6.38.8-32.fc15.x86_64"
59
60     testing="GRUB2 add kernel with default=saved_entry and a terrible title"
61@@ -640,13 +640,13 @@ if [ "$testgrub2" == "y" ]; then
62     testing="GRUB2 set default with default=saved_entry and a terrible name"
63     grub2Test grub2.9 add/g2-1.9 --env grubenv.1 --set-default-index=0
64     commandTest "saved_default output" \
65-        "grub2-editenv test/grub2-support_files/env_temp list" \
66+        "grub-editenv test/grub2-support_files/env_temp list" \
67         'saved_entry=Fedora (3.10.3-300.fc19.x86_64) 19 (Schrödinger’s Cat)'
68
69     testing="GRUB2 set default with default=saved_entry"
70     grub2Test grub2.8 add/g2-1.8 --env grubenv.1 --set-default-index=0
71     commandTest "saved_default output" \
72-        "grub2-editenv test/grub2-support_files/env_temp list" \
73+        "grub-editenv test/grub2-support_files/env_temp list" \
74         "saved_entry=title"
75
76     testing="GRUB2 --default-index with default=saved_entry"
77