LinuxMCE Forums
May 25, 2013, 07:01:25 pm GMT-1 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Rule #1 - Be Patient - Rule #2 - Don't ask when, if you don't contribute - Rule #3 - You have coding skills - LinuxMCE's small brother is available: http://www.agocontrol.com
 
   Home   Help Search Chat Login Register  
Pages: [1]
  Print  
Author Topic: How to get the DVB devices keep the same numbers ? UDEV?  (Read 567 times)
Viking
Addicted
*
Posts: 521


View Profile
« 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 Sad
Current I have found a script that I am using , but it should somehow be possible using UDEV to get them "sticky" Wink

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:
#!/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
Logged

pw44
Addicted
*
Posts: 651


View Profile
« Reply #1 on: November 19, 2009, 07:40:55 pm »

take a look at:
http://tnlessone.wordpress.com/2007/01/27/how-to-get-symlinks-to-point-tv-and-webcam-through/
and
http://www.linuxfromscratch.org/lfs/view/6.3/chapter07/symlinks.html
Logged
Viking
Addicted
*
Posts: 521


View Profile
« Reply #2 on: November 22, 2009, 08:06:59 pm »

Thanks, I will have a look at it Smiley
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!