From: "Walter Dnes" <waltdnes@waltdnes.org>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] serial in /sys
Date: Thu, 29 Nov 2012 17:35:57 -0500 [thread overview]
Message-ID: <20121129223557.GA11921@waltdnes.org> (raw)
In-Reply-To: <CAKpSnpK=fegV=dm=EEKu8+c+_W62=KGs-kgNHCN_wAECU2Oi6Q@mail.gmail.com>
On Thu, Nov 29, 2012 at 07:31:10PM +0000, Jorge Almeida wrote
> It is a matter of programming, not looking. I need a program that
> creates the symlink when the device is plugged in. Think mdev
> (more precisely, a complement to mdev that would take care of a few
> particular devices, to allow using fstab to mount them in chosen
> mountpoints, and then leave the rest to mdev).
I have a couple of scripts that automount USB devices under mdev. See
https://wiki.gentoo.org/wiki/Mdev for the general setup, and
https://wiki.gentoo.org/wiki/Mdev/Automount_USB and
https://wiki.gentoo.org/wiki/Mdev/Automount_USB/automount
Once set up, "it just works". If you want to go spelunking through
/sys for connected USB devices, here are a few hints. I currently
have connected to my machine...
* a Dell keyboard
* a Logitech trackball mouse
* an external USB hard drive
* 2 USB keys
The output below shows that not every USB device has a serial number,
and the "Patriot Memory" key has a serial number but no manufacturer...
[d531][waltdnes][~] find /sys/devices/pci0* -name serial | xargs cat
0000:00:1a.0
0000:00:1a.1
0000:00:1a.2
0000:00:1a.7
0000:00:1d.0
0000:00:1d.1
0000:00:1d.2
0000:00:1d.7
00000000000000070493
078215B00E5C
574341565530313435313431
[d531][waltdnes][~] find /sys/devices/pci0* -name manufacturer | xargs cat
Linux 3.3.8-gentoo uhci_hcd
Linux 3.3.8-gentoo uhci_hcd
Dell
Linux 3.3.8-gentoo uhci_hcd
Logitech
Linux 3.3.8-gentoo ehci_hcd
Linux 3.3.8-gentoo uhci_hcd
Linux 3.3.8-gentoo uhci_hcd
Linux 3.3.8-gentoo uhci_hcd
Linux 3.3.8-gentoo ehci_hcd
SanDisk Corporation
Western Digital
[d531][waltdnes][~] find /sys/devices/pci0* -name product | xargs cat
UHCI Host Controller
UHCI Host Controller
Dell USB Keyboard
2003
UHCI Host Controller
Trackball
c404
EHCI Host Controller
UHCI Host Controller
UHCI Host Controller
UHCI Host Controller
EHCI Host Controller
Cruzer Titanium
Patriot Memory
My Book 1110
--
Walter Dnes <waltdnes@waltdnes.org>
We are apparently better off trying to avoid udev like the plague.
Linus Torvalds; 2012/10/03 https://lkml.org/lkml/2012/10/3/349
next prev parent reply other threads:[~2012-11-29 22:37 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-29 17:57 [gentoo-user] serial in /sys Jorge Almeida
2012-11-29 18:35 ` Marco Bonfiglio
2012-11-29 19:07 ` Jorge Almeida
2012-11-29 22:09 ` Kevin Chadwick
2012-11-30 10:00 ` Neil Bothwick
2012-11-30 12:48 ` Jorge Almeida
2012-11-29 19:20 ` Bruce Hill
2012-11-29 19:31 ` Jorge Almeida
2012-11-29 20:20 ` Bruce Hill
2012-11-29 20:56 ` Jorge Almeida
2012-11-29 22:35 ` Walter Dnes [this message]
2012-11-30 0:28 ` Jorge Almeida
2012-11-30 3:09 ` Walter Dnes
2012-11-30 9:58 ` Jorge Almeida
2012-12-01 3:47 ` Walter Dnes
2012-12-01 4:55 ` Joshua Murphy
2012-12-01 9:11 ` Jorge Almeida
2012-12-01 9:08 ` Jorge Almeida
2012-11-30 0:56 ` James Cloos
2012-11-30 18:02 ` Volker Armin Hemmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121129223557.GA11921@waltdnes.org \
--to=waltdnes@waltdnes.org \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox