summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall/sysinstall.h
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2002-12-03 22:25:47 +0000
committerrwatson <rwatson@FreeBSD.org>2002-12-03 22:25:47 +0000
commit7df36e7050d668954254dfbc385eabcb706e1e34 (patch)
treea476abe9eff91a0f04e8f6b23f1bca03960ea984 /usr.sbin/sysinstall/sysinstall.h
parent1d704c21dc2b4a5dac9c13d406a91876f3c63e70 (diff)
downloadFreeBSD-src-7df36e7050d668954254dfbc385eabcb706e1e34.zip
FreeBSD-src-7df36e7050d668954254dfbc385eabcb706e1e34.tar.gz
Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option. (1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and NEWFS_CUSTOM. Don't mix up the arguments to them: you can't use soft updates on an msdos file system. (2) Distinguish adding new arguments to the newfs command line from replacing it. Permit the addition of new arguments by the user for NEWFS_UFS. If we entirely replace the command line provided by sysinstall, call it NEWFS_CUSTOM. 'N' will now add additional arguments; 'Z' will opt to replace the newfs command line entirely, but will prompt the user with their current command line as a starting point. (3) Construct the newfs command line dynamically based on the options provided by the user at label-time. Right now, this means selecting UFS1 vs. UFS2, and the soft updates flag. Drop in some variables to support ACLs and MAC Multilabel in the future also, but don't expose them now. This provides sysinstall with the ability to do more "in band" editing of the newfs command line, so we can provide more support for the user, but doesn't sacrifice the ability to entirely specify the newfs command line of the user is willing to give up on the cushiness factor. It also makes it easier for us to specify defaults in the future, and define conditional behavior based on user configuration selections. For now, we default to UFS1, and permit UFS2 to be used as the root only on non-i386 systems. While I was there, I dropped the default fragment and block sizes, since newfs has much more sensible defaults now. Reviewed by: jhb, marcel Approved by: re ia64 bits from: marcel
Diffstat (limited to 'usr.sbin/sysinstall/sysinstall.h')
-rw-r--r--usr.sbin/sysinstall/sysinstall.h37
1 files changed, 31 insertions, 6 deletions
diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h
index 1a0e20a..7ed0fab 100644
--- a/usr.sbin/sysinstall/sysinstall.h
+++ b/usr.sbin/sysinstall/sysinstall.h
@@ -308,14 +308,39 @@ typedef enum {
PART_FAT,
} PartType;
-/* The longest newfs command we'll hand to system() */
-#define NEWFS_CMD_MAX 256
+#define NEWFS_UFS_CMD "newfs"
+#define NEWFS_MSDOS_CMD "newfs_msdos"
+
+enum newfs_type { NEWFS_UFS, NEWFS_MSDOS, NEWFS_CUSTOM };
+#define NEWFS_UFS_STRING "UFS"
+#define NEWFS_MSDOS_STRING "FAT"
+#define NEWFS_CUSTOM_STRING "CST"
+
+/* The longest set of custom command line arguments we'll pass. */
+#define NEWFS_CMD_ARGS_MAX 256
typedef struct _part_info {
- Boolean newfs;
- char mountpoint[FILENAME_MAX];
- char newfs_cmd[NEWFS_CMD_MAX];
- int soft;
+ char mountpoint[FILENAME_MAX];
+
+ /* Is invocation of newfs desired? */
+ Boolean do_newfs;
+
+ enum newfs_type newfs_type;
+ union {
+ struct {
+ char user_options[NEWFS_CMD_ARGS_MAX];
+ Boolean acls; /* unused */
+ Boolean multilabel; /* unused */
+ Boolean softupdates;
+ Boolean ufs2;
+ } newfs_ufs;
+ struct {
+ /* unused */
+ } newfs_msdos;
+ struct {
+ char command[NEWFS_CMD_ARGS_MAX];
+ } newfs_custom;
+ } newfs_data;
} PartInfo;
/* An option */
OpenPOWER on IntegriCloud