Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: Paulo on April 07, 2013, 10:20:25 AM

Title: How to get VID and PID of USB flash drive in TC?
Post by: Paulo on April 07, 2013, 10:20:25 AM
Hi all

Anyone know the easiest way to get the VendorID and ProductID of connected USB devices, especially USB flash drives?
I have tried dmesg and udevadm info --query=all --name=/dev/sda1 but to no avail.

Thanks.
Title: Re: How to get VID and PID of USB flash drive in TC?
Post by: tinypoodle on April 07, 2013, 10:38:34 AM
lsusb?
Title: Re: How to get VID and PID of USB flash drive in TC?
Post by: Paulo on April 07, 2013, 10:40:33 AM
Aha forgot about that one.

EDIT:

Not installed by default, will check the repo.

EDIT 2:

Nope, not there.
Perhaps it's part of another package?
Title: Re: How to get VID and PID of USB flash drive in TC?
Post by: Paulo on April 07, 2013, 10:49:46 AM
OK found it, it's part of usb-utils.
Thanks tinypoodle.
Title: Re: How to get VID and PID of USB flash drive in TC?
Post by: tinypoodle on April 07, 2013, 10:51:08 AM
I cheated and used the defaultconfig binary from busybox :P
Title: Re: How to get VID and PID of USB flash drive in TC?
Post by: Paulo on April 07, 2013, 11:04:21 AM
Hi tinypoodle

You should get the real lsusb as it comes with a real nice file called usb.ids.gz
It's a big database (actually a flat text file) with thousands of PIDs and VIDs.
Very handy.
Title: Re: How to get VID and PID of USB flash drive in TC?
Post by: tinypoodle on April 07, 2013, 11:17:35 AM
https://usb-ids.gowdy.us/read/UD  ;)
Title: Re: How to get VID and PID of USB flash drive in TC?
Post by: Paulo on April 07, 2013, 11:26:14 AM
OK since we are playing "Top Trumps"  :) usb-utils also comes with a script to update usb.ids
Title: Re: How to get VID and PID of USB flash drive in TC?
Post by: tinypoodle on April 07, 2013, 11:29:20 AM
Code: [Select]
cat /sys/devices/pci*/*/usb*/*/idVendor
cat /sys/devices/pci*/*/usb*/*/idProduct

KISS :D
Title: Re: How to get VID and PID of USB flash drive in TC?
Post by: Paulo on April 07, 2013, 11:37:16 AM
Code: [Select]
usb-devices | grep 'P:'

Less typing  :)
Title: Re: How to get VID and PID of USB flash drive in TC?
Post by: tinypoodle on April 07, 2013, 11:44:59 AM
The fact that core extensions could not easily be unloaded has taught me discipline wrt to exhaust all means to achieve a goal before considering to load an additional extension.
Title: Re: How to get VID and PID of USB flash drive in TC?
Post by: Paulo on April 07, 2013, 11:55:49 AM
Can't argue there and I suspect it will happen naturally as I get more proficient with Linux.
That is exactly the reason why I like TC so much, it's a no-bloat, bare minimum approach
that forces one to do more with less and if you really can't manage, there are always the....cough...splutter...extensions to fall back on.

Contrary to what most people say that TC is for the seasoned Linux user, I actually think it's a perfect "2nd stage" distro to learn on.
By "2nd stage" I mean first start as I did on something easier like Puppy Linux, get used to that as it's pretty friendly then later on as the confidence grows
move to TC to learn more of the "nitty-gritty" stuff.

And if by chance you stuff the whole thing up, no big deal reformat the USB stick, load it back on and you're up and running in a few minutes as opposed to the
other big distros that expect to be installed onto HDD and a gigs and gigs in size.
Title: Re: How to get VID and PID of USB flash drive in TC?
Post by: tinypoodle on April 07, 2013, 02:41:26 PM
udevadm could actually do:
Code: [Select]
udevadm info --attribute-walk --name /dev/sd*|grep id
Title: Re: How to get VID and PID of USB flash drive in TC?
Post by: thane on April 07, 2013, 03:30:09 PM
OT, but re stuffing the whole thing up (which I've done a few times) it's worthwhile saving the mydata.tgz file (and of course any non-TCL files you want to keep) somewhere safe. I spent a lot more time recreating/recovering the info on those than I did reloading the system and extensions.
Title: Re: How to get VID and PID of USB flash drive in TC?
Post by: Paulo on April 08, 2013, 07:04:45 AM
@tinypoodle
At least I was on the right track with udevadm but did
not know about those options so thanks for the tip.
Actually udev is something I want to learn when I get a gap.
Been collecting bits and pieces of info on udev and rules and converting them to pdf to make a mini booklet for further study.

@thane
Good point, I will start saving mydata on a regular basis.
Title: Re: How to get VID and PID of USB flash drive in TC?
Post by: coreplayer2 on April 10, 2013, 10:41:41 PM
I wish I'd had more success with previous backups of  mydata.tz file. 

Instead I find more security in making new copies of the following config file before making any changes:

.filetool.lst
.xfiletool.lst
bootlocal.sh
bootsync.sh
extlinux.conf (or grub equivalent)
onboot.lst


copies of the above have saved my bacon many many times ;)

Title: Re: How to get VID and PID of USB flash drive in TC?
Post by: thane on April 11, 2013, 09:29:08 AM
Well, I guess I've been luckier, but the overall point (that it takes a lot longer to recreate personal settings and data than it does to reload the system and extensions) is a valid one.