Tiny Core Linux

Tiny Core Base => Micro Core => Topic started by: johnsmith on February 23, 2014, 08:37:55 PM

Title: udev oddness in microcore
Post by: johnsmith on February 23, 2014, 08:37:55 PM
I have been developing a program which will later run on microcore.

in this program I at some point want to get some information on harddrives and use udev to do so.

Now it seems udev is incomplete on tinycore or something because I cannot get the information out of the drives even though the exact same hardware setup with debian I can use udev to get the information.

I am looking to get serial and model.

Is there a way to fix this?
Title: Re: udev oddness in microcore
Post by: gerald_clark on February 23, 2014, 08:52:14 PM
Try hdparm.
Title: Re: udev oddness in microcore
Post by: johnsmith on February 23, 2014, 09:11:59 PM
I am looking to integrate it into a program. not using an external program...
udev offers libraries libudev.
Title: Re: udev oddness in microcore
Post by: tinypoodle on February 23, 2014, 09:15:50 PM
Install the udev-lib extension.

Subject of thread appears to be rather misleading then.
Title: Re: udev oddness in microcore
Post by: johnsmith on February 23, 2014, 09:26:06 PM
I have statically compiled. the problem is Udev NOT reporting it, they dont get populated at boot time.

try for yourself and type into console
Code: [Select]
udevadm info --query=property --name="device path here"
there is no entry for model,serial,wwn etc this incidentally also means you cant make udev rules
Title: Re: udev oddness in microcore
Post by: tinypoodle on February 23, 2014, 09:38:44 PM
Please provide a concrete example for "device path here"
Title: Re: udev oddness in microcore
Post by: johnsmith on February 23, 2014, 09:42:19 PM
/dev/sda
/dev/hda

basically any device that is populated by udev. so cdrom drives sg0 etc all should work
Title: Re: udev oddness in microcore
Post by: tinypoodle on February 23, 2014, 09:51:15 PM
Code: [Select]
udevadm info --query property --attribute-walk --name sda|grep -e serial -e model
Title: Re: udev oddness in microcore
Post by: Juanito on February 24, 2014, 03:02:48 AM
I noticed something like this before in a different context - tinycore uses an edited version of the set of rules that comes with the udev-173 package, so you probably need to use one or more of the original rules in full.
Title: Re: udev oddness in microcore
Post by: curaga on February 25, 2014, 02:13:56 PM
You can get disk models directly from /sys, but serials aren't exposed anywhere, so you need to query them via scsi somehow (full udev, or any other helper).
Title: Re: udev oddness in microcore
Post by: tinypoodle on February 25, 2014, 06:46:47 PM
Code: [Select]
sudo sh -c 'find /sys -type f -name serial|xargs cat'
seems to work for me.
Title: Re: udev oddness in microcore
Post by: curaga on February 26, 2014, 04:18:59 AM
I don't have SCSI serials there, only USB?
Title: Re: udev oddness in microcore
Post by: johnsmith on February 26, 2014, 06:18:16 AM
is it possible to get full udev for microcore?

I really only want it as backup if the scsi inquiry doesnt work, but I was just surprised that udev isnt fully functional
Title: Re: udev oddness in microcore
Post by: tinypoodle on February 26, 2014, 08:39:41 AM
I don't have SCSI serials there, only USB?

Indeed /dev/sda with which I tested as shown in prior posts is a USB device here, while no SCSI devices are connected.

I would not have expected such a difference in exposure.