svn commit: r357845 - head/stand/efi/loader

Kyle Evans kevans at FreeBSD.org
Wed Feb 12 22:29:09 UTC 2020


Author: kevans
Date: Wed Feb 12 22:29:08 2020
New Revision: 357845
URL: https://svnweb.freebsd.org/changeset/base/357845

Log:
  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.
  
  Reviewed by:	imp, sigsys at gmail.com
  Submitted/Diagnosed by:	sigsys at gmail.com
  Differential Revision:	https://reviews.freebsd.org/D23390

Modified:
  head/stand/efi/loader/main.c

Modified: head/stand/efi/loader/main.c
==============================================================================
--- head/stand/efi/loader/main.c	Wed Feb 12 21:52:10 2020	(r357844)
+++ head/stand/efi/loader/main.c	Wed Feb 12 22:29:08 2020	(r357845)
@@ -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