freebsd-nq/etc/defaults
Ian Lepore 50e3590c44 Enhance mdmfs(8) to work with tmpfs(5).
Existing scripts and associated config such as rc.initdiskless, rc.d/var,
and others, use mdmfs to create memory filesystems. That program accepts a
size argument which allows SI suffixes and treats an unsuffixed number as a
count of 512 byte sectors. That makes it difficult to convert existing
scripts to use tmpfs instead of mdmfs, because tmpfs treats unsuffixed
numbers as a count of bytes. The script logic to deal with existing user
config that might include suffixed and unsuffixed numbers is... unpleasant.

Also, there is no g'tee that tmpfs will be available. It is sometimes
configured out of small-resource embedded systems to save memory and flash
storage space.

These changes enhance mdmfs(8) so that it accepts two new values for the
'md-device' arg: 'tmpfs' and 'auto'. With tmpfs, the program always uses
tmpfs(5) (and fails if it's not available). With 'auto' the program prefers
tmpfs, but falls back to using md(4) if tmpfs isn't available. It also
handles the -s <size> argument so that the mdconfig interpetation of
unsuffixed numbers applies when tmpfs is used as well, so that existing user
config keeps working after a switch to tmpfs.

A new rc setting, mfs_type, is added to etc/defaults/rc.conf to let users
force the use of tmpfs or md; the default value is "auto".

Differential Revision:	https://reviews.freebsd.org/D12301
2017-09-29 22:13:26 +00:00
..
bluetooth.device.conf
devfs.rules
Makefile DIRDEPS_BUILD: Fix staging of share/sendmail and share/examples. 2016-03-11 23:45:09 +00:00
Makefile.depend DIRDEPS_BUILD: Fix staging of share/sendmail and share/examples. 2016-03-11 23:45:09 +00:00
periodic.conf Deorbit catman. The tradeoff of disk for performance has long since tipped 2017-09-13 16:35:16 +00:00
rc.conf Enhance mdmfs(8) to work with tmpfs(5). 2017-09-29 22:13:26 +00:00