Index: usr.sbin/installboot/evboards.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/installboot/evboards.c,v
retrieving revision 1.6
diff -u -r1.6 evboards.c
--- usr.sbin/installboot/evboards.c	6 Aug 2021 07:55:13 -0000	1.6
+++ usr.sbin/installboot/evboards.c	5 Jul 2022 21:20:23 -0000
@@ -441,16 +441,6 @@
 static const char evb_db_base_location[] =
     EVBOARDS_PLIST_BASE "/share/installboot";
 
-#ifndef DEFAULT_UBOOT_PKG_PATH
-#define	DEFAULT_UBOOT_PKG_PATH	"/usr/pkg/share/u-boot"
-#endif
-
-#ifndef UBOOT_PATHS_ENV_VAR
-#define	UBOOT_PATHS_ENV_VAR	"INSTALLBOOT_UBOOT_PATHS"
-#endif
-
-static const char evb_uboot_pkg_path[] = DEFAULT_UBOOT_PKG_PATH;
-
 /*
  * evb_db_base_path --
  *	Returns the path to the base board db file.
@@ -483,9 +473,8 @@
 	int i, count;
 	char *cp, *startcp;
 
-	pathspec = getenv(UBOOT_PATHS_ENV_VAR);
-	if (pathspec == NULL)
-		pathspec = evb_uboot_pkg_path;
+	pathspec = params->uboot_paths;
+	assert(pathspec != NULL);
 
 	if (strlen(pathspec) == 0)
 		goto out;
Index: usr.sbin/installboot/installboot.8
===================================================================
RCS file: /cvsroot/src/usr.sbin/installboot/installboot.8,v
retrieving revision 1.102
diff -u -r1.102 installboot.8
--- usr.sbin/installboot/installboot.8	5 Dec 2021 04:46:33 -0000	1.102
+++ usr.sbin/installboot/installboot.8	5 Jul 2022 21:20:23 -0000
@@ -42,6 +42,7 @@
 .Op Fl m Ar machine
 .Op Fl o Ar options
 .Op Fl t Ar fstype
+.Op Fl u Ar U-boot-paths
 .Ar filesystem
 .Ar primary
 .Op Ar secondary
@@ -407,6 +408,24 @@
 .Fl B Ar s2bno .
 .El
 .
+.It Fl u Ar U-boot-paths
+.Ar U-boot-paths
+is a colon-separated list of search paths to scan for
+.Sy U-boot
+packages with
+.Nm installboot
+installation overlays.
+If multiple overlays are found, overlays from paths closer to the front
+of the list take precedence.
+If not specified, environment variable 
+.Ev INSTALLBOOT_UBOOT_PATHS
+is used if defined; otherwise, the default path is
+.Pa /usr/pkg/share/u-boot .
+This option is only used on platforms that support
+using
+.Sy U-boot :
+.Sy evbarm .
+.
 .It Fl v
 Verbose operation.
 .
Index: usr.sbin/installboot/installboot.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/installboot/installboot.c,v
retrieving revision 1.40
diff -u -r1.40 installboot.c
--- usr.sbin/installboot/installboot.c	7 May 2019 05:02:42 -0000	1.40
+++ usr.sbin/installboot/installboot.c	5 Jul 2022 21:20:23 -0000
@@ -60,6 +60,7 @@
 
 static	void	getmachine(ib_params *, const char *, const char *);
 static	void	getfstype(ib_params *, const char *, const char *);
+static	void	getubootpaths(ib_params *, const char *);
 static	void	parseoptions(ib_params *, const char *);
 __dead static	void	usage(void);
 static	void	options_usage(void);
@@ -103,6 +104,14 @@
 
 #define DFL_SECSIZE	512	/* Don't use DEV_BSIZE. It's host's value. */
 
+#ifndef DEFAULT_UBOOT_PKG_PATH
+#define	DEFAULT_UBOOT_PKG_PATH	"/usr/pkg/share/u-boot"
+#endif
+
+#ifndef UBOOT_PATHS_ENV_VAR
+#define	UBOOT_PATHS_ENV_VAR	"INSTALLBOOT_UBOOT_PATHS"
+#endif
+
 int
 main(int argc, char *argv[])
 {
@@ -126,8 +135,12 @@
 	params->s1fd = -1;
 	if ((p = getenv("MACHINE")) != NULL)
 		getmachine(params, p, "$MACHINE");
+	getubootpaths(params, DEFAULT_UBOOT_PKG_PATH);
+	if ((p = getenv(UBOOT_PATHS_ENV_VAR)) != NULL) {
+		getubootpaths(params, p);
+	}
 
-	while ((ch = getopt(argc, argv, "b:B:cefm:no:t:v")) != -1) {
+	while ((ch = getopt(argc, argv, "b:B:cefm:no:t:u:v")) != -1) {
 		switch (ch) {
 
 		case 'b':
@@ -176,6 +189,10 @@
 			getfstype(params, optarg, "-t");
 			break;
 
+		case 'u':
+			getubootpaths(params, optarg);
+			break;
+
 		case 'v':
 			params->flags |= IB_VERBOSE;
 			break;
@@ -602,6 +619,15 @@
 }
 
 static void
+getubootpaths(ib_params *param, const char *paths)
+{
+	assert(param != NULL);
+	assert(paths != NULL);
+
+	param->uboot_paths = paths;
+}
+
+static void
 usage(void)
 {
 	const char	*prog;
@@ -609,7 +635,7 @@
 	prog = getprogname();
 	fprintf(stderr,
 "usage: %s [-fnv] [-B s2bno] [-b s1bno] [-m machine] [-o options]\n"
-"\t\t   [-t fstype] filesystem primary [secondary]\n"
+"\t\t   [-t fstype] [-u uboot-paths] filesystem primary [secondary]\n"
 "usage: %s -c [-fnv] [-m machine] [-o options] [-t fstype] filesystem\n"
 "usage: %s -e [-fnv] [-m machine] [-o options] bootstrap\n",
 	    prog, prog, prog);
Index: usr.sbin/installboot/installboot.h
===================================================================
RCS file: /cvsroot/src/usr.sbin/installboot/installboot.h,v
retrieving revision 1.42
diff -u -r1.42 installboot.h
--- usr.sbin/installboot/installboot.h	21 Jun 2020 17:17:02 -0000	1.42
+++ usr.sbin/installboot/installboot.h	5 Jul 2022 21:20:23 -0000
@@ -105,6 +105,7 @@
 	const char	*board;		/* board specification */
 	const char	*dtb;		/* dtb specification */
 	const char	*media;		/* boot media type */
+	const char	*uboot_paths;	/* u-boot paths (evbarm) */
 
 		/* temporary working data */
 	void		*mach_data;	/* platform-specific data */
