]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
rc.initdiskless: add support for auxiliary NVRAM.
authoreugen <eugen@FreeBSD.org>
Sat, 20 Oct 2018 18:13:51 +0000 (18:13 +0000)
committereugen <eugen@FreeBSD.org>
Sat, 20 Oct 2018 18:13:51 +0000 (18:13 +0000)
commit1901274ba0e2916e63792fb3b3bfc4e8ec00fc83
tree64ddfcf0693abcb7e2c5ae1898b8f9bc366c734c
parentb5745038bc11c95ea860e852709528deaaae23f7
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
libexec/rc/rc.initdiskless