Bugfixes only, release on Friday the 30th.

Rob Landley rob at landley.net
Mon Jun 26 20:15:36 UTC 2006


On Monday 26 June 2006 2:49 pm, Paul Fox wrote:
>  > > I think the $MDEV variable is not so necessary (if you want to shrink
>  > > the code a little), since the $DEVPATH var is already passed to the
>  > > command executed and can be used to get the actual device name by
>  > > removing the prefix.
>  >
>  > DEVPATH is only set for hotplug events, not scanning with mdev -s.  It
>  > also turns "ln -s $MDEV cdrom" into "ln -s `echo $DEVPATH | sed
>  > 's at .*/@@'` cdrom" which is a lot clumsier.
>
> i know this is a detail in the greater scheme of this thread, but
> if you're using ash, then this:
>     ln -s ${DEVPATH##*/} cdrom
> is pretty painless.  doesn't work in msh, i'm afraid.

Yeah, but I just copied it to my pending folder to make it work in libbb.

So what user interface do people think mdev should have for shellouts?  (No 
guarantees I'll do it, but I'm asking so suggest away.)

At the very least, I'm leaning towards setting "ACTION=add" during scanning, 
so you can always test for that in the script.  The MDEV=name and the @ and $ 
styles of shellouts are optional and could be removed as unnecessary bloat, 
but removing MDEV means I have to set DEVPATH instead during scanning so it's 
not really a win (on top of ${DEVPATH##*/} being kind of ugly), and needing a 
single shell test for add/remove is likely to be larger than having C code do 
it in once place.

I'm still open to fixing it, but I can't think of a better solution.  (But 
this may be due to me being somewhat fried right now...)

Rob

P.S.  My recent brush with environment variables has me pondering a 
bb_setenv(name, value) that allocates the "name=value" string for you, and 
also tracks and frees it too if you re-set the same value, via a simple 
linked list.  bb_setenv(name, NULL) would clear the thing, possibly with a 
bb_clearenv(name) implemented as {bb_setenv(name, NULL); } to save the extra 
function parameter, if that turned out to be a win...
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list