Ubuntu :: Create An Udev Rule To Stop Card Reader From Being Initialized
Jan 24, 2010
I have a netbook (MSI Wind U100 rebrand) that has one of those card readers built into the handrest. The thing is I've never used it once, and it keeps popping up in powertop as waking the cpu when it should just shut up and be quiet.Aside from breaking open the case and tearing it out, the immediate solution is to browse to /sys/bus/usb/devices/usb1/1-6/ and pipe 1 to the file remove. That disables it until system reboot or resume, at which point I have to do it all over again.
Code:
$ echo 1 | sudo tee /sys/bus/usb/devices/usb1/1-6/remove
Now I'd like to create an udev rule to make it not get initialized at all. A quick Google search found me this article on creating udev rules, and after toying about with the udevadm tool I managed to produce the attributes/properties of the device.
Code:
zorael@lethe:/sys/bus/usb/devices/usb1/1-6$ udevadm info -a -p $(pwd)
Udevadm info starts with the device specified by the devpath and then walks up the chain of parent devices. It prints for every device found, all possible attributes in the udev rules key format. A rule to match, can be composed by the attributes of the device and the attributes from one single parent device.
I am trying to write a udev rule for my headset but i don't understand where i get the information to make the rule. I know i need to add
Code: RUN+="bash /home/luke-jennings/headset" at the end of it so the script i wrote runs. I don't know how to get any of the identifying info for the headset and which bits to use where. How do I get the information?
I'm trying to set my network interfaces so that they don't get random every boot.(eg assign eth0 to a network interface with a given MAC addr, and eth1 to the other one)I trew in a udev rule (in fact just modified the rules that was automatically generated and set the ethX in it) but the system ignores my udev rule.What am I missing ?Here is all the info :
Code: $cat /etc/udev/rules.d/70-persistent-net.rules # This file maintains persistent names for network interfaces.
On Ubuntu 10.04 I would like to setup udev to execute a backup script when a specific USB drive is inserted. Udev detects the USB drive, but my script is executed 7 times instead of just once. Can't figure out what's wrong.
My udev rules file:
Code: /etc/udev/rules.d# cat 20-stick.rules ACTION=="add", ATTRS{vendor}=="Kingston", ATTRS{model}=="DataTraveler G2 ", RUN="/usr/local/bin/sync.sh" Dummy backup script: connecting USB drive results in 7 times date written to /tmp/test code....
I'm running Ubuntu 9.10 (Karmic Koala) on a laptop and would like NumLock to automatically toggle depending on whether my USB keyboard is plugged in (numlock on) or unplugged (numlock off).
To accomplish this, I first installed the "numlockx" package. numlockx on and numlockx off works fine.
To hook into the device system, I thought I'd use udev. I have read "Writing udev rules", but I'm having trouble getting the udev rule to work.
First, here's an example of the dmesg output:
[20906.985102] usb 3-2: new low speed USB device using uhci_hcd and address 6 [20907.166403] usb 3-2: configuration #1 chosen from 1 choice [20907.192904] input: Microsoft Natural® Ergonomic Keyboard 4000 as /devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.0/input/input20 [20907.193100] microsoft 0003:045E:00DB.000B: input,hidraw1: USB HID v1.11
The symlink part is fine but it does not appear to run the command when I plug the device in. I can run the command "/usr/local/bin/my_command" from the shell fine.
Code:
mount /dev/myusbstick_1 /media/TMPUSB && cryptsetup luksOpen /dev/md5 md5_crypt --key-file=/media/TMPUSB/key && vgscan && vgchange -ay && mount -a && umount /media/TMPUSB
What am I missing. I have tried +x in owner,group and other.By the way what does UDEV run as, I assumned +x on ROOT as that is the owner should be enough.
i need all my /media/* newly created by insertion of usb drives, chmodded 666.I tried some tips using various threads, but i failed.I'm on Slack 64 13.0.
I'm having some trouble with udev, in that it won't create me a symlink for the infrared device which is part of my Hauppauge Nova-TD-500 TV card.I've got the card installed, and for the most part working, but I want to have the infrared device on /dev/ir.I've created a rule in /etc/udev/rules.d/ called 55-dvb_usb_dib0700-ir.rules which contains this:
Code: SUBSYSTEM=="input", ATTR{name}=="IR-receiver inside an USB DVB receiver", RUN="/bin/date > /home/xbmc/foo", SYMLINK+="ir"
I'm trying to configure gpsd 2.96 to start automatically from udev rule on a Slack 13.37 box.1. I've compiled and installed gpsd from sources and made sure it starts manually.2. I've copied the /lib/udev/gpsd.hotplug and /lib/udev/gpsd.hotplug.wrapper scripts in their places from the source tree and made them executable.3. I've copied the gpsd.rules file from sources into /etc/udev/rules.d4. I renamed it 99-persistent-gpsd.rules to run late in the bootup process.5. I've copied the /etc/default/gpsd file from sources and made sure it has the right settings inside.
Now, for the results. If I plug the gps usb dongle in while the system runs, it starts gpsd if it is not started, and it connects to it just as it should. But if I start the system with the dongle in, gpsd doesn't get started during boot. I can't find any relevant message in /var/log/syslog or /var/log/messages for boot time. There is stuff there from when I plug the dongle in while the system is running though. It's like udev ignores the rules for it at boot time.Is there something in the Slackware boot scripts that would prevent running those scriptssd.hotplug.wrapper which in turn runs /lib/udev/gpsd.hotplug which is a Python script)?Here is the contents of 99-persistent-gpsd.rules (ignore the comments referring to Debian, it was meant for a Debian box). My usb gps adapter is the first one - the Prolific chipset one:
I have a trayless SATA hotswap bay that is really terrific for quickly attaching and removing SATA hard drives. I'm trying to write a udev rule to create a symbolic link to the device node for the drive that is attached through the hotswap bay (/dev/bay -> /dev/sdX). This eliminates any ambiguity when performing destructive tasks (fdisk, etc). I'm running squeeze amd64. I've read through several tutorials and have it working somewhat. Here's the output of udevadm info for a drive attached via the hotswap bay.
Here is my udev rule DEVPATH=="/devices/pci0000:00/0000:00:11.0/host7/*", SUBSYSTEM=="block", SYMLINK+="bay%n"
This produces the desired behavior and gives me an fdisk-able device node. The problem I am having is that the "host" component of the DEVPATH varies from bootup to bootup. I'm just using on onboard SATA, host2-7, specifically host7. There is also onboard PATA, host0-1. It seems to just be random which "host"s are assigned to which controller. For example, the next time I boot the system, the onboard SATA will be host0-5 and the onboard PATA will be host6-7. In this simple case, I could just write 2 rules, one for each possibility and it would still be correct because of the different PCI addresses of the two controllers. But on systems with more SCSI (uh... libata, actually) controllers, a "host" file can point to different physical ports between bootstraps. This would be bad. Does anyone know of a way to write a rule to tie a device node to a specific physical SATA port on the motherboard/hba?
I am compiling libmp3lame from svn and I got following error No rule to make target `basic.html', needed by `all-am'. Stop. which package am I missing.....??
Looking for a card reader/writer that will support most current card types. I am running Fedora 12 x86_64 on a home-grown desktop. Are there any gotchas, that I need to watch for?Also, Internal vs. external, any benefits of one over the other, or is it just personal preference?
I am relatively new to linux and am running into a problem. I just got a new laptop and need to configure/install it's wireless driver but am getting an error when running "make". The error is: make[1]: Entering directory `/lib/modules/2.6.37.1-1.2-desktop/build' make[1]: *** No rule to make target `modules'. Stop.
I have scoured these forums and know that others have the same issue (when configuring other drivers/programs). I am sorry if this post is redundant. It sounds like the Makefile is pointing to the wrong directory. I am using opensuse 11.4, have make and gcc installed. My kernel is linux-2.6.37.1-1.2 (I just re-installed the desktop kernel to make sure it was up to date). The driver I am trying to install is located here: AUR (en) - rtl8192ce.
Another forum suggests pointing somewhere in the /usr/src/linux-2.6.37.1-1.2 directory instead. Is this correct? Should I be pointing to a folder within this? I am not a programmer but any description about what I am actually putting in this directory and why would be awesome (so I can learn a bit more). Or just helping me solve the problem would be great too.
I need help creating an iptable rule. The iptables are installed on my router. My router also connects to a "hide my a**" vpn account at 79.142.65.5:443 The goal is to somehow force the traffic to go through the vpn, because what sometimes happens is, the vpn connection drops (for what ever reason) and my real ip becomes exposed. Basically, I want to block "myself" from accessing the Internet when not connected to the vpn because of privacy concerns.
Below is my iptables. It has the 3 default chains and it also has many custom user chains. I need to know what kind of a rule to add, What interface to apply it to (lo,tun0,br-lan,eth1) and the correct chain to insert into.For example, you could tell me something like:
Do I have to create a rule for: Code: $IPT -A fwalert -p tcp --tcp-flags SYN,ACK SYN,ACK -m conntrack --ctstate NEW $RLIMIT -j LOG $LOGLIMIT --log-tcp-options --log-level 4 --log-prefix to drop rather than log if my table has a default policy of drop with : Code: $IPT -t fwalert -P DROP
I am following the instructions on Section 8.1.* Device Driver ConceptsHere I was able to proceed till section 8.1.4.After making the hello.c file,the make file and patching the Kconfig as mentioned,I tried to run the $ make ARCH=ARM CROSS_COMPILE=xscale_be- gconfig This gave error as:make: *** No rule to make target `gconfig'. Stop.I am not sure if my kernel is correctly compliled,but I was able to complie and build the kernel for arm before by cloning the kernel and building from the following link without any error. https://omapzoom.org/gf/project/omap...ux+OMAP+Kernel
I'm trying to configure auditd to monitor "strange" events with apache2 weberver on Wheezy (though same problem occurs on Jessie), tried both with "vanilla" 3.2 and backports 3.16 kernel I am actually using.
Here's auditd rules I have problem with:
Code: Select all-a exit,never -F arch=b64 -S stat -F path=/var/www/server-status -k web -a exit,always -F arch=b64 -S stat -F uid=www-data -F success=0 -k web
So to recap, I want to log stat syscall failures for www-data user, but excluding some "known" issues, such as that "/var/www/server-status" (after a2enmod status, /server-status path can be accessed for statistics, though apache2 still tries to find physical file for that path and fails).
Question (and Google results aren't making this clear): Ubuntu has both iptables & ip6tables installed. 1. If I set a rule in iptables, does that rule also apply to ipv6, or just ipv4?
2. If "no" to above, then it would be prudent to *also* set ip6tables rules as well if I want to maintain an active firewall, correct?
3. Does ip6tables rules have the same syntax and behavior (more or less) to iptables rules - i.e. can I just copy my iptables rules & change "iptables" to "ip6tables"?
4. Any gotchas or issues that I should be aware of?
I have all of my music on an SD card so it doesn't take up space on my hard drive. I put it into my SD card reader and ubuntu is all like, "gtfo doesn't exist."
I have installed Ubuntu 10.10 in my system. I have plug in th USB card reader but it is not detected. Eventhough the same card is detected when I'd pluged in at last night and I have just browse the folders in the memory card.Then I just right click on the icon in media folder and click eject the texts in file /var/ log/messages for above operation.
I have googlled and get these commands to install extracted .tar.gz file such as ./configure, make and make install, after extraction it becomes a directory called eclipse. But when i giving these commands also i got error like this
My multimedia card reader does not work with new ubuntu version fresh install: lsusb says: Code: Bus 001 Device 002: alcor micro corp. multimedia card reader dmesg:
Code: [6.544269] usb-storage: device scan complete [6.544848] scsi 2:0:0:0: Direct-Access Generic USB SD Reader 1.00 PQ: 0 ANSI: 0 [6.545482] scsi 2:0:0:1: Direct-Access Generic USB CF Reader 1.01 PQ: 0 ANSI: 0 [6.546102] scsi 2:0:0:2: Direct-Access Generic USB SM Reader 1.02 PQ: 0 ANSI: 0 [6.546728] scsi 2:0:0:3: Direct-Access Generic USB MS Reader 1.03 PQ: 0 ANSI: 0 [6.547227] sd 2:0:0:0: Attached scsi generic sg2 type 0 [6.547338] sd 2:0:0:1: Attached scsi generic sg3 type 0 [6.547439] sd 2:0:0:2: Attached scsi generic sg4 type 0 [6.547550] sd 2:0:0:3: Attached scsi generic sg5 type 0 .....
My PC is an Intel Core-i7-950 with 8GB RAM. The motherboard is an Intel Extreme, DX580G. Ubuntu (64) 10.10 is the only OS run on this system, and uses the entire hard-disk.
Today, I purchased an internal USB card reader that connects to the USB socket on the motherboard. Once I connected it, the PC started hanging on boot. When it hangs, there is nothing but a non-blinking, still cursor on the top left corner of the screen.
Earlier I had set the Grub2 boot delay to '0', and therefore I guess I do not get to see any messages or the Grub2 menu.
The story is the same with an external USB card-reader. If I connect the external card-reader and try to boot, the PC hangs in the manner described above.
If I disconnect the internal / external USB card-reader, everything is normal.
The following web-page describes the problem in the manner I can understand. But it does not provide a permanent solution.
Bus 005 Device 002: ID 058f:9360 Alcor Micro Corp. 8-in-1 Media Card Reader Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 003: ID 046d:c50e Logitech, Inc. Cordless Mouse Receiver Bus 003 Device 002: ID 046d:c313 Logitech, Inc.
I can't seem to get my card reader to work. The USB port on the reader works and sometimes I can read my SD card. Usually, nothing shows up in the media/ folder. I looked at this write-up [URL]... but I'm not sure if this is what I should do. Here are some info I was able to pull up: