LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 09-24-2012, 03:59 PM   #1
alikasundara
LQ Newbie
 
Registered: Sep 2012
Location: London
Distribution: Gentoo amd64
Posts: 13

Rep: Reputation: 2
Question How to disable unused device without blacklisting a module


Hello,

Does anyone know a general way of disabling a device without blacklisting a module/driver? The reason I am asking this is that I have two webcams (one built-in, one external) and I want to permanently disable the built-in one. Blacklisting a module is not an option cause both webcams use the same driver (uvcvideo, if that makes a difference)...
I was trying to find a way to do that using udev rule(s) but no luck so far.

Crossposted a week ago on askubuntu: http://askubuntu.com/questions/18970...n-external-one

Thanks,
Alikasundara
 
Old 09-24-2012, 04:10 PM   #2
camorri
Senior Member
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1
Posts: 4,851

Rep: Reputation: 432Reputation: 432Reputation: 432Reputation: 432Reputation: 432
Have you looked in the BIOS to see if you can disable it there? If you can, then the OS won't see the device at all.
 
Old 09-24-2012, 04:12 PM   #3
alikasundara
LQ Newbie
 
Registered: Sep 2012
Location: London
Distribution: Gentoo amd64
Posts: 13

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by camorri View Post
Have you looked in the BIOS to see if you can disable it there? If you can, then the OS won't see the device at all.
Yes, that was the first thing I tried (no luck). Sorry for not mentioning it in the original post.

Thanks,
Alikasundara
 
Old 09-24-2012, 04:19 PM   #4
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 10.04/12.04, Scientific Linux 6.3, Android-x86, Maemo
Posts: 1,658

Rep: Reputation: 138Reputation: 138
This blogger wrote a udev rule to switch which one was primary...

http://windywindycitytech.wordpress....-linux-ubuntu/

You could do something similar, just not enable the one at all...

However, what about the BIOS? Many built in cameras can be disabled in the BIOS settings...
 
Old 09-24-2012, 04:30 PM   #5
alikasundara
LQ Newbie
 
Registered: Sep 2012
Location: London
Distribution: Gentoo amd64
Posts: 13

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by JaseP View Post
This blogger wrote a udev rule to switch which one was primary...

http://windywindycitytech.wordpress....-linux-ubuntu/

You could do something similar, just not enable the one at all...
Thanks for your reply, but I am looking to disable the device completely for paranoia reasons ;-)

Quote:
However, what about the BIOS? Many built in cameras can be disabled in the BIOS settings...
I have checked that already. Unfortunately my BIOS seems to be very limited and does not support disabling the webcam...

Thanks,
Alikasundara
 
Old 09-24-2012, 04:38 PM   #6
camorri
Senior Member
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1
Posts: 4,851

Rep: Reputation: 432Reputation: 432Reputation: 432Reputation: 432Reputation: 432
You might look into unplugging the web cam. Most manufacturers have doc on how to remove and replace parts. If you are handy, and have some physical kill, you may be able to simply unplug the device.
 
Old 09-24-2012, 05:04 PM   #7
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 10.04/12.04, Scientific Linux 6.3, Android-x86, Maemo
Posts: 1,658

Rep: Reputation: 138Reputation: 138
Quote:
Originally Posted by alikasundara View Post
Thanks for your reply, but I am looking to disable the device completely for paranoia reasons ;-)
If in the udev rules,... you "send it to never-never land," by not defining a valid rule that will allow its use, it will be functionally disabled. That means modifying the blogger's udev rules to define the built-in camera such that it will not get picked up by uvcvideo.

If a device is not properly defined by the system's udev rules,... and cannot be found, it doesn't exist as far as the system is concerned. Unuseable. It's just an unknown device...

Only someone with root access would be able to fix it...

Short of physically removing it, only cutting power to it will "completely" disable it,... and that's a (missing) BIOS function.
 
Old 09-24-2012, 05:25 PM   #8
alikasundara
LQ Newbie
 
Registered: Sep 2012
Location: London
Distribution: Gentoo amd64
Posts: 13

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by JaseP View Post
If in the udev rules,... you "send it to never-never land," by not defining a valid rule that will allow its use, it will be functionally disabled. That means modifying the blogger's udev rules to define the built-in camera such that it will not get picked up by uvcvideo.
Sounds promising... This rule matches the device:

Code:
SUBSYSTEM=="usb", ATTRS{idVendor}=="5986", ATTRS{idProduct}=="0361"
Any idea how to make it "invalid" enough?

Thank you!
 
Old 09-24-2012, 05:28 PM   #9
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 10.04/12.04, Scientific Linux 6.3, Android-x86, Maemo
Posts: 1,658

Rep: Reputation: 138Reputation: 138
Start by commenting it out... the # in the beginning of it's line...
 
Old 09-24-2012, 05:32 PM   #10
alikasundara
LQ Newbie
 
Registered: Sep 2012
Location: London
Distribution: Gentoo amd64
Posts: 13

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by JaseP View Post
Start by commenting it out... the # in the beginning of it's line...
The webcam was enabled without any udev configuration, so commenting out the rule I have just created will not help...
 
Old 09-24-2012, 05:53 PM   #11
alikasundara
LQ Newbie
 
Registered: Sep 2012
Location: London
Distribution: Gentoo amd64
Posts: 13

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by camorri View Post
You might look into unplugging the web cam. Most manufacturers have doc on how to remove and replace parts. If you are handy, and have some physical kill, you may be able to simply unplug the device.
I will do that as a last resort ;-)
It just seems unbelivable to me that there is no easy way to disable a particular device on OS level.
 
Old 09-24-2012, 06:24 PM   #12
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 10.04/12.04, Scientific Linux 6.3, Android-x86, Maemo
Posts: 1,658

Rep: Reputation: 138Reputation: 138
Are you sure that there is no udev rule regarding this camera? Did you check within the /etc/udev/rules.d/ directory? They might just ID the camera by vendor...

I'm not sure how uvcvideo works, but I would assume that udev has to ID the device first, before it just starts using it... uvcvideo is part of the v4l2 subsystem, ... and one would assume that this device is getting assigned to something like /dev/video0 or something ...
 
Old 09-25-2012, 02:50 AM   #13
alikasundara
LQ Newbie
 
Registered: Sep 2012
Location: London
Distribution: Gentoo amd64
Posts: 13

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by JaseP View Post
Are you sure that there is no udev rule regarding this camera? Did you check within the /etc/udev/rules.d/ directory? They might just ID the camera by vendor...
Positive. The only udev rules I have cover persistent net device naming.

Quote:
I'm not sure how uvcvideo works, but I would assume that udev has to ID the device first, before it just starts using it... uvcvideo is part of the v4l2 subsystem, ... and one would assume that this device is getting assigned to something like /dev/video0 or something ...
It is assigned to /dev/video0 without any rules at all. I am guessing that's because video0 is the default name for this device. Udev man page states that "If no matching rule is found, the default kernel device name is used". I think that's exactly the case here, cause with udev stopped the /dev/video0 node is not created (it's actually removed whenever I stop udev).

Thanks,
Alikasundara
 
Old 09-25-2012, 10:25 AM   #14
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 10.04/12.04, Scientific Linux 6.3, Android-x86, Maemo
Posts: 1,658

Rep: Reputation: 138Reputation: 138
That just doesn't sound right...

What about in...
/usr/lib/udev/rules.d
???

My understanding was that udevadm handled all the /dev namings... ?!?!
But then again, I don't know whether the udev developers even fully understand udev...
 
Old 09-25-2012, 10:41 AM   #15
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 10.04/12.04, Scientific Linux 6.3, Android-x86, Maemo
Posts: 1,658

Rep: Reputation: 138Reputation: 138
Alright,... Following up my own post...

See here,...

http://content.hccfl.edu/pollock/AUnix1/udev-info.htm

Third paragraph,... I suppose it is possible for the driver to produce its own dev namings...

So, there's either a rule in one of the rules.d directories, or there's a listing in the driver's data file for the major and minor device node numbers, or the UVC driver is doing it directly. If it's the two former scenarios, you need to edit those files. If it's the latter, you either patch UVC to NOT pick up that device, or you're S-O-L, unfortunately.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
blacklisting a driver (module) cccc Debian 3 05-12-2011 09:29 AM
ubuntu karmic module blacklisting okar Linux - Kernel 1 11-02-2009 05:51 PM
Blacklisting a module for specific hardware krisrao Linux - Hardware 2 12-04-2007 07:08 AM
Blacklisting a device or module. rbh123 Linux - Newbie 5 09-13-2006 08:22 AM
How to disable unused hardware ?? kevkim55 Linux - Hardware 2 01-01-2006 11:08 PM


All times are GMT -5. The time now is 04:40 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration