1223264Sdougb#!/bin/sh
2223264Sdougb
3223264Sdougb# Copyright (c) 2011 Douglas Barton
4223264Sdougb# All rights reserved.
5223264Sdougb#
6223264Sdougb# Redistribution and use in source and binary forms, with or without
7223264Sdougb# modification, are permitted provided that the following conditions
8223264Sdougb# are met:
9223264Sdougb# 1. Redistributions of source code must retain the above copyright
10223264Sdougb#    notice, this list of conditions and the following disclaimer.
11223264Sdougb# 2. Redistributions in binary form must reproduce the above copyright
12223264Sdougb#    notice, this list of conditions and the following disclaimer in the
13223264Sdougb#    documentation and/or other materials provided with the distribution.
14223264Sdougb#
15223264Sdougb# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16223264Sdougb# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17223264Sdougb# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18223264Sdougb# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19223264Sdougb# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20223264Sdougb# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21223264Sdougb# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22223264Sdougb# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23223264Sdougb# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24223264Sdougb# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25223264Sdougb# SUCH DAMAGE.
26223264Sdougb#
27223264Sdougb# $FreeBSD$
28223264Sdougb#
29223264Sdougb# PROVIDE: kld
30228191Sobrien# REQUIRE: kldxref
31223264Sdougb# KEYWORD: nojail
32223264Sdougb
33223264Sdougb. /etc/rc.subr
34223264Sdougb
35223264Sdougbname="kld"
36223264Sdougb
37223264Sdougbstart_cmd="${name}_start"
38223264Sdougbstop_cmd=':'
39223264Sdougb
40223264Sdougbkld_start()
41223264Sdougb{
42223264Sdougb	[ -n "$kld_list" ] || return
43223264Sdougb
44224273Sdougb	local _kld
45223264Sdougb
46223264Sdougb	echo 'Loading kernel modules:'
47223264Sdougb	for _kld in $kld_list ; do
48224273Sdougb		load_kld -e ${_kld}.ko $_kld
49223264Sdougb	done
50223264Sdougb}
51223264Sdougb
52223264Sdougbload_rc_config $name
53223264Sdougbrun_rc_command "$1"
54