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);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to