[U-Boot] [PATCH v8 07/13] tools: add genboardscfg.py
Simon Glass
sjg at chromium.org
Wed Jul 30 17:38:29 CEST 2014
Hi Tom,
On 30 July 2014 16:22, Tom Rini <trini at ti.com> wrote:
> On Wed, Jul 30, 2014 at 04:12:09PM +0100, Simon Glass wrote:
>> Hi Tom,
>>
>> On 30 July 2014 15:07, Tom Rini <trini at ti.com> wrote:
>> > On Wed, Jul 30, 2014 at 02:08:19PM +0900, Masahiro Yamada wrote:
>> >
>> >> Now the primary data for each board is in Kconfig, defconfig and
>> >> MAINTAINERS.
>> >>
>> >> It is true boards.cfg is needed for MAKEALL and buildman and might be
>> >> useful to brouse all the supported boards in a single database.
>> >> But it would be painful to maintain the boards.cfg in sync.
>> >>
>> >> So, this is the solution.
>> >> Add a tool to generate the equivalent boards.cfg file based on
>> >> the latest Kconfig, defconfig and MAINTAINERS.
>> >>
>> >> We can keep all the functions of MAKEALL and buildman with it.
>> >>
>> >> The best thing would be to change MAKEALL and buildman for not
>> >> depending on boards.cfg in the future, but it would take some time.
>> > [snip]
>> >> +def get_make_cmd():
>> >> + """Get the command name of GNU Make."""
>> >> + try:
>> >> + make_cmd = subprocess.check_output([SHOW_GNU_MAKE])
>> >> + except subprocess.CalledProcessError:
>> >> + print >> sys.stderr, 'GNU Make not found'
>> >> + sys.exit(1)
>> >> + return make_cmd.rstrip()
>> >
>> > So subprocess.check_output comes from Python 2.7 and Ubuntu 10.04 ships
>> > with 2.6. This isn't a deal-breaker as I'm working on updating the two
>> > calls here now (and we'll set aside mailmapper, that's not going to be
>> > commonly used I think).
>>
>> We could use tools/patman/command.py's OutputOneLine().
>
> That feels like a lot of code to borrow, or should we be able to just
> import and use it? And would you mind reviewing the patch I posted that
> switches over to subprocess.Popen() ? Thanks!
Yes it is a lot of code. You can just import and borrow it so long as
it is available on the python path. See tools/buildman/buildman.py for
the code:
# Bring in the patman libraries
our_path = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(our_path, '../patman'))
I didn't see that patch you mention, will take a look.
Regards,
Simon
More information about the U-Boot
mailing list