/etc/rc.initdiskless support for small systems

Eugene Grosbein eugen at grosbein.net
Mon Nov 2 09:32:16 UTC 2015


Hi!

Sometimes it is suitable to use stock /etc/rc.initdiskless to manage boot-time configuration
of embedded systems. Sadly, rc.initdislkess assumes there is distinct file system
keeping persitent local configuration (startup config). Small systems like MIPS routers
may have no enough flash space for full-blown fs.

I've patched rc.initdiskless to run auxiliary command at boot time to extract
startup configuration from such small local storage, f.e. from /dev/map/cfg
I've just submited the patch with PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204215
This way, one can use /conf/default/etc/extract command doing something like:

cd "$1" && bsdcpio --quiet -idu < /dev/map/cfg

/etc/rc.initdiskless runs such command passing /etc as $1 at boot time then.


More information about the freebsd-mips mailing list