mdev with hda's

Harald Becker ralda at gmx.de
Tue May 10 22:16:54 UTC 2011


 Hallo David!

> The script you provided does the exact same thing as "@env >>
> /tmp/parent2" (confirmed via output), so I'll include that at the
> bottom of this email.

Ok, you didn't gave the exact information I expected, but I'm going to
get an idea about your trouble ... (see below)

>> ... or in other word's: The only idea I got from your description is, it
>> can't be a a problem of mdev ... sorry ... so, give exact example,
>> please.
>
> No, what I'm saying is ...

Keep cool, I didn't expect you being an "idiot". That is the reason, I
asked for more information (was just satirical provocation with that
statement). As you *have* some kind of trouble, there *has to be* a
problem ... but not everybody use the same description for the same kind
of thing, and not every trouble origins at the expected place.

> it looks like it *is* a problem with mdev because *no* scripts are
> being called *at all*, (...)
> Until the output between the two types of devices become standard by
> mdev, I can't call any script as the information will be accessible to
> one, but not the other.

You are missing the fact, that mdev is not the only process in the
execution hierarchy and environment variables are passed trough from
parent to child processes. So the real problem needs indeed a bit more
of differentiating, which hasn't been revealed before you gave more
information!

... so lets clarify your problem first:

- Your trouble is *not* due to any differences in environment variable
passing between direct execution of 'env' in mdev or script ... that's
what I understood from the starting of your question.

- Your trouble is because of the differences in environment settings
between hda and sda devices ... am I right now?


... now some quick trouble analyzes:

- You are right, that output shows environment differences between hda
and sda (fact).

- Quick look into mdev  source shows, that only two environment
variables are set/modified by mdev itself. Those variables are MDEV and
SUBSYSTEM. Other variables get just passed on from the caller of mdev.
(fact - if I do not have tomatoes on my eyes)

- Investigation of your output about MDEV and SUBSYSTEM variables show
those variables are set correct for hda and sda devices. (fact - or I'm
wrong about principle of mdev operation)

- As mdev only modifies variables MDEV and SUBSYSTEM and those look
correct, your trouble doesn't look like wrong behavior of mdev. (right?)

- As environment shows major differences between hda and sda devices, we
need to look a bit closer, where do those differences come from. (right?)

- So who is the caller of mdev? If mdev is called as a hotplug handler,
the caller of mdev is the kernel ... or to be correct a kernel thread.

- And here we are at the point of difference. Depending on the kind of
device the hotplug handler (mdev) is called from different kernel
threads. (fact - as far as I understand kernel behavior)

- As mdev passes environment variables from it's calling parent and only
modifies the variables MDEV and SUBSYSTEM, the differences in
environment setting originate in different kernel threads. (right?)

- As this is the Busybox mailing list, the right place for mdev
questions, but the origin of different environment setup seam to come
from the differences in kernel threads, further questions need to be
forwarded to the Linux kernel guys.

Did I got that right now?


BTW: I told you about unreliability of device information extraction
from kernel. This is exactly one of those cases. Different type of
device and the kernel doesn't reliably provide the expected set of
informations. Here we have the difference between device types, but
formerly this information even changed for the same device between
kernel versions.

If anybody can tell about how to reliable get all that device
informations, someone should be able to modify mdev to reliable setup
all expected environment variables. Meanwhile it seams the best to me,
to keep on passing the kernel threads environment to the called hotplug
helper script. Which is what mdev does. The helper scripts needs to deal
with the differences in environment settings between device types.
That's why there exist different helper scripts for scsi, ata, usb
devices, etc. ... or big cases on those device types in an even
complexer helper script.

Sorry, that I can't provide a solution for your trouble.

--
Harald


More information about the busybox mailing list