From owner-svn-src-all@freebsd.org Sun Sep 2 18:40:19 2018 Return-Path: Delivered-To: svn-src-all@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 317A9FF66A5; Sun, 2 Sep 2018 18:40:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E14AF82CAF; Sun, 2 Sep 2018 18:40:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D82B61D03D; Sun, 2 Sep 2018 18:40:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w82IeIq3052732; Sun, 2 Sep 2018 18:40:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w82IeIAL052731; Sun, 2 Sep 2018 18:40:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201809021840.w82IeIAL052731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 2 Sep 2018 18:40:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338432 - head/usr.sbin/efibootmgr X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/efibootmgr X-SVN-Commit-Revision: 338432 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2018 18:40:19 -0000 Author: imp Date: Sun Sep 2 18:40:18 2018 New Revision: 338432 URL: https://svnweb.freebsd.org/changeset/base/338432 Log: Make -a (to make the entry active) apply to creation of a new boot variable. Approved by: re@ (rgrimes) PR: 231013 Differential Revision: https://reviews.freebsd.org/D16977 Modified: head/usr.sbin/efibootmgr/efibootmgr.c Modified: head/usr.sbin/efibootmgr/efibootmgr.c ============================================================================== --- head/usr.sbin/efibootmgr/efibootmgr.c Sun Sep 2 18:29:38 2018 (r338431) +++ head/usr.sbin/efibootmgr/efibootmgr.c Sun Sep 2 18:40:18 2018 (r338432) @@ -622,7 +622,7 @@ create_loadopt(uint8_t *buf, size_t bufmax, uint32_t a static int make_boot_var(const char *label, const char *loader, const char *kernel, const char *env, bool dry_run, - int bootnum) + int bootnum, bool activate) { struct entry *new_ent; uint32_t load_attrs = 0; @@ -665,6 +665,8 @@ make_boot_var(const char *label, const char *loader, c /* don't make the new bootvar active by default, use the -a option later */ load_attrs = LOAD_OPTION_CATEGORY_BOOT; + if (activate) + load_attrs |= LOAD_OPTION_ACTIVE; load_opt_buf = malloc(MAX_LOADOPT_LEN); if (load_opt_buf == NULL) err(1, "malloc"); @@ -915,7 +917,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 != NULL)