[pvrusb2] driver status / update

Mike Isely isely at isely.net
Sat Jan 17 11:40:54 CST 2009


On Sat, 17 Jan 2009, fivenote wrote:

> Everything is working!
> 
> My final problem was with mythtv-setup. When I ran it from the desktop
> shortcut it created it runs gksudo and I enter my password to have it
> run as root. But for some reason it won't open the analog side of the
> card for me to configure it for mythtv.
> 
> If I open a terminal and 'sudo su' then 'mythtv-setup', it can open
> and configure the card. Go figure.
> 

> I noticed something similar when I was using the sysfs interface to
> test pvrusb2. If I 'sudo echo television > cur_val' I get permission
> denied. If I 'sudo su' first, I can then write values.

This gotcha has been noticed before on this list.  It's a subtle detail 
of shell file redirection.  The "> cur_val" part is being interpreted 
not by the sudo'ed part but by your outer shell which of course is not 
running as root.  By doing "sudo su" first (or really, "sudo -s" is more 
efficient) you're creating a new interactive shell - and in that case 
everything you type on the following command lines go to that new shell.  
But when you do:

  sudo echo television > cur_val

What happens in that case is that the part passed to the sudo is just 
this:

  sudo echo television > cur_val
  ^^^^^^^^^^^^^^^^^^^^

And that's because your current interactive shell is seeing the ">" and 
keeping it for itself.  So this part:

  sudo echo television > cur_val
                       ^^^^^^^^^

gets acted upon like a normal user and of course that's not what you 
want and it isn't going to work.  Alternatively you could have done this 
instead:

  sudo "echo television > cur_val"

The quotes force the entire string to be one argument value which is 
passed unmolested to the sudo'd root shell which will then act on the 
file redirection itself.


> 
> Thanks to Mike and Hans and the other v4l-dvb developers for working
> through this. You are a very responsive and helpful developer group.

Glad you're having a good day.


I've had a lousy week.  I've got a mythtv backend here with Seagate 1TB 
drives w/ flakey firmware that are failing, I had to deal with a flat 
tire and jammed lugnuts last Thursday, and about an hour ago I learned 
from the plumber that what should have been a simple clogged kitchen 
drain here is going to require tearing out a length of pipe (apparently 
the problem has been building for a while).  Unfortunately that length 
of pipe is in the ceiling in my *finished* office area, which is where 
the isely.net server is, along with 10 years of other crap built up, all 
of which must now be moved before Monday else it gets accidentally 
splattered with stinky crap from a drain pipe.  So much for my weekend.

Suffice to say that www.isely.net will goes off the air some time today 
or tomorrow.  I'm just going to move it and its connections to another 
room, so the outage should not be more than an hour or two.

The above is actually on-topic (sort of) - because it's all going to 
further delay the other pvrusb2 driver changes I had planned.  Sorry 
about that.

  -Mike

-- 

Mike Isely
isely @ pobox (dot) com
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8


More information about the pvrusb2 mailing list