[U-Boot] [PATCH] tools/netconsole: make a bit more robust and use ncb when possible

Mike Frysinger vapier at gentoo.org
Wed Sep 9 16:54:38 CEST 2009


On Wednesday 09 September 2009 10:32:44 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > > 2) "use ncb when possible"
> > >
> > > Here I really dislike the implementation of "when possible", which
> > > makes silent and undocumented assumptions about from which directory
> > > the script has to be run. I guess the "when possible" would almost
> > > always turn out to be false, so we might omit the patch alltogether,
> > > especially since it's also documented in "doc/README.NetConsole".
> > >
> > > If we add it, we should follow standard UNIX philosophy and assume
> > > that you set your PATH accordingly to reach the tools you want to use.
> >
> > since ncb is compiled whenever netconsole is enabled, and people
> > typically use this script with netconsole enabled, "when possible" tends
> > to be line up fairly often.  also, the broadcast aspect is pretty useful.
> >  i guess i could
> 
> Agreed. But the code is based on the assumption that your current
> directory when attaching to the console of a target is the U-Boot
> source directory. For me, this is definitely not always the case. I
> might as well have /tftpboot or solilar as cwd.

it takes multiple steps.  first, the cwd and then based on argv0.  so even if 
you're in a different place, if the script lives in the source tree when you 
execute it, it'll work fine.

> > make it search PATH, but the idea was to have things "just work" rather
> > than forcing people to install random utils into their PATH.
> 
> I rather have people intentionally install tools to some directory in
> their PATH or set PATH intentionally to some tool directory rather
> than have tools suddenly and mysteriously break just because I run
> them from a different location.

if they're both installed into the same place, then it'll still work.  i can 
add a PATH search in place of the cwd one as the argv0+PATH should handle both 
cases fine.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090909/e0e07d43/attachment.pgp 


More information about the U-Boot mailing list