Commit Graph

3 Commits

Author SHA1 Message Date
Eugene Grosbein
707a657cbf rc.initdiskless: fix commentary grammar after r339465
MFC after:	1 month
2018-10-20 18:46:36 +00:00
Eugene Grosbein
b4d24263c2 rc.initdiskless: add support for auxiliary NVRAM.
Currently, rc.inidiskless assumes that local system configuration
changes are kept in some mountable file system. For example,
nanobsd uses dedicated partition mounted as /cfg for this.

However, small embedded devices like MIPS routers may have no enough flash
space to keep full-blown file system but have only one or couple
small flash blocks to keep persistent local configuration overrides.

This change extends rc.initdiskless and introduces ability to run auxiliary
command /conf/T/M/extract that is supposed to extract configuration overrides
from such local storage.

For example, the command /conf/default/etc/extract may contain something like:

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

bsdcpio command extracts compressed archive from the storage to /etc
assuming the storage is exposed by the kernel as /dev/map/cfg to userland.

PR:		204215
MFC after:	1 month
2018-10-20 18:13:51 +00:00
Bjoern A. Zeeb
0696600c41 Move the rc framework out of sbin/init into libexec/rc.
The reasons for this are forward looking to pkgbase:
 * /sbin/init is a special binary; try not to replace it with
   every package update because an rc script was touched.
   (a follow-up commit will make init its own package)
 * having rc in its own place will allow more easy replacement
   of the rc framework with alternatives, such as openrc.

Discussed with:		brd (during BSDCam), kmoore
Requested by:		cem, bz
PR:			231522
Approved by:		re (gjb)
2018-10-17 16:49:11 +00:00