From owner-freebsd-bugs@freebsd.org Fri Aug 31 21:49:28 2018 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A21EFDDB36 for ; Fri, 31 Aug 2018 21:49:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id C646E86B5A for ; Fri, 31 Aug 2018 21:49:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 8C62CFDDB32; Fri, 31 Aug 2018 21:49:27 +0000 (UTC) Delivered-To: bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A676FDDB2B for ; Fri, 31 Aug 2018 21:49:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E052A86B54 for ; Fri, 31 Aug 2018 21:49:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 3FB2726352 for ; Fri, 31 Aug 2018 21:49:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w7VLnQuv074247 for ; Fri, 31 Aug 2018 21:49:26 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w7VLnQRE074244 for bugs@FreeBSD.org; Fri, 31 Aug 2018 21:49:26 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 231013] [patch] efibootmgr(8): Add option to activate EFI boot entry after creating it Date: Fri, 31 Aug 2018 21:49:26 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: imp@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2018 21:49:28 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D231013 Warner Losh changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |imp@FreeBSD.org --- Comment #3 from Warner Losh --- -a should already be there for that. diff --git a/usr.sbin/efibootmgr/efibootmgr.c b/usr.sbin/efibootmgr/efibootmgr.c index eaf7a1c1903..103c993f66d 100644 --- a/usr.sbin/efibootmgr/efibootmgr.c +++ b/usr.sbin/efibootmgr/efibootmgr.c @@ -622,7 +622,7 @@ create_loadopt(uint8_t *buf, size_t bufmax, uint32_t attributes, efidp dp, size_ static int make_boot_var(const char *label, const char *loader, const char *kernel, c= onst char *env, bool dry_run, - int bootnum) + int bootnum, bool activate) { struct entry *new_ent; uint32_t load_attrs =3D 0; @@ -665,6 +665,8 @@ make_boot_var(const char *label, const char *loader, co= nst char *kernel, const c /* don't make the new bootvar active by default, use the -a option later */ load_attrs =3D LOAD_OPTION_CATEGORY_BOOT; + if (activate) + load_attrs |=3D LOAD_OPTION_ACTIVE; load_opt_buf =3D malloc(MAX_LOADOPT_LEN); if (load_opt_buf =3D=3D NULL) err(1, "malloc"); @@ -693,7 +695,6 @@ make_boot_var(const char *label, const char *loader, co= nst char *kernel, const c LIST_INSERT_HEAD(&efivars, new_ent, entries); free(load_opt_buf); free(dp); - return 0; } @@ -915,7 +916,7 @@ main(int argc, char *argv[]) */ make_boot_var(opts.label ? opts.label : "", opts.loader, opts.kernel, opts.env, opts.dry_run, - opts.has_bootnum ? opts.bootnum : -1); + opts.has_bootnum ? opts.bootnum : -1, opts.set_active); else if (opts.set_active || opts.set_inactive ) handle_activity(opts.bootnum, opts.set_active); else if (opts.order !=3D NULL) --=20 You are receiving this mail because: You are the assignee for the bug.=