Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Feb 2020 04:42:16 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r358208 - in stable: 11/stand/efi/loader 12/stand/efi/loader
Message-ID:  <202002210442.01L4gGVP074975@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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/11/stand/efi/loader/main.c
Directory Properties:
  stable/11/   (props changed)

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

Modified: stable/11/stand/efi/loader/main.c
==============================================================================
--- stable/11/stand/efi/loader/main.c	Fri Feb 21 04:41:22 2020	(r358207)
+++ stable/11/stand/efi/loader/main.c	Fri Feb 21 04:42:16 2020	(r358208)
@@ -169,8 +169,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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202002210442.01L4gGVP074975>