installer: Remove unused code to run memtest and create a memtest86 floppy.
authorSascha Wildner <saw@online.de>
Sat, 18 Sep 2010 20:54:46 +0000 (22:54 +0200)
committerSascha Wildner <saw@online.de>
Sun, 19 Sep 2010 09:14:10 +0000 (11:14 +0200)
share/installer/cmdnames.conf
usr.sbin/installer/dfuibe_installer/flow.c
usr.sbin/installer/dfuibe_installer/fn.h
usr.sbin/installer/dfuibe_installer/fn_diagnostic.c
usr.sbin/installer/dfuibe_installer/fn_disk.c

index ceb0cc5..4ba15bc 100644 (file)
@@ -71,8 +71,6 @@ VIDCONTROL=usr/sbin/vidcontrol
 
 DHCPD=usr/pkg/sbin/dhcpd
 
-MEMTEST=usr/local/bin/memtest
-
 # These aren't commands, but they're configurable here nonetheless.
 
 DMESG_BOOT=var/run/dmesg.boot
index 9f44e76..e1c9be4 100644 (file)
@@ -709,20 +709,6 @@ state_diagnostics_menu(struct i_fn_args *a)
                    NULL
                );
 
-               if (is_file("%sboot/memtest86.flp.bz2", a->os_root)) {
-                       dfui_form_action_add(f, "memtest86",
-                           dfui_info_new(_("Create memtest86 Floppy"),
-                           _("Create a floppy which boots into a dedicated memory-test"),
-                           ""));
-               }
-
-               if (is_program("%susr/local/bin/memtest", a->os_root)) {
-                       dfui_form_action_add(f, "memtest",
-                           dfui_info_new(_("Run On-Line Memory Test"),
-                           _("Test the memory in the machine while running"),
-                           ""));
-               }
-
                k = dfui_form_action_add(f, "cancel",
                    dfui_info_new(_("Return to Utilities Menu"), "", ""));
                dfui_action_property_set(k, "accelerator", "ESC");
@@ -739,10 +725,6 @@ state_diagnostics_menu(struct i_fn_args *a)
                        fn_show_pnpinfo(a);
                } else if (strcmp(dfui_response_get_action_id(r), "natacontrol") == 0) {
                        fn_show_natacontrol(a);
-               } else if (strcmp(dfui_response_get_action_id(r), "memtest") == 0) {
-                       fn_memtest(a);
-               } else if (strcmp(dfui_response_get_action_id(r), "memtest86") == 0) {
-                       fn_create_memtest86_floppy(a);
                } else if (strcmp(dfui_response_get_action_id(r), "cancel") == 0) {
                        state = state_utilities_menu;
                        done = 1;
index 3b2b5ef..0265a32 100644 (file)
@@ -77,9 +77,7 @@ void           fn_show_dmesg(struct i_fn_args *);
 void            fn_show_pciconf(struct i_fn_args *);
 void            fn_show_pnpinfo(struct i_fn_args *);
 void            fn_show_natacontrol(struct i_fn_args *);
-void            fn_memtest(struct i_fn_args *);
 
-void            view_memtest_log(struct i_fn_args *);
 void            show_ifconfig(struct dfui_connection *, char *);
 
 /* LiveCD Utilties: Disk Utilities */
@@ -94,7 +92,6 @@ void           fn_wipe_start_of_disk(struct i_fn_args *);
 void            fn_wipe_start_of_slice(struct i_fn_args *);
 void            fn_format_msdos_floppy(struct i_fn_args *);
 void            fn_create_cdboot_floppy(struct i_fn_args *);
-void            fn_create_memtest86_floppy(struct i_fn_args *);
 
 int             format_slice(struct i_fn_args *);
 
index bdb12f4..01077cc 100644 (file)
 
 /*** DIAGNOSTIC FUNCTIONS ***/
 
-void
-fn_memtest(struct i_fn_args *a)
-{
-       struct dfui_form *f;
-       struct dfui_response *r;
-       struct dfui_dataset *ds, *new_ds;
-       struct commands *cmds;
-       struct command *cmd;
-       const char *memtestsize;
-
-       f = dfui_form_create(
-           "memtest",
-           _("Memory test"),
-           _("Memory test - Enter the size in values such as 400M, 1G."),
-           "",
-
-           "f", "memtestsize", _("Memory test size"),
-           _("Enter the amount of memory you would like to check:"), "",
-
-           "a", "ok", _("OK"), "", "",
-           "a", "cancel", _("Cancel Memory Test"), "", "",
-           "p", "accelerator", "ESC",
-
-           NULL
-       );
-
-       ds = dfui_dataset_new();
-       dfui_dataset_celldata_add(ds, "memtestsize", "");
-       dfui_form_dataset_add(f, ds);
-
-       if (!dfui_be_present(a->c, f, &r))
-               abort_backend();
-
-       if (strcmp(dfui_response_get_action_id(r), "ok") == 0) {
-               new_ds = dfui_response_dataset_get_first(r);
-               memtestsize = dfui_dataset_get_value(new_ds, "memtestsize");
-               cmds = commands_new();
-               cmd = command_add(cmds,
-                   "cd %s && %s%s %s 1 --log",
-                   a->tmp,
-                   a->os_root, cmd_name(a, "MEMTEST"),
-                   memtestsize);
-               command_set_log_mode(cmd, COMMAND_LOG_QUIET);
-               cmd = command_add(cmds,
-                   "%s%s -E -v '^Unable to malloc' %smemtest.log > %smemtest.log.new",
-                   a->os_root, cmd_name(a, "GREP"),
-                   a->tmp, a->tmp);
-               cmd = command_add(cmds, "%s%s %smemtest.log.new %smemtest.log",
-                   a->os_root, cmd_name(a, "MV"),
-                   a->tmp, a->tmp);
-               cmd = command_add(cmds,
-                   "%s%s -E -v '^Allocated.*failed' %smemtest.log > %smemtest.log.new",
-                   a->os_root, cmd_name(a, "GREP"),
-                   a->tmp, a->tmp);
-               cmd = command_add(cmds, "%s%s %smemtest.log.new %smemtest.log",
-                   a->os_root, cmd_name(a, "MV"),
-                   a->tmp, a->tmp);
-               if (commands_execute(a, cmds)) {
-                       commands_free(cmds);
-                       view_memtest_log(a);
-                       cmds = commands_new();
-                       cmd = command_add(cmds, "%s%s -f %smemtest.log",
-                           a->os_root, cmd_name(a, "RM"),
-                           a->tmp);
-                       commands_execute(a, cmds);
-               } else {
-                       inform(a->c, _("Memory test could not be run."));
-               }
-               commands_free(cmds);
-       }
-
-       dfui_form_free(f);
-       dfui_response_free(r);
-}
-
-void
-view_memtest_log(struct i_fn_args *a)
-{
-       struct aura_buffer *error_log;
-       struct dfui_form *f;
-       struct dfui_response *r;
-
-       error_log = aura_buffer_new(1024);
-       aura_buffer_cat_file(error_log, "%smemtest.log", a->tmp);
-
-       f = dfui_form_create(
-           "error_log",
-           _("Error Log"),
-           aura_buffer_buf(error_log),
-           "",
-
-           "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(error_log);
-}
-
 void
 fn_show_dmesg(struct i_fn_args *a)
 {
index fe5aa89..2d0999e 100644 (file)
@@ -573,47 +573,6 @@ fn_create_cdboot_floppy(struct i_fn_args *a)
        }
 }
 
-void
-fn_create_memtest86_floppy(struct i_fn_args *a)
-{
-       struct commands *cmds;
-
-       switch (dfui_be_present_dialog(a->c, _("Create memtest86 Floppy"),
-           "Create memtest86 Floppy|Return to Utilities Menu",
-           "While this installer allows you to test memory "
-           "on-line, the fact that the installer and operating "
-           "system are already loaded means that the memory "
-           "test has certain limits.  For a more thorough "
-           "memory test, you can create a floppy containing "
-           "the memtest86 program, which boots up independently "
-           "of any operating system, allowing it access to "
-           "almost the entire memory of the computer for testing.\n\n"
-           "memtest86 is not a part of %s; "
-           "the memtest86 project can be found here:\n\n"
-           "http://www.memtest86.com/\n\n"
-           "To create a memtest86 floppy, insert a blank floppy "
-           "in unit 0 (``drive A:'') before proceeding."
-           "", OPERATING_SYSTEM_NAME)) {
-       case 1:
-               cmds = commands_new();
-               command_add(cmds, "%s%s -c %sboot/memtest86.flp.bz2 | "
-                   "%s%s of=%sdev/fd0 bs=32k",
-                   a->os_root, cmd_name(a, "BUNZIP2"),
-                   a->os_root,
-                   a->os_root, cmd_name(a, "DD"),
-                   a->os_root);
-               if (commands_execute(a, cmds))
-                       inform(a->c, _("memtest86 floppy successfully created!"));
-               else
-                       inform(a->c, _("memtest86 floppy was not successfully created."));
-               break;
-       case 2:
-               return;
-       default:
-               abort_backend();
-       }
-}
-
 /**** NON-fn_ FUNCTIONS ***/
 
 int