blob: e693916e1df1bee2b023d2a8cf49b6280f9bf3b2 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001From 15f0572f2f456c2c1b700bc790d9ce7a5c13cc74 Mon Sep 17 00:00:00 2001
Patrick Williamsddad1a12017-02-23 20:36:32 -06002From: 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>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080011
Patrick Williamsddad1a12017-02-23 20:36:32 -060012---
13 grubby.c | 4 ++--
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080014 test.sh | 8 ++++----
15 2 files changed, 6 insertions(+), 6 deletions(-)
Patrick Williamsddad1a12017-02-23 20:36:32 -060016
17diff --git a/grubby.c b/grubby.c
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080018index 396041a..3ceae69 100644
Patrick Williamsddad1a12017-02-23 20:36:32 -060019--- a/grubby.c
20+++ b/grubby.c
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080021@@ -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);
Patrick Williamsddad1a12017-02-23 20:36:32 -060027
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080028 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;
Patrick Williamsddad1a12017-02-23 20:36:32 -060033
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080034- 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;
Patrick Williamsddad1a12017-02-23 20:36:32 -060039diff --git a/test.sh b/test.sh
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080040index 33d24cf..009479c 100755
Patrick Williamsddad1a12017-02-23 20:36:32 -060041--- a/test.sh
42+++ b/test.sh
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080043@@ -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
Patrick Williamsddad1a12017-02-23 20:36:32 -060053 --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"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080061@@ -640,13 +640,13 @@ if [ "$testgrub2" == "y" ]; then
Patrick Williamsddad1a12017-02-23 20:36:32 -060062 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ödingers 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"