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.
looking at device '/bus/usb/devices/usb1/1-6':
KERNEL=="1-6"
SUBSYSTEM=="usb"
DRIVER=="usb"
ATTR{configuration}=="CARD READER
[code].....
View 2 Replies
ADVERTISEMENT
May 23, 2010
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?
View 6 Replies
View Related
Jun 3, 2010
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.
[code]....
View 3 Replies
View Related
May 2, 2011
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....
View 2 Replies
View Related
Jan 13, 2010
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
[Code]....
View 3 Replies
View Related
Mar 29, 2011
I am not good at writing udev rules. I am using RHEL 4.7, I would like to invoke a file install.sh which is in CDROM as soon as the CDROM is inserted
View 2 Replies
View Related
Aug 1, 2010
I have a UDEV rule below that maps a symlink from a specific usb device and 'Should' run a command.
Code:
BUS=="usb",SYSFS{serial}=="1111111111111111111111111111",SYMLINK+="myusbstick_%n",RUN+="/usr/local/bin/my_command"
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.
View 2 Replies
View Related
May 12, 2010
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.
View 14 Replies
View Related
Sep 19, 2010
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"
[code]....
View 6 Replies
View Related
May 29, 2011
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:
Code:
# udev rules for gpsd
# $Id: gpsd.rules 5861 2009-08-03 13:41:01Z bzed $
[code]....
View 14 Replies
View Related
Apr 19, 2011
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.
looking at device '/devices/pci0000:00/0000:00:11.0/host7/target7:0:0/7:0:0:0/block/sdb':
KERNEL=="sdb"
SUBSYSTEM=="block"
DRIVER==""
ATTR{range}=="16"
ATTR{ext_range}=="256"
ATTR{removable}=="0"
ATTR{ro}=="0"
ATTR{size}=="156301488"
ATTR{alignment_offset}=="0"
ATTR{capability}=="52" ....
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?
View 1 Replies
View Related
Aug 2, 2010
make /usr/bin/make all-am
make: Nothing to be done for `/usr/bin/make'.
make: *** No rule to make target `all-am'. Stop.
whats wrong with this???
View 2 Replies
View Related
Sep 23, 2010
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.....??
View 9 Replies
View Related
Jan 20, 2010
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?
View 5 Replies
View Related
Apr 13, 2011
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.
View 9 Replies
View Related
Sep 1, 2011
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:
Quote:
FORWARD chain, change rule 1 to
iptables -R FORWARD 1 -j zone_wan_MSSFIX -p tcp --destination-port 443 -i eth1
Obviously, That was just a guess, I need someone that knows iptables to help me.
Code:
Chain INPUT (Policy: ACCEPT)
Rule # Traffic Target Prot In Out Source Destination Options
Rule 1 72.95 KB DROP all * * 0.0.0.0/0 0.0.0.0/0 state INVALID
Rule 2 1.11 GB ACCEPT all * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
[code].....
View 3 Replies
View Related
Apr 20, 2010
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
View 3 Replies
View Related
Feb 23, 2010
I'm not an iptables expert. Anybody know how to create a rule/chain that will log info similar to what tcpdump -s0 would do?
View 3 Replies
View Related
Jan 24, 2009
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
View 2 Replies
View Related
Apr 25, 2016
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).
But the problem is.. excluding does not work.
Here's "auditctl -l" output:
Code: Select all# auditctl -l
LIST_RULES: exit,never arch=3221225534 (0xc000003e) watch=/var/www/server-status key=web syscall=stat
LIST_RULES: exit,always arch=3221225534 (0xc000003e) uid=33 (0x21) success=0 key=web syscall=stat
But when I execute:
Code: Select all# wget -O - http://localhost/server-status
audit.log appears:
Code: Select alltype=SYSCALL msg=audit(1461591557.077:365): arch=c000003e syscall=4 success=no exit=-2 a0=7f1bedab9358 a1=7ffef316ac20 a2=7ffef316ac20 a3=7f1bedab91f8 items=1 ppid=2398 pid=2451 auid=4294967295 uid=33 gid=33 euid=33 suid=33 fsuid=33 egid=33 sgid=33 fsgid=33 tty=(none) ses=4294967295 comm="apache2" exe="/usr/lib/apache2/mpm-prefork/apache2" key="web"
type=CWD msg=audit(1461591557.077:365):Â cwd="/"
type=PATH msg=audit(1461591557.077:365): item=0 name="/var/www/server-status" nametype=UNKNOWN
type=UNKNOWN[1327] msg=audit(1461591557.077:365): proctitle=2F7573722F7362696E2F61706163686532002D6B007374617274
So, syscall=4 (stat) is still captured. Looks like "path" is known for auditd, but not excluded.
I've tried various rule combinations, for example simpler, more generic one:
Code: Select all-a exit,never -F path=/var/www/server-status
But it's the same.
Sadly man audit.rules and man auditctl does not have "exit,never" examples, only some (sometimes also similarly unsuccessfull) google results.
Could it be that Debian kernel does not support some audit features?
View 1 Replies
View Related
Jul 16, 2010
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?
View 9 Replies
View Related
Dec 6, 2010
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."
View 2 Replies
View Related
Mar 30, 2011
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.
View 2 Replies
View Related
May 18, 2011
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
[Code].....
View 2 Replies
View Related
Feb 25, 2010
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 .....
View 2 Replies
View Related
Jul 30, 2010
My girlfriends laptop (Acer Aspire 5536) has an internal memory card slot, however Ubuntu doesn't seem to be recognising it.
[Code]....
View 5 Replies
View Related
Apr 18, 2011
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.
[URL]
View 5 Replies
View Related
Jun 16, 2011
lsusb output:
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.
[Code]...
View 3 Replies
View Related
Jun 28, 2011
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:
sg_scan -i Code:
/dev/sg0: scsi0 channel=0 id=0 lun=0 [em]
HL-DT-ST DVD-RAM GH22NP20 2.00 [rmb=1 cmdq=0 pqual=0 pdev=0x5]
/dev/sg1: scsi0 channel=0 id=1 lun=0 [em]
[Code]...
View 7 Replies
View Related
Jul 15, 2011
When using Smargo+ card reader with Ubuntu 10.04 server, I get the following error when starting up binary using smargo.
Code:
ERROR, function call SR_Init(reader) returns error.
It seems to be a USB problem related to the Smargo+ card reader.
View 1 Replies
View Related