From owner-FreeBSD-tech-jp@jp.freebsd.org  Mon Apr  2 22:35:37 2001
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id WAA45565;
	Mon, 2 Apr 2001 22:35:37 +0900 (JST)
	(envelope-from owner-FreeBSD-tech-jp@jp.FreeBSD.org)
Received: from lily.sanpei.org (u1027.seaple.icc.ne.jp [210.170.9.27])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id WAA45560
	for <FreeBSD-tech-jp@jp.freebsd.org>; Mon, 2 Apr 2001 22:35:36 +0900 (JST)
	(envelope-from sanpei@sanpei.org)
Received: from lavender.sanpei.org (lavender-cherry.sanpei.org [192.168.7.1])
	by lily.sanpei.org (8.9.3+3.2W/3.7W) with ESMTP id WAA36928;
	Mon, 2 Apr 2001 22:35:30 +0900 (JST)
Received: from localhost (localhost [127.0.0.1])
	by lavender.sanpei.org (8.11.2/3.7W) with ESMTP id f32DZVN65163;
	Mon, 2 Apr 2001 22:35:31 +0900 (JST)
Date: Mon, 02 Apr 2001 22:35:30 +0900 (JST)
Message-Id: <20010402.223530.38690337.sanpei@sanpei.org>
To: FreeBSD-tech-jp@jp.freebsd.org, yoshio.mita@ma2.justnet.ne.jp
From: MIHIRA Sanpei Yoshiro <sanpei@sanpei.org>
In-Reply-To: <20010401095936.1.22749.qmail@ma2.justnet.ne.jp>
References: <868zlmqgst.wl@cheerful.com>
	<20010401095936.1.22749.qmail@ma2.justnet.ne.jp>
X-Mailer: Mew version 1.95b116 on Emacs 21.0 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Reply-To: FreeBSD-tech-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+010328
X-Sequence: FreeBSD-tech-jp 3053
Subject: [FreeBSD-tech-jp 3053] Re: nullfs
Errors-To: owner-FreeBSD-tech-jp@jp.freebsd.org
Sender: owner-FreeBSD-tech-jp@jp.freebsd.org
X-Originator: sanpei@sanpei.org

>>> $B:rG/(B 9 $B7n$3$m$K!$(B5-current $B$G(B nullfs $B<~JU$N=$@5$,$O$$$C$F$$$^$9!%(B
>>$B$P$9$P$9;H$C$F$$$^$9$,$*$h$=LdBj$"$j$^$;$s!%(B
>
>$B$=$&$9$k$H(B, 4$B7O$G$O$J$/$F(B5$B7O$r%$%s%9%H!<%k$7$F$_$k$H$h$5$=$&$G$9$M(B.
>diskless $B$@$HIaDL$K%U%!%$%k$rE83+$9$k$@$1$G%$%s%9%H!<%k40N;$@$+$i(B
>$BJXMx$G$9$M(B.

  rc.diskless{1,2} $B$G$O(B, MFS $B$r;H$C$F$$$^$9$,(B, 5-current $B$G$O(B MFS $B$O(B
$B<!$N$h$&$J%a%C%;!<%8$r=P$7$F(B, md $B$r;H$&$h$&8@$C$F$-$^$9(B.

WARNING: MFS is being phased out in preference for md devices
WARNING: Please see mdconfig(8) for details
WARNING: Continuing in 15 seconds

  $B@h7n(B current@FreeBSD.org $B$GOCBj$K$7$?$H$3$m(B, md $B$r;H$&$h$&$K$9$k%Q%C(B
$B%A$r$$$?$@$-$^$7$?(B(send-pr $B$5$l$F$$$k$1$I(B, diff $B$N<h$jJ}$,4V0c$C$F$$(B
$B$?$j$7$^$9(B). $B8D?ME*$K$O<j85$GF0$$$F$$$k$N$G$9$,(B, $B%Q%C%A$r@0M}$9$k;~(B
$B4V$,L5$$$N$G(B, $B$=$N8e$O$=$N$^$^$G$9(B. 

$B4XO"%9%l%C%I$O2<5-$N(B Subject $B$J$I$+$iC5$7$F$_$F$/$@$5$$(B.

Subject: use md device in /etc/rc.diskless{1,2}
From: MIHIRA Sanpei Yoshiro <sanpei@sanpei.org>
To: current@FreeBSD.org
Date: Mon, 26 Mar 2001 13:13:55 +0900 (JST)

  $B$A$J$_$K(B, $B;d$O(B, 3.3-RELEASE $B:"$H(B, $B:#G/$N(B 3 $B7n$0$i$$$+$i(B5-current 
$B$G(B, pxe $BBP1~(B Intel FastEthercard $B$rMQ$$$F(B diskless $B2=$7$F$$$^$9(B.

  NFSROOT:/conf/[client_IP_address]/etc $B$K%U%!%$%k$rCV$/$HJ#?tBf$"$C(B
$B$F$?$j(B, OS version-up $B;~$J$I$K3Z$@$H;W$$$^$9(B. 
---
MIHIRA, Sanpei Yoshiro
Yokohama, Japan.

--- src/etc/rc.diskless1.orig	Sun Feb 11 00:18:53 2001
+++ src/etc/rc.diskless1	Mon Mar 26 21:50:13 2001
@@ -98,9 +98,14 @@
 # WARNING! null mounts cannot handle mmap, and since many programs
 # use mmap (such as 'cp'), we have to copy.
 #
-mount_mfs -s 2048 -T qp120at dummy /conf/etc
+# up to now we don't have make swapon and so we must use malloc
+#
+mdconfig -a -t malloc -s 2048 -u 10
+disklabel -r -w md10 auto 
+newfs /dev/md10c
+mount /dev/md10c /conf/etc
 cp -Rp /etc/* /conf/etc
-chkerr $? "MFS mount on /conf/etc"
+chkerr $? "MD mount on /conf/etc"
 
 if [ -d /conf/${bootp_ipa} ] ; then
         cp -Rp /conf/${bootp_ipa}/etc/* /conf/etc
@@ -112,7 +117,8 @@
 
 # Make the new directory available as /etc
 #
-mount_null /conf/etc /etc
+umount /dev/md10c
+mount /dev/md10c /etc
 
 # Tell /etc/rc to run the specified script after
 # it does its mounts but before it does anything

--- src/etc/rc.diskless2.orig	Mon Mar 26 21:50:18 2001
+++ src/etc/rc.diskless2	Mon Mar 26 22:18:46 2001
@@ -38,28 +38,29 @@
 	. /etc/rc.conf
 fi
 
-mount_mfs -s ${varsize:=65536} -T qp120at dummy /var
-var_dirs="run dev db msgs tmp spool spool/mqueue spool/lpd spool/output \
-	spool/output/lpd"
-for i in ${var_dirs}
-do
-    mkdir /var/${i}
-done
-chmod 755 /var/run
-chmod 755 /var/db
-chmod 755 /var/spool
-chmod 1777 /var/tmp
-chown -R root.daemon /var/spool/output
-chgrp daemon /var/spool/lpd
+# If the diskless station work without swap use malloc instead of swap
+#
+case ${swap_enable} in
+[Yy][Ee][Ss])
+	mdconfig -a -t swap -s ${varsize:=65536} -u 11
+	;;
+*)
+	mdconfig -a -t malloc -s ${varsize:=65536} -u 11
+	;;
+esac
+
+disklabel -r -w md11 auto
+newfs /dev/md11c
+mount /dev/md11c /mnt
+
+# cp the pre-build /var dir and make available as /var
 #
 # XXX make sure to create one dir for each printer as requested by lpd
 #
+cp -Rp /var/* /mnt
+umount /dev/md11c
+mount /dev/md11c /var
 
 if [ ! -h /tmp -a ! -h /var/tmp ]; then
 	mount_null /var/tmp /tmp
 fi
-
-# extract a list of device entries, then copy them to a writable partition
-(cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp
-mount_mfs -s 4096 -i 512 -T qp120at dummy /dev
-(cd /; cpio -i -H newc -d < /tmp/dev.tmp)
