Make it possible to specify the path to userboot.so with the -b flag.

Reviewed by:	neel
This commit is contained in:
Juli Mallett 2016-01-14 22:07:35 +00:00
parent cb03a5029b
commit e83ddf77d4

View File

@ -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);