* Re: UDEV : ASUS Laptop G73S MultiCard Reader
From: Greg KH @ 2011-07-17 18:53 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <4E217D77.7030503@gatworks.com>
On Sun, Jul 17, 2011 at 11:50:31AM -0400, Postmaster wrote:
>
> >That is because this is a different device, and it says it is a
> >vendor-specific protocol, which will not work with the usb-storage
> >driver, sorry.
>
> I Disagree with most of what u suggest.
I'm sorry to hear that.
> Who knows what vendor specific means. And you really wont know until
> you try. Which is why there are tables to handle Unusual Devices.
If a vendor says it is not a mass-storage device, why do you think they
are lying? And the term, "vendor specific" has a very specific
definition, see the USB specification if you are curious as to what it
is.
> At this time there is a realtek driver in the latest kern code. I
> would like to load up this driver when usb-core detects this device.
>
> Right now, I have not found the udev rule for loading up usb-storage.
There is no such rule, the usb device id causes it to happen through
modprobe of the module alias of the device.
> So where are the udev system specs
This is not something that udev does at all, sorry.
> BTW: is there a way to disable, and enable the device? Since this
> usb device is internal, if I have too many "printk" or DBG messages
> at boot-up time, it tends to overflow the rsyslogd daemon.
>
> btw#2 where is this forum? All one sees in the written docs is to
> email questions, rather than post questions to a forum.
Yes, this is done through email, not a web forum.
greg k-h
^ permalink raw reply
* udev: disable mtd_probe?
From: Allin Cottrell @ 2011-07-18 20:45 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: TEXT/PLAIN, Size: 474 bytes --]
Since the new mechanism for enabling/disabling selected
components of the udev "extras" was introduced it hasn't been
possible to disable mtd_probe, so far as I can see.
Could we please have that option, unless there are compelling
reasons to the contrary? The MTD stuff drags in a bunch of
dependencies.
I'm attaching a little patch to configure.ac and Makefile.am
in udev-172 that does the job.
--
Allin Cottrell
Department of Economics
Wake Forest University, NC
[-- Attachment #2: Type: TEXT/PLAIN, Size: 2878 bytes --]
diff -ur udev-172.orig/configure.ac udev-172/configure.ac
--- udev-172.orig/configure.ac 2011-07-10 19:42:53.958052609 -0400
+++ udev-172/configure.ac 2011-07-18 09:22:25.834001037 -0400
@@ -87,6 +87,14 @@
AM_CONDITIONAL([ENABLE_RULE_GENERATOR], [test "x$enable_rule_generator" = xyes])
# ------------------------------------------------------------------------------
+# mtd_probe - autoloads FTL module for mtd devices
+# ------------------------------------------------------------------------------
+AC_ARG_ENABLE([mtd_probe],
+ AS_HELP_STRING([--disable-mtd_probe], [disable MTD support]),
+ [], [enable_mtd_probe=yes])
+AM_CONDITIONAL([ENABLE_MTD_PROBE], [test "x$enable_mtd_probe" = xyes])
+
+# ------------------------------------------------------------------------------
# usb/pci-db - read vendor/device string database
# ------------------------------------------------------------------------------
AC_ARG_ENABLE([hwdb],
diff -ur udev-172.orig/Makefile.am udev-172/Makefile.am
--- udev-172.orig/Makefile.am 2011-07-10 19:09:01.791662889 -0400
+++ udev-172/Makefile.am 2011-07-18 09:22:45.453001047 -0400
@@ -294,17 +294,6 @@
dist_udevrules_DATA += extras/v4l_id/60-persistent-v4l.rules
# ------------------------------------------------------------------------------
-# mtd_probe - autoloads FTL module for mtd devices
-# ------------------------------------------------------------------------------
-extras_mtd_probe_mtd_probe_SOURCES = \
- extras/mtd_probe/mtd_probe.c \
- extras/mtd_probe/mtd_probe.h \
- extras/mtd_probe/probe_smartmedia.c
-extras_mtd_probe_mtd_probe_CPPFLAGS = $(AM_CPPFLAGS)
-dist_udevrules_DATA += extras/mtd_probe/75-probe_mtd.rules
-libexec_PROGRAMS += extras/mtd_probe/mtd_probe
-
-# ------------------------------------------------------------------------------
# accelerometer - updates device orientation
# ------------------------------------------------------------------------------
extras_accelerometer_accelerometer_SOURCES = extras/accelerometer/accelerometer.c
@@ -333,6 +322,20 @@
extras/rule_generator/75-persistent-net-generator.rules
endif
+if ENABLE_MTD_PROBE
+# ------------------------------------------------------------------------------
+# mtd_probe - autoloads FTL module for mtd devices
+# ------------------------------------------------------------------------------
+extras_mtd_probe_mtd_probe_SOURCES = \
+ extras/mtd_probe/mtd_probe.c \
+ extras/mtd_probe/mtd_probe.h \
+ extras/mtd_probe/probe_smartmedia.c
+extras_mtd_probe_mtd_probe_CPPFLAGS = $(AM_CPPFLAGS)
+dist_udevrules_DATA += extras/mtd_probe/75-probe_mtd.rules
+libexec_PROGRAMS += extras/mtd_probe/mtd_probe
+
+endif
+
if ENABLE_HWDB
# ------------------------------------------------------------------------------
# usb/pci-db - read vendor/device string database
^ permalink raw reply
* Re: udev: disable mtd_probe?
From: Kay Sievers @ 2011-07-18 21:10 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <alpine.LNX.2.00.1107181640050.10649@waverley.Belkin>
On Mon, Jul 18, 2011 at 22:45, Allin Cottrell <cottrell@wfu.edu> wrote:
> Since the new mechanism for enabling/disabling selected components of the
> udev "extras" was introduced it hasn't been possible to disable mtd_probe,
> so far as I can see.
>
> Could we please have that option, unless there are compelling reasons to the
> contrary? The MTD stuff drags in a bunch of
> dependencies.
No problem with the patch or the option, but: Dependencies? A bunch? I
don't see any. Not even the rules are doing anything, if no mtd
devices are present.
Kay
^ permalink raw reply
* Re: udev: disable mtd_probe?
From: Gabor Z. Papp @ 2011-07-18 21:17 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <alpine.LNX.2.00.1107181640050.10649@waverley.Belkin>
* Kay Sievers <kay.sievers@vrfy.org>:
| > Could we please have that option, unless there are compelling reasons to the
| > contrary? The MTD stuff drags in a bunch of
| > dependencies.
| No problem with the patch or the option, but: Dependencies? A bunch? I
| don't see any. Not even the rules are doing anything, if no mtd
| devices are present.
CC extras/mtd_probe/extras_mtd_probe_mtd_probe-mtd_probe.o
In file included from extras/mtd_probe/mtd_probe.c:19: extras/mtd_probe/mtd_probe.h:20:26: error: mtd/mtd-user.h: No such file or directory
$ uname -a
Linux gzp1 2.6.32.42 #1 SMP PREEMPT Mon Jun 27 09:36:50 CEST 2011 i686 GNU/Linux
and:
extras/input_id/input_id.c: In function 'test_key':
extras/input_id/input_id.c:173: error: 'BTN_TRIGGER_HAPPY' undeclared (first use in this function)
^ permalink raw reply
* Re: udev: disable mtd_probe?
From: Kay Sievers @ 2011-07-18 21:19 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <alpine.LNX.2.00.1107181640050.10649@waverley.Belkin>
On Mon, Jul 18, 2011 at 23:17, Gabor Z. Papp <gzp@papp.hu> wrote:
> * Kay Sievers <kay.sievers@vrfy.org>:
>
> | > Could we please have that option, unless there are compelling reasons to the
> | > contrary? The MTD stuff drags in a bunch of
> | > dependencies.
>
> | No problem with the patch or the option, but: Dependencies? A bunch? I
> | don't see any. Not even the rules are doing anything, if no mtd
> | devices are present.
>
> CC extras/mtd_probe/extras_mtd_probe_mtd_probe-mtd_probe.o
> In file included from extras/mtd_probe/mtd_probe.c:19: extras/mtd_probe/mtd_probe.h:20:26: error: mtd/mtd-user.h: No such file or directory
>
> $ uname -a
> Linux gzp1 2.6.32.42 #1 SMP PREEMPT Mon Jun 27 09:36:50 CEST 2011 i686 GNU/Linux
>
> and:
>
> extras/input_id/input_id.c: In function 'test_key':
> extras/input_id/input_id.c:173: error: 'BTN_TRIGGER_HAPPY' undeclared (first use in this function)
You just need recent kernel headers to compile udev.
Kay
^ permalink raw reply
* Re: udev: disable mtd_probe?
From: Gabor Z. Papp @ 2011-07-18 21:22 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <alpine.LNX.2.00.1107181640050.10649@waverley.Belkin>
* Kay Sievers <kay.sievers@vrfy.org>:
| > Linux gzp1 2.6.32.42 #1 SMP PREEMPT Mon Jun 27 09:36:50 CEST 2011 i686 GNU/Linux
| >
| > and:
| >
| > extras/input_id/input_id.c: In function 'test_key':
| > extras/input_id/input_id.c:173: error: 'BTN_TRIGGER_HAPPY' undeclared (first use in this function)
| You just need recent kernel headers to compile udev.
Requirements:
- Version 2.6.32 of the Linux kernel with sysfs, procfs, signalfd, inotify, unix domain sockets, networking and hotplug enabled
^ permalink raw reply
* Re: udev: disable mtd_probe?
From: Allin Cottrell @ 2011-07-18 21:37 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <alpine.LNX.2.00.1107181640050.10649@waverley.Belkin>
On Mon, 18 Jul 2011, Kay Sievers wrote:
> On Mon, Jul 18, 2011 at 22:45, Allin Cottrell <cottrell@wfu.edu> wrote:
>> Since the new mechanism for enabling/disabling selected components of the
>> udev "extras" was introduced it hasn't been possible to disable mtd_probe,
>> so far as I can see.
>>
>> Could we please have that option, unless there are compelling reasons to the
>> contrary? The MTD stuff drags in a bunch of
>> dependencies.
>
> No problem with the patch or the option [...]
Good, thanks.
> but: Dependencies? A bunch? I don't see any. Not even the rules
> are doing anything, if no mtd devices are present.
Maybe I'm misunderstanding something, but I thought I had to install
the mtd-utils and/or configure MTD support into the kernel.
Certainly, the mtd_probe build bombs out on my system with mtd.h not
found. And if the mtd-utils are needed, they drag in attr and
libacl.
--
Allin Cottrell
Department of Economics
Wake Forest University
^ permalink raw reply
* Re: udev: disable mtd_probe?
From: Kay Sievers @ 2011-07-18 21:40 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <alpine.LNX.2.00.1107181640050.10649@waverley.Belkin>
On Mon, Jul 18, 2011 at 23:37, Allin Cottrell <cottrell@wfu.edu> wrote:
> On Mon, 18 Jul 2011, Kay Sievers wrote:
>> but: Dependencies? A bunch? I don't see any. Not even the rules are doing
>> anything, if no mtd devices are present.
>
> Maybe I'm misunderstanding something, but I thought I had to install the
> mtd-utils and/or configure MTD support into the kernel. Certainly, the
> mtd_probe build bombs out on my system with mtd.h not found. And if the
> mtd-utils are needed, they drag in attr and libacl.
No, nothing like this is needed, it only runs a tiny program that
reads a device and loads a kernel module. No dependencies are needed
for that.
You can see in the section you made conditional, it does not get rid
of anything.
Kay
^ permalink raw reply
* Re: udev: disable mtd_probe?
From: Kay Sievers @ 2011-07-18 21:44 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <alpine.LNX.2.00.1107181640050.10649@waverley.Belkin>
On Mon, Jul 18, 2011 at 23:40, Kay Sievers <kay.sievers@vrfy.org> wrote:
> On Mon, Jul 18, 2011 at 23:37, Allin Cottrell <cottrell@wfu.edu> wrote:
>> On Mon, 18 Jul 2011, Kay Sievers wrote:
>>> but: Dependencies? A bunch? I don't see any. Not even the rules are doing
>>> anything, if no mtd devices are present.
>>
>> Maybe I'm misunderstanding something, but I thought I had to install the
>> mtd-utils and/or configure MTD support into the kernel. Certainly, the
>> mtd_probe build bombs out on my system with mtd.h
mtd.h? It includes: mtd/mtd-user.h, which is there since 2.6.17. You
need proper or more recent kernel headers, I guess, it's not any
external dependency.
Kay
^ permalink raw reply
* Re: udev: disable mtd_probe?
From: Kay Sievers @ 2011-07-18 21:49 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <alpine.LNX.2.00.1107181640050.10649@waverley.Belkin>
On Mon, Jul 18, 2011 at 23:22, Gabor Z. Papp <gzp@papp.hu> wrote:
> * Kay Sievers <kay.sievers@vrfy.org>:
>
> | > Linux gzp1 2.6.32.42 #1 SMP PREEMPT Mon Jun 27 09:36:50 CEST 2011 i686 GNU/Linux
> | >
> | > and:
> | >
> | > extras/input_id/input_id.c: In function 'test_key':
> | > extras/input_id/input_id.c:173: error: 'BTN_TRIGGER_HAPPY' undeclared (first use in this function)
>
> | You just need recent kernel headers to compile udev.
>
> Requirements:
> Â - Version 2.6.32 of the Linux kernel with sysfs, procfs, signalfd, inotify, unix domain sockets, networking and hotplug enabled
>
That's the runtime dependency. The build dependency might be more
recent. We usually don't really check what's needed, as long as it is
on the last released and current distro nobody really knows when it
was introduced. In this case. seems, it's at least 2.6.34.
It's generally not a good idea to build new low-level tools against
outdated kernels or run new low-level tools against them. Things can
easily go wrong. We usually only test the other way around: new
kernels on old userspace. That should work fine for quite a while.
Kay
^ permalink raw reply
* Re: udev: disable mtd_probe?
From: Allin Cottrell @ 2011-07-19 16:06 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <alpine.LNX.2.00.1107181640050.10649@waverley.Belkin>
On Mon, 18 Jul 2011, Kay Sievers wrote:
> On Mon, Jul 18, 2011 at 23:40, Kay Sievers <kay.sievers@vrfy.org> wrote:
>> On Mon, Jul 18, 2011 at 23:37, Allin Cottrell <cottrell@wfu.edu> wrote:
>>> On Mon, 18 Jul 2011, Kay Sievers wrote:
>>>> but: Dependencies? A bunch? I don't see any. Not even the rules are doing
>>>> anything, if no mtd devices are present.
>>>
>>> Maybe I'm misunderstanding something, but I thought I had to install the
>>> mtd-utils and/or configure MTD support into the kernel. Certainly, the
>>> mtd_probe build bombs out on my system with mtd.h
>
> mtd.h? It includes: mtd/mtd-user.h, which is there since 2.6.17. You
> need proper or more recent kernel headers, I guess, it's not any
> external dependency.
OK, my bad. I'm using kernel 2.6.39.3 but I hadn't copied or
linked the mtd subdir of the kernel headers to /usr/include.
Allin Cottrell
^ permalink raw reply
* Re: udev: disable mtd_probe?
From: Kay Sievers @ 2011-07-19 20:06 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <alpine.LNX.2.00.1107181640050.10649@waverley.Belkin>
On Tue, Jul 19, 2011 at 18:06, Allin Cottrell <cottrell@wfu.edu> wrote:
> On Mon, 18 Jul 2011, Kay Sievers wrote:
>> mtd.h? It includes: mtd/mtd-user.h, which is there since 2.6.17. You
>> need proper or more recent kernel headers, I guess, it's not any
>> external dependency.
>
> OK, my bad. I'm using kernel 2.6.39.3 but I hadn't copied or
> linked the mtd subdir of the kernel headers to /usr/include.
Applied the patch anyway.
Thanks,
Kay
^ permalink raw reply
* Re: [PATCH SCSI] sr: check_events() ignore GET_EVENT when TUR says
From: Tejun Heo @ 2011-07-20 16:33 UTC (permalink / raw)
To: James E.J. Bottomley; +Cc: linux-scsi, kay.sievers, maggu2810, linux-hotplug
In-Reply-To: <20110630130348.GQ3386@htj.dyndns.org>
On Thu, Jun 30, 2011 at 03:03:48PM +0200, Tejun Heo wrote:
> From: Kay Sievers <kay.sievers@vrfy.org>
>
> Some broken devices indicates that media has changed on every
> GET_EVENT_STATUS_NOTIFICATION. This translates into MEDIA_CHANGE
> uevent on every open() which lets udev run into a loop.
>
> Verify GET_EVENT result against TUR and if it generates spurious
> events for several times in a row, ignore the GET_EVENT events, and
> trust only the TUR status.
>
> This is the log of a USB stick with a (broken) fake CDROM drive:
>
> scsi 5:0:0:0: Direct-Access SanDisk U3 Cruzer Micro 8.02 PQ: 0 ANSI: 0 CCS
> sd 5:0:0:0: Attached scsi generic sg3 type 0
> scsi 5:0:0:1: CD-ROM SanDisk U3 Cruzer Micro 8.02 PQ: 0 ANSI: 0
> sd 5:0:0:0: [sdb] Attached SCSI removable disk
> sr2: scsi3-mmc drive: 48x/48x tray
> sr 5:0:0:1: Attached scsi CD-ROM sr2
> sr 5:0:0:1: Attached scsi generic sg4 type 5
> sr2: GET_EVENT and TUR disagree continuously, suppress GET_EVENT events
> sd 5:0:0:0: [sdb] 31777279 512-byte logical blocks: (16.2 GB/15.1 GiB)
> sd 5:0:0:0: [sdb] No Caching mode page present
> sd 5:0:0:0: [sdb] Assuming drive cache: write through
> sd 5:0:0:0: [sdb] No Caching mode page present
> sd 5:0:0:0: [sdb] Assuming drive cache: write through
> sdb: sdb1
>
> -tj: Updated to consider only spurious GET_EVENT events among
> different types of disagreement and allow using TUR for kernel
> event polling after GET_EVENT is ignored.
>
> Reported-By: Markus Rathgeb maggu2810@googlemail.com
> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Cc: stable@kernel.org # >= v2.6.38, fixes udev busy looping w/ certain devices
James, ping.
--
tejun
^ permalink raw reply
* Re: [PATCH SCSI] sr: check_events() ignore GET_EVENT when TUR says otherwise
From: Kay Sievers @ 2011-07-20 16:42 UTC (permalink / raw)
To: Tejun Heo; +Cc: James E.J. Bottomley, linux-scsi, maggu2810, linux-hotplug
In-Reply-To: <20110720163308.GC9924@mtj.dyndns.org>
On Wed, Jul 20, 2011 at 18:33, Tejun Heo <tj@kernel.org> wrote:
> On Thu, Jun 30, 2011 at 03:03:48PM +0200, Tejun Heo wrote:
>> From: Kay Sievers <kay.sievers@vrfy.org>
>>
>> Some broken devices indicates that media has changed on every
>> GET_EVENT_STATUS_NOTIFICATION. Â This translates into MEDIA_CHANGE
>> uevent on every open() which lets udev run into a loop.
>>
>> Verify GET_EVENT result against TUR and if it generates spurious
>> events for several times in a row, ignore the GET_EVENT events, and
>> trust only the TUR status.
> James, ping.
This is a rather urgent fix, that needs to go in, and also to -stable.
Systems run into endless loops with ever-growing event queues. Nothing
really works any more if we hit that condition, unless the (broken)
device is disconnected.
Thanks,
Kay
^ permalink raw reply
* Re: [PATCH SCSI] sr: check_events() ignore GET_EVENT when TUR says
From: James Bottomley @ 2011-07-20 16:45 UTC (permalink / raw)
To: Kay Sievers; +Cc: Tejun Heo, linux-scsi, maggu2810, linux-hotplug
In-Reply-To: <CAPXgP11R=386wbqpOpymzdXYYhpvJg9Aj1Xck3wi91smud-8iA@mail.gmail.com>
On Wed, 2011-07-20 at 18:42 +0200, Kay Sievers wrote:
> On Wed, Jul 20, 2011 at 18:33, Tejun Heo <tj@kernel.org> wrote:
> > On Thu, Jun 30, 2011 at 03:03:48PM +0200, Tejun Heo wrote:
> >> From: Kay Sievers <kay.sievers@vrfy.org>
> >>
> >> Some broken devices indicates that media has changed on every
> >> GET_EVENT_STATUS_NOTIFICATION. This translates into MEDIA_CHANGE
> >> uevent on every open() which lets udev run into a loop.
> >>
> >> Verify GET_EVENT result against TUR and if it generates spurious
> >> events for several times in a row, ignore the GET_EVENT events, and
> >> trust only the TUR status.
>
> > James, ping.
>
> This is a rather urgent fix, that needs to go in, and also to -stable.
>
> Systems run into endless loops with ever-growing event queues. Nothing
> really works any more if we hit that condition, unless the (broken)
> device is disconnected.
Sorry ... I have it marked for inclusion in my internal queue, I'm just
having difficulty finding time to do a dump from queue and test. I
should be able to get all the fixes sorted on the 'plane home tomorrow.
James
^ permalink raw reply
* Re: detection usb camera devices in my own application
From: Kay Sievers @ 2011-07-21 10:29 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <Pine.LNX.4.44L0.1107101057360.12216-100000@netrider.rowland.org>
On Thu, Jul 21, 2011 at 12:24, Sudarshan Jagadale <snjagadale@gmail.com> wrote:
> In addition to VendorID and ProductID,
> can i get info about the iProduct and iManufaturer name from
> /sys/bus/usb/devices? e.g.
>
> "UVC Camera" Product and "Logitech inc" Manufacturer
>
> I did corss check these name in you MENTIONED USB directories but i fail to
> get this names. IS THERE ANY WAY TO GET THIS?
Check the output of:
$ grep . /sys/bus/usb/devices/*/{product,manufacturer}
Kay
^ permalink raw reply
* Re: detection usb camera devices in my own application
From: Kay Sievers @ 2011-07-21 11:14 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <Pine.LNX.4.44L0.1107101057360.12216-100000@netrider.rowland.org>
On Thu, Jul 21, 2011 at 13:00, Sudarshan Jagadale <snjagadale@gmail.com> wrote:
> i have conneced one camera UVC camera logitech but it has not got refeclted
> here...?
Logitech cameras often have no textual strings in the device.
You can only look up the vendor/product in the USB database, like
'lsusb' is doing it. There is no way for the kernel to know or export
these strings if they are not stored in the device itself.
Kay
^ permalink raw reply
* Re: detection usb camera devices in my own application
From: Kay Sievers @ 2011-07-21 11:16 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <Pine.LNX.4.44L0.1107101057360.12216-100000@netrider.rowland.org>
On Thu, Jul 21, 2011 at 13:12, Sudarshan Jagadale <snjagadale@gmail.com> wrote:
> some how i have to create all the information that present in
> /proc/bus/input/devices if camera driver is not installed...
> because this information is really neccesary to use perticular camera device
> is 2-3 cameras are connected at single time ...
'Create' this information? Where do you want to create it?
Kay
^ permalink raw reply
* Re: detection usb camera devices in my own application
From: Kay Sievers @ 2011-07-21 11:38 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <Pine.LNX.4.44L0.1107101057360.12216-100000@netrider.rowland.org>
On Thu, Jul 21, 2011 at 13:27, Sudarshan Jagadale <snjagadale@gmail.com> wrote:
> I want to use these camera in my frame work so i need to use /dev/video0
> device and those are mapped at /proc/bus/input/devices..
The video0 devices are not visible in 'input' devices. That's just the
button on the camera, which is its own device.
Maybe you mean /proc/bus/usb/devices? That file does not exist on
recent kernels, and should not be used for anything. The information
about devices is all /sys, not in /proc.
> but if some one
> removes kernel module to use another kernel module for another camera then
> this information lost and again regenerats it for another camera... \
>
> my requirment is to support the multiple camera types on single system...
> like i want to support logitech camera and quanta camera ...and both has
> their own Kernel driver module....
>
> so there will be rmmod for one kernel module and insmod for another one...
You need to make sure then, that the specific drivers will not bind to
the camera which they should no handle, that's can only be done inside
the driver itself, not from outside.
There is no standard way to prevent a driver to search for all devices
it can handle, it will just bind to all devices which do not have a
driver already.
Kay
^ permalink raw reply
* Re: detection usb camera devices in my own application
From: Alan Stern @ 2011-07-21 15:06 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <Pine.LNX.4.44L0.1107101057360.12216-100000@netrider.rowland.org>
On Thu, 21 Jul 2011, Sudarshan Jagadale wrote:
> Hello ,
>
> thanks friends!
>
> In addition to VendorID and ProductID,
> can i get info about the iProduct and iManufaturer name from
> /sys/bus/usb/devices? e.g.
>
> "UVC Camera" Product and "Logitech inc" Manufacturer
>
>
> I did corss check these name in you MENTIONED USB directories but i fail to
> get this names. IS THERE ANY WAY TO GET THIS?
Basically, no. If the camera itself does not make that information
available then there is no way for your program to get it.
Alan Stern
^ permalink raw reply
* Re: detection usb camera devices in my own application
From: Alan Stern @ 2011-07-21 15:08 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <Pine.LNX.4.44L0.1107101057360.12216-100000@netrider.rowland.org>
On Thu, 21 Jul 2011, Sudarshan Jagadale wrote:
> I want to use these camera in my frame work so i need to use /dev/video0
> device and those are mapped at /proc/bus/input/devices.. but if some one
> removes kernel module to use another kernel module for another camera then
> this information lost and again regenerats it for another camera... \
>
> my requirment is to support the multiple camera types on single system...
> like i want to support logitech camera and quanta camera ...and both has
> their own Kernel driver module....
>
> so there will be rmmod for one kernel module and insmod for another one...
Why? Can't you have both kernel modules loaded at the same time?
> so instead of using information from /proc/bus/input/devices i have to
> generats it from usb driver so that it will not lost after kernel driver
> removed...
>
> basically there are two main infromation in addition of vendor and product
> those are bus_info and device name ..i have no clue how to generate bus info
What do you mean by "bus info"?
Alan Stern
^ permalink raw reply
* Re: detection usb camera devices in my own application
From: Alan Stern @ 2011-07-22 14:08 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <Pine.LNX.4.44L0.1107101057360.12216-100000@netrider.rowland.org>
On Fri, 22 Jul 2011, Sudarshan Jagadale wrote:
> we can not install two camera kernel module at same time....
>
> if logitech QuicCam (ko - uvcvideo) and quanta camera (/uvcvideo.ko) they
> need to install using modprobe uvcvideo and insmode uvcvideo.ko .....if
> first is installed then we nned to remove it usng rmmod to install
> other...else system will give error of already presnet...
> I get following error if i try second kernel module to install..
>
> *insmod: error inserting '/home/manjiri/uvc_video_2.6.*
>
> *32_21/uvcvideo.ko': -1 File exists*
This looks like you are trying to install the same module twice. What
makes you think "insmod uvcvideo.ko" is any different from "modprobe
uvcvideo"?
> after long discussion with you it seems that we need to have own kernel
> mdoule to write the hotplug device detection utility?
>
> there is other way of /sys/bus/usb/device but it is not achivable....since
> there are lots of direcotry and we need to look for all direcoties with no
> ':' and 'usb' name?
If you think that's too hard to program, maybe you can find someone
else to write the program for you.
Alan Stern
^ permalink raw reply
* Re: detection usb camera devices in my own application
From: Kay Sievers @ 2011-07-22 14:30 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <Pine.LNX.4.44L0.1107101057360.12216-100000@netrider.rowland.org>
On Fri, Jul 22, 2011 at 16:08, Alan Stern <stern@rowland.harvard.edu> wrote:
> On Fri, 22 Jul 2011, Sudarshan Jagadale wrote:
>> there is other way of /sys/bus/usb/device but it is not achivable....since
>> there are lots of direcotry and we need to look for all direcoties with  no
>> ':' and 'usb' name?
>
> If you think that's too hard to program, maybe you can find someone
> else to write the program for you.
Right, it's a couple of lines only, with libudev though. It even can
tell the program when something changes during runtime. There is no
other sensible option really than to copy libudev's sysfs/netlink
logic, or to use libudev, if programs want to be hotplug aware these
days.
Kay
^ permalink raw reply
* Overriding a keymap file
From: Thomas Hood @ 2011-07-26 16:19 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 1205 bytes --]
Sometimes the administrator wants to override the relevant file
in (on Debian:) /lib/udev/keymaps/. It would be convenient if this
could be done by creating a separate file under SYSCONFDIR,
i.e., under /etc, which would contain only the entries that the
admin wants to change.
For example, /lib/udev/keymaps/module-lenovo contains 16 lines.
Suppose the admin wants to change
0x13 zoom
to
0x13 search
If he changes /lib/udev/keymaps directly then his changes will
be overwritten by his packaging system on the next upgrade
of the udev package. So that is not a reasonable course of action.
He does have the alternative of adding a udev rules file to
(on Debian) /etc/udev/rules.d but this is much less convenient
since it has to duplicate significant amounts of udev code from
(on Debian) /lib/udev/rules.d/95-keymap.rules.
As an example of how support for a "keymap override" file
could be added I attach a patch. It has been tested and works
on my Ubuntu 11.04 system but I don't know how well it conforms
to applicable coding standards.
Should "keymap override" support be added to udev? And is my
patch anything like the right way to do it?
Comments most welcome.
--
Thomas Hood
[-- Attachment #2: udev-keymap-override_20110721th1.diff --]
[-- Type: text/x-patch, Size: 1648 bytes --]
--- extras/keymap/keymap.c_ORIG 2011-07-21 15:01:08.830054279 +0200
+++ extras/keymap/keymap.c 2011-07-21 14:48:45.322209254 +0200
@@ -184,14 +184,15 @@
scancode, k->id);
}
-static int merge_table(int fd, const char *filename) {
+static int merge_table(int fd, const char *filename, int report_fopen_fail) {
int r = 0;
int line = 0;
FILE* f;
f = fopen(filename, "r");
if (!f) {
- perror(filename);
+ if (report_fopen_fail)
+ perror(filename);
r = -1;
goto fail;
}
@@ -250,7 +251,7 @@
{
static char result[PATH_MAX];
- /* If keymap file is given without a path, assume udev directory; must end with '/' * */
+ /* If keymap file is given without a path, assume udev default directory; must end with '/' * */
if (!strchr(path, '/')) {
snprintf(result, sizeof(result), "%s%s", LIBEXECDIR "/keymaps/", path);
return result;
@@ -258,6 +259,18 @@
return path;
}
+static const char* override_keymap_path(const char* path)
+{
+ static char result[PATH_MAX];
+
+ /* If keymap file is given without a path, assume udev override directory; must end with '/' * */
+ if (!strchr(path, '/')) {
+ snprintf(result, sizeof(result), "%s%s", SYSCONFDIR "/udev/keymaps/", path);
+ return result;
+ }
+ return path;
+}
+
/* read one event; return 1 if valid */
static int read_event(int fd, struct input_event* ev)
{
@@ -424,7 +437,8 @@
/* two arguments (device, mapfile): set map file */
if (argc == optind+2) {
- merge_table(fd, default_keymap_path(argv[optind+1]));
+ merge_table(fd, default_keymap_path(argv[optind+1]), 1);
+ merge_table(fd, override_keymap_path(argv[optind+1]), 0);
return 0;
}
^ permalink raw reply
* udev rule matching using ENV
From: william @ 2011-07-26 19:15 UTC (permalink / raw)
To: linux-hotplug
Dear list
i am trying to create a udev rule which executes a script whenever a usb
stick is removed with a particular uuid
The uuid is changeable and we have a common settings file which exports
the UUID from the usb partition.
What i would like is to import the UUID from the settings file and match
that with the actual ID_FS_UUID with the remove action.
So i created 99-remove-usb.rules with the following contents
IMPORT{program}="/usr/local/bin/usb-stick-uuid.sh"
ACTION="remove", ENV{ID_FS_UUID}="ENV{MY_UUID}",
RUN+="/usr/local/bin/usb-removed.sh"
The program usb-stick-uuid.sh now only echo's:
MY_UUIDÿ744c66-3671-447c-8fa0-d96fc6f82352
and nothing else.
But it does never match.
When i enter the uuid by hand in the rule it does work:
ACTION="remove",
ENV{ID_FS_UUID}="ff744c66-3671-447c-8fa0-d96fc6f82352",
RUN+="/usr/local/bin/usb-removed.sh"
Am i doing something wrong or is it just the way it works? I also could
not find any example on the internet matching two ENV strings.
My system:
ubuntu 10.10
udev version 162
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox