Module Name:    src
Committed By:   jmcneill
Date:           Sun Jun 28 11:39:50 UTC 2020

Modified Files:
        src/sys/stand/efiboot: Makefile.efiboot boot.c exec.c version
Removed Files:
        src/sys/stand/efiboot: efienv.c efienv.h

Log Message:
Remove support for storing settings in EFI environment variables now that
we have boot.cfg support.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/stand/efiboot/Makefile.efiboot
cvs rdiff -u -r1.26 -r1.27 src/sys/stand/efiboot/boot.c
cvs rdiff -u -r1.6 -r0 src/sys/stand/efiboot/efienv.c
cvs rdiff -u -r1.3 -r0 src/sys/stand/efiboot/efienv.h
cvs rdiff -u -r1.17 -r1.18 src/sys/stand/efiboot/exec.c
cvs rdiff -u -r1.18 -r1.19 src/sys/stand/efiboot/version

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/stand/efiboot/Makefile.efiboot
diff -u src/sys/stand/efiboot/Makefile.efiboot:1.16 src/sys/stand/efiboot/Makefile.efiboot:1.17
--- src/sys/stand/efiboot/Makefile.efiboot:1.16	Fri Jun 26 03:23:04 2020
+++ src/sys/stand/efiboot/Makefile.efiboot	Sun Jun 28 11:39:50 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.efiboot,v 1.16 2020/06/26 03:23:04 thorpej Exp $
+# $NetBSD: Makefile.efiboot,v 1.17 2020/06/28 11:39:50 jmcneill Exp $
 
 S=		${.CURDIR}/../../..
 
@@ -23,7 +23,7 @@ AFLAGS.start.S= ${${ACTIVE_CC} == "clang
 SOURCES=	crt0-efi-${GNUEFIARCH}.S reloc_${GNUEFIARCH}.c
 SOURCES+=	boot.c bootmenu.c conf.c console.c dev_net.c devopen.c exec.c \
 		module.c overlay.c panic.c prompt.c
-SOURCES+=	efiboot.c efichar.c efidev.c efienv.c efigetsecs.c efifdt.c \
+SOURCES+=	efiboot.c efichar.c efidev.c efigetsecs.c efifdt.c \
 		efifile.c efiblock.c efinet.c efipxe.c efiacpi.c efirng.c smbios.c
 
 .PATH: ${S}/external/bsd/libfdt/dist

Index: src/sys/stand/efiboot/boot.c
diff -u src/sys/stand/efiboot/boot.c:1.26 src/sys/stand/efiboot/boot.c:1.27
--- src/sys/stand/efiboot/boot.c:1.26	Sat Jun 27 18:52:24 2020
+++ src/sys/stand/efiboot/boot.c	Sun Jun 28 11:39:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.c,v 1.26 2020/06/27 18:52:24 jmcneill Exp $	*/
+/*	$NetBSD: boot.c,v 1.27 2020/06/28 11:39:50 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka <non...@netbsd.org>
@@ -32,7 +32,6 @@
 #include "efifile.h"
 #include "efifdt.h"
 #include "efiacpi.h"
-#include "efienv.h"
 #include "efirng.h"
 #include "module.h"
 #include "overlay.h"
@@ -101,10 +100,6 @@ void	command_unload(char *);
 void	command_ls(char *);
 void	command_mem(char *);
 void	command_menu(char *);
-void	command_printenv(char *);
-void	command_setenv(char *);
-void	command_clearenv(char *);
-void	command_resetenv(char *);
 void	command_reset(char *);
 void	command_version(char *);
 void	command_quit(char *);
@@ -123,10 +118,6 @@ const struct boot_command commands[] = {
 	{ "ls",		command_ls,		"ls [hdNn:/path]" },
 	{ "mem",	command_mem,		"mem" },
 	{ "menu",	command_menu,		"menu" },
-	{ "printenv",	command_printenv,	"printenv [key]" },
-	{ "setenv",	command_setenv,		"setenv <key> <value>" },
-	{ "clearenv",	command_clearenv,	"clearenv <key>" },
-	{ "resetenv",	command_resetenv,	"resetenv" },
 	{ "reboot",	command_reset,		"reboot|reset" },
 	{ "reset",	command_reset,		NULL },
 	{ "version",	command_version,	"version" },
@@ -311,53 +302,6 @@ command_menu(char *arg)
 }
 
 void
-command_printenv(char *arg)
-{
-	char *val;
-
-	if (arg && *arg) {
-		val = efi_env_get(arg);
-		if (val) {
-			printf("\"%s\" = \"%s\"\n", arg, val);
-			FreePool(val);
-		}
-	} else {
-		efi_env_print();
-	}
-}
-
-void
-command_setenv(char *arg)
-{
-	char *spc;
-
-	spc = strchr(arg, ' ');
-	if (spc == NULL || spc[1] == '\0') {
-		command_help("");
-		return;
-	}
-
-	*spc = '\0';
-	efi_env_set(arg, spc + 1);
-}
-
-void
-command_clearenv(char *arg)
-{
-	if (*arg == '\0') {
-		command_help("");
-		return;
-	}
-	efi_env_clear(arg);
-}
-
-void
-command_resetenv(char *arg)
-{
-	efi_env_reset();
-}
-
-void
 command_version(char *arg)
 {
 	char pathbuf[80];
@@ -482,74 +426,12 @@ print_banner(void)
 	    bootprog_name, bootprog_rev);
 }
 
-static void
-read_env(void)
-{
-	char *s;
-
-	s = efi_env_get("fdtfile");
-	if (s) {
-#ifdef EFIBOOT_DEBUG
-		printf(">> Setting DTB path to '%s' from environment\n", s);
-#endif
-		set_dtb_path(s);
-		FreePool(s);
-	}
-
-	s = efi_env_get("initrd");
-	if (s) {
-#ifdef EFIBOOT_DEBUG
-		printf(">> Setting initrd path to '%s' from environment\n", s);
-#endif
-		set_initrd_path(s);
-		FreePool(s);
-	}
-
-	s = efi_env_get("bootfile");
-	if (s) {
-#ifdef EFIBOOT_DEBUG
-		printf(">> Setting bootfile path to '%s' from environment\n", s);
-#endif
-		set_bootfile(s);
-		FreePool(s);
-	}
-
-	s = efi_env_get("rootdev");
-	if (s) {
-#ifdef EFIBOOT_DEBUG
-		printf(">> Setting default device to '%s' from environment\n", s);
-#endif
-		set_default_device(s);
-		FreePool(s);
-	}
-
-	s = efi_env_get("bootargs");
-	if (s) {
-#ifdef EFIBOOT_DEBUG
-		printf(">> Setting default boot args to '%s' from environment\n", s);
-#endif
-		set_bootargs(s);
-		FreePool(s);
-	}
-
-	s = efi_env_get("rndseed");
-	if (s) {
-#ifdef EFIBOOT_DEBUG
-		printf(">> Setting rndseed path to '%s' from environment\n", s);
-#endif
-		set_rndseed_path(s);
-		FreePool(s);
-	}
-}
-
 void
 boot(void)
 {
 	char pathbuf[80];
 	int currname, c;
 
-	read_env();
-
 	if (efi_bootdp != NULL && efi_file_path(efi_bootdp, BOOTCFG_FILENAME, pathbuf, sizeof(pathbuf)) == 0) {
 		twiddle_toggle = 1;
 		parsebootconf(pathbuf);

Index: src/sys/stand/efiboot/exec.c
diff -u src/sys/stand/efiboot/exec.c:1.17 src/sys/stand/efiboot/exec.c:1.18
--- src/sys/stand/efiboot/exec.c:1.17	Fri Jun 26 03:23:04 2020
+++ src/sys/stand/efiboot/exec.c	Sun Jun 28 11:39:50 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: exec.c,v 1.17 2020/06/26 03:23:04 thorpej Exp $ */
+/* $NetBSD: exec.c,v 1.18 2020/06/28 11:39:50 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2019 Jason R. Thorpe
@@ -28,7 +28,6 @@
  */
 
 #include "efiboot.h"
-#include "efienv.h"
 #include "efifdt.h"
 #include "efiacpi.h"
 #include "efirng.h"

Index: src/sys/stand/efiboot/version
diff -u src/sys/stand/efiboot/version:1.18 src/sys/stand/efiboot/version:1.19
--- src/sys/stand/efiboot/version:1.18	Fri Jun 26 03:23:04 2020
+++ src/sys/stand/efiboot/version	Sun Jun 28 11:39:50 2020
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.18 2020/06/26 03:23:04 thorpej Exp $
+$NetBSD: version,v 1.19 2020/06/28 11:39:50 jmcneill Exp $
 
 NOTE ANY CHANGES YOU MAKE TO THE EFI BOOTLOADER HERE.  The format of this
 file is important - make sure the entries are appended on end, last item
@@ -22,3 +22,4 @@ is taken as the current.
 1.15:	Add module support.
 2.0:	Add boot.cfg support.
 2.1:	Remove efiboot.plist support; support dtoverlay in boot.cfg.
+2.2:	Remove support for storing settings in EFI env vars.

Reply via email to