Add HAMMER support to the installer
[dragonfly.git] / contrib / bsdinstaller-1.1.6 / src / backend / installer / flow.c
index 003a2e6..0691bb2 100644 (file)
 #ifdef ENABLE_NLS
 #include <libintl.h>
 #include <locale.h>
-#include "dfui/lang.h"
+#include "libdfui/lang.h"
 #define _(String) gettext (String)
 extern int _nl_msg_cat_cntr;
 #else
 #define _(String) (String)
 #endif
 
-#include "aura/mem.h"
-#include "aura/dict.h"
-#include "aura/fspred.h"
+#include "libaura/mem.h"
+#include "libaura/dict.h"
+#include "libaura/fspred.h"
 
-#include "dfui/dfui.h"
+#include "libdfui/dfui.h"
 #ifdef DEBUG
-#include "dfui/dump.h"
+#include "libdfui/dump.h"
 #endif
-#include "dfui/system.h"
+#include "libdfui/system.h"
 
-#include "installer/commands.h"
-#include "installer/confed.h"
-#include "installer/diskutil.h"
-#include "installer/functions.h"
-#include "installer/package.h"
-#include "installer/uiutil.h"
+#include "libinstaller/commands.h"
+#include "libinstaller/confed.h"
+#include "libinstaller/diskutil.h"
+#include "libinstaller/functions.h"
+#include "libinstaller/package.h"
+#include "libinstaller/uiutil.h"
 
 #include "flow.h"
 #include "fn.h"
@@ -121,8 +121,8 @@ state_lang_menu(struct i_fn_args *a)
 
                        "p", "role", "menu",
 
-                       "a", "default", "default",
-                       "Do not choose any language", "",
+                       "a", "default", "English",
+                       "English Standard Default", "",
                        "a", "ru", "Russian",
                        "Russian KOI8-R", "",
                        NULL
@@ -979,6 +979,37 @@ state_select_disk(struct i_fn_args *a)
        }
 }
 
+void
+state_ask_fs(struct i_fn_args *a)
+{
+       use_hammer = 0;
+
+       switch (dfui_be_present_dialog(a->c, _("Select file system"),
+           _("Use HAMMER|Use UFS|Return to Select Disk"),
+           _("Please select the file system you want to use with %s\n\n"
+             "HAMMER is the new %s file system.  UFS the traditional BSD file system"),
+           OPERATING_SYSTEM_NAME,
+           OPERATING_SYSTEM_NAME))
+       {
+       case 1:
+               /* HAMMER */
+               use_hammer = 1;
+               break;
+       case 2:
+               /* UFS */
+               break;
+       case 3:
+               state = state_select_disk;
+               return;
+               /* NOTREACHED */
+               break;
+       default:
+               abort_backend();
+               break;
+       }
+       state = state_create_subpartitions;
+}
+
 /*
  * state_format_disk: ask the user if they wish to format the disk they
  * selected.
@@ -1018,7 +1049,7 @@ state_format_disk(struct i_fn_args *a)
 
                fn_format_disk(a);
                if (a->result)
-                       state = state_create_subpartitions;
+                       state = state_ask_fs;
                else
                        state = state_format_disk;
                break;
@@ -1113,7 +1144,7 @@ state_select_slice(struct i_fn_args *a)
                        } else {
                                inform(a->c, _("Primary partition #%d was formatted."),
                                    slice_get_number(storage_get_selected_slice(a->s)));
-                               state = state_create_subpartitions;
+                               state = state_ask_fs;
                        }
                } else {
                        inform(a->c, _("Action cancelled - no primary partitions were formatted."));
@@ -1408,7 +1439,7 @@ state_setup_remote_installation_server(struct i_fn_args *a)
                            a->os_root, cmd_name(a, "INETD"));
                        command_add(cmds, "%s%s %svar/db/dhcpd.leases",
                            a->os_root, cmd_name(a, "TOUCH"), a->os_root);
-                       command_add(cmds, "%s%s >%sdev/null 2>&1",
+                       command_add(cmds, "%s%s -cf /etc/dhcpd.conf >%sdev/null 2>&1",
                            a->os_root, cmd_name(a, "DHCPD"), a->os_root);
                        command_add(cmds, "%s%s >%sdev/null 2>&1",
                            a->os_root, cmd_name(a, "RPCBIND"), a->os_root);