Date: Wed, 28 Dec 2011 14:53:42 +0000 From: Chris Rees <utisoft@gmail.com> To: Kostik Belousov <kostikbel@gmail.com> Cc: hackers@freebsd.org Subject: Re: Checking for other kernel modules on load Message-ID: <CADLo83-OBNWzY_r_oFmUBjkNoCpifJ0_u9dYN52YTZ69X06o4Q@mail.gmail.com> In-Reply-To: <20111228135641.GV50300@deviant.kiev.zoral.com.ua> References: <CADLo838QjrUunABB=3R_d6NO9bnNAcKXM%2BZt3DRam3RnOGnxGw@mail.gmail.com> <B8D5A1B2-4790-48CA-AAC3-D4333D52ECEB@gsoft.com.au> <CADLo8382uPC6YmreCz8irVuiOhSwc2axJTgQRpVJk-%2B0Win8rQ@mail.gmail.com> <20111228135641.GV50300@deviant.kiev.zoral.com.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
2011/12/28 Kostik Belousov <kostikbel@gmail.com>: > On Wed, Dec 28, 2011 at 12:23:58PM +0000, Chris Rees wrote: >> On 28 December 2011 12:21, Daniel O'Connor <doconnor@gsoft.com.au> wrote= : >> > >> > On 28/12/2011, at 22:07, Chris Rees wrote: >> >> Is there a simple way to check for existence of a driver? =A0I could >> >> even check for /dev/sndstat, though that doesn't seem elegant to me..= . >> > >> > kldstat -v, but really /dev/sndstat seems simpler and just as effectiv= e. >> > >> >> Cheers-- I was thinking of a kernel-level function though. >> >> cognet@ suggested using modfind("sound"), I'll go with that. > Obvious question is what the panic is. Checking for modules loaded is > papering over some issue. True, although I figured that it was a simple conflict, possibly to do with sndstat. Also, I'm getting panics with the following patch, whether sound is loaded or not :) + if (modfind("sound") >=3D 0) + { + cmn_err (CE_WARN, "A conflicting sound driver is already loaded"); + return EBUSY; + } + Is there a better way to handle such conflicts? Chris
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADLo83-OBNWzY_r_oFmUBjkNoCpifJ0_u9dYN52YTZ69X06o4Q>