summaryrefslogtreecommitdiff
path: root/tools/genboardscfg.py
Commit message (Collapse)AuthorAgeLines
* tools/genboardscfg.py: change shebang into /usr/bin/env python2Masahiro Yamada2014-08-28-1/+3
| | | | | | | | | This tool only works on python 2 (python 2.6 or lator). Change the shebang to make sure the script is run by python 2 and clearly say the supported version in the comment block. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* tools/genboardscfg.py: improve performanceMasahiro Yamada2014-08-28-6/+33
| | | | | | | | | | | | | | I guess some developers are already getting sick of this tool because it generally takes a few minites to generate the boards.cfg on a reasonable computer. The idea popped up on my mind was to skip Makefiles and to run script/kconfig/conf directly. This tool should become about 4 times faster. You might still not be satisfied, but better than doing nothing. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* tools/genboardscfg.py: check if the boards.cfg is up to dateMasahiro Yamada2014-08-28-2/+56
| | | | | | | | | | | | | | It looks silly to regenerate the boards.cfg even when it is already up to date. The tool should exit with doing nothing if the boards.cfg is newer than any of defconfig, Kconfig and MAINTAINERS files. Specify -f (--force) option to get the boards.cfg regenerated regardless its time stamp. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* tools/genboardscfg.py: fix minor problems on terminationMasahiro Yamada2014-08-28-66/+90
| | | | | | | | | | | | | | | | | | | This tool deletes the incomplete boards.cfg if it encounters an error or is is terminated by the user. I notice some problems even though they rarely happen. [1] The boards.cfg is removed if the program is terminated during __gen_boards_cfg() function but before boards.cfg is actually touched. In this case, the previous boards.cfg should be kept as it is. [2] If an error occurs while deleting the incomplete boards.cfg, the program throws another exception. This hides the privious exception and we will not be able to know the real cause. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* tools/genboardscfg.py: wait for unfinished subprocesses before error-outMasahiro Yamada2014-08-28-0/+3
| | | | | | | | | | | | | | | When an error occurs or the program is terminated by the user on the way, the destructer __del__ of class Slot is invoked and the work directories are removed. We have to make sure there are no subprocesses (in this case, "make O=<work_dir> ...") using the work directories before removing them. Otherwise the subprocess spits a bunch of error messages possibly causing more problems. Perhaps some users may get upset to see too many error messages. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* tools/genboardscfg.py: be tolerant of insane KconfigMasahiro Yamada2014-08-28-2/+9
| | | | | | | | | | The tools/genboardscfg.py expects all the Kconfig and defconfig are written correctly. Imagine someone accidentally has broken a board. Error-out just for one broken board is annoying for the other developers. Let the tool skip insane boards and continue processing. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* tools/genboardscfg.py: be tolerant of missing MAINTAINERSMasahiro Yamada2014-08-28-1/+11
| | | | | | | | | | | | | | tools/genboardscfg.py expects all the boards have MAINTAINERS. If someone adds a new board but misses to add its MAINTAINERS file, tools/genboardscfg.py fails to generate the boards.cfg file. It is annoying for the other developers. This commit allows tools/genboardscfg.py to display warning messages and continue processing even if some MAINTAINERS files are missing or have broken formats. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* tools/genboardscfg.py: ignore defconfigs starting with a dotMasahiro Yamada2014-08-28-0/+2
| | | | | | | | | | | | Kconfig in U-Boot creates a temporary file configs/.tmp_defconfig during processing "make <board>_defconfig". The temporary file might be left over for some reasons. Just in case, tools/genboardscfg.py should make sure to not read such garbage files. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* tools/genboardscfg.py: fix a bug of MAINTAINERS handlingMasahiro Yamada2014-08-28-1/+1
| | | | | | | | | This patch fixes a minor problem: If a block without "F: configs/*_defconfig" is followed by another block with "F: configs/*_defconfig", the maintainers from the former block are squashed into the latter. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* tools/genboardscfg.py: no exception if columns undetectableRoger Meier2014-08-21-3/+1
| | | | | | | | | | | | The existing terminalsize detection raised an exception on build server. Just removes the exception. This also deactivates the progress indicator. Remove a trainling whitespace. Signed-off-by: Roger Meier <roger@bufferoverflow.ch> CC: Masahiro Yamada <yamada.m@jp.panasonic.com> CC: Tom Rini <trini@ti.com>
* tools/genboardscfg.py: Do not output SPLCPU fieldMasahiro Yamada2014-08-21-4/+2
| | | | | | | | | | | | | | | | | | Prior to Kconfig, the CPU field of boards.cfg could optionally have ":SPLCPU", like "armv7:arm720t". (Actually this syntax was only used for Tegra platform.) Now it is not necessary at all because CPU is defined by CONFIG_SYS_CPU in Kconfig. For Tegra platform, the Kconfig option is described as follows: config SYS_CPU string default "arm720t" if SPL_BUILD default "armv7" if !SPL_BUILD Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* tools, scripts: refactor error-out statements of Python scriptsMasahiro Yamada2014-08-21-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In Python, sys.exit() function can also take an object other than an integer. If an integer is given to the argument, Python exits with the return code of it. If a non-integer argument is given, Python outputs it to stderr and exits with the return code of 1. That means, print >> sys.stderr, "Blah Blah" sys.exit(1) is equivalent to sys.exit("Blah Blah") The latter is a useful shorthand. Note: Some error messages in Buildman and Patman were output to stdout. But they should go to stderr. They are also fixed by this commit. This is a nice side effect. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* tools: add genboardscfg.pyMasahiro Yamada2014-07-30-0/+504
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. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>