From owner-svn-src-all@freebsd.org Sat Jun 9 17:16:40 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 830AB1011C90; Sat, 9 Jun 2018 17:16:40 +0000 (UTC) (envelope-from kevans@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 E799B806B5; Sat, 9 Jun 2018 15:52:30 +0000 (UTC) (envelope-from kevans@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 C97B41FF17; Sat, 9 Jun 2018 15:52:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w59FqUMl060404; Sat, 9 Jun 2018 15:52:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w59FqTDB060399; Sat, 9 Jun 2018 15:52:29 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806091552.w59FqTDB060399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 9 Jun 2018 15:52:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334885 - in head/stand: common efi/loader i386/libi386 userboot/userboot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/stand: common efi/loader i386/libi386 userboot/userboot X-SVN-Commit-Revision: 334885 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.26 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: Sat, 09 Jun 2018 17:16:40 -0000 Author: kevans Date: Sat Jun 9 15:52:29 2018 New Revision: 334885 URL: https://svnweb.freebsd.org/changeset/base/334885 Log: stand: One more trivial consolidation (setting environment from howto) Modified: head/stand/common/boot.c head/stand/common/bootstrap.h head/stand/efi/loader/main.c head/stand/i386/libi386/bootinfo.c head/stand/userboot/userboot/bootinfo.c Modified: head/stand/common/boot.c ============================================================================== --- head/stand/common/boot.c Sat Jun 9 15:28:37 2018 (r334884) +++ head/stand/common/boot.c Sat Jun 9 15:52:29 2018 (r334885) @@ -174,6 +174,16 @@ bootenv_flags() return (howto); } +void +bootenv_set(int howto) +{ + int i; + + for (i = 0; howto_names[i].ev != NULL; i++) + if (howto & howto_names[i].mask) + setenv(howto_names[i].ev, "YES", 1); +} + static int autoboot(int timeout, char *prompt) { Modified: head/stand/common/bootstrap.h ============================================================================== --- head/stand/common/bootstrap.h Sat Jun 9 15:28:37 2018 (r334884) +++ head/stand/common/bootstrap.h Sat Jun 9 15:52:29 2018 (r334885) @@ -64,6 +64,7 @@ int parse(int *argc, char ***argv, const char *str); void autoboot_maybe(void); int getrootmount(char *rootdev); int bootenv_flags(void); +void bootenv_set(int); /* misc.c */ char *unargv(int argc, char *argv[]); Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Sat Jun 9 15:28:37 2018 (r334884) +++ head/stand/efi/loader/main.c Sat Jun 9 15:52:29 2018 (r334885) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -549,9 +548,8 @@ main(int argc, CHAR16 *argv[]) } } } - for (i = 0; howto_names[i].ev != NULL; i++) - if (howto & howto_names[i].mask) - setenv(howto_names[i].ev, "YES", 1); + + bootenv_set(howto); /* * XXX we need fallback to this stuff after looking at the ConIn, ConOut and ConErr variables Modified: head/stand/i386/libi386/bootinfo.c ============================================================================== --- head/stand/i386/libi386/bootinfo.c Sat Jun 9 15:28:37 2018 (r334884) +++ head/stand/i386/libi386/bootinfo.c Sat Jun 9 15:52:29 2018 (r334885) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "bootstrap.h" #include "libi386.h" #include "btxv86.h" @@ -130,11 +129,8 @@ bi_getboothowto(char *kargs) void bi_setboothowto(int howto) { - int i; - for (i = 0; howto_names[i].ev != NULL; i++) - if (howto & howto_names[i].mask) - setenv(howto_names[i].ev, "YES", 1); + bootenv_set(howto); } /* Modified: head/stand/userboot/userboot/bootinfo.c ============================================================================== --- head/stand/userboot/userboot/bootinfo.c Sat Jun 9 15:28:37 2018 (r334884) +++ head/stand/userboot/userboot/bootinfo.c Sat Jun 9 15:52:29 2018 (r334885) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "bootstrap.h" #include "libuserboot.h" @@ -131,11 +130,8 @@ bi_getboothowto(char *kargs) void bi_setboothowto(int howto) { - int i; - for (i = 0; howto_names[i].ev != NULL; i++) - if (howto & howto_names[i].mask) - setenv(howto_names[i].ev, "YES", 1); + bootenv_set(howto); } /*