From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Breitegger Date: Sun, 04 Nov 2007 09:17:01 +0000 Subject: dvb and udev and mythtv Message-Id: <472D8E0D.80109@tuxstef.org> MIME-Version: 1 Content-Type: multipart/mixed; boundary="------------060709010100080105000802" List-Id: To: linux-hotplug@vger.kernel.org This is a multi-part message in MIME format. --------------060709010100080105000802 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Hi. I've seen some post about the random load order of udev and dvb drivers. I'm using mythtv on debian. Has anybody some working udev rules for me? I've tried to blacklist the modules and then load them with /etc/modules but if they are blacklisted, they aren't loaded if they're in /etc/modules. For some quick hacking I've written a script: /usr/local/bin/mythcard.pl This one is looking into dmesg and sets the capturecard table and sascg-ng correct. Once again: It's a dirty hack. #!/usr/bin/perl -w use DBI; my $database = "mythconverg"; my $hostname = "gw"; my $dsn = "DBI:mysql:database=$database;host=$hostname"; my $user = "mythtv"; my $pass = "mythtv"; my $config_file="/usr/local/bin/runsasc"; my $cardlist=`(/bin/dmesg | /bin/grep frontend)`; my $cardlist_video=`(/bin/dmesg | /bin/grep video)`; open(CFG, "<$config_file") || die "file not found"; my @cfg_rows = ; close(CFG); sub write_file { my $cards = shift; my @new_rows; foreach(@cfg_rows) { $_ =~ s/OPTIONS="-j [0-9]:[0-9] --cam-dir "/OPTIONS="-j $cards --cam-dir "/g; push(@new_rows,$_); } open(CFG, ">$config_file") || die "file not found"; print CFG @new_rows; close(CFG); } my $dbh = DBI::->connect( $dsn, $user, $pass, { 'RaiseError' => 1, 'AutoCommit' => 1 } ) or die DBI::errstr; my $sql = qq/ UPDATE capturecard SET videodevice = ? WHERE cardid = ? /; if (index($cardlist,"frontend 0 (DiBcom 3000MC/P)") > 0) { $cardid=1; $videodevice=0; my $sth=$dbh->prepare($sql); my $out=$sth->execute($videodevice,$cardid); } if (index($cardlist,"frontend 0 (Conexant CX24123/CX24109)") > 0) { $cardid=2; $videodevice=3; my $sth=$dbh->prepare($sql); my $out=$sth->execute($videodevice,$cardid); write_file("0:3"); } if (index($cardlist,"frontend 1 (Conexant CX24123/CX24109)") > 0) { $cardid=2; $videodevice=3; my $sth=$dbh->prepare($sql); my $out=$sth->execute($videodevice,$cardid); write_file("1:3"); } if (index($cardlist,"frontend 1 (DiBcom 3000MC/P)") > 0) { $cardid=1; $videodevice=1; my $sth=$dbh->prepare($sql); my $out=$sth->execute($videodevice,$cardid); } if (index($cardlist,"frontend 2 (Conexant CX24123/CX24109)") > 0) { $cardid=2; $videodevice=3; my $sth=$dbh->prepare($sql); my $out=$sth->execute($videodevice,$cardid); write_file("2:3"); } if (index($cardlist,"frontend 2 (DiBcom 3000MC/P)") > 0) { $cardid=3; $videodevice=2; my $sth=$dbh->prepare($sql); my $out=$sth->execute($videodevice,$cardid); } if (index($cardlist_video,"ivtv0: Registered device video0 for encoder MPG (4096 kB)") > 0) { $cardid=4; $videodevice="/dev/video0"; my $sth=$dbh->prepare($sql); my $out=$sth->execute($videodevice,$cardid); } if (index($cardlist_video,"ivtv0: Registered device video1 for encoder MPG (4096 kB)") > 0) { $cardid=4; $videodevice="/dev/video1"; my $sth=$dbh->prepare($sql); my $out=$sth->execute($videodevice,$cardid); } $dbh->disconnect; --------------060709010100080105000802 Content-Type: text/x-vcard; charset=utf-8; name="tuxstef.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="tuxstef.vcf" begin:vcard fn:Stefan Breitegger n:Breitegger;Stefan email;internet:tuxstef@tuxstef.org tel;home:0676 315 39 44 version:2.1 end:vcard --------------060709010100080105000802 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ --------------060709010100080105000802 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel --------------060709010100080105000802--