sysinst support for WAPBL

Simon Burge <[email protected]>
Newsgroups gmane.os.netbsd.devel.installation
Message-ID <[email protected]>
Hi folks,

The original WAPBL patches had sysinst support for enabling journaling
by reserving space at the end of the filesystem since that was the only
supported log position.  This involved a fair bit of work to sysinst
to add menus for journal log sizes and so on.  Now, we can just add an
option to enable the mount "log" option.

The following patch does this.  Any problems with this?  My main comment
is that adding any fs options is a bit hidden, but I can't think of an
easy way to address that.

One other comment - maybe move softdep and log above all the rest
(async, noatime, ...)?  I suspect those two will be the more common
choices.

Cheers,
Simon.
sysinst.diff (text/plain, 3.3 KB)
Index: defs.h
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/defs.h,v
retrieving revision 1.135
diff -d -p -u -r1.135 defs.h
--- defs.h	28 Jan 2008 02:47:12 -0000	1.135
+++ defs.h	2 Aug 2008 07:53:48 -0000
@@ -188,6 +188,7 @@ typedef struct _partinfo {
 #define PIF_NOEXEC	0x0100		/* mount -o noexec */
 #define PIF_NOSUID	0x0200		/* mount -o nosuid */
 #define PIF_SOFTDEP	0x0400		/* mount -o softdep */
+#define PIF_LOG		0x0800		/* mount -o log */
 #define PIF_MOUNT_OPTS	0x0ff0		/* all above mount flags */
 #define PIF_RESET	0x1000		/* internal - restore previous values */
 } partinfo;	/* Single partition from a disklabel */
Index: disks.c
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/disks.c,v
retrieving revision 1.99
diff -d -p -u -r1.99 disks.c
--- disks.c	2 Feb 2008 09:26:45 -0000	1.99
+++ disks.c	2 Aug 2008 07:53:48 -0000
@@ -348,7 +348,10 @@ make_filesystems(void)
 			    lbl->pi_flags & PIF_FFSv2 ? 2 : 1,
 			    lbl->pi_fsize * lbl->pi_frag, lbl->pi_fsize,
 			    lbl->pi_isize != 0 ? " -i " : "", lbl->pi_isize);
-			mnt_opts = "-tffs -o async";
+			if (lbl->pi_flags & PIF_LOG)
+				mnt_opts = "-tffs -o log";
+			else
+				mnt_opts = "-tffs -o async";
 			fsname = "ffs";
 			break;
 		case FS_BSDLFS:
@@ -502,7 +505,8 @@ make_fstab(void)
 		if (strcmp(mp, "/") == 0 && !(bsdlabel[i].pi_flags & PIF_MOUNT))
 			s = "# ";
 
- 		scripting_fprintf(f, "%s/dev/%s%c\t\t%s\t%s\trw%s%s%s%s%s%s%s%s\t\t %d %d\n",
+ 		scripting_fprintf(f,
+		  "%s/dev/%s%c\t\t%s\t%s\trw%s%s%s%s%s%s%s%s%s\t\t %d %d\n",
 		   s, diskdev, 'a' + i, mp, fstype,
 		   bsdlabel[i].pi_flags & PIF_MOUNT ? "" : ",noauto",
 		   bsdlabel[i].pi_flags & PIF_ASYNC ? ",async" : "",
@@ -512,6 +516,7 @@ make_fstab(void)
 		   bsdlabel[i].pi_flags & PIF_NOEXEC ? ",noexec" : "",
 		   bsdlabel[i].pi_flags & PIF_NOSUID ? ",nosuid" : "",
 		   bsdlabel[i].pi_flags & PIF_SOFTDEP ? ",softdep" : "",
+		   bsdlabel[i].pi_flags & PIF_LOG ? ",log" : "",
 		   dump_freq, fsck_pass);
 	}
 
Index: label.c
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/label.c,v
retrieving revision 1.51
diff -d -p -u -r1.51 label.c
--- label.c	23 Oct 2006 19:44:57 -0000	1.51
+++ label.c	2 Aug 2008 07:53:49 -0000
@@ -528,6 +528,8 @@ set_ptn_label(menudesc *m, int opt, void
 			wprintw(m->mw, "nosuid ");
 		if (p->pi_flags & PIF_SOFTDEP)
 			wprintw(m->mw, "softdep ");
+		if (p->pi_flags & PIF_LOG)
+			wprintw(m->mw, "log ");
 		break;
 	case PTN_MENU_MOUNTPT:
 		wprintw(m->mw, msg_string(MSG_mountpt_fmt), p->pi_mount);
Index: menus.mi
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/menus.mi,v
retrieving revision 1.32
diff -d -p -u -r1.32 menus.mi
--- menus.mi	28 Apr 2008 20:22:53 -0000	1.32
+++ menus.mi	2 Aug 2008 07:53:49 -0000
@@ -145,6 +145,8 @@ menu mountoptions, title MSG_toggle, y=5
 		{ ((partinfo *)arg)->pi_flags ^= PIF_NOSUID; };
 	option "softdep", exit, action
 		{ ((partinfo *)arg)->pi_flags ^= PIF_SOFTDEP; };
+	option "log", exit, action
+		{ ((partinfo *)arg)->pi_flags ^= PIF_LOG; };
 
 menu netbsd, title MSG_NetBSD_VERSION_Install_System, y=-1,
     exit, exitstring MSG_Exit_Install_System;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.