aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorEmmanuel Vadot <manu@FreeBSD.org>2019-05-10 16:44:35 +0000
committerEmmanuel Vadot <manu@FreeBSD.org>2019-05-10 16:44:35 +0000
commit67a5e53398f7d5a06724062858d9f71779aa37f9 (patch)
treef5b10182d1dda117c704d3ac6917d65c84c2d575 /usr.sbin
parent73f707e259d609049b039e9c38565c8669b62695 (diff)
downloadsrc-67a5e53398f7d5a06724062858d9f71779aa37f9.tar.gz
src-67a5e53398f7d5a06724062858d9f71779aa37f9.zip
efibootmgr: Do not add the new boot entry in dry-run is specified
While here fix a typo. Sponsored-by: Ampere Computing, LLC Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D20212
Notes
Notes: svn path=/head/; revision=347441
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/efibootmgr/efibootmgr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/efibootmgr/efibootmgr.c b/usr.sbin/efibootmgr/efibootmgr.c
index 5793388fbcc0..e62ff6b50588 100644
--- a/usr.sbin/efibootmgr/efibootmgr.c
+++ b/usr.sbin/efibootmgr/efibootmgr.c
@@ -679,7 +679,7 @@ make_boot_var(const char *label, const char *loader, const char *kernel, const c
lopt_size = create_loadopt(load_opt_buf, MAX_LOADOPT_LEN, load_attrs,
dp, llen + klen, label, env, env ? strlen(env) + 1 : 0);
if (lopt_size == BAD_LENGTH)
- errx(1, "Can't crate loadopt");
+ errx(1, "Can't create loadopt");
ret = 0;
if (!dry_run) {
@@ -690,7 +690,8 @@ make_boot_var(const char *label, const char *loader, const char *kernel, const c
if (ret)
err(1, "efi_set_variable");
- add_to_boot_order(bootvar); /* first, still not active */
+ if (!dry_run)
+ add_to_boot_order(bootvar); /* first, still not active */
new_ent = malloc(sizeof(struct entry));
if (new_ent == NULL)
err(1, "malloc");