Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jan 2010 20:41:45 +0100
From:      Bernhard Froehlich <decke@bluelife.at>
To:        Torfinn Ingolfsen <torfinn.ingolfsen@broadpark.no>
Cc:        freebsd-multimedia@FreeBSD.org
Subject:   Re: usleep's pvrxxx port and /boot/loader.conf - panic
Message-ID:  <c6509d52251e57991ade700a0b6396b0@bluelife.at>
In-Reply-To: <20100125202425.18ad4fb2.torfinn.ingolfsen@broadpark.no>
References:  <20100102001753.090c89ad.torfinn.ingolfsen@broadpark.no> <53a1e0711001012338v4ba68961o4a1d26a40abce396@mail.gmail.com> <20100125202425.18ad4fb2.torfinn.ingolfsen@broadpark.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 25 Jan 2010 20:24:25 +0100, Torfinn Ingolfsen
<torfinn.ingolfsen@broadpark.no> wrote:
> On Sat, 02 Jan 2010 15:38:11 +0800
> Henry Hu <henry.hu.sh@gmail.com> wrote:
> 
>> You may try /etc/rc.local
> 
> Thanks for the hit. With a little help from another person who semt me
> his cron script (via private mail), I have cooked up this little script,
> to be put in /usr/local/etc/rc.d and cxmload_enable="YES" to be set
> in /etc/rc.conf. Works for me.
> 
> The script:
> #!/bin/sh
> #
> #
> # PROVIDE: cxmload
> # REQUIRE: DAEMON
> # BEFORE: LOGIN
> # KEYWORD: shutdown
> 
> #
> 
> . /etc/rc.subr
> 
> name="cxmload"
> rcvar=${name}_enable
> 
> : ${cxmload_enable:="NO"}
> 
> start_cmd=${name}_start
> stop_cmd=${name}_stop
> 
> cxmload_start() {
>         if ! /sbin/kldstat | grep -w cxm.ko >/dev/null; then
>                 echo "Loading the cxm kmod."
>                 /sbin/kldload cxm.ko
>         else
>                 echo "The cxm kmod is already loaded."
>         fi
> }
> 
> cxmload_stop() {
>         echo "Dummy - we don't unload the cxm kmod."
> }
> 
> load_rc_config ${name}
> run_rc_command "$1"
> 
> All I need now is to make sure that this script runs before the
> mythbackend script.

All you need to do is to change REQUIRE and BEFORE so that it gets called
before the daemons start. Have a look at some ports that load kernel
modules - for example virtualbox-ose-kmod which uses:

# PROVIDE:	vboxnet
# REQUIRE:	FILESYSTEMS
# BEFORE:	netif
# KEYWORD:	nojail


http://www.freebsd.org/cgi/cvsweb.cgi/ports/emulators/virtualbox-ose-kmod/files/vboxnet.in?rev=1.1;content-type=text%2Fplain

-- 
Bernhard Fröhlich
http://www.bluelife.at/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c6509d52251e57991ade700a0b6396b0>