[U-Boot] [RFC PATCH] genboardscfg.py: use Python2 from default path

Masahiro Yamada yamada.m at jp.panasonic.com
Tue Sep 30 10:58:21 CEST 2014


Hi Wolfgang,


On Tue, 30 Sep 2014 10:17:22 +0200
Wolfgang Denk <wd at denx.de> wrote:

> Instead of searching for Python2 in $PATH, use the one installed by
> the system (i. e. /usr/bin/python2).  This prevents failures like
> this:
> 
> -> ./MAKEALL m53evk
> Traceback (most recent call last):
>   File "tools/genboardscfg.py", line 19, in <module>
>     import fnmatch
> ImportError: No module named fnmatch
> Failed to generate boards.cfg
> 
> This happens for example with all but the most recent versions of
> Yocto based tool chains (inclusing all currently existing versions of
> the ELDK), which provide a python2 binary in SYSROOT/usr/bin/python2,
> but do not include the "fnmatch" module.

I'd like to regard the root cause of the problem
as ELDK missing fnmatch module.

I have no idea if fnmatch module is so special.


> By using the system installed Python interpreter, the user is able to
> install any missing modules himself, without need to patch and rebuild
> the whole tool chain.



I think '/usr/bin/env python' is a general strategy
to support various platforms where Python might not
be installed in /usr/bin directory.
(Buildman and Patman have already adopted this way.)


If necessary, I do not mind this change (as I only use Linux).

Though FreeBSD people (Jeroen) might be unhappy
because the standard installation path of Python
is '/usr/local/bin/python' on FreeBSD.

(OK. They can have a symbolic link  /usr/bin/python2 => /usr/local/bin/python2)



Best Regards
Masahiro Yamada



More information about the U-Boot mailing list