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 * Diagnostic functions for installer.
37 * $Id: fn_diagnostic.c,v 1.21 2005/03/13 01:53:58 cpressey Exp $
40 #include <sys/types.h>
50 #define _(String) gettext (String)
52 #define _(String) (String)
55 #include "libaura/mem.h"
56 #include "libaura/buffer.h"
58 #include "libdfui/dfui.h"
60 #include "libinstaller/commands.h"
61 #include "libinstaller/confed.h"
62 #include "libinstaller/diskutil.h"
63 #include "libinstaller/functions.h"
64 #include "libinstaller/package.h"
65 #include "libinstaller/uiutil.h"
68 #include "pathnames.h"
70 /*** DIAGNOSTIC FUNCTIONS ***/
73 fn_show_dmesg(struct i_fn_args *a)
75 struct aura_buffer *e;
77 struct dfui_response *r;
79 e = aura_buffer_new(1024);
80 aura_buffer_cat_file(e, "%s%s", a->os_root, cmd_name(a, "DMESG_BOOT"));
84 _("System Startup Messages (dmesg)"),
88 "p", "role", "informative",
89 "p", "minimum_width", "72",
90 "p", "monospaced", "true",
92 "a", "ok", _("OK"), "", "",
93 "p", "accelerator", "ESC",
98 if (!dfui_be_present(a->c, f, &r))
102 dfui_response_free(r);
108 fn_show_pciconf(struct i_fn_args *a)
110 struct aura_buffer *e;
112 struct dfui_response *r;
114 e = aura_buffer_new(1024);
115 aura_buffer_cat_pipe(e, "pciconf -l -v");
117 f = dfui_form_create(
123 "p", "role", "informative",
124 "p", "minimum_width", "72",
125 "p", "monospaced", "true",
127 "a", "ok", _("OK"), "", "",
128 "p", "accelerator", "ESC",
133 if (!dfui_be_present(a->c, f, &r))
137 dfui_response_free(r);
143 fn_show_natacontrol(struct i_fn_args *a)
145 struct aura_buffer *e;
147 struct dfui_response *r;
149 e = aura_buffer_new(1024);
150 aura_buffer_cat_pipe(e, "natacontrol list");
152 f = dfui_form_create(
158 "p", "role", "informative",
159 "p", "minimum_width", "72",
160 "p", "monospaced", "true",
162 "a", "ok", _("OK"), "", "",
163 "p", "accelerator", "ESC",
168 if (!dfui_be_present(a->c, f, &r))
172 dfui_response_free(r);
178 show_ifconfig(struct dfui_connection *c, char *ifname)
180 struct aura_buffer *e;
182 e = aura_buffer_new(1024);
183 aura_buffer_cat_pipe(e, "/sbin/ifconfig %s", ifname);
184 inform(c, "%s", aura_buffer_buf(e));