diff options
author | cjc <cjc@FreeBSD.org> | 2003-03-17 23:15:53 +0000 |
---|---|---|
committer | cjc <cjc@FreeBSD.org> | 2003-03-17 23:15:53 +0000 |
commit | c5ea907b7e85445d08b73db5b00fb0e09de4c9f4 (patch) | |
tree | e211663bdcc09e0c0e9782ba63c61c281ce7d300 /etc/rc.d/kldxref | |
parent | 2575bf9123f9d3c2353d1f5faf6626561514d034 (diff) | |
download | FreeBSD-src-c5ea907b7e85445d08b73db5b00fb0e09de4c9f4.zip FreeBSD-src-c5ea907b7e85445d08b73db5b00fb0e09de4c9f4.tar.gz |
A new rc-ng script to build linker.hints files with kldxref(8)
automatically at boot time. Associated rc.conf(5) knobs and
documentation are included.
Diffstat (limited to 'etc/rc.d/kldxref')
-rw-r--r-- | etc/rc.d/kldxref | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/etc/rc.d/kldxref b/etc/rc.d/kldxref new file mode 100644 index 0000000..8b93e37 --- /dev/null +++ b/etc/rc.d/kldxref @@ -0,0 +1,35 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: kldxref +# REQUIRE: root mountcritlocal +# BEFORE: network1 +# KEYWORD: FreeBSD + +. /etc/rc.subr + +rcvar="kldxref_enable" +name="kldxref" +stop_cmd=":" +start_cmd="kldxref_start" + +kldxref_start () { + if [ -n "$kldxref_module_path" ]; then + MODULE_PATHS="$kldxref_module_path" + else + MODULE_PATHS=`sysctl -n kern.module_path` + fi + IFS=';' + for MODULE_DIR in $MODULE_PATHS; do + if [ ! -f "$MODULE_DIR/linker.hints" ] || + checkyesno kldxref_clobber; then + echo "Building $MODULE_DIR/linker.hints" + kldxref "$MODULE_DIR" + fi + done +} + +load_rc_config $name +run_rc_command "$1" |