Module Name:    src
Committed By:   ahoka
Date:           Sun Oct 18 12:09:48 UTC 2009

Modified Files:
        src/distrib/utils/sysinst: bsddisklabel.c defs.h disks.c main.c
        src/distrib/utils/sysinst/arch/amd64: md.h
        src/distrib/utils/sysinst/arch/i386: md.h

Log Message:
Give the option to use tmpfs for /tmp in sysinst instead of the older
mfs on i386 and amd64. Should be enabled on other platforms with reliable
tmpfs too.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/distrib/utils/sysinst/bsddisklabel.c
cvs rdiff -u -r1.145 -r1.146 src/distrib/utils/sysinst/defs.h
cvs rdiff -u -r1.108 -r1.109 src/distrib/utils/sysinst/disks.c
cvs rdiff -u -r1.53 -r1.54 src/distrib/utils/sysinst/main.c
cvs rdiff -u -r1.25 -r1.26 src/distrib/utils/sysinst/arch/amd64/md.h
cvs rdiff -u -r1.66 -r1.67 src/distrib/utils/sysinst/arch/i386/md.h

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

Modified files:

Index: src/distrib/utils/sysinst/bsddisklabel.c
diff -u src/distrib/utils/sysinst/bsddisklabel.c:1.52 src/distrib/utils/sysinst/bsddisklabel.c:1.53
--- src/distrib/utils/sysinst/bsddisklabel.c:1.52	Thu May 14 16:23:38 2009
+++ src/distrib/utils/sysinst/bsddisklabel.c	Sun Oct 18 12:09:48 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.52 2009/05/14 16:23:38 sborrill Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.53 2009/10/18 12:09:48 ahoka Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -61,9 +61,9 @@
 /* For the current state of this file blame a...@netbsd.org */
 /* Even though he wasn't the last to hack it, but he did admit doing so :-) */
 
-#define	PART_ANY	-1
-#define	PART_EXTRA	-2
-#define	PART_TMP_MFS	-3
+#define	PART_ANY		-1
+#define	PART_EXTRA		-2
+#define	PART_TMP_RAMDISK	-3
 
 /* Defaults for things that might be defined in md.h */
 #ifndef PART_ROOT
@@ -290,7 +290,7 @@
 	}
 
 	size = NUMSEC(size, mult, dlcylsize);
-	if (p->ptn_id == PART_TMP_MFS) {
+	if (p->ptn_id == PART_TMP_RAMDISK) {
 		p->size = size;
 		return 0;
 	}
@@ -357,9 +357,13 @@
 #define PI_SWAP 1
 		{ PART_SWAP,	{ 's', 'w', 'a', 'p', '\0' },
 	 	  DEFSWAPSIZE,	DEFSWAPSIZE, 0, 0 },
-		{ PART_TMP_MFS,	
+		{ PART_TMP_RAMDISK,
+#ifdef HAVE_TMPFS
+		  { 't', 'm', 'p', ' ', '(', 't', 'm', 'p', 'f', 's', ')', '\0' },
+#else
 		  { 't', 'm', 'p', ' ', '(', 'm', 'f', 's', ')', '\0' },
-		    64, 0, 0, 0 },
+#endif
+		  64, 0, 0, 0 },
 #define PI_USR 3
 		{ PART_USR,	{ '/', 'u', 's', 'r', '\0' },	DEFUSRSIZE,
 		  0, 0, 0 },
@@ -495,7 +499,7 @@
 					break;
 				continue;
 			}
-			if (p->ptn_id == PART_TMP_MFS)
+			if (p->ptn_id == PART_TMP_RAMDISK)
 				continue;
 			p->size += pi.free_space % dlcylsize;
 			break;
@@ -510,8 +514,8 @@
 				size = p->limit;
 		}
 		i = p->ptn_id;
-		if (i == PART_TMP_MFS) {
-			tmp_mfs_size = size;
+		if (i == PART_TMP_RAMDISK) {
+			tmp_ramdisk_size = size;
 			size = 0;
 			continue;
 		}

Index: src/distrib/utils/sysinst/defs.h
diff -u src/distrib/utils/sysinst/defs.h:1.145 src/distrib/utils/sysinst/defs.h:1.146
--- src/distrib/utils/sysinst/defs.h:1.145	Sat Sep 19 14:57:27 2009
+++ src/distrib/utils/sysinst/defs.h	Sun Oct 18 12:09:48 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.145 2009/09/19 14:57:27 abs Exp $	*/
+/*	$NetBSD: defs.h,v 1.146 2009/10/18 12:09:48 ahoka Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -257,7 +257,7 @@
 #define partition_name(x)	('a' + (x))
 partinfo oldlabel[MAXPARTITIONS];	/* What we found on the disk */
 partinfo bsdlabel[MAXPARTITIONS];	/* What we want it to look like */
-int tmp_mfs_size;
+daddr_t tmp_ramdisk_size;
 
 #define DISKNAME_SIZE 16
 char bsddiskname[DISKNAME_SIZE];

Index: src/distrib/utils/sysinst/disks.c
diff -u src/distrib/utils/sysinst/disks.c:1.108 src/distrib/utils/sysinst/disks.c:1.109
--- src/distrib/utils/sysinst/disks.c:1.108	Sat Oct  3 12:00:00 2009
+++ src/distrib/utils/sysinst/disks.c	Sun Oct 18 12:09:48 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.108 2009/10/03 12:00:00 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.109 2009/10/18 12:09:48 ahoka Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -746,13 +746,18 @@
 		   dump_freq, fsck_pass);
 	}
 
-	if (tmp_mfs_size != 0) {
+	if (tmp_ramdisk_size != 0) {
+#ifdef HAVE_TMPFS
+		scripting_fprintf(f, "tmpfs\t\t/tmp\ttmpfs\trw,-m=1777,-s=%d\n",
+		    tmp_ramdisk_size * 512);
+#else
 		if (swap_dev != -1)
 			scripting_fprintf(f, "/dev/%s%c\t\t/tmp\tmfs\trw,-s=%d\n",
-				diskdev, 'a' + swap_dev, tmp_mfs_size);
+				diskdev, 'a' + swap_dev, tmp_ramdisk_size);
 		else
 			scripting_fprintf(f, "swap\t\t/tmp\tmfs\trw,-s=%d\n",
-				tmp_mfs_size);
+				tmp_ramdisk_size);
+#endif
 	}
 
 	/* Add /kern, /proc and /dev/pts to fstab and make mountpoint. */

Index: src/distrib/utils/sysinst/main.c
diff -u src/distrib/utils/sysinst/main.c:1.53 src/distrib/utils/sysinst/main.c:1.54
--- src/distrib/utils/sysinst/main.c:1.53	Sun Dec 21 11:02:41 2008
+++ src/distrib/utils/sysinst/main.c	Sun Oct 18 12:09:48 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.53 2008/12/21 11:02:41 martin Exp $	*/
+/*	$NetBSD: main.c,v 1.54 2009/10/18 12:09:48 ahoka Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -114,7 +114,7 @@
 
 	sizemult = 1;
 	disktype = "unknown";
-	tmp_mfs_size = 0;
+	tmp_ramdisk_size = 0;
 	doessf = "";
 	clean_xfer_dir = 0;
 	mnt2_mounted = 0;

Index: src/distrib/utils/sysinst/arch/amd64/md.h
diff -u src/distrib/utils/sysinst/arch/amd64/md.h:1.25 src/distrib/utils/sysinst/arch/amd64/md.h:1.26
--- src/distrib/utils/sysinst/arch/amd64/md.h:1.25	Tue Apr  7 10:45:05 2009
+++ src/distrib/utils/sysinst/arch/amd64/md.h	Sun Oct 18 12:09:48 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.h,v 1.25 2009/04/07 10:45:05 tsutsui Exp $	*/
+/*	$NetBSD: md.h,v 1.26 2009/10/18 12:09:48 ahoka Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -62,6 +62,9 @@
 /* have support for booting form UFS2 */
 #define	HAVE_UFS2_BOOT
 
+/* allow using tmpfs for /tmp instead of mfs */
+#define HAVE_TMPFS
+
 /* have file system specific primary boot loader */
 #define	HAVE_BOOTXX_xFS
 #define	BOOTXXDIR	"/usr/mdec"

Index: src/distrib/utils/sysinst/arch/i386/md.h
diff -u src/distrib/utils/sysinst/arch/i386/md.h:1.66 src/distrib/utils/sysinst/arch/i386/md.h:1.67
--- src/distrib/utils/sysinst/arch/i386/md.h:1.66	Tue Apr  7 10:45:05 2009
+++ src/distrib/utils/sysinst/arch/i386/md.h	Sun Oct 18 12:09:48 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.h,v 1.66 2009/04/07 10:45:05 tsutsui Exp $	*/
+/*	$NetBSD: md.h,v 1.67 2009/10/18 12:09:48 ahoka Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -63,6 +63,9 @@
 /* have support for booting from UFS2 */
 #define	HAVE_UFS2_BOOT
 
+/* allow using tmpfs for /tmp instead of mfs */
+#define HAVE_TMPFS
+
 /* have file system specific primary boot loader */
 #define	HAVE_BOOTXX_xFS
 #define	BOOTXXDIR	"/usr/mdec"

Reply via email to