Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jan 2016 22:07:35 +0000 (UTC)
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r294047 - head/sys/boot/userboot/test
Message-ID:  <201601142207.u0EM7Zvd064658@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jmallett
Date: Thu Jan 14 22:07:35 2016
New Revision: 294047
URL: https://svnweb.freebsd.org/changeset/base/294047

Log:
  Make it possible to specify the path to userboot.so with the -b flag.
  
  Reviewed by:	neel

Modified:
  head/sys/boot/userboot/test/test.c

Modified: head/sys/boot/userboot/test/test.c
==============================================================================
--- head/sys/boot/userboot/test/test.c	Thu Jan 14 22:02:21 2016	(r294046)
+++ head/sys/boot/userboot/test/test.c	Thu Jan 14 22:07:35 2016	(r294047)
@@ -414,7 +414,7 @@ void
 usage()
 {
 
-	printf("usage: [-d <disk image path>] [-h <host filesystem path>\n");
+	printf("usage: [-b <userboot shared object>] [-d <disk image path>] [-h <host filesystem path>\n");
 	exit(1);
 }
 
@@ -425,9 +425,14 @@ main(int argc, char** argv)
 	void (*func)(struct loader_callbacks *, void *, int, int);
 	int opt;
 	char *disk_image = NULL;
+	const char *userboot_obj = "/boot/userboot.so";
 
-	while ((opt = getopt(argc, argv, "d:h:")) != -1) {
+	while ((opt = getopt(argc, argv, "b:d:h:")) != -1) {
 		switch (opt) {
+		case 'b':
+			userboot_obj = optarg;
+			break;
+
 		case 'd':
 			disk_image = optarg;
 			break;
@@ -441,8 +446,7 @@ main(int argc, char** argv)
 		}
 	}
 
-	h = dlopen("/boot/userboot.so",
-            RTLD_LOCAL);
+	h = dlopen(userboot_obj, RTLD_LOCAL);
 	if (!h) {
 		printf("%s\n", dlerror());
 		return (1);



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