Some ideas on Tim's script

Ian Lepore ian at FreeBSD.org
Thu Jan 31 15:30:01 UTC 2013


On Wed, 2013-01-30 at 21:14 -0800, Tim Kientzle wrote:
> On Jan 30, 2013, at 6:24 AM, George Rosamond wrote:
> > 
> > But first, with 8G images, I had to adjust the config.sh's SD_SIZE below 7900 for Kingston SD Cards to fit.  I can give more specifics if desired.  Anyone else experience that?
> 
> I have a bunch of different SD cards around here -- different
> sizes, different manufacturers -- and I think every one is
> 50MB-100MB smaller than the advertised size.
> 
> > In terms of /etc/fstab, I think adding tmpfs to the kernel would be useful.  Without it, using md(4) for /var/log, /tmp and /var/tmp is certainly a nice way to minimize disk writes.
> 
> How well does this work on a machine with only 256MB RAM?

At work we use an md disk for /tmp (and often for /var with /tmp linked
to /var/tmp) on units with only 64mb of ram.  We typically use 4mb for
combined /var and /tmp, but the kind of stuff we run isn't hungry for
temp space.

> > It might also make sense to add rc_debug="YES" and rc_info="YES" to the default /etc/rc.conf.  Most users are testing right now, and it's only logical for the pool of people hacking on them.
> 
> I wasn't aware of those options; I'll add them.
> 
> One of my wish-list items is to figure out how to buildkernel
> with a config file stored outside of /usr/src.  Then it would
> be possible to have a kernel config as part of the
> beaglebsd setup files, separate from the config in /usr/src
> that seems to be optimized for kernel debugging.
> 

Symlink the config into the arm/conf dir.  When I create a sandbox for
playing with a given unit (RPi, BeagleBone, etc) the hierarchy is:

  bsdstaging/
    bbone/
      ...
    dplug/
      ...
    rpi/
      mk
      config/
        RPI-B-SERIAL
        make.conf
        src.conf
      nfsroot/
      obj/
      patches/
      src/

'mk' is a script that sets up environment stuff, does a cd into src/ and
runs make.  The script symlinks $(pwd)/config/RPI-B-SERIAL into
src/sys/arm/conf, sets MAKEOBJDIR to $(pwd)/obj, DESTDIR to
$(pwd)/nfsroot, and launches make with a command line so that
config/make.conf and config/src.conf and KERNCONF= are all set up to use
the items in config/.

The nfsroot dir is nullfs-mounted at the nfs export mountpoint that's
configured as the dhcp-served root dir for that unit.

Right now I've got lots of almost-identical copies of this script, one
per project I'm working on.  Soon enough the commonalities will become
clear and I'll standardize it into my ~/bin directory.  It's not a big
complicated script at all, I'll attach it.

> > And maybe to add the relevant ntpdate(8) settings to /etc/rc.conf.
> 
> Has anyone tried running ntpdate from devd?  So that when/if
> the network interface initializes, ntpdate gets run at that point.
> That would avoid the tedious delay if there's no network at
> boot time.
> 

I think ntpd may be a better solution.  If you set ntpd_enable and
ntpd_sync_on_start to YES, ntpd will background itself immediately and
set the clock as soon as it reaches a server.  The downsides are a bit
of syslog spam as it whines periodically about not finding its peers
until the network shows up, and of course at some point a minute or two
after the network is connected, the clock is going to make a big jump
forward, and some apps don't react well to that.

-- Ian



More information about the freebsd-arm mailing list