Author Topic: How to get the DVB devices keep the same numbers ? UDEV?  (Read 2622 times)

Viking

  • Addicted
  • *
  • Posts: 521
    • View Profile
How to get the DVB devices keep the same numbers ? UDEV?
« on: November 19, 2009, 12:27:54 pm »
Hi,

I have not seen or found anything for getting the DVB devices below /dev/dvb to keep the same numbers after reboot.

I have got 4 different cards/USB devices and they keep changing numbers :(
Current I have found a script that I am using , but it should somehow be possible using UDEV to get them "sticky" ;)

Anyone having better knowledge than I about UDEV ?


Here is the script that I am using, after that I configure MythTV to use adaptor6 to 9.

/usr/pluto/bin/create_dvb_links.sh
Code: [Select]
#!/bin/bash

# Install dvb-utils :
# apt-get install dvb-utils
# And copy to /usr/pluto/bin
# And add /usr/pluto/bin/create_dvb_links.sh to /etc/init.d/mythtv-backend

#
# This script will make links in /dev/dvb/adaptorN such that
# /dev/dvb/adaptor6 == Opera DVB-S
# /dev/dvb/adaptor7 == KNC ONE DVB-C
# /dev/dvb/adaptor8 == TT S2-3200
# /dev/dvb/adaptor9 == TT AV7110 1 DVB-S

AV7110_1_MAC="00:d0:5c:00:c6:d2"
TT3200_MAC="00:d0:5c:64:a3:48"
KNCONE_DVB_C_MAC="00:09:d6:6d:6d:fe"
OPERA_USB_MAC="00:e0:4f:00:11:d5"

# remove old links
i=0
while [ $i -le 9 ]; do
    dev="/dev/dvb/adapter"$i
    if [ -L $dev ] ; then
        rm -f $dev
    fi
    let i=i+1
done


# sort out cards

i=0
while [ $i -le 5 ]; do
    dev="/dev/dvb/adapter"$i
    if [ -d $dev ] ; then
        dvbnet -a $i -p 1 > /dev/null 2>&1
        if `ifconfig -a | grep dvb | grep -q $OPERA_USB_MAC` ; then
            ln -s $dev /dev/dvb/adapter6
        fi
        if `ifconfig -a | grep dvb | grep -q $KNCONE_DVB_C_MAC` ; then
            ln -s $dev /dev/dvb/adapter7
        fi
        if `ifconfig -a | grep dvb | grep -q $TT3200_MAC` ; then
            ln -s $dev /dev/dvb/adapter8
        fi
        if `ifconfig -a | grep dvb | grep -q $AV7110_1_MAC` ; then
            ln -s $dev /dev/dvb/adapter9
        fi
        dvbnet -a $i -d 0 > /dev/null 2>&1
    fi
    let i=i+1
done

Greetings
Viking


Viking

  • Addicted
  • *
  • Posts: 521
    • View Profile
Re: How to get the DVB devices keep the same numbers ? UDEV?
« Reply #2 on: November 22, 2009, 08:06:59 pm »
Thanks, I will have a look at it :)