nldev

NetLink DEVice manager; a lightweight netlink frontend for mdev.
git clone git://r-36.net/nldev
Log | Files | Refs | LICENSE

commit 3926fcc07fb8171017902702050d473e05948c26
parent 0ae13c5543d925768153f7356ca216330d24a0fd
Author: Christoph Lohmann <20h@r-36.net>
Date:   Sun, 10 Jun 2012 18:23:34 +0200

Applying DVB changes for the new mdev.conf format.

Diffstat:
mdev/lib/dvbdev | 22++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/mdev/lib/dvbdev b/mdev/lib/dvbdev @@ -1,20 +1,22 @@ #!/bin/busybox ash -# MDEV=dvb0.demux1 -> ADAPTER=dvb0 -> N=0 -ADAPTER=${MDEV%.*} -N=${ADAPTER#dvb} -# MDEV=dvb0.demux1 -> DEVB_DEV=demux1 -DVB_DEV=${MDEV#*.} +[ -n "$MDEV" ] || exit 0 +[ -n "$DEVNAME" ] || exit 0 +[ "$SUBSYSTEM" = "dvb" ] || exit 0 + +MDEV=$(basename ${MDEV}) +DVBDEVPATH=$(dirname "${DEVNAME}") +DVBPATH=$(dirname "${DVBDEVPATH}") case "$ACTION" in add|"") - mkdir -p dvb/adapter${N} - mv ${MDEV} dvb/adapter${N}/${DVB_DEV} + mkdir -p ${DVBDEVPATH} + mv ${MDEV} ${DVBDEVPATH} ;; remove) - rm -f dvb/adapter${N}/${DVB_DEV} - rmdir dvb/adapter${N} 2>/dev/null - rmdir dvb/ 2>/dev/null + rm -f ${DEVNAME} + rmdir ${DVBDEVPATH} 2>/dev/null + rmdir ${DVBPATH} 2>/dev/null esac exit 0