WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: udev oddness in microcore  (Read 5579 times)

Offline johnsmith

  • Newbie
  • *
  • Posts: 11
udev oddness in microcore
« 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?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: udev oddness in microcore
« Reply #1 on: February 23, 2014, 08:52:14 PM »
Try hdparm.

Offline johnsmith

  • Newbie
  • *
  • Posts: 11
Re: udev oddness in microcore
« Reply #2 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.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: udev oddness in microcore
« Reply #3 on: February 23, 2014, 09:15:50 PM »
Install the udev-lib extension.

Subject of thread appears to be rather misleading then.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline johnsmith

  • Newbie
  • *
  • Posts: 11
Re: udev oddness in microcore
« Reply #4 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

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: udev oddness in microcore
« Reply #5 on: February 23, 2014, 09:38:44 PM »
Please provide a concrete example for "device path here"
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline johnsmith

  • Newbie
  • *
  • Posts: 11
Re: udev oddness in microcore
« Reply #6 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

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: udev oddness in microcore
« Reply #7 on: February 23, 2014, 09:51:15 PM »
Code: [Select]
udevadm info --query property --attribute-walk --name sda|grep -e serial -e model
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: udev oddness in microcore
« Reply #8 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.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: udev oddness in microcore
« Reply #9 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).
The only barriers that can stop you are the ones you create yourself.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: udev oddness in microcore
« Reply #10 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.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: udev oddness in microcore
« Reply #11 on: February 26, 2014, 04:18:59 AM »
I don't have SCSI serials there, only USB?
The only barriers that can stop you are the ones you create yourself.

Offline johnsmith

  • Newbie
  • *
  • Posts: 11
Re: udev oddness in microcore
« Reply #12 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

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: udev oddness in microcore
« Reply #13 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.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)