Module Name:    src
Committed By:   christos
Date:           Mon May 20 19:28:44 UTC 2013

Modified Files:
        src/distrib/utils/embedded/conf: evbarm.conf

Log Message:
If minwrites is set:
        - set noatime, nodevmtime for root
        - use tmpfs for frequently written files
        - use unix sockets instead of fifos for postfix
From:
http://rich-tbp.blogspot.com/2013/03/netbsd-on-rpi-minimizing-disk-writes.html


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/distrib/utils/embedded/conf/evbarm.conf

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/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.10 src/distrib/utils/embedded/conf/evbarm.conf:1.11
--- src/distrib/utils/embedded/conf/evbarm.conf:1.10	Fri Mar  1 09:28:22 2013
+++ src/distrib/utils/embedded/conf/evbarm.conf	Mon May 20 15:28:44 2013
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.10 2013/03/01 14:28:22 htodd Exp $
+# $NetBSD: evbarm.conf,v 1.11 2013/05/20 19:28:44 christos Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -60,7 +60,7 @@ drivedata: 0 
 EOF
 }
 
-make_fstab_evbarm() {
+make_fstab_evbarm_normal() {
 	cat > ${mnt}/etc/fstab << EOF
 # NetBSD /etc/fstab
 # See /usr/share/examples/fstab/ for more examples.
@@ -73,8 +73,45 @@ procfs		/proc		procfs	rw
 EOF
 }
 
+# From Richard Neswold's:
+# http://rich-tbp.blogspot.com/2013/03/netbsd-on-rpi-minimizing-disk-writes.html
+# Also for the postfix stuff below
+make_fstab_evbarm_minwrites() {
+	cat > ${mnt}/etc/fstab << EOF
+# NetBSD /etc/fstab
+# See /usr/share/examples/fstab/ for more examples.
+/dev/ld0a	/			ffs	rw,log,noatime,nodevmtime 1 1
+/dev/ld0b	none			swap	sw			  0 0
+/dev/ld0e	/boot			msdos	rw			  1 1
+kernfs		/kern			kernfs	rw
+ptyfs		/dev/pts		ptyfs	rw
+procfs		/proc			procfs	rw
+tmpfs		/tmp			tmpfs	rw,-s32M
+tmpfs		/var/log		tmpfs	rw,union,-s32M
+tmpfs		/var/run		tmpfs	rw,union,-s1M
+tmpfs		/var/mail		tmpfs	rw,union,-s10M
+tmpfs		/var/spool/postfix	tmpfs	rw,union,-s20M
+tmpfs		/var/db/postfix		tmpfs	rw,union,-s1M
+tmpfs		/var/chroot		tmpfs	rw,union,-s10M
+EOF
+}
+
+make_fstab_evbarm() {
+	if $minwrites; then
+		make_fstab_evbarm_minwrites
+	else
+		make_fstab_evbarm_normal
+	fi
+}
+
 customize_evbarm() {
 	cp ${release}/etc/rc.conf ${mnt}/etc/rc.conf
+	if $minwrites; then
+		mkdir ${mnt}/etc/postfix
+		(umask 022
+		sed -e 's/fifo/unix/' < ${release}/etc/postfix/master.cf > \
+		    ${mnt}/etc/postfix/master.cf)
+	fi
 	cat >> ${mnt}/etc/rc.conf << EOF
 rc_configured=YES
 hostname=${board}

Reply via email to