From owner-freebsd-arm@FreeBSD.ORG Fri Mar 7 00:14:30 2014 Return-Path: Delivered-To: freebsd-arm@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 769F2B6F; Fri, 7 Mar 2014 00:14:30 +0000 (UTC) Received: from feynman.konjz.org (feynman.konjz.org [64.147.119.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 319C6ED3; Fri, 7 Mar 2014 00:14:29 +0000 (UTC) Received: from 127.0.0.1 (tor-exit-node.cs.washington.edu [128.208.2.233]) (authenticated bits=0) by feynman.konjz.org (8.14.7/8.14.4) with ESMTP id s270EEvs086818 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 6 Mar 2014 19:14:18 -0500 (EST) (envelope-from george@ceetonetechnology.com) Message-ID: <53190F52.7030605@ceetonetechnology.com> Date: Thu, 06 Mar 2014 19:14:10 -0500 From: George Rosamond MIME-Version: 1.0 To: Ian Lepore , Jia-Shiun Li Subject: Re: TMPFS in kernels References: <5313D0FE.8010008@ceetonetechnology.com> <1393818974.1149.270.camel@revolution.hippie.lan> <5314016B.1000107@ceetonetechnology.com> <20140303061136.GB85204@zibbi.meraka.csir.co.za> <1394148799.1149.354.camel@revolution.hippie.lan> In-Reply-To: <1394148799.1149.354.camel@revolution.hippie.lan> Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 8bit Cc: "freebsd-arm@freebsd.org" X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 00:14:30 -0000 Ian Lepore: > On Thu, 2014-03-06 at 13:03 +0800, Jia-Shiun Li wrote: >> On Tue, Mar 4, 2014 at 10:48 PM, Warner Losh wrote: >>> >>> On Mar 4, 2014, at 3:30 AM, Jia-Shiun Li wrote: >>> >>>> I remember hacking it a while ago to adopt tmpfs instead on my pxeboot >>>> test environment. It only requires changing the line mdmfs mounting md to >>>> 'mount -t tmpfs' (plus mount options), and everything else will work as usual. >>> >>> I’ll have to give it a spin on NanoBSD then, at least as an option… >>> >> >> The actual patch & result pasted below to save you some time. >> Only tested on x86 pxeboot though. >> >> -----8<----------8<----------8<----- >> >> % diff -bu /usr/src/etc/rc.initdiskless >> /b/tftpboot/FreeBSD/install/etc/rc.initdiskless >> --- /usr/src/etc/rc.initdiskless 2013-04-11 21:03:31.000000000 +0800 >> +++ /b/tftpboot/FreeBSD/install/etc/rc.initdiskless 2014-03-06 >> 12:43:47.000000000 +0800 >> @@ -198,7 +198,10 @@ >> # Create a generic memory disk >> # >> mount_md() { >> - /sbin/mdmfs -S -i 4096 -s $1 -M md $2 >> +# /sbin/mdmfs -S -i 4096 -s $1 -M md $2 >> + local tmpfs_size >> + tmpfs_size=$(($1 * 1024)) >> + /sbin/mount -t tmpfs -osize=$tmpfs_size tmpfs $2 >> } >> >> # Create the memory filesystem if it has not already been created >> >> % cat df >> Filesystem Size Used Avail >> Capacity Mounted on >> 192.168.233.1:/b/tftpboot/FreeBSD/install/ 29G 17G 9.8G 63% / >> devfs 1.0K 1.0K 0B >> 100% /dev >> tmpfs 10M 2.6M 7.4M >> 26% /etc >> tmpfs 10M 180K 9.8M >> 2% /var >> /dev/md0 19M 24K 17M >> 0% /tmp >> % cat mount >> 192.168.233.1:/b/tftpboot/FreeBSD/install/ on / (nfs, read-only) >> devfs on /dev (devfs, local, multilabel) >> tmpfs on /etc (tmpfs, local) >> tmpfs on /var (tmpfs, local) >> /dev/md0 on /tmp (ufs, local) >> >> >> -Jia-Shiun. > > FYI, I just posted a patchset to freebsd-arch@ and freebsd-rc@ to > address this in a slightly different way. > > http://lists.freebsd.org/pipermail/freebsd-arch/2014-March/015141.html > > Basically I updated the mdmfs program to automatically use tmpfs if it's > available in the kernel and the device name is "auto", along with > changes to rc.initdiskless and defaults/rc.conf to set the device name > to "auto" by default. > Cool. So assume it would then be added to the (new) RPI-B and ALIX kernels. Am I correct? g