Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/distrib/utils/embedded/conf If minwrites is set:



details:   https://anonhg.NetBSD.org/src/rev/7e486c795275
branches:  trunk
changeset: 786915:7e486c795275
user:      christos <christos%NetBSD.org@localhost>
date:      Mon May 20 19:28:44 2013 +0000

description:
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

diffstat:

 distrib/utils/embedded/conf/evbarm.conf |  41 +++++++++++++++++++++++++++++++-
 1 files changed, 39 insertions(+), 2 deletions(-)

diffs (64 lines):

diff -r 8d96a79dab70 -r 7e486c795275 distrib/utils/embedded/conf/evbarm.conf
--- a/distrib/utils/embedded/conf/evbarm.conf   Mon May 20 19:27:17 2013 +0000
+++ b/distrib/utils/embedded/conf/evbarm.conf   Mon May 20 19:28:44 2013 +0000
@@ -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 @@
 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 @@
 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}



Home | Main Index | Thread Index | Old Index