On Fri, 6 Dec 2002 09:54:44 +1100 Nick Croft wrote:
> Any ideas on what is needed to make /dev/usbscanner permanent?  After
> a reboot, it seems I need to do
> 
>       sudo mknod /dev/usbscanner c 180 48
>       sudo chmod 666 /dev/usbscanner
> 
> 
> each time.

Sounds like you're running with devfs.  Does a "ps ax" show a devfsd
process running?  I wasn't aware that distributions were turning it on
by default..

The Documentation/usb/scanner.txt file in your kernel source tree has
details on how to make devfs do what you want, ie something like:

REGISTER ^usb/scanner0$ CFUNCTION GLOBAL symlink usb/scanner0 usbscanner
UNREGISTER ^usb/scanner0$ CFUNCTION GLOBAL unlink usbscanner

in /etc/devfsd.conf (or /etc/devfs/devfsd.conf on some distributions),
and killall -HUP devfsd to reload the configuration.

And to set the same permissions you'll need a line like
REGISTER ^usb/scanner.$ PERMISSIONS root.root 0666
(untested, YMMV, etc...)

> And in a similar area, when I list /dev/usb, I get
> 
>                 nick@artarmon ~ % ls /dev/usb -l
>                 total 0
>                 crw-rw-rw-    1 root     root     180,  48 Jan  1  1970
>                 scanner0

Yep, definitely devfs.  It's a dynamic filesystem, and device nodes are
created and deleted on the fly by the kernel as modules are loaded and
unloaded (or in the case of USB, as devices are added or removed). 
The default naming scheme is wildly different to what you're used to,
though, and it's the job of the devfsd daemon to add symlinks to the
more familiar device names.  It also manages ownership and permissions
of devices.

The point is that everything created by devfs gets an epoch timestamp.

> And strangely, root is not allowed to rm that device, according to the
> means known to me. (I seem to recall making that one some time agao
> when I was trying to configure an unsupported scanner).

Another side effect of the dynamic generation.  By the same token, you
can't remove anything in /proc either, although it could be a pretty
neat way to upgrade or replace broken hardware.

The kernel documentation again has fairly thorough devfs documentation,
in Documentation/filesystems/devfs/ .  Also see the manpages for devfsd
and devfsd.conf.

Cheers,
-- 
Pete
-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to