Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Mar 2014 17:20:27 -0700
From:      Ian Lepore <ian@FreeBSD.org>
To:        George Rosamond <george@ceetonetechnology.com>
Cc:        "freebsd-arm@freebsd.org" <freebsd-arm@FreeBSD.org>
Subject:   Re: TMPFS in kernels
Message-ID:  <1394151627.1149.357.camel@revolution.hippie.lan>
In-Reply-To: <53190F52.7030605@ceetonetechnology.com>
References:  <5313D0FE.8010008@ceetonetechnology.com> <1393818974.1149.270.camel@revolution.hippie.lan> <5314016B.1000107@ceetonetechnology.com> <20140303061136.GB85204@zibbi.meraka.csir.co.za> <CAHNYxxPvRwmSDw8M9znFi1QsDq%2BR=Ash7AODWTct4Q_TBdOCVQ@mail.gmail.com> <C1297CD6-C313-4516-BA51-71C427C45B79@bsdimp.com> <CAHNYxxOAcjiU0C6of9wBeHyXiCCgdJWt2Y8BpV%2BDyyD=fxdG2g@mail.gmail.com> <1394148799.1149.354.camel@revolution.hippie.lan> <53190F52.7030605@ceetonetechnology.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 2014-03-06 at 19:14 -0500, George Rosamond wrote:
> 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 <imp@bsdimp.com> wrote:
> >>>
> >>> On Mar 4, 2014, at 3:30 AM, Jia-Shiun Li <jiashiun@gmail.com> wrote=
:
> >>>
> >>>> I remember hacking it a while ago to adopt tmpfs instead on my pxe=
boot
> >>>> test environment. It only requires changing the line mdmfs mountin=
g md to
> >>>> 'mount -t tmpfs' (plus mount options), and everything else will wo=
rk as usual.
> >>>
> >>> I=92ll have to give it a spin on NanoBSD then, at least as an optio=
n=85
> >>>
> >>
> >> 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.00000000=
0 +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=3D$(($1 * 1024))
> >> +    /sbin/mount -t tmpfs -osize=3D$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.
> >=20
> > FYI, I just posted a patchset to freebsd-arch@ and freebsd-rc@ to
> > address this in a slightly different way.=20
> >=20
> > http://lists.freebsd.org/pipermail/freebsd-arch/2014-March/015141.htm=
l
> >=20
> > Basically I updated the mdmfs program to automatically use tmpfs if i=
t'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 nam=
e
> > to "auto" by default.
> >=20
>=20
> Cool.  So assume it would then be added to the (new) RPI-B and ALIX
> kernels.  Am I correct?
>=20
> g
>=20

Yeah, for the kernel side of it, I'm just adding TMPFS to
arm/conf/DEFAULTS since the concensus seems to be that we want it in all
kernels.  I'm waiting for a universe-kernels build to finish and if it's
clean I'll commit that tonight.

For the other part of it, we'll see what feedback comes from the review
on the other lists, it may not get committed for a few days.

-- Ian





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1394151627.1149.357.camel>