hi there,

i am trying to trick /etc/hotplug/attach into mounting
the sd card from my android smartphone.

the principal problem seems to be that at the time
of e.g. sd2 showing up, the disklabel is not ready yet.
(maybe the delay is the time android needs to unmount it)

as no disklabel is ready, 'label:' is also empty and nothing
happens.

so i set out to try make a small sleep loop until
disklabel can return the label instead of
"ioctl DIOCGDINFO: Input/output error"

but it seems like disklabel does not really differentiate
between failures.

$ sudo disklabel sd2
disklabel: ioctl DIOCGDINFO: Input/output error
tyin:~$ echo $?
4

$ sudo disklabel sd3
disklabel: /dev/rsd3c: Device not configured
$ echo $?
4

also, i could not find the return codes in the disklabel
man page.  is there a way to differentiate between the
error situations?  i dont want to loop forever...


with all these usb thingies, would it make sense
to have a disklabel parameter to return just the label/duid
for scripting purposes?

-f
-- 
the greatest hate springs from the greatest love.

Reply via email to