Hello,

On Tue, Oct 03, 2006 at 08:19:38PM +1000, Anand Kumria wrote :
> A 'modprobe 'tun' in the startup script and then checking if
> /dev/net/tun exists ought to be enough.

AFAIK, the modprobe trick works only if udev is present. And even
then, I am not sure if it is synchronous; I don't want the script to
fail if udev is too slow to spawn the device node, postinst can simply
not afford to fail.

If udev is not there, it's actually the opposite, mknod triggers the
load of the LKM.

> That'll work with standard kernels (just tested), custom kernels
> which have it modular(just tested), customer kernels which have it
> inbuilt (untested).

I haven't checked either, but I suspect that if tun were statically
built, it would only work after reboot (past udev installation) when
udev creates /dev/net/tun anyway, as per /etc/udev/links.conf.

> It won't work for custom kernels where the default is not to build
> tun (also not tested) and the check for /dev/net/tun should catch
> those anyway.

/dev/net/tun might be there while the module is not available. To detect
availability, you have to actually open the device; it could probably be
done too, though it would be more intricate than simply checking for the
node presence.

I considered adding the modprobe and/or the mknod work-arounds, but my
sponsor reported it weren't such a good idea.

OTOH, the mol package seems to do both (can't test it, I don't have a
ppc).

Regards,

-- 
Rémi Denis-Courmont
http://www.remlab.net/

Reply via email to