2 * Copyright (c)2004 The DragonFly Project. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
8 * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
11 * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in
13 * the documentation and/or other materials provided with the
16 * Neither the name of the DragonFly Project nor the names of its
17 * contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
25 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
31 * OF THE POSSIBILITY OF SUCH DAMAGE.
36 * Main program for installer backend.
37 * $Id: main.c,v 1.18 2005/03/11 19:57:27 cpressey Exp $
48 #define _(String) gettext (String)
50 #define _(String) (String)
53 #include "libaura/mem.h"
55 #include "libdfui/dfui.h"
56 #include "libdfui/dump.h"
57 #include "libdfui/system.h"
60 #include "pathnames.h"
62 static void usage(char **);
65 main(int argc, char **argv)
68 char *rendezvous = NULL;
75 setlocale (LC_ALL, "");
76 bindtextdomain (PACKAGE, LOCALEDIR);
81 * XXX TODO: set transport and rendezvous from
82 * corresponding environment variables, if set.
85 strlcpy(os_root, DEFAULT_OS_ROOT, sizeof(os_root));
88 dfui_debug_file = fopen("/tmp/dfuibe_installer_debug.log", "w");
92 * Get command-line arguments.
94 while ((opt = getopt(argc, argv, "o:r:t:")) != -1) {
97 strlcpy(os_root, optarg, sizeof(os_root));
100 rendezvous = aura_strdup(optarg);
103 transport = user_get_transport(optarg);
114 transport = user_get_transport("tcp");
116 if (rendezvous == NULL) {
117 if (transport == DFUI_TRANSPORT_TCP)
118 rendezvous = aura_strdup("9999");
120 rendezvous = aura_strdup("test");
123 do_reboot = flow(transport, rendezvous, os_root,
136 fprintf(stderr, _("Usage: %s [-o rootdir] [-r rendezvous] "
137 "[-t npipe|tcp]\n"), argv[0]);