svn commit: r358208 - in stable: 11/stand/efi/loader 12/stand/efi/loader

Kyle Evans kevans at FreeBSD.org
Fri Feb 21 04:42:17 UTC 2020


Author: kevans
Date: Fri Feb 21 04:42:16 2020
New Revision: 358208
URL: https://svnweb.freebsd.org/changeset/base/358208

Log:
  MFC r357845: efiloader: don't execute hooks when setting currdev/loaddev
  
  We still need to set the hooks to prevent improper manipulations thereafter
  at the loader prompt, but as it is we're actively preventing loaddev from
  being set correctly in some circumstances (ZFS in particular) and doing more
  work than needed with currdev -- that hook in particular validates it as a
  correct device, which we can assume isn't needed in this context.

Modified:
  stable/12/stand/efi/loader/main.c
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/stand/efi/loader/main.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/stand/efi/loader/main.c
==============================================================================
--- stable/12/stand/efi/loader/main.c	Fri Feb 21 04:41:22 2020	(r358207)
+++ stable/12/stand/efi/loader/main.c	Fri Feb 21 04:42:16 2020	(r358208)
@@ -180,8 +180,17 @@ static void
 set_currdev(const char *devname)
 {
 
-	env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, env_nounset);
-	env_setenv("loaddev", EV_VOLATILE, devname, env_noset, env_nounset);
+	/*
+	 * Don't execute hooks here; we may need to try setting these more than
+	 * once here if we're probing for the ZFS pool we're supposed to boot.
+	 * The currdev hook is intended to just validate user input anyways,
+	 * while the loaddev hook makes it immutable once we've determined what
+	 * the proper currdev is.
+	 */
+	env_setenv("currdev", EV_VOLATILE | EV_NOHOOK, devname, efi_setcurrdev,
+	    env_nounset);
+	env_setenv("loaddev", EV_VOLATILE | EV_NOHOOK, devname, env_noset,
+	    env_nounset);
 }
 
 static void


More information about the svn-src-all mailing list