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.
This commit is contained in:
Crist J. Clark 2003-03-17 23:15:53 +00:00
parent 331fce2ee7
commit 5d75ba3db9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=112354
3 changed files with 82 additions and 0 deletions

View File

@ -28,6 +28,9 @@ apm_enable="NO" # Set to YES to enable APM BIOS functions (or NO).
apmd_enable="NO" # Run apmd to handle APM event from userland.
apmd_flags="" # Flags to apmd (if enabled).
devd_enable="NO" # Run devd, to trigger programs on device tree changes.
kldxref_enable="NO" # Build linker.hints files with kldxref(8).
kldxref_clobber="NO" # Overwrite old linker.hints at boot.
kldxref_module_path="" # Override kern.module_path. A ';'-delimited list.
pccard_enable="NO" # Set to YES if you want to configure PCCARD devices.
pccard_mem="DEFAULT" # If pccard_enable=YES, this is card memory address.
pccard_beep="2" # pccard beep type.

35
etc/rc.d/kldxref Normal file
View File

@ -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"

View File

@ -124,6 +124,48 @@ daemon.
Run
.Xr devd 8
to handle device added, removed or unknown events from the kernel.
.It Va kldxref_enable
.Pq Vt bool
Set to
.Dq Li NO
by default.
Set to
.Dq Li YES
to automatically rebuild
.Pa linker.hints
files with
.Xr kldxref 8
at boot time.
.It Va kldxref_clobber
.Pq Vt bool
Set to
.Dq Li NO
by default.
If
.Va kldxref_enable
is true,
setting to
.Dq Li YES
will overwrite existing
.Pa linker.hints
files at boot time.
Otherwise,
only missing
.Pa linker.hints
files are generated.
.It Va kldxref_module_path
.Pq Vt str
Empty by default.
A semi-colon
.Pq Dq \;
delimited list of paths containing
.Xr kld 4
modules.
If empty,
the contents of the
.Em kern.module_path
.Xr sysctl 8
are used.
.It Va pccard_enable
.Pq Vt bool
If set to
@ -2247,6 +2289,7 @@ values.)
.Xr kbdcontrol 1 ,
.Xr makewhatis 1 ,
.Xr vidcontrol 1 ,
.Xr kld 4 ,
.Xr tcp 4 ,
.Xr udp 4 ,
.Xr exports 5 ,
@ -2262,6 +2305,7 @@ values.)
.Xr inetd 8 ,
.Xr isdnd 8 ,
.Xr isdntrace 8 ,
.Xr kldxref 8 ,
.Xr lpd 8 ,
.Xr mdconfig 8 ,
.Xr moused 8 ,