diff options
author | jmallett <jmallett@FreeBSD.org> | 2016-01-14 22:07:35 +0000 |
---|---|---|
committer | jmallett <jmallett@FreeBSD.org> | 2016-01-14 22:07:35 +0000 |
commit | 07212910c5970e08e1821fbe7d0701a0d9353872 (patch) | |
tree | ca56c2917cbf08b6045a01f072277d83f33992f8 | |
parent | b44c9b27614b4dd0f17257fca26ff654d074a0b9 (diff) | |
download | FreeBSD-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.c | 12 |
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); |