summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2016-01-14 22:07:35 +0000
committerjmallett <jmallett@FreeBSD.org>2016-01-14 22:07:35 +0000
commit07212910c5970e08e1821fbe7d0701a0d9353872 (patch)
treeca56c2917cbf08b6045a01f072277d83f33992f8
parentb44c9b27614b4dd0f17257fca26ff654d074a0b9 (diff)
downloadFreeBSD-src-07212910c5970e08e1821fbe7d0701a0d9353872.zip
FreeBSD-src-07212910c5970e08e1821fbe7d0701a0d9353872.tar.gz
Make it possible to specify the path to userboot.so with the -b flag.
Reviewed by: neel
-rw-r--r--sys/boot/userboot/test/test.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/boot/userboot/test/test.c b/sys/boot/userboot/test/test.c
index d7ec3e4..d5707de 100644
--- a/sys/boot/userboot/test/test.c
+++ b/sys/boot/userboot/test/test.c
@@ -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);
OpenPOWER on IntegriCloud