View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 1 post ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sat Mar 03, 2007 9:15 pm 
Offline
Joined: Mon Feb 06, 2006 5:11 pm
Posts: 353
Location: Brisbane, Australia
Hi,

I recently added a dual tuner to my HTPC now totalling 5. I discovered that i could not add any extra /dev/dvb/adapter branches with mknod, the minor number appeared to be limited to 8 bits (0 - 255 range) and would wrap causing the major number to increment. I fixed this problem by updateing my coreutils package (there were some dependencey issues, but i just ignored these), this updated mknod which allows for 24bit minor number (i think).


Code:
#!/bin/bash

function create_adapter() {
        local nr="$1" major="$2" minor="$3"

        mkdir /dev/dvb/adapter${nr}
        mknod /dev/dvb/adapter${nr}/video0      c $major $(( $minor ))
        mknod /dev/dvb/adapter${nr}/audio0      c $major $(( $minor +1 ))
        mknod /dev/dvb/adapter${nr}/frontend0 c $major $(( $minor +3 ))
        mknod /dev/dvb/adapter${nr}/demux0      c $major $(( $minor +4 ))
        mknod /dev/dvb/adapter${nr}/dvr0        c $major $(( $minor +5 ))
        mknod /dev/dvb/adapter${nr}/ca0 c $major $(( $minor +6 ))
        mknod /dev/dvb/adapter${nr}/net0        c $major $(( $minor +7 ))
        mknod /dev/dvb/adapter${nr}/osd0        c $major $(( $minor +8 ))
}

major=$(awk '/DVB/ { print $1 }' /proc/devices)
if test "$major" = ""; then
        echo "can't figure dvb major number, dvb modules not loaded yet?"
        exit 1
fi

echo "creating dvb device nodes for major $major"
rm -rf /dev/dvb/adapter*
create_adapter 0 $major 0
create_adapter 1 $major 64
create_adapter 2 $major 128
create_adapter 3 $major 192
create_adapter 4 $major 256
create_adapter 5 $major 320
create_adapter 6 $major 384
create_adapter 7 $major 448
chmod 755 /dev/dvb/adapter*
chmod 660 /dev/dvb/adapter*/*
chown root:video /dev/dvb/adapter*/*



BigB


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu