09-08-2014 05:12 AM
I have two uImage with linux 3.8 & 3.14. When I use the 3.8 kernel to run, /dev/video0 can be made when I connect a USB Camera. But when I use the 3.14, no device is create. I must run "mdev -s" to make the device file create.
I do many test to find the error. Someone said that to add"echo /sbin/mdev > proc/sys/kernel/hotplug". I think the error isn't realated to this, because it runs ok if I don't use it in the 3.8 version. I think it doesn't detect the hotplug uevent to realize mounting the device. It must be something wrong with the kernel setting, or something changed with the two different versions. Waiting for your help, thanks a lot!
PS: In the kernel configs, I set: CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y
09-08-2014 06:21 AM
It is likely related to "mdev.conf" (usually in /etc/).
There must be lines in there to match the device. It may also need to load the device driver and firmware.
A line like this is needed when your camera driver was compiled as module:
$MODALIAS=.* 0:0 660 @modprobe "$MODALIAS"
And you'll need a line to match the device node, something like this:
video[0-9] 0:0 660 >v4l/
When in doubt, I route the events to a shell script that appends some information to a log file in /tmp/ using a line like this:
video[0-9] 0:0 660 */etc/mdev/mdev-debug.sh
09-08-2014 06:34 AM
mdev.conf is must be in somewhere in the ramdisk system. But I use the same ramdisk with diferent kernel, the result is diferent. So I doubt the kernel setting. I don't understand your way to debug, Could you explain it detailly?
09-12-2014 03:37 AM
There is no "mdev.conf" in /etc/. I write a script to the proc/sys/kernel/hotplug, but there's nothing to do when I connect a USB device. I think it's no hotplug event.
09-12-2014 07:48 AM
For hotplug to work, you need a hotplug manager like mdev or udev. For embedded systems, mdev is the obvious choice.
At some point in initialization, some script will write "/sbin/mdev" to the hotplug sysfs file. Then mdev will handle these events by creating nodes and calling scripts.
You problem isn't with the kernel, it's with your root filesystem and user space applications. You say you only changed the kernel but from your message I gather that you're actually referring to a complete BSP using that kernel version.