diff options
author | flz <flz@FreeBSD.org> | 2006-05-18 15:29:27 +0000 |
---|---|---|
committer | flz <flz@FreeBSD.org> | 2006-05-18 15:29:27 +0000 |
commit | 3d58ab6ef3bedfa3b3edb454ac4b509eaca930ed (patch) | |
tree | e8c7f4ff77c794dfe3d81de6e5b60ed7c24acc58 /etc/rc.subr | |
parent | d54cf9fc0c7b57e54ebfba869e5dca6f802374ad (diff) | |
download | FreeBSD-src-3d58ab6ef3bedfa3b3edb454ac4b509eaca930ed.zip FreeBSD-src-3d58ab6ef3bedfa3b3edb454ac4b509eaca930ed.tar.gz |
Add two new scripts (mdconfig/mdconfig2) to replace old ramdisk{,-own}
scripts. These scripts handle vnode backed md(4) devices.
Old ramdisk{,-own} scripts will stay a bit in CVS to allow some time for
migration since variable names have changed (ramdisk_* -> mdconfig_*).
Two new variables have been introduced to be able to populate the md(4)
device once it has been mounted (mdconfig_*_files and mdconfig_*_cmd).
Use should be as easy as:
mdconfig_md0="-t malloc -s 10m"
mdconfig_md1="-t vnode -f /var/foo.img"
See rc.conf(5) for more information and description of the additional
variables.
Approved by: cperciva
Diffstat (limited to 'etc/rc.subr')
-rw-r--r-- | etc/rc.subr | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/etc/rc.subr b/etc/rc.subr index 1037bbc..9c6a158 100644 --- a/etc/rc.subr +++ b/etc/rc.subr @@ -1379,6 +1379,35 @@ ltr() echo "${_out}" } +# require_kld name +# Ensure given module is loaded. +# Try to load it if it's not. +require_kld() +{ + local _name _line _ret + + _name=$1 + _me="require_kld" + + _ret=`kldstat -v | while read _line; do + case ${_line} in + *" ${_name}") + echo "yes" + ;; + *) + ;; + esac; + done` + + if [ -z "${_ret}" ]; then + if kldload ${_name}; then + info "${_name} module loaded." + else + err 1 "${_me}: ${_name} module failed to load." + fi + fi +} + # Creates a list of providers for GELI encryption. geli_make_list() { |