Module Name:    src
Committed By:   martin
Date:           Tue Oct 13 17:26:28 UTC 2020

Modified Files:
        src/usr.sbin/sysinst: bsddisklabel.c defs.h disklabel.c disks.c gpt.c
            label.c msg.mi.de msg.mi.en msg.mi.es msg.mi.fr msg.mi.pl
            partitions.h util.c

Log Message:
PR 55142: on popular demand bring back expert options to adjust the
number of free inodes, block size and fragment size for FFS and LFS.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.66 -r1.67 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.41 -r1.42 src/usr.sbin/sysinst/disklabel.c
cvs rdiff -u -r1.70 -r1.71 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/sysinst/gpt.c
cvs rdiff -u -r1.29 -r1.30 src/usr.sbin/sysinst/label.c
cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/sysinst/msg.mi.de
cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/sysinst/msg.mi.en \
    src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/sysinst/msg.mi.es
cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/sysinst/partitions.h
cvs rdiff -u -r1.47 -r1.48 src/usr.sbin/sysinst/util.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sysinst/bsddisklabel.c
diff -u src/usr.sbin/sysinst/bsddisklabel.c:1.55 src/usr.sbin/sysinst/bsddisklabel.c:1.56
--- src/usr.sbin/sysinst/bsddisklabel.c:1.55	Tue Oct 13 10:44:25 2020
+++ src/usr.sbin/sysinst/bsddisklabel.c	Tue Oct 13 17:26:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.55 2020/10/13 10:44:25 martin Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.56 2020/10/13 17:26:28 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1494,6 +1494,9 @@ apply_settings_to_partitions(struct disk
 			infos[i].last_mounted = want->mount;
 			infos[i].fs_type = want->fs_type;
 			infos[i].fs_sub_type = want->fs_version;
+			infos[i].fs_opt1 = want->fs_opt1;
+			infos[i].fs_opt2 = want->fs_opt2;
+			infos[i].fs_opt3 = want->fs_opt3;
 			new_part_id = ps->pscheme->add_partition(ps,
 			    &infos[i], NULL);
 			if (new_part_id == NO_PART)
@@ -1578,6 +1581,9 @@ apply_settings_to_partitions(struct disk
 			infos[i].last_mounted = want->mount;
 			infos[i].fs_type = want->fs_type;
 			infos[i].fs_sub_type = want->fs_version;
+			infos[i].fs_opt1 = want->fs_opt1;
+			infos[i].fs_opt2 = want->fs_opt2;
+			infos[i].fs_opt3 = want->fs_opt3;
 			if (want->fs_type != FS_UNUSED &&
 			    want->type != PT_swap) {
 				want->instflags |= PUIINST_NEWFS;
@@ -1637,6 +1643,9 @@ apply_settings_to_partitions(struct disk
 			infos[i].last_mounted = want->mount;
 			infos[i].fs_type = want->fs_type;
 			infos[i].fs_sub_type = want->fs_version;
+			infos[i].fs_opt1 = want->fs_opt1;
+			infos[i].fs_opt2 = want->fs_opt2;
+			infos[i].fs_opt3 = want->fs_opt3;
 
 			if (wanted->parts->pscheme->add_outer_partition
 			    != NULL)

Index: src/usr.sbin/sysinst/defs.h
diff -u src/usr.sbin/sysinst/defs.h:1.66 src/usr.sbin/sysinst/defs.h:1.67
--- src/usr.sbin/sysinst/defs.h:1.66	Mon Oct 12 16:14:32 2020
+++ src/usr.sbin/sysinst/defs.h	Tue Oct 13 17:26:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.66 2020/10/12 16:14:32 martin Exp $	*/
+/*	$NetBSD: defs.h,v 1.67 2020/10/13 17:26:28 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -311,6 +311,7 @@ struct part_usage_info {
 	unsigned int instflags;		/* installer handling flags */
 	uint fs_type, fs_version;	/* e.g. FS_LFS, or FS_BSDFS,
 					 * version = 2 for FFSv2 */
+	uint fs_opt1, fs_opt2, fs_opt3;	/* FS specific, FFS: block/frag */
 #ifndef	NO_CLONES
 	/*
 	 * Only != NULL when PUIFLG_CLONE_PARTS is set, describes the
@@ -352,7 +353,7 @@ struct partition_usage_set {
  */
 struct single_part_fs_edit {
  	struct partition_usage_set *pset;
-	size_t index, first_custom_attr;
+	size_t index, first_custom_attr, offset, mode;
 	part_id id;
 	struct disk_part_info info;	/* current partition data */
 	struct part_usage_info *wanted;	/* points at our edit data */

Index: src/usr.sbin/sysinst/disklabel.c
diff -u src/usr.sbin/sysinst/disklabel.c:1.41 src/usr.sbin/sysinst/disklabel.c:1.42
--- src/usr.sbin/sysinst/disklabel.c:1.41	Mon Oct 12 16:14:32 2020
+++ src/usr.sbin/sysinst/disklabel.c	Tue Oct 13 17:26:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel.c,v 1.41 2020/10/12 16:14:32 martin Exp $	*/
+/*	$NetBSD: disklabel.c,v 1.42 2020/10/13 17:26:28 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@ struct disklabel_disk_partitions {
 	struct disklabel l;
 	daddr_t ptn_alignment, install_target;
 	char last_mounted[MAXPARTITIONS][MOUNTLEN];
-	uint fs_sub_type[MAXPARTITIONS];
+	uint fs_sub_type[MAXPARTITIONS], fs_opt3[MAXPARTITIONS];
 };
 
 /*
@@ -772,6 +772,10 @@ disklabel_get_part_info(const struct dis
 				info->last_mounted = parts->last_mounted[part];
 			info->fs_type = parts->l.d_partitions[part].p_fstype;
 			info->fs_sub_type = parts->fs_sub_type[part];
+			info->fs_opt2 = parts->l.d_partitions[part].p_fsize;
+			info->fs_opt1 = info->fs_opt2 *
+			    parts->l.d_partitions[part].p_frag;
+			info->fs_opt3 = parts->fs_opt3[part];
 			if (part == RAW_PART &&
 			    parts->l.d_partitions[part].p_fstype == FS_UNUSED)
 				info->flags |=
@@ -820,6 +824,13 @@ disklabel_set_part_info(struct disk_part
 			parts->l.d_partitions[part].p_size = info->size;
 			parts->l.d_partitions[part].p_fstype =
 			    dl_part_type_from_generic(info->nat_type);
+			parts->l.d_partitions[part].p_fsize = info->fs_opt2;
+			if (info->fs_opt2 != 0)
+				parts->l.d_partitions[part].p_frag =
+				    info->fs_opt1 / info->fs_opt2;
+			else
+				parts->l.d_partitions[part].p_frag = 0;
+			parts->fs_opt3[part] = info->fs_opt3;
 			if (info->last_mounted != NULL &&
 			    info->last_mounted != parts->last_mounted[part])
 				strlcpy(parts->last_mounted[part],
@@ -1111,6 +1122,12 @@ disklabel_add_partition(struct disk_part
 	parts->l.d_partitions[part].p_size = data.size;
 	parts->l.d_partitions[part].p_fstype =
 	     dl_part_type_from_generic(data.nat_type);
+	parts->l.d_partitions[part].p_fsize = info->fs_opt2;
+	if (info->fs_opt2 != 0)
+		parts->l.d_partitions[part].p_frag =
+		    info->fs_opt1 / info->fs_opt2;
+	else
+		parts->l.d_partitions[part].p_frag = 0;
 	if (data.last_mounted && data.last_mounted[0])
 		strlcpy(parts->last_mounted[part], data.last_mounted,
 		    sizeof(parts->last_mounted[part]));
@@ -1174,6 +1191,12 @@ disklabel_add_outer_partition(struct dis
 	parts->l.d_partitions[part].p_size = info->size;
 	parts->l.d_partitions[part].p_fstype =
 	     dl_part_type_from_generic(info->nat_type);
+	parts->l.d_partitions[part].p_fsize = info->fs_opt2;
+	if (info->fs_opt2 != 0)
+		parts->l.d_partitions[part].p_frag =
+		    info->fs_opt1 / info->fs_opt2;
+	else
+		parts->l.d_partitions[part].p_frag = 0;
 	if (info->last_mounted && info->last_mounted[0])
 		strlcpy(parts->last_mounted[part], info->last_mounted,
 		    sizeof(parts->last_mounted[part]));

Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.70 src/usr.sbin/sysinst/disks.c:1.71
--- src/usr.sbin/sysinst/disks.c:1.70	Mon Oct 12 14:29:41 2020
+++ src/usr.sbin/sysinst/disks.c	Tue Oct 13 17:26:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.70 2020/10/12 14:29:41 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.71 2020/10/13 17:26:28 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1078,7 +1078,8 @@ int
 make_filesystems(struct install_partition_desc *install)
 {
 	int error = 0, partno = -1;
-	char *newfs = NULL, devdev[PATH_MAX], rdev[PATH_MAX];
+	char *newfs = NULL, devdev[PATH_MAX], rdev[PATH_MAX],
+	    opts[200], opt[30];
 	size_t i;
 	struct part_usage_info *ptn;
 	struct disk_partitions *parts;
@@ -1142,16 +1143,33 @@ make_filesystems(struct install_partitio
 		parts->pscheme->get_part_device(parts, ptn->cur_part_id,
 		    rdev, sizeof rdev, &partno, raw_dev_name, true, true);
 
+		opts[0] = 0;
 		switch (ptn->fs_type) {
 		case FS_APPLEUFS:
-			asprintf(&newfs, "/sbin/newfs");
+			if (ptn->fs_opt3 != 0)
+				snprintf(opts, sizeof opts, "-i %u",
+				    ptn->fs_opt3);
+			asprintf(&newfs, "/sbin/newfs %s", opts);
 			mnt_opts = "-tffs -o async";
 			fsname = "ffs";
 			break;
 		case FS_BSDFFS:
+			if (ptn->fs_opt3 != 0)
+				snprintf(opts, sizeof opts, "-i %u ",
+				    ptn->fs_opt3);
+			if (ptn->fs_opt1 != 0) {
+				snprintf(opt, sizeof opt, "-b %u ",
+				    ptn->fs_opt1);
+				strcat(opts, opt);
+			}
+			if (ptn->fs_opt2 != 0) {
+				snprintf(opt, sizeof opt, "-f %u ",
+				    ptn->fs_opt2);
+				strcat(opts, opt);
+			}
 			asprintf(&newfs,
-			    "/sbin/newfs -V2 -O %d",
-			    ptn->fs_version == 2 ? 2 : 1);
+			    "/sbin/newfs -V2 -O %d %s",
+			    ptn->fs_version == 2 ? 2 : 1, opts);
 			if (ptn->mountflags & PUIMNT_LOG)
 				mnt_opts = "-tffs -o log";
 			else
@@ -1159,7 +1177,10 @@ make_filesystems(struct install_partitio
 			fsname = "ffs";
 			break;
 		case FS_BSDLFS:
-			asprintf(&newfs, "/sbin/newfs_lfs");
+			if (ptn->fs_opt1 != 0 && ptn->fs_opt2 != 0)
+				snprintf(opts, sizeof opts, "-b %u",
+				     ptn->fs_opt1 * ptn->fs_opt2);
+			asprintf(&newfs, "/sbin/newfs_lfs %s", opts);
 			mnt_opts = "-tlfs";
 			fsname = "lfs";
 			break;

Index: src/usr.sbin/sysinst/gpt.c
diff -u src/usr.sbin/sysinst/gpt.c:1.20 src/usr.sbin/sysinst/gpt.c:1.21
--- src/usr.sbin/sysinst/gpt.c:1.20	Mon Oct 12 16:14:32 2020
+++ src/usr.sbin/sysinst/gpt.c	Tue Oct 13 17:26:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpt.c,v 1.20 2020/10/12 16:14:32 martin Exp $	*/
+/*	$NetBSD: gpt.c,v 1.21 2020/10/13 17:26:28 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -131,7 +131,8 @@ struct gpt_part_entry {
 	char gp_label[GPT_LABEL_LEN];	/* user defined label */
 	char gp_dev_name[GPT_DEV_LEN];	/* name of wedge */
 	const char *last_mounted;	/* last mounted if known */
-	uint fs_type, fs_sub_type;	/* FS_* and maybe sub type */
+	uint fs_type, fs_sub_type,	/* FS_* and maybe sub type */
+	    fs_opt1, fs_opt2, fs_opt3;	/* transient file system options */
 	uint gp_flags;	
 #define	GPEF_ON_DISK	1		/* This entry exists on-disk */
 #define	GPEF_MODIFIED	2		/* this entry has been changed */
@@ -518,6 +519,9 @@ gpt_get_part_info(const struct disk_part
 	info->last_mounted = p->last_mounted;
 	info->fs_type = p->fs_type;
 	info->fs_sub_type = p->fs_sub_type;
+	info->fs_opt1 = p->fs_opt1;
+	info->fs_opt2 = p->fs_opt2;
+	info->fs_opt3 = p->fs_opt3;
 	if (p->gp_flags & GPEF_TARGET)
 		info->flags |= PTI_INSTALL_TARGET;
 
@@ -1055,6 +1059,9 @@ gpt_info_to_part(struct gpt_part_entry *
 	}
 	p->fs_type = info->fs_type;
 	p->fs_sub_type = info->fs_sub_type;
+	p->fs_opt1 = info->fs_opt1;
+	p->fs_opt2 = info->fs_opt2;
+	p->fs_opt3 = info->fs_opt3;
 	
 	return true;
 }

Index: src/usr.sbin/sysinst/label.c
diff -u src/usr.sbin/sysinst/label.c:1.29 src/usr.sbin/sysinst/label.c:1.30
--- src/usr.sbin/sysinst/label.c:1.29	Tue Oct 13 11:28:32 2020
+++ src/usr.sbin/sysinst/label.c	Tue Oct 13 17:26:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: label.c,v 1.29 2020/10/13 11:28:32 martin Exp $	*/
+/*	$NetBSD: label.c,v 1.30 2020/10/13 17:26:28 martin Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: label.c,v 1.29 2020/10/13 11:28:32 martin Exp $");
+__RCSID("$NetBSD: label.c,v 1.30 2020/10/13 17:26:28 martin Exp $");
 #endif
 
 #include <sys/types.h>
@@ -50,6 +50,7 @@ __RCSID("$NetBSD: label.c,v 1.29 2020/10
 #include <sys/dkio.h>
 #include <sys/param.h>
 #include <sys/bootblock.h>
+#include <sys/bitops.h>
 #include <ufs/ffs/fs.h>
 
 #include "defs.h"
@@ -292,6 +293,97 @@ edit_fs_size(menudesc *m, void *arg)
 }
 
 static int
+set_ffs_opt_pow2(menudesc *m, void *arg)
+{
+	struct single_part_fs_edit *edit = arg;
+	size_t val = 1 << (edit->offset+m->cursel);
+
+	if (edit->mode == 1) {
+		edit->info.fs_opt1 = val;
+		edit->wanted->fs_opt1 = val;
+	} else if (edit->mode == 2) {
+		edit->info.fs_opt2 = val;
+		edit->wanted->fs_opt2 = val;
+	}
+	return 0;
+}
+
+static int
+edit_fs_ffs_opt(menudesc *m, void *arg, msg head,
+    size_t min_val, size_t max_val)
+{
+	struct single_part_fs_edit *edit = arg;
+	menu_ent opts[min(MAXPHYS/4096, 8)];
+	char names[min(MAXPHYS/4096, 8)][20];
+	size_t i, val;
+	int menu;
+
+	edit->offset = ilog2(min_val);
+	memset(opts, 0, sizeof opts);
+	for (i = 0, val = min_val; val <= max_val; i++, val <<= 1) {
+		snprintf(names[i], sizeof names[i], "%zu", val);
+		opts[i].opt_name = names[i];
+		opts[i].opt_action = set_ffs_opt_pow2;
+		opts[i].opt_flags = OPT_EXIT;
+	}
+	menu = new_menu(head, opts, i, 40, 6, 0, 0, MC_NOEXITOPT,
+	    NULL, NULL, NULL, NULL, NULL);
+	if (menu < 0)
+		return 1;
+	process_menu(menu, arg);
+	free_menu(menu);
+	return 0;
+}
+
+static int
+edit_fs_ffs_block(menudesc *m, void *arg)
+{
+	struct single_part_fs_edit *edit = arg;
+
+	edit->mode = 1;		/* edit fs_opt1 */
+	return edit_fs_ffs_opt(m, arg, MSG_Select_file_system_block_size,
+	    4096, MAXPHYS);
+}
+
+static int
+edit_fs_ffs_frag(menudesc *m, void *arg)
+{
+	struct single_part_fs_edit *edit = arg;
+	size_t bsize, sec_size;
+
+	edit->mode = 2;		/* edit fs_opt2 */
+	bsize = edit->info.fs_opt1;
+	if (bsize == 0) {
+		sec_size = edit->wanted->parts->bytes_per_sector;
+		if (edit->wanted->size >= (daddr_t)(128L*(GIG/sec_size)))
+			bsize = 32*1024;
+		else if (edit->wanted->size >= (daddr_t)(1000L*(MEG/sec_size)))
+			bsize = 16*1024;
+		else if (edit->wanted->size >= (daddr_t)(20L*(MEG/sec_size)))
+			bsize = 8*1024;
+		else
+			bsize = 4+1024;
+	}
+	return edit_fs_ffs_opt(m, arg, MSG_Select_file_system_fragment_size,
+		bsize / 8, bsize);
+}
+
+static int
+edit_fs_ffs_avg_size(menudesc *m, void *arg)
+{
+	struct single_part_fs_edit *edit = arg;
+	char answer[12];
+
+	snprintf(answer, sizeof answer, "%u", edit->info.fs_opt3);
+	msg_prompt_win(MSG_ptn_isize_prompt, -1, 18, 0, 0,
+		answer, answer, sizeof answer);
+	edit->info.fs_opt3 = atol(answer);
+	edit->wanted->fs_opt3 = edit->info.fs_opt3;
+
+	return 0;
+}
+
+static int
 edit_fs_preserve(menudesc *m, void *arg)
 {
 	struct single_part_fs_edit *edit = arg;
@@ -748,6 +840,13 @@ edit_ptn(menudesc *menu, void *arg)
 		{ .opt_menu=MENU_mountoptions, .opt_flags=OPT_SUB },
 		{ .opt_action=edit_fs_mountpt },
 	};
+
+	static const menu_ent edit_ptn_fields_ffs[] = {
+		{ .opt_action=edit_fs_ffs_avg_size },
+		{ .opt_action=edit_fs_ffs_block },
+		{ .opt_action=edit_fs_ffs_frag },
+	};
+
 	static const menu_ent edit_ptn_fields_tail[] = {
 		{ .opt_name=MSG_askunits, .opt_menu=MENU_sizechoice,
 		  .opt_flags=OPT_SUB },
@@ -771,6 +870,9 @@ edit_ptn(menudesc *menu, void *arg)
 	num_opts = __arraycount(edit_ptn_fields_head) +
 	    __arraycount(edit_ptn_fields_head2) +
 	    __arraycount(edit_ptn_fields_tail);
+	if (edit.wanted->fs_type == FS_BSDFFS ||
+	    edit.wanted->fs_type == FS_BSDLFS)
+		num_opts += __arraycount(edit_ptn_fields_ffs);
 	if (with_inst_opt)
 		num_opts += __arraycount(edit_ptn_fields_head_add);
 	if (is_new_part)
@@ -792,6 +894,11 @@ edit_ptn(menudesc *menu, void *arg)
 	}
 	memcpy(popt, edit_ptn_fields_head2, sizeof(edit_ptn_fields_head2));
 	popt +=  __arraycount(edit_ptn_fields_head2);
+	if (edit.wanted->fs_type == FS_BSDFFS ||
+	    edit.wanted->fs_type == FS_BSDLFS) {
+		memcpy(popt, edit_ptn_fields_ffs, sizeof(edit_ptn_fields_ffs));
+		popt +=  __arraycount(edit_ptn_fields_ffs);
+	}
 	edit.first_custom_attr = popt - mopts;
 	if (!is_new_part) {
 		for (size_t i = 0;
@@ -897,6 +1004,7 @@ edit_ptn(menudesc *menu, void *arg)
 		}
 		remember_deleted(pset,
 		    pset->infos[edit.index].parts);
+		pset->cur_free_space += pset->infos[edit.index].size;
 		memmove(pset->infos+edit.index,
 		    pset->infos+edit.index+1,
 		    sizeof(*pset->infos)*(pset->num-edit.index));
@@ -974,7 +1082,7 @@ draw_edit_ptn_line(menudesc *m, int opt,
 	static int col_width;
 	static const char *ptn_type, *ptn_start, *ptn_size, *ptn_end,
 	     *ptn_newfs, *ptn_mount, *ptn_mount_options, *ptn_mountpt,
-	     *ptn_install;
+	     *ptn_install, *ptn_bsize, *ptn_fsize, *ptn_isize;
 	const char *c;
 	char val[MENUSTRSIZE];
 	const char *attrname;
@@ -995,6 +1103,9 @@ draw_edit_ptn_line(menudesc *m, int opt,
 		LOAD(ptn_mount);
 		LOAD(ptn_mount_options);
 		LOAD(ptn_mountpt);
+		LOAD(ptn_bsize);
+		LOAD(ptn_fsize);
+		LOAD(ptn_isize);
 #undef LOAD
 
 		for (size_t i = 0;
@@ -1063,6 +1174,33 @@ draw_edit_ptn_line(menudesc *m, int opt,
 			    ? MSG_Yes : MSG_No));
 		return;
 	}
+	if (m->opts[opt].opt_action == edit_fs_ffs_block) {
+		wprintw(m->mw, "%*s : %u", col_width, ptn_bsize,
+			edit->wanted->fs_opt1);
+		return;
+	}
+	if (m->opts[opt].opt_action == edit_fs_ffs_frag) {
+		wprintw(m->mw, "%*s : %u", col_width, ptn_fsize,
+			edit->wanted->fs_opt2);
+		return;
+	}
+	if (m->opts[opt].opt_action == edit_fs_ffs_avg_size) {
+		if (edit->wanted->fs_opt3 == 0)
+			wprintw(m->mw, "%*s : %s", col_width, ptn_isize,
+				msg_string(MSG_ptn_isize_dflt));
+		else {
+        	        char buf[24], *line;
+			const char *t = buf;
+
+			snprintf(buf, sizeof buf, "%u", edit->wanted->fs_opt3);
+			line = str_arg_subst(msg_string(MSG_ptn_isize_bytes),
+			    1, &t);
+			wprintw(m->mw, "%*s : %s", col_width, ptn_isize,
+				line);
+			free(line);
+		}
+		return;
+	}
 	if (m->opts[opt].opt_menu == MENU_mountoptions) {
 		wprintw(m->mw, "%*s : ", col_width, ptn_mount_options);
 		if (edit->wanted->mountflags & PUIMNT_ASYNC)

Index: src/usr.sbin/sysinst/msg.mi.de
diff -u src/usr.sbin/sysinst/msg.mi.de:1.23 src/usr.sbin/sysinst/msg.mi.de:1.24
--- src/usr.sbin/sysinst/msg.mi.de:1.23	Mon Oct 12 16:14:32 2020
+++ src/usr.sbin/sysinst/msg.mi.de	Tue Oct 13 17:26:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.de,v 1.23 2020/10/12 16:14:32 martin Exp $	*/
+/*	$NetBSD: msg.mi.de,v 1.24 2020/10/13 17:26:28 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -147,9 +147,6 @@ message heads
 message sectors
 {Sektoren}
 
-message fs_isize
-{Durchschnittliche Dateigröße (in Bytes)}
-
 message mountpoint
 {Mountpoint (oder 'kein(e)'))}
 
@@ -410,12 +407,6 @@ message label_offset_tail	{Start ($2)}
 message invalid_sector_number
 {Ungültiger Wert}
 
-message Select_file_system_block_size
-{Wählen Sie die Blockgröße des Dateisystems aus}
-
-message Select_file_system_fragment_size
-{Wählen Sie die Fragmentgröße des Dateisystems aus}
-
 message packname
 {Bitte geben Sie Ihrer NetBSD-Festplatte einen Namen}
 
@@ -1075,10 +1066,11 @@ message Use_Default_Parts {Standard-Part
 message Use_Different_Part_Scheme
 {Alles löschen, anderes Partitionierungsverfahren statt $1 verwenden}
 
-message Gigabytes {Gigabytes}
-message Megabytes {Megabytes}
-message Cylinders {Zylinder}
-message Sectors {Sektoren}
+message Gigabytes	{Gigabyte}
+message Megabytes	{Megabyte}
+message Bytes		{Byte}
+message Cylinders	{Zylinder}
+message Sectors		{Sektoren}
 message Select_medium {Medium auswählen}
 message ftp {FTP}
 message http {HTTP}
@@ -1339,6 +1331,25 @@ message ptn_start	{Start}
 message ptn_size	{Größe}
 message ptn_end		{Ende}
 
+message ptn_bsize	{Blockgröße}
+message ptn_fsize	{Fragmentgröße}
+message ptn_isize	{Durchschnittliche Dateigröße}
+
+/* Called with:				Example
+ *  $0 = avg file size in byte		1200
+ */
+message ptn_isize_bytes	{$0 Bytes (zur Inode-Bestimmung)}
+message ptn_isize_dflt	{4 Fragmente}
+
+message Select_file_system_block_size
+{Wählen Sie die Blockgröße des Dateisystems aus}
+
+message Select_file_system_fragment_size
+{Wählen Sie die Fragmentgröße des Dateisystems aus}
+
+message ptn_isize_prompt
+{Durchschnittliche Dateigröße (in Bytes)}
+
 message Invalid_numeric {Ungültige Zahl!}
 message Too_large {Zu groß!}
 message No_free_space {Kein freier Speicherplatz.}

Index: src/usr.sbin/sysinst/msg.mi.en
diff -u src/usr.sbin/sysinst/msg.mi.en:1.31 src/usr.sbin/sysinst/msg.mi.en:1.32
--- src/usr.sbin/sysinst/msg.mi.en:1.31	Mon Oct 12 16:14:32 2020
+++ src/usr.sbin/sysinst/msg.mi.en	Tue Oct 13 17:26:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.en,v 1.31 2020/10/12 16:14:32 martin Exp $	*/
+/*	$NetBSD: msg.mi.en,v 1.32 2020/10/13 17:26:28 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -140,9 +140,6 @@ message heads
 message sectors
 {sectors}
 
-message fs_isize
-{average file size (bytes)}
-
 message mountpoint
 {mount point (or 'none')}
 
@@ -399,12 +396,6 @@ message label_offset_tail		{Start ($2)}
 message invalid_sector_number
 {Badly formed number}
 
-message Select_file_system_block_size
-{Select file system block size}
-
-message Select_file_system_fragment_size
-{Select file system fragment size}
-
 message packname
 {Please enter a name for your NetBSD disk}
 
@@ -1015,6 +1006,7 @@ message Use_Different_Part_Scheme
 
 message Gigabytes {Gigabytes}
 message Megabytes {Megabytes}
+message Bytes {Bytes}
 message Cylinders {Cylinders}
 message Sectors {Sectors}
 message Select_medium {Install from}
@@ -1270,6 +1262,25 @@ message ptn_start		{start}
 message ptn_size		{size}
 message ptn_end			{end}
 
+message ptn_bsize		{block size}
+message ptn_fsize		{fragment size}
+message ptn_isize		{avg file size}
+
+/* Called with: 			Example
+ *  $0 = avg file size in byte		1200
+ */
+message ptn_isize_bytes {$0 bytes (for number of inodes)}
+message ptn_isize_dflt	{4 fragments}
+
+message Select_file_system_block_size
+{Select file system block size}
+
+message Select_file_system_fragment_size
+{Select file system fragment size}
+
+message ptn_isize_prompt
+{average file size (bytes)}
+
 message No_free_space {No free space}
 message Invalid_numeric {Invalid numeric!}
 message Too_large {Too large!}
Index: src/usr.sbin/sysinst/msg.mi.pl
diff -u src/usr.sbin/sysinst/msg.mi.pl:1.31 src/usr.sbin/sysinst/msg.mi.pl:1.32
--- src/usr.sbin/sysinst/msg.mi.pl:1.31	Mon Oct 12 16:14:32 2020
+++ src/usr.sbin/sysinst/msg.mi.pl	Tue Oct 13 17:26:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.pl,v 1.31 2020/10/12 16:14:32 martin Exp $	*/
+/*	$NetBSD: msg.mi.pl,v 1.32 2020/10/13 17:26:28 martin Exp $	*/
 /*	Based on english version: */
 /*	NetBSD: msg.mi.pl,v 1.36 2004/04/17 18:55:35 atatat Exp       */
 
@@ -144,9 +144,6 @@ message heads
 message sectors
 {sektory}
 
-message fs_isize
-{sredni rozmiar pliku (bajty)}
-
 message mountpoint
 {punkt montowania (lub 'zaden')}
 
@@ -391,12 +388,6 @@ message label_offset_tail		{Poczatek ($2
 message invalid_sector_number
 {Nieprawidlowa liczba}
 
-message Select_file_system_block_size
-{Wybierz rozmiar bloku dla systemu plikow}
-
-message Select_file_system_fragment_size
-{Wybierz rozmiar fragmentu dla systemu plikow}
-
 message packname
 {Podaj nazwe dla swojego dysku NetBSD}
 
@@ -1010,6 +1001,7 @@ message Use_Different_Part_Scheme
 
 message Gigabytes {Gigabajty}
 message Megabytes {Megabajty}
+message Bytes {Bajty}
 message Cylinders {Cylindry}
 message Sectors {Sektory}
 message Select_medium {Wybierz nosnik}
@@ -1269,6 +1261,25 @@ message ptn_start		{poczatek}
 message ptn_size		{rozmiar}
 message ptn_end			{koniec}
 
+message ptn_bsize		{rozmiar bloku}
+message ptn_fsize		{rozmiar fragmentu}
+message ptn_isize		{Sredni rozm. pliku}
+
+/* Called with: 			Example
+ *  $0 = avg file size in byte		1200
+ */
+message ptn_isize_bytes		{$0 bajtow}
+message ptn_isize_dflt		{4 fragmenty}
+
+message Select_file_system_block_size
+{Wybierz rozmiar bloku dla systemu plikow}
+
+message Select_file_system_fragment_size
+{Wybierz rozmiar fragmentu dla systemu plikow}
+
+message ptn_isize_prompt
+{sredni rozmiar pliku (bajty)}
+
 message No_free_space {Brak wolnego miejsca}
 message Invalid_numeric {Nieprawidlowa wartosc!}
 message Too_large {Zbyt duza wartosc!}

Index: src/usr.sbin/sysinst/msg.mi.es
diff -u src/usr.sbin/sysinst/msg.mi.es:1.25 src/usr.sbin/sysinst/msg.mi.es:1.26
--- src/usr.sbin/sysinst/msg.mi.es:1.25	Mon Oct 12 16:14:32 2020
+++ src/usr.sbin/sysinst/msg.mi.es	Tue Oct 13 17:26:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.es,v 1.25 2020/10/12 16:14:32 martin Exp $	*/
+/*	$NetBSD: msg.mi.es,v 1.26 2020/10/13 17:26:28 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -147,9 +147,6 @@ message heads
 message sectors
 {sectores}
 
-message fs_isize
-{tamaño promedio del fichero (bytes)}
-
 message mountpoint
 {punto de montaje (o 'ninguno')}
 
@@ -405,12 +402,6 @@ message label_offset_tail		{inicio ($2)}
 message invalid_sector_number
 {Número mal formado}
 
-message Select_file_system_block_size
-{Seleccione el tamaño de bloque del sistema de archivos}
-
-message Select_file_system_fragment_size
-{Seleccione el tamaño de fragmento del sistema de archivos}
-
 message packname
 {Por favor entroduzca un nombre para el disco NetBSD}
 
@@ -1042,6 +1033,7 @@ message Use_Different_Part_Scheme
 
 message Gigabytes {Gigabytes}
 message Megabytes {Megabytes}
+message Bytes {Bytes}
 message Cylinders {Cilindros}
 message Sectors {Sectores}
 message Select_medium {Seleccione el medio}
@@ -1320,6 +1312,25 @@ message ptn_start		{inicio}
 message ptn_size		{tamaño}
 message ptn_end			{fin}
 
+message ptn_bsize		{tamaño bloque}
+message ptn_fsize		{tamaño frag}
+message ptn_isize		{tam prom archi}
+
+/* Called with:                         Example
+ *  $0 = avg file size in byte          1200
+ */
+message ptn_isize_bytes		{$0 bytes (para número de inodos)}
+message ptn_isize_dflt		{4 fragmentos}
+
+message Select_file_system_block_size
+{Seleccione el tamaño de bloque del sistema de archivos}
+
+message Select_file_system_fragment_size
+{Seleccione el tamaño de fragmento del sistema de archivos}
+
+message ptn_isize_prompt
+{tamaño promedio del fichero (bytes)}
+
 message No_free_space {Sin espacio libre}
 message Invalid_numeric {Número no válido!}
 message Too_large {Demasiado grande!}

Index: src/usr.sbin/sysinst/msg.mi.fr
diff -u src/usr.sbin/sysinst/msg.mi.fr:1.30 src/usr.sbin/sysinst/msg.mi.fr:1.31
--- src/usr.sbin/sysinst/msg.mi.fr:1.30	Mon Oct 12 16:14:32 2020
+++ src/usr.sbin/sysinst/msg.mi.fr	Tue Oct 13 17:26:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.fr,v 1.30 2020/10/12 16:14:32 martin Exp $	*/
+/*	$NetBSD: msg.mi.fr,v 1.31 2020/10/13 17:26:28 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -149,9 +149,6 @@ message heads
 message sectors
 {secteurs}
 
-message fs_isize
-{taille moyenne de fichier (octets)}
-
 message mountpoint
 {point de montage (ou 'aucun')}
 
@@ -408,12 +405,6 @@ message label_offset_tail		{Début ($2)}
 message invalid_sector_number
 {nombre invalide}
 
-message Select_file_system_block_size
-{Sélectionnez la taille de bloc du système de fichiers}
-
-message Select_file_system_fragment_size
-{Sélectionnez la taille de fragment du système de fichiers}
-
 message packname
 {Veuillez donner un nom à votre disque.}
 
@@ -1105,6 +1096,7 @@ message Use_Different_Part_Scheme
 
 message Gigabytes {Gigaoctets}
 message Megabytes {Mégaoctets}
+message Bytes {Octets}
 message Cylinders {Cylindres}
 message Sectors {Secteurs}
 message Select_medium {Sélection du média d'installation}
@@ -1372,6 +1364,25 @@ message ptn_start		{Début}
 message ptn_size		{taille}
 message ptn_end			{fin}
 
+message ptn_bsize		{taille de bloc}
+message ptn_fsize		{taille de fragment}
+message ptn_isize		{taille moyenne de fichier}
+
+/* Called with: 			Example
+ *  $0 = avg file size in byte		1200
+ */
+message ptn_isize_bytes		{$0 bytes}
+message ptn_isize_dflt		{4 fragments}
+
+message Select_file_system_block_size
+{Sélectionnez la taille de bloc du système de fichiers}
+
+message Select_file_system_fragment_size
+{Sélectionnez la taille de fragment du système de fichiers}
+
+message ptn_isize_prompt
+{taille moyenne de fichier (octets)}
+
 message No_free_space {Pas d'espace libre}
 message Invalid_numeric {Nombre invalide!}
 message Too_large {Trop grand!}

Index: src/usr.sbin/sysinst/partitions.h
diff -u src/usr.sbin/sysinst/partitions.h:1.18 src/usr.sbin/sysinst/partitions.h:1.19
--- src/usr.sbin/sysinst/partitions.h:1.18	Mon Oct 12 16:14:32 2020
+++ src/usr.sbin/sysinst/partitions.h	Tue Oct 13 17:26:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: partitions.h,v 1.18 2020/10/12 16:14:32 martin Exp $	*/
+/*	$NetBSD: partitions.h,v 1.19 2020/10/13 17:26:28 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -139,10 +139,14 @@ struct disk_part_info {
 	 * returned. Backends can not rely on them to be valid.
 	 */
 	const char *last_mounted;		/* last mount point or NULL */
-	unsigned int fs_type, fs_sub_type;	/* FS_* type of filesystem
+	unsigned int fs_type, fs_sub_type,	/* FS_* type of filesystem
 						 * and for some FS a sub
 						 * type (e.g. FFSv1 vs. FFSv2)
 						 */
+		fs_opt1, fs_opt2, fs_opt3;	/* FS specific option, used
+						 * for FFS block/fragsize
+						 * and inodes
+						 */
 };
 
 /* An unused area that may be used for new partitions */

Index: src/usr.sbin/sysinst/util.c
diff -u src/usr.sbin/sysinst/util.c:1.47 src/usr.sbin/sysinst/util.c:1.48
--- src/usr.sbin/sysinst/util.c:1.47	Sun Sep 27 17:36:40 2020
+++ src/usr.sbin/sysinst/util.c	Tue Oct 13 17:26:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.47 2020/09/27 17:36:40 martin Exp $	*/
+/*	$NetBSD: util.c,v 1.48 2020/10/13 17:26:28 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -2133,6 +2133,9 @@ usage_info_list_from_parts(struct part_u
 			(*list)[no].fs_type = info.fs_type;
 			(*list)[no].fs_version = info.fs_sub_type;
 		}
+		(*list)[no].fs_opt1 = info.fs_opt1;
+		(*list)[no].fs_opt2 = info.fs_opt2;
+		(*list)[no].fs_opt3 = info.fs_opt3;
 		no++;
 	}
 	return true;

Reply via email to