mdev with hda's

David Henderson dhenderson at digital-pipe.com
Tue May 10 19:30:11 UTC 2011


On 05/10/2011 02:30 PM, Harald Becker wrote:
>   Hallo David!
>
>> Hey Harald, currently I'm not using my script as shown by the above
>> mdev.conf lines.  I won't even begin to troubleshoot it until the mdev
>> environment exporting can get resolved (as my script uses several
>> variables from it).  Any ideas why it's being exported incorrectly?
> Before we start another UUID/serial number story, can you give an exact
> example which script fails in exactly which way and how it is called ...
> else any unspecific idea can lead into the wrong direction ...

lol yeah we don't want another chapter of the same story. :)  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.

> ... 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 it looks like it *is* a problem with mdev because 
*no* scripts are being called *at all*, just the environment being 
output by mdev into a text file.  Unfortunately this outputted text file 
is different based on internal (problematic) vs external (no problems) 
devices.  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.

> ... or try out my short example and give output of comparable
> /tmp/parent and /tmp/parent2
>
> ... how else shall we do diagnosis to resolve a trouble, without exact
> facts?

See the below text files for the requested output.

> --
> Harald
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox


first, let's get the 'env' output called from the bash prompt so you can 
see that mdev is giving the wrong environment variables for hda's:

root at dev_pc:~# env
TERM=linux
SHELL=/bin/bash
QUIET=>/dev/null
SSH_CLIENT=192.168.0.166 45609 22
GUIPORT=81
OLDPWD=/tmp
OS=XiniX
LANIP=
SSH_TTY=/dev/pts/0
USER=root
LD_LIBRARY_PATH=/lib:/home/root/.lib:/home/.everyone/.lib
BOOTMODE=normal
ED=EE
SUPPORT=XYZ
WANIP=
MAIL=/var/mail/root
PATH=/bin:/sbin
PWD=/home/root
TZ=EST5EDT
GUISERVER=127.0.0.1
ADMAIL=support at XYZ.com
SHLVL=1
HOME=/home/root
LOGNAME=root
SVDIR=/var/run/services
PIDDIR=/var/run/pids
SSH_CONNECTION=192.168.0.166 45609 192.168.0.135 22
VER=0.5
ADMIN=Dave
DEBUG=0
_=/bin/env




contents of /tmp/parent:
(uses mdev rule: (hd[a-z])              root:users      660     @env >> 
/tmp/parent)

root at dev_pc:/tmp# cat parent
TERM=linux
SUBSYSTEM=block
GUIPORT=81
OS=XiniX
USER=root
LD_LIBRARY_PATH=/lib:/home/root/.lib:/home/.everyone/.lib
bootmode=normal
ED=EE
PATH=/bin:/sbin
SUPPORT=XYZ
vga=0x314
_=/bin/env
PWD=/tmp
TZ=EST5EDT
GUISERVER=127.0.0.1
ADMAIL=support at XYZ.com
HOME=/home/root
SHLVL=3
MDEV=hdc
PIDDIR=/var/run/pids
SVDIR=/var/run/services
VER=0.5
ADMIN=Dave




contents of /tmp/child:
(uses mdev rule: (hd[a-z])([0-9]+)       root:users      660     @env >> 
/tmp/child)

root at dev_pc:/tmp# cat child
TERM=linux
SUBSYSTEM=block
GUIPORT=81
OS=XiniX
USER=root
LD_LIBRARY_PATH=/lib:/home/root/.lib:/home/.everyone/.lib
bootmode=normal
ED=EE
PATH=:/bin:/sbin
SUPPORT=XYZ
vga=0x314
_=/bin/env
PWD=/tmp
TZ=EST5EDT
GUISERVER=127.0.0.1
ADMAIL=support at XYZ.com
HOME=/home/root
SHLVL=3
MDEV=hdc1
PIDDIR=/var/run/pids
SVDIR=/var/run/services
VER=0.5
ADMIN=Dave




Now lets take a look at correct mdev environment output from sda's:


contents of /tmp/parent2:
(uses mdev rule: (sd[a-z])              root:users      660     @env >> 
/tmp/parent2)

root at dev_pc:/tmp# cat parent2
DEVTYPE=disk
SUBSYSTEM=block
DEVPATH=/devices/pci0000:00/0000:00:10.3/usb1/1-2/1-2:1.0/host1/target1:0:0/1:0:0:0/block/sda
MINOR=0
PATH=/sbin:/bin:/usr/sbin:/usr/bin
ACTION=add
PWD=/dev
MAJOR=8
DEVNAME=sda
SHLVL=1
HOME=/
MDEV=sda
SEQNUM=508
_=/bin/env




contents of /tmp/child2:
(uses mdev rule: (sd[a-z])([0-9]+)       root:users      660     @env >> 
/tmp/child2)

root at dev_pc:/tmp# cat child2
DEVTYPE=partition
SUBSYSTEM=block
DEVPATH=/devices/pci0000:00/0000:00:10.3/usb1/1-2/1-2:1.0/host1/target1:0:0/1:0:0:0/block/sda/sda2
MINOR=2
PATH=/sbin:/bin:/usr/sbin:/usr/bin
ACTION=add
PWD=/dev
MAJOR=8
DEVNAME=sda2
SHLVL=1
HOME=/
MDEV=sda2
SEQNUM=510
_=/bin/env



As you can see the differences in output between hda's and sda's is 
vastly different.  With hda's, mdev appears to be outputting the bash 
environment with the additional MDEV and SUBSYSTEM variables, which is 
not what should be happening.  The sda's mdev output is correct.  Once 
again, this is *not* a problem with a script as *none* are being 
called.  Any further help would greatly be appreciated.

Dave


More information about the busybox mailing list