Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 May 2019 16:44:35 +0000 (UTC)
From:      Emmanuel Vadot <manu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r347441 - head/usr.sbin/efibootmgr
Message-ID:  <201905101644.x4AGiZE0088065@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: manu
Date: Fri May 10 16:44:35 2019
New Revision: 347441
URL: https://svnweb.freebsd.org/changeset/base/347441

Log:
  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

Modified:
  head/usr.sbin/efibootmgr/efibootmgr.c

Modified: head/usr.sbin/efibootmgr/efibootmgr.c
==============================================================================
--- head/usr.sbin/efibootmgr/efibootmgr.c	Fri May 10 16:43:53 2019	(r347440)
+++ head/usr.sbin/efibootmgr/efibootmgr.c	Fri May 10 16:44:35 2019	(r347441)
@@ -679,7 +679,7 @@ make_boot_var(const char *label, const char *loader, 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, 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");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905101644.x4AGiZE0088065>