]> git.ozlabs.org Git - petitboot/blobdiff - discover/pb-discover.c
discover: Use pxeconffile for udhcpc option name
[petitboot] / discover / pb-discover.c
index ccd1c7daba597441c9df3dac3e67f89ed2aeab50..b15413090e49fefc34b84ef0f7f0385328994ad5 100644 (file)
 #include <log/log.h>
 #include <pb-config/pb-config.h>
 #include <process/process.h>
+#include <talloc/talloc.h>
 
 #include "udev.h"
 #include "user-event.h"
 #include "discover-server.h"
 #include "device-handler.h"
 #include "network.h"
+#include "sysinfo.h"
 
 static void print_version(void)
 {
@@ -172,6 +174,8 @@ int main(int argc, char *argv[])
        if (opts.no_autoboot == opt_yes)
                config_set_autoboot(false);
 
+       system_info_init(server);
+
        handler = device_handler_init(server, waitset, opts.dry_run == opt_yes);
        if (!handler)
                return EXIT_FAILURE;
@@ -197,10 +201,16 @@ int main(int argc, char *argv[])
        }
 
        device_handler_destroy(handler);
+       user_event_destroy(uev);
        udev_destroy(udev);
+       discover_server_destroy(server);
        config_fini();
+       talloc_free(waitset);
 
        pb_log("--- end ---\n");
 
+       if (log != stderr)
+               fclose(log);
+
        return EXIT_SUCCESS;
 }