Re: How to load a kernel module automatically?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Julian Sikorski (belegdol@xxxxxxxxx) said: 
> Sounds good. Can you shed some more light?

It was sort of a joke, but if you want uinput to load automatically,
you could add something like the attached. It's a pretty gross layering
violation, though.

If you want to do it directly in udev, instead, something like:

BUS=="usb", SYSFS{idProduct}=="0483", SYSFS{idVendor}=="2016", RUN+="/sbin/modprobe uinput"

in a /etc/udev/rules.d rules file should work.

Bill


--- linux-2.6.20.noarch/drivers/input/misc/uinput.c.foo	2007-04-13 15:33:56.000000000 -0400
+++ linux-2.6.20.noarch/drivers/input/misc/uinput.c	2007-04-13 15:42:28.000000000 -0400
@@ -32,6 +32,7 @@
 #include <linux/poll.h>
 #include <linux/slab.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/init.h>
 #include <linux/input.h>
 #include <linux/smp_lock.h>
@@ -39,6 +40,16 @@
 #include <linux/miscdevice.h>
 #include <linux/uinput.h>
 
+#define VENDOR_ID_UPEK	0x0483
+#define PRODUCT_ID_THINKFINGER	0x2016
+
+static struct usb_device_id uinput_table[] = {
+        {USB_DEVICE(VENDOR_ID_UPEK, PRODUCT_ID_THINKFINGER)},
+        {}
+};
+
+MODULE_DEVICE_TABLE(usb, uinput_table);
+
 static int uinput_dev_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
 {
 	struct uinput_device	*udev;
--
Fedora-maintainers mailing list
Fedora-maintainers@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-maintainers
--
Fedora-maintainers-readonly mailing list
Fedora-maintainers-readonly@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-maintainers-readonly

[Index of Archives]     [Fedora Users]     [Fedora Development]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux