Merge ~ubuntu-core-dev/grub/+git/ubuntu:sil2100/ubuntu-auto-nvram into ~ubuntu-core-dev/grub/+git/ubuntu:ubuntu

Proposed by Łukasz Zemczak
Status: Merged
Approved by: Mathieu Trudel-Lapierre
Approved revision: d5f3fb20b22da07856778d9bc1b81022aa302113
Merge reported by: Mathieu Trudel-Lapierre
Merged at revision: d5f3fb20b22da07856778d9bc1b81022aa302113
Proposed branch: ~ubuntu-core-dev/grub/+git/ubuntu:sil2100/ubuntu-auto-nvram
Merge into: ~ubuntu-core-dev/grub/+git/ubuntu:ubuntu
Diff against target: 477 lines (+281/-16)
9 files modified
debian/.git-dpm (+2/-2)
debian/changelog (+8/-0)
debian/patches/add-an-auto-nvram-option-to-grub-install.patch (+226/-0)
debian/patches/series (+1/-0)
grub-core/osdep/basic/no_platform.c (+3/-2)
grub-core/osdep/unix/platform.c (+20/-2)
grub-core/osdep/windows/platform.c (+3/-2)
include/grub/util/install.h (+3/-2)
util/grub-install.c (+15/-6)
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre Approve
Review via email: mp+343642@code.launchpad.net

Commit message

Add the auto-nvram functionality of only attempting the NVRAM variable update if the system has access to those. Useful for dual BIOS-EFI devices.

Description of the change

Add the auto-nvram functionality of only attempting the NVRAM variable update if the system has access to those. Useful for dual BIOS-EFI devices.

git-dpm ubuntu branch (patched).

To post a comment you must log in.
d5f3fb2... by Łukasz Zemczak

merge patched-ubuntu into ubuntu

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/.git-dpm b/debian/.git-dpm
index a6e25a6..32844ae 100644
--- a/debian/.git-dpm
+++ b/debian/.git-dpm
@@ -1,6 +1,6 @@
1# see git-dpm(1) from git-dpm package1# see git-dpm(1) from git-dpm package
24a2879d2ea9e6179ac0f45d7196b9d905fcab0f621696f83780575139eb0ad801a311c947028278f2
34a2879d2ea9e6179ac0f45d7196b9d905fcab0f631696f83780575139eb0ad801a311c947028278f2
40992ffbac6a1b4c97c350d12e5301e0067daa0d640992ffbac6a1b4c97c350d12e5301e0067daa0d6
50992ffbac6a1b4c97c350d12e5301e0067daa0d650992ffbac6a1b4c97c350d12e5301e0067daa0d6
6grub2_2.02.orig.tar.xz6grub2_2.02.orig.tar.xz
diff --git a/debian/changelog b/debian/changelog
index 2e7a56d..07c31df 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
1grub2 (2.02-2ubuntu9) UNRELEASED; urgency=medium
2
3 * debian/patches/add-an-auto-nvram-option-to-grub-install.patch: Add the
4 --auto-nvram option to grub-install for auto-detecting NVRAM availability
5 before attempting NVRAM updates.
6
7 -- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Fri, 20 Apr 2018 19:41:26 +0200
8
1grub2 (2.02-2ubuntu8) bionic; urgency=medium9grub2 (2.02-2ubuntu8) bionic; urgency=medium
210
3 * Drop debian/patches/mkconfig_keep_native_term_active.patch, which can11 * Drop debian/patches/mkconfig_keep_native_term_active.patch, which can
diff --git a/debian/patches/add-an-auto-nvram-option-to-grub-install.patch b/debian/patches/add-an-auto-nvram-option-to-grub-install.patch
4new file mode 10064412new file mode 100644
index 0000000..d22dae9
--- /dev/null
+++ b/debian/patches/add-an-auto-nvram-option-to-grub-install.patch
@@ -0,0 +1,226 @@
1From 1696f83780575139eb0ad801a311c947028278f2 Mon Sep 17 00:00:00 2001
2From: Łukasz 'sil2100' Zemczak <lukasz.zemczak@canonical.com>
3Date: Fri, 20 Apr 2018 19:27:37 +0200
4Subject: Add an auto-nvram option to grub-install for auto-detecting NVRAM
5 access
6
7This adds the auto-nvram functionality of only attempting the NVRAM
8variable update if the system has access to those. Useful for dual
9BIOS-EFI devices.
10
11Patch-Name: add-an-auto-nvram-option-to-grub-install.patch
12---
13 grub-core/osdep/basic/no_platform.c | 5 +++--
14 grub-core/osdep/unix/platform.c | 22 ++++++++++++++++++++--
15 grub-core/osdep/windows/platform.c | 5 +++--
16 include/grub/util/install.h | 5 +++--
17 util/grub-install.c | 21 +++++++++++++++------
18 5 files changed, 44 insertions(+), 14 deletions(-)
19
20diff --git a/grub-core/osdep/basic/no_platform.c b/grub-core/osdep/basic/no_platform.c
21index d76c34c14..b39e97f48 100644
22--- a/grub-core/osdep/basic/no_platform.c
23+++ b/grub-core/osdep/basic/no_platform.c
24@@ -25,7 +25,7 @@
25
26 void
27 grub_install_register_ieee1275 (int is_prep, const char *install_device,
28- int partno, const char *relpath)
29+ int partno, const char *relpath, int detect_nvram)
30 {
31 grub_util_error ("%s", _("no IEEE1275 routines are available for your platform"));
32 }
33@@ -33,7 +33,8 @@ grub_install_register_ieee1275 (int is_prep, const char *install_device,
34 void
35 grub_install_register_efi (grub_device_t efidir_grub_dev,
36 const char *efifile_path,
37- const char *efi_distributor)
38+ const char *efi_distributor,
39+ int detect_nvram)
40 {
41 grub_util_error ("%s", _("no EFI routines are available for your platform"));
42 }
43diff --git a/grub-core/osdep/unix/platform.c b/grub-core/osdep/unix/platform.c
44index f9c376c35..04d0d8c42 100644
45--- a/grub-core/osdep/unix/platform.c
46+++ b/grub-core/osdep/unix/platform.c
47@@ -134,7 +134,8 @@ grub_install_remove_efi_entries_by_distributor (const char *efi_distributor)
48 int
49 grub_install_register_efi (grub_device_t efidir_grub_dev,
50 const char *efifile_path,
51- const char *efi_distributor)
52+ const char *efi_distributor,
53+ int detect_nvram)
54 {
55 const char * efidir_disk;
56 int efidir_part;
57@@ -153,6 +154,18 @@ grub_install_register_efi (grub_device_t efidir_grub_dev,
58 #ifdef __linux__
59 grub_util_exec ((const char * []){ "modprobe", "-q", "efivars", NULL });
60 #endif
61+
62+ /* If requested, we try to detect if NVRAM access is available and if not,
63+ resume normal operation. */
64+ if (detect_nvram)
65+ {
66+ error = grub_util_exec_redirect_null ((const char * []){ "efibootmgr", NULL });
67+ if (error == 2)
68+ return 0;
69+ else if (error)
70+ return error;
71+ }
72+
73 /* Delete old entries from the same distributor. */
74 error = grub_install_remove_efi_entries_by_distributor (efi_distributor);
75 if (error)
76@@ -178,7 +191,7 @@ grub_install_register_efi (grub_device_t efidir_grub_dev,
77
78 void
79 grub_install_register_ieee1275 (int is_prep, const char *install_device,
80- int partno, const char *relpath)
81+ int partno, const char *relpath, int detect_nvram)
82 {
83 char *boot_device;
84
85@@ -189,6 +202,11 @@ grub_install_register_ieee1275 (int is_prep, const char *install_device,
86 grub_util_error (_("%s: not found"), "ofpathname");
87 }
88
89+ /* If requested, we try to detect if NVRAM access is available and if not,
90+ resume normal operation. */
91+ if (detect_nvram && grub_util_exec_redirect_null ((const char * []){ "nvram", NULL }))
92+ return;
93+
94 /* Get the Open Firmware device tree path translation. */
95 if (!is_prep)
96 {
97diff --git a/grub-core/osdep/windows/platform.c b/grub-core/osdep/windows/platform.c
98index c30025b13..1c9695970 100644
99--- a/grub-core/osdep/windows/platform.c
100+++ b/grub-core/osdep/windows/platform.c
101@@ -210,7 +210,8 @@ set_efi_variable_bootn (grub_uint16_t n, void *in, grub_size_t len)
102 void
103 grub_install_register_efi (grub_device_t efidir_grub_dev,
104 const char *efifile_path,
105- const char *efi_distributor)
106+ const char *efi_distributor,
107+ int detect_nvram)
108 {
109 grub_uint16_t *boot_order, *new_boot_order;
110 grub_uint16_t *distributor16;
111@@ -417,7 +418,7 @@ grub_install_register_efi (grub_device_t efidir_grub_dev,
112
113 void
114 grub_install_register_ieee1275 (int is_prep, const char *install_device,
115- int partno, const char *relpath)
116+ int partno, const char *relpath, int detect_nvram)
117 {
118 grub_util_error ("%s", _("no IEEE1275 routines are available for your platform"));
119 }
120diff --git a/include/grub/util/install.h b/include/grub/util/install.h
121index 58648e209..115188399 100644
122--- a/include/grub/util/install.h
123+++ b/include/grub/util/install.h
124@@ -212,11 +212,12 @@ grub_install_get_default_powerpc_machtype (void);
125 int
126 grub_install_register_efi (grub_device_t efidir_grub_dev,
127 const char *efifile_path,
128- const char *efi_distributor);
129+ const char *efi_distributor,
130+ int detect_nvram);
131
132 void
133 grub_install_register_ieee1275 (int is_prep, const char *install_device,
134- int partno, const char *relpath);
135+ int partno, const char *relpath, int detect_nvram);
136
137 void
138 grub_install_sgi_setup (const char *install_device,
139diff --git a/util/grub-install.c b/util/grub-install.c
140index 2214e4549..b8f91101d 100644
141--- a/util/grub-install.c
142+++ b/util/grub-install.c
143@@ -59,6 +59,7 @@ static int removable = 0;
144 static int no_extra_removable = 0;
145 static int recheck = 0;
146 static int update_nvram = 1;
147+static int auto_nvram = 0;
148 static char *install_device = NULL;
149 static char *debug_image = NULL;
150 static char *rootdir = NULL;
151@@ -115,7 +116,8 @@ enum
152 OPTION_PRODUCT_VERSION,
153 OPTION_UEFI_SECURE_BOOT,
154 OPTION_NO_UEFI_SECURE_BOOT,
155- OPTION_NO_EXTRA_REMOVABLE
156+ OPTION_NO_EXTRA_REMOVABLE,
157+ OPTION_AUTO_NVRAM
158 };
159
160 static int fs_probe = 1;
161@@ -206,6 +208,10 @@ argp_parser (int key, char *arg, struct argp_state *state)
162 update_nvram = 0;
163 return 0;
164
165+ case OPTION_AUTO_NVRAM:
166+ auto_nvram = 1;
167+ return 0;
168+
169 case OPTION_FORCE:
170 force = 1;
171 return 0;
172@@ -296,6 +302,9 @@ static struct argp_option options[] = {
173 {"no-nvram", OPTION_NO_NVRAM, 0, 0,
174 N_("don't update the `boot-device'/`Boot*' NVRAM variables. "
175 "This option is only available on EFI and IEEE1275 targets."), 2},
176+ {"auto-nvram", OPTION_AUTO_NVRAM, 0, 0,
177+ N_("only update NVRAM variables if possible. "
178+ "This option is only available on EFI and IEEE1275 targets."), 2},
179 {"skip-fs-probe",'s',0, 0,
180 N_("do not probe for filesystems in DEVICE"), 0},
181 {"no-bootsector", OPTION_NO_BOOTSECTOR, 0, 0,
182@@ -1924,7 +1933,7 @@ main (int argc, char *argv[])
183 ? ins_dev->disk->partition->number + 1 : 0;
184 dev = grub_util_get_os_disk (install_device);
185 grub_install_register_ieee1275 (0, dev, partno,
186- "\\\\BootX");
187+ "\\\\BootX", auto_nvram);
188 }
189 grub_device_close (ins_dev);
190 free (grub_elf);
191@@ -1956,7 +1965,7 @@ main (int argc, char *argv[])
192 grub_device_close (ins_dev);
193 if (update_nvram)
194 grub_install_register_ieee1275 (1, grub_util_get_os_disk (install_device),
195- 0, NULL);
196+ 0, NULL, auto_nvram);
197 break;
198 }
199 /* fallthrough. */
200@@ -1971,7 +1980,7 @@ main (int argc, char *argv[])
201 ? grub_dev->disk->partition->number + 1 : 0;
202 dev = grub_util_get_os_disk (grub_devices[0]);
203 grub_install_register_ieee1275 (0, dev,
204- partno, relpath);
205+ partno, relpath, auto_nvram);
206 }
207 break;
208 case GRUB_INSTALL_PLATFORM_MIPS_ARC:
209@@ -2020,7 +2029,7 @@ main (int argc, char *argv[])
210 int error = 0;
211 error = grub_install_register_efi (efidir_grub_dev,
212 "\\System\\Library\\CoreServices",
213- efi_distributor);
214+ efi_distributor, auto_nvram);
215 if (error)
216 grub_util_error (_("efibootmgr failed to register the boot entry: %s"),
217 strerror (error));
218@@ -2135,7 +2144,7 @@ main (int argc, char *argv[])
219 (part ? ",": ""), (part ? : ""));
220 grub_free (part);
221 error = grub_install_register_efi (efidir_grub_dev,
222- efifile_path, efi_distributor);
223+ efifile_path, efi_distributor, auto_nvram);
224 if (error)
225 grub_util_error (_("efibootmgr failed to register the boot entry: %s"),
226 strerror (error));
diff --git a/debian/patches/series b/debian/patches/series
index 47ad08d..298e3f0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -75,3 +75,4 @@ bufio_sensible_block_sizes.patch
75shorter_version_info.patch75shorter_version_info.patch
76skip_text_gfxpayload_where_not_supported.patch76skip_text_gfxpayload_where_not_supported.patch
77yylex-explicitly_cast_fprintf_to_void.patch77yylex-explicitly_cast_fprintf_to_void.patch
78add-an-auto-nvram-option-to-grub-install.patch
diff --git a/grub-core/osdep/basic/no_platform.c b/grub-core/osdep/basic/no_platform.c
index d76c34c..b39e97f 100644
--- a/grub-core/osdep/basic/no_platform.c
+++ b/grub-core/osdep/basic/no_platform.c
@@ -25,7 +25,7 @@
2525
26void26void
27grub_install_register_ieee1275 (int is_prep, const char *install_device,27grub_install_register_ieee1275 (int is_prep, const char *install_device,
28 int partno, const char *relpath)28 int partno, const char *relpath, int detect_nvram)
29{29{
30 grub_util_error ("%s", _("no IEEE1275 routines are available for your platform"));30 grub_util_error ("%s", _("no IEEE1275 routines are available for your platform"));
31}31}
@@ -33,7 +33,8 @@ grub_install_register_ieee1275 (int is_prep, const char *install_device,
33void33void
34grub_install_register_efi (grub_device_t efidir_grub_dev,34grub_install_register_efi (grub_device_t efidir_grub_dev,
35 const char *efifile_path,35 const char *efifile_path,
36 const char *efi_distributor)36 const char *efi_distributor,
37 int detect_nvram)
37{38{
38 grub_util_error ("%s", _("no EFI routines are available for your platform"));39 grub_util_error ("%s", _("no EFI routines are available for your platform"));
39}40}
diff --git a/grub-core/osdep/unix/platform.c b/grub-core/osdep/unix/platform.c
index f9c376c..04d0d8c 100644
--- a/grub-core/osdep/unix/platform.c
+++ b/grub-core/osdep/unix/platform.c
@@ -134,7 +134,8 @@ grub_install_remove_efi_entries_by_distributor (const char *efi_distributor)
134int134int
135grub_install_register_efi (grub_device_t efidir_grub_dev,135grub_install_register_efi (grub_device_t efidir_grub_dev,
136 const char *efifile_path,136 const char *efifile_path,
137 const char *efi_distributor)137 const char *efi_distributor,
138 int detect_nvram)
138{139{
139 const char * efidir_disk;140 const char * efidir_disk;
140 int efidir_part;141 int efidir_part;
@@ -153,6 +154,18 @@ grub_install_register_efi (grub_device_t efidir_grub_dev,
153#ifdef __linux__154#ifdef __linux__
154 grub_util_exec ((const char * []){ "modprobe", "-q", "efivars", NULL });155 grub_util_exec ((const char * []){ "modprobe", "-q", "efivars", NULL });
155#endif156#endif
157
158 /* If requested, we try to detect if NVRAM access is available and if not,
159 resume normal operation. */
160 if (detect_nvram)
161 {
162 error = grub_util_exec_redirect_null ((const char * []){ "efibootmgr", NULL });
163 if (error == 2)
164 return 0;
165 else if (error)
166 return error;
167 }
168
156 /* Delete old entries from the same distributor. */169 /* Delete old entries from the same distributor. */
157 error = grub_install_remove_efi_entries_by_distributor (efi_distributor);170 error = grub_install_remove_efi_entries_by_distributor (efi_distributor);
158 if (error)171 if (error)
@@ -178,7 +191,7 @@ grub_install_register_efi (grub_device_t efidir_grub_dev,
178191
179void192void
180grub_install_register_ieee1275 (int is_prep, const char *install_device,193grub_install_register_ieee1275 (int is_prep, const char *install_device,
181 int partno, const char *relpath)194 int partno, const char *relpath, int detect_nvram)
182{195{
183 char *boot_device;196 char *boot_device;
184197
@@ -189,6 +202,11 @@ grub_install_register_ieee1275 (int is_prep, const char *install_device,
189 grub_util_error (_("%s: not found"), "ofpathname");202 grub_util_error (_("%s: not found"), "ofpathname");
190 }203 }
191204
205 /* If requested, we try to detect if NVRAM access is available and if not,
206 resume normal operation. */
207 if (detect_nvram && grub_util_exec_redirect_null ((const char * []){ "nvram", NULL }))
208 return;
209
192 /* Get the Open Firmware device tree path translation. */210 /* Get the Open Firmware device tree path translation. */
193 if (!is_prep)211 if (!is_prep)
194 {212 {
diff --git a/grub-core/osdep/windows/platform.c b/grub-core/osdep/windows/platform.c
index c30025b..1c96959 100644
--- a/grub-core/osdep/windows/platform.c
+++ b/grub-core/osdep/windows/platform.c
@@ -210,7 +210,8 @@ set_efi_variable_bootn (grub_uint16_t n, void *in, grub_size_t len)
210void210void
211grub_install_register_efi (grub_device_t efidir_grub_dev,211grub_install_register_efi (grub_device_t efidir_grub_dev,
212 const char *efifile_path,212 const char *efifile_path,
213 const char *efi_distributor)213 const char *efi_distributor,
214 int detect_nvram)
214{215{
215 grub_uint16_t *boot_order, *new_boot_order;216 grub_uint16_t *boot_order, *new_boot_order;
216 grub_uint16_t *distributor16;217 grub_uint16_t *distributor16;
@@ -417,7 +418,7 @@ grub_install_register_efi (grub_device_t efidir_grub_dev,
417418
418void419void
419grub_install_register_ieee1275 (int is_prep, const char *install_device,420grub_install_register_ieee1275 (int is_prep, const char *install_device,
420 int partno, const char *relpath)421 int partno, const char *relpath, int detect_nvram)
421{422{
422 grub_util_error ("%s", _("no IEEE1275 routines are available for your platform"));423 grub_util_error ("%s", _("no IEEE1275 routines are available for your platform"));
423}424}
diff --git a/include/grub/util/install.h b/include/grub/util/install.h
index 58648e2..1151883 100644
--- a/include/grub/util/install.h
+++ b/include/grub/util/install.h
@@ -212,11 +212,12 @@ grub_install_get_default_powerpc_machtype (void);
212int212int
213grub_install_register_efi (grub_device_t efidir_grub_dev,213grub_install_register_efi (grub_device_t efidir_grub_dev,
214 const char *efifile_path,214 const char *efifile_path,
215 const char *efi_distributor);215 const char *efi_distributor,
216 int detect_nvram);
216217
217void218void
218grub_install_register_ieee1275 (int is_prep, const char *install_device,219grub_install_register_ieee1275 (int is_prep, const char *install_device,
219 int partno, const char *relpath);220 int partno, const char *relpath, int detect_nvram);
220221
221void222void
222grub_install_sgi_setup (const char *install_device,223grub_install_sgi_setup (const char *install_device,
diff --git a/util/grub-install.c b/util/grub-install.c
index 2214e45..b8f9110 100644
--- a/util/grub-install.c
+++ b/util/grub-install.c
@@ -59,6 +59,7 @@ static int removable = 0;
59static int no_extra_removable = 0;59static int no_extra_removable = 0;
60static int recheck = 0;60static int recheck = 0;
61static int update_nvram = 1;61static int update_nvram = 1;
62static int auto_nvram = 0;
62static char *install_device = NULL;63static char *install_device = NULL;
63static char *debug_image = NULL;64static char *debug_image = NULL;
64static char *rootdir = NULL;65static char *rootdir = NULL;
@@ -115,7 +116,8 @@ enum
115 OPTION_PRODUCT_VERSION,116 OPTION_PRODUCT_VERSION,
116 OPTION_UEFI_SECURE_BOOT,117 OPTION_UEFI_SECURE_BOOT,
117 OPTION_NO_UEFI_SECURE_BOOT,118 OPTION_NO_UEFI_SECURE_BOOT,
118 OPTION_NO_EXTRA_REMOVABLE119 OPTION_NO_EXTRA_REMOVABLE,
120 OPTION_AUTO_NVRAM
119 };121 };
120122
121static int fs_probe = 1;123static int fs_probe = 1;
@@ -206,6 +208,10 @@ argp_parser (int key, char *arg, struct argp_state *state)
206 update_nvram = 0;208 update_nvram = 0;
207 return 0;209 return 0;
208210
211 case OPTION_AUTO_NVRAM:
212 auto_nvram = 1;
213 return 0;
214
209 case OPTION_FORCE:215 case OPTION_FORCE:
210 force = 1;216 force = 1;
211 return 0;217 return 0;
@@ -296,6 +302,9 @@ static struct argp_option options[] = {
296 {"no-nvram", OPTION_NO_NVRAM, 0, 0,302 {"no-nvram", OPTION_NO_NVRAM, 0, 0,
297 N_("don't update the `boot-device'/`Boot*' NVRAM variables. "303 N_("don't update the `boot-device'/`Boot*' NVRAM variables. "
298 "This option is only available on EFI and IEEE1275 targets."), 2},304 "This option is only available on EFI and IEEE1275 targets."), 2},
305 {"auto-nvram", OPTION_AUTO_NVRAM, 0, 0,
306 N_("only update NVRAM variables if possible. "
307 "This option is only available on EFI and IEEE1275 targets."), 2},
299 {"skip-fs-probe",'s',0, 0,308 {"skip-fs-probe",'s',0, 0,
300 N_("do not probe for filesystems in DEVICE"), 0},309 N_("do not probe for filesystems in DEVICE"), 0},
301 {"no-bootsector", OPTION_NO_BOOTSECTOR, 0, 0,310 {"no-bootsector", OPTION_NO_BOOTSECTOR, 0, 0,
@@ -1924,7 +1933,7 @@ main (int argc, char *argv[])
1924 ? ins_dev->disk->partition->number + 1 : 0;1933 ? ins_dev->disk->partition->number + 1 : 0;
1925 dev = grub_util_get_os_disk (install_device);1934 dev = grub_util_get_os_disk (install_device);
1926 grub_install_register_ieee1275 (0, dev, partno,1935 grub_install_register_ieee1275 (0, dev, partno,
1927 "\\\\BootX");1936 "\\\\BootX", auto_nvram);
1928 }1937 }
1929 grub_device_close (ins_dev);1938 grub_device_close (ins_dev);
1930 free (grub_elf);1939 free (grub_elf);
@@ -1956,7 +1965,7 @@ main (int argc, char *argv[])
1956 grub_device_close (ins_dev);1965 grub_device_close (ins_dev);
1957 if (update_nvram)1966 if (update_nvram)
1958 grub_install_register_ieee1275 (1, grub_util_get_os_disk (install_device),1967 grub_install_register_ieee1275 (1, grub_util_get_os_disk (install_device),
1959 0, NULL);1968 0, NULL, auto_nvram);
1960 break;1969 break;
1961 }1970 }
1962 /* fallthrough. */1971 /* fallthrough. */
@@ -1971,7 +1980,7 @@ main (int argc, char *argv[])
1971 ? grub_dev->disk->partition->number + 1 : 0;1980 ? grub_dev->disk->partition->number + 1 : 0;
1972 dev = grub_util_get_os_disk (grub_devices[0]);1981 dev = grub_util_get_os_disk (grub_devices[0]);
1973 grub_install_register_ieee1275 (0, dev,1982 grub_install_register_ieee1275 (0, dev,
1974 partno, relpath);1983 partno, relpath, auto_nvram);
1975 }1984 }
1976 break;1985 break;
1977 case GRUB_INSTALL_PLATFORM_MIPS_ARC:1986 case GRUB_INSTALL_PLATFORM_MIPS_ARC:
@@ -2020,7 +2029,7 @@ main (int argc, char *argv[])
2020 int error = 0;2029 int error = 0;
2021 error = grub_install_register_efi (efidir_grub_dev,2030 error = grub_install_register_efi (efidir_grub_dev,
2022 "\\System\\Library\\CoreServices",2031 "\\System\\Library\\CoreServices",
2023 efi_distributor);2032 efi_distributor, auto_nvram);
2024 if (error)2033 if (error)
2025 grub_util_error (_("efibootmgr failed to register the boot entry: %s"),2034 grub_util_error (_("efibootmgr failed to register the boot entry: %s"),
2026 strerror (error));2035 strerror (error));
@@ -2135,7 +2144,7 @@ main (int argc, char *argv[])
2135 (part ? ",": ""), (part ? : ""));2144 (part ? ",": ""), (part ? : ""));
2136 grub_free (part);2145 grub_free (part);
2137 error = grub_install_register_efi (efidir_grub_dev,2146 error = grub_install_register_efi (efidir_grub_dev,
2138 efifile_path, efi_distributor);2147 efifile_path, efi_distributor, auto_nvram);
2139 if (error)2148 if (error)
2140 grub_util_error (_("efibootmgr failed to register the boot entry: %s"),2149 grub_util_error (_("efibootmgr failed to register the boot entry: %s"),
2141 strerror (error));2150 strerror (error));

Subscribers

People subscribed via source and target branches