#include <sys/types.h>
#include <dirent.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef ENABLE_NLS
#include <libintl.h>
#define _(String) gettext (String)
#else
#define _(String) (String)
#endif
#include "libaura/mem.h"
#include "libaura/buffer.h"
#include "libdfui/dfui.h"
#include "libinstaller/commands.h"
#include "libinstaller/confed.h"
#include "libinstaller/diskutil.h"
#include "libinstaller/functions.h"
#include "libinstaller/uiutil.h"
#include "fn.h"
#include "pathnames.h"
void
fn_show_dmesg(struct i_fn_args *a)
{
struct aura_buffer *e;
struct dfui_form *f;
struct dfui_response *r;
e = aura_buffer_new(1024);
aura_buffer_cat_file(e, "%s%s", a->os_root, cmd_name(a, "DMESG_BOOT"));
f = dfui_form_create(
"dmesg",
_("System Startup Messages (dmesg)"),
aura_buffer_buf(e),
"",
"p", "role", "informative",
"p", "minimum_width", "72",
"p", "monospaced", "true",
"a", "ok", _("OK"), "", "",
"p", "accelerator", "ESC",
NULL
);
if (!dfui_be_present(a->c, f, &r))
abort_backend();
dfui_form_free(f);
dfui_response_free(r);
aura_buffer_free(e);
}
void
fn_show_pciconf(struct i_fn_args *a)
{
struct aura_buffer *e;
struct dfui_form *f;
struct dfui_response *r;
e = aura_buffer_new(1024);
aura_buffer_cat_pipe(e, "pciconf -l -v");
f = dfui_form_create(
"pciconf",
_("PCI Devices"),
aura_buffer_buf(e),
"",
"p", "role", "informative",
"p", "minimum_width", "72",
"p", "monospaced", "true",
"a", "ok", _("OK"), "", "",
"p", "accelerator", "ESC",
NULL
);
if (!dfui_be_present(a->c, f, &r))
abort_backend();
dfui_form_free(f);
dfui_response_free(r);
aura_buffer_free(e);
}
void
fn_show_natacontrol(struct i_fn_args *a)
{
struct aura_buffer *e;
struct dfui_form *f;
struct dfui_response *r;
e = aura_buffer_new(1024);
aura_buffer_cat_pipe(e, "natacontrol list");
f = dfui_form_create(
"natacontrol",
_("ATA Devices"),
aura_buffer_buf(e),
"",
"p", "role", "informative",
"p", "minimum_width", "72",
"p", "monospaced", "true",
"a", "ok", _("OK"), "", "",
"p", "accelerator", "ESC",
NULL
);
if (!dfui_be_present(a->c, f, &r))
abort_backend();
dfui_form_free(f);
dfui_response_free(r);
aura_buffer_free(e);
}
void
show_ifconfig(struct dfui_connection *c, char *ifname)
{
struct aura_buffer *e;
e = aura_buffer_new(1024);
aura_buffer_cat_pipe(e, "/sbin/ifconfig %s", ifname);
inform(c, "%s", aura_buffer_buf(e));
aura_buffer_free(e);
}