[MPlayer-dev-eng] [PATCH] Devfs autodetection
David Holm
david at realityrift.com
Tue Jun 11 12:31:58 CEST 2002
On Tue, 2002-06-11 at 07:27, David Holm wrote:
> It might be more appropriate to check /proc/mounts for ' devfs ' (the
> spaces are needed or otherwise you might detect usbdevfs) as devfsd is
> not required to be running for devfs to work.
>
> //David
The following code is used in another project I'm working on. It has
been tested on numerous systems. Of course you would have to modify it
as it is made to detect if devfs isn't being used, but you get the idea
=)
#! /bin/sh
# This is a simple scripts to create the devices for em8300 driver,
# it should abort if you have the devfs filesystem mounted, em8300
# supports devfs so there should be no need.
DEVFS=`cat /proc/mounts | grep " devfs "`
if [ -z "$DEVFS" ] ; then
echo "Devfs not mounted creating device nodes"
mknod /dev/em8300-0 c 121 0
ln -fs /dev/em8300-0 /dev/em8300
mknod /dev/em8300_mv-0 c 121 1
ln -fs /dev/em8300_mv-0 /dev/em8300_mv
mknod /dev/em8300_ma-0 c 121 2
ln -fs /dev/em8300_ma-0 /dev/em8300_ma
mknod /dev/em8300_sp-0 c 121 3
ln -fs /dev/em8300_sp-0 /dev/em8300_sp
chmod 666 /dev/em8300*
else
echo "Hmmm, looks like you have devfs mounted, Im going to be
safe and leave thi
ngs alone!"
fi
More information about the MPlayer-dev-eng
mailing list