summaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* tools/genboardscfg.py: pick up also commented maitainersMasahiro Yamada2014-09-241-0/+3
| | | | | | | | | | | | | | | | | | We are still keeping invalid email addressed in MAINTAINERS because they carry information. The problem is that scripts/get_maintainer.pl adds emails in the "M:" field including invalid ones. We want to comment out invalid email addresses in MAINTAINERS to prevent scripts/get_maintainer.pl from picking them up. On the other hand, we want to collect them for boards.cfg to know the last known maintainer of each board. This commit adjusts tools/genboardscfg.py to parse also the commented "M:" fields, which is useful for the next commit. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* tools/env: change stripping strategy to allow no-strippingThomas Petazzoni2014-09-241-6/+8
| | | | | | | | | | | | | | | | | | | | | When building the U-Boot tools for non-ELF platforms (such as Blackfin FLAT), since commit 79fc0c5f498c3982aa4740c273ab1a9255063d9c ("tools/env: cross-compile fw_printenv without setting HOSTCC"), the build fails because it tries to strip a FLAT binary, which does not make sense. This commit solves this by changing the stripping logic in tools/env/Makefile to be similar to the one in tools/Makefile. This logic continues to apply strip to the final binary, but does not abort the build if it fails, and does the stripping in place on the final binary. This allows the logic to work fine if stripping doesn't work, as it leaves the final binary untouched. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Sonic Zhang <sonic.zhang@analog.com> Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Reviewed-by: Sonic Zhang <sonic.zhang@analog.com>
* patman: Add a -m option to avoid copying the maintainersSimon Glass2014-09-213-5/+12
| | | | | | | | | The get_maintainers script is a useful default, but sometimes is copies too many people, or takes a long time to run. Add an option to disable it and update the README. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Fix the logic for the bloat commandSimon Glass2014-09-211-3/+3
| | | | | | | This check should now be done whatever mode buildman is running in, since we may be displaying information while building. Signed-off-by: Simon Glass <sjg@chromium.org>
* kconfiglib: change SPDX-License-Identifier to ISCMasahiro Yamada2014-09-171-1/+1
| | | | | | | | | Commit f219e01311b2 (tools: Import Kconfiglib) added SPDX GPL-2.0+ to this library by mistake. It should be ISC. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Ulf Magnusson <ulfalizer@gmail.com>
* Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini2014-09-172-1/+8
|\
| * imximage: Fix imximage IVT bug for EIM-NOR bootYe.Li2014-09-091-0/+7
| | | | | | | | | | | | | | | | | | | | | | The load region size of EIM-NOR are defined to 0. For this case, the parameter "imximage_init_loadsize" must be calculated. The imximage tool implements the calculation in the "imximage_generate" function, but the following function "imximage_set_header" resets the value and not calculate. This bug cause some fields of IVT head are not correct, for example the boot_data and DCD overlay the application area. Signed-off-by: Ye.Li <B37916@freescale.com>
| * tools: imximage: Fix the maximum DCD size for mx53/mx6Fabio Estevam2014-09-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to mx53 and mx6 reference manuals: "The maximum size of the DCD limited to 1768 bytes." As each DCD entry consists of 8 bytes, we have a total of 1768 / 8 = 221, and excluding the first entry, which is the header leads to 220 as the maximum number for DCD size. Reported-by: Jonas Karlsson <jonas.d.karlsson@gmail.com> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Nitin Garg <nitin.garg@freescale.com> Acked-by: Nitin Garg <nitin.garg@freescale.com>
* | tools/genboardscfg.py: improve performance more with KconfiglibMasahiro Yamada2014-09-161-440/+258
| | | | | | | | | | | | | | | | | | | | The idea of using Kconfiglib was given by Tom Rini. It allows us to scan lots of defconfigs very quickly. This commit also uses multiprocessing for further acceleration. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Suggested-by: Tom Rini <trini@ti.com> Acked-by: Simon Glass <sjg@chromium.org>
* | tools: Import KconfiglibMasahiro Yamada2014-09-161-0/+3799
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kconfiglib is the flexible Python Kconfig parser and library created by Ulf Magnusson. (https://github.com/ulfalizer/Kconfiglib) This commit imports kconfiglib.py from commit ce84c22e58fa59cb93679d4ead03c3cd1387965e, with ISC SPDX-License-Identifier. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com> Cc: Ulf Magnusson <ulfalizer@gmail.com> Cc: Wolfgang Denk <wd@denx.de>
* | buildman: fix typos of --dry-run help messageMasahiro Yamada2014-09-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | try run => dry run no nothing => do nothing "..." => '...' The last one is for consistency with the other option helps. Change-Id: I1d69047d1fae6ef095a18f69f44ee13c448db9b7 Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* | buildman: Create parent directories as necessaryThierry Reding2014-09-092-3/+6
| | | | | | | | | | | | | | | | | | When creating build directories also create parents as necessary. This fixes a failure when building a hierarchical branch (i.e. foo/bar). Signed-off-by: Thierry Reding <treding@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Tom Rini <trini@ti.com>
* | patman: make run results better visibleVadim Bendebury2014-09-091-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For an occasional user of patman some failures are not obvious: for instance when checkpatch reports warnings, the dry run still reports that the email would be sent. If it is not dry run, the warnings are shown on the screen, but it is not clear that the email was not sent. Add some code to report failure to send email explicitly. Tested by running the script on a patch with style violations, observed error messages in the script output. Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Doug Anderson <dianders@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
* | buildman: Ignore conflicting tagsSimon Glass2014-09-093-9/+13
| | | | | | | | | | | | | | | | | | | | | | Tags like Series-version are normally expected to appear once, and with a unique value. But buildman doesn't actually look at these tags. So ignore conflicts. This allows bulidman to build a branch containing multiple patman series. Reported-by: Steve Rae <srae@broadcom.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* | buildman: Permit branch names with an embedded '/'Simon Glass2014-09-092-5/+14
| | | | | | | | | | | | | | | | | | | | At present buildman naively uses the branch name as part of its directory path, which causes problems if the name has an embedded '/'. Replace these with '_' to fix the problem. Reported-by: Steve Rae <srae@broadcom.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* | buildman: Expand output test to cover directory prefixesSimon Glass2014-09-091-8/+46
| | | | | | | | | | | | | | | | Now that buildman supports removing the build directory prefix from output, add a test for it. Also ensure that output directories are removed when the test completes. Signed-off-by: Simon Glass <sjg@chromium.org>
* | buildman: Add additional functional testsSimon Glass2014-09-091-18/+306
| | | | | | | | | | | | | | This adds coverage of core features of the builder, including the command-line options which affect building. Signed-off-by: Simon Glass <sjg@chromium.org>
* | patman: Start with a clean series when neededSimon Glass2014-09-091-1/+3
| | | | | | | | | | | | | | | | | | | | | | For reasons that are not well-understood, GetMetaDataForList() can end up adding to an existing series even when it appears that it should be starting a new one. Change from using a default constructor parameter to an explicit one, to work around this problem. Signed-off-by: Simon Glass <sjg@chromium.org>
* | buildman: Provide an internal option to clean the outpur dirSimon Glass2014-09-091-1/+10
| | | | | | | | | | | | | | | | | | | | For testing it is useful to clean the output directory before running a test. This avoids a test interfering with the results of a subsequent test by leaving data around. Add this feature as an optional parameter to the control logic. Signed-off-by: Simon Glass <sjg@chromium.org>
* | buildman: Correct counting of build failures on retrySimon Glass2014-09-091-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | When a build is to be performed, buildman checks to see if it has already been done. In most cases it will not bother trying again. However, it was not reading the return code from the 'done' file, so if the result was a failure, it would not be counted. This depresses the 'failure' count stats that buildman prints in this case. Fix this bug by always reading the return code. Signed-off-by: Simon Glass <sjg@chromium.org>
* | buildman: Allow tests to have their own boardsSimon Glass2014-09-092-10/+31
| | | | | | | | | | | | | | Rather than reading boards.cfg, which may take time to generate and is not necessarily suitable for running tests, create our own list of boards. Signed-off-by: Simon Glass <sjg@chromium.org>
* | buildman: Avoid looking at config file or toolchains in testsSimon Glass2014-09-092-5/+29
| | | | | | | | | | | | | | | | These files may not exist in the environment, or may not be suitable for testing. Provide our own config file and our own toolchains when running tests. Signed-off-by: Simon Glass <sjg@chromium.org>
* | buildman: Set up bsettings outside the control moduleSimon Glass2014-09-092-1/+2
| | | | | | | | | | | | | | Move the bsettings code back to the main buildman.py file, so we can do something different when testing. Signed-off-by: Simon Glass <sjg@chromium.org>
* | buildman: Add a functional testSimon Glass2014-09-094-18/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | Buildman currently lacks testing in many areas, including its use of git, make and many command-line flags. Add a functional test which covers some of these areas. So far it does a fake 'build' of all boards for the current source tree. This version reads the real ~/.buildman and boards.cfg files. Future work will improve this. Signed-off-by: Simon Glass <sjg@chromium.org>
* | patman: Provide a way to intercept commands for testingSimon Glass2014-09-091-0/+20
| | | | | | | | | | | | | | | | | | | | Add a test point for the command module. This allows tests to emulate the execution of commands. This provides more control (since we can make the fake 'commands' do whatever we like), makes it faster to write tests since we don't need to set up as much environment, and speeds up test execution. Signed-off-by: Simon Glass <sjg@chromium.org>
* | buildman: Move full help code into the control moduleSimon Glass2014-09-092-6/+8
| | | | | | | | | | | | | | There is no good reason to keep this code separate. Move it into control.py so it is easier to test. Signed-off-by: Simon Glass <sjg@chromium.org>
* | buildman: Move the command line code into its own fileSimon Glass2014-09-092-71/+87
| | | | | | | | | | | | | | | | We want to be able to issue parser commands from within buildman for test purposes. Move the parser code into its own file so we don't end up needing the buildman and test modules to reference each other. Signed-off-by: Simon Glass <sjg@chromium.org>
* | patman: RunPipe() should not pipe stdout/stderr unless askedSimon Glass2014-09-092-3/+7
| | | | | | | | | | | | | | RunPipe() currently pipes the output of stdout and stderr to a pty, but this is not the intended behaviour. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
* | buildman: Enhance basic test to check summary outputSimon Glass2014-09-091-5/+96
| | | | | | | | | | | | | | | | Adjust the basic test so that it checks all console output. This will help to ensure that the builder is behaving correctly with printing summary information. Signed-off-by: Simon Glass <sjg@chromium.org>
* | buildman: Send builder output through a function for testingSimon Glass2014-09-091-28/+30
| | | | | | | | | | | | | | To allow us to verify the builder's console output, send it through a function which can collect it when running in test mode. Signed-off-by: Simon Glass <sjg@chromium.org>
* | patman: Add a way of recording terminal output for testingSimon Glass2014-09-091-0/+72
| | | | | | | | | | | | | | | | When running unit tests we don't want output to go to the terminal. Provide a way of collecting it so that it can be examined by test code later. Signed-off-by: Simon Glass <sjg@chromium.org>
* | patman: Fix detection of git versionSimon Glass2014-09-051-0/+2
| | | | | | | | | | | | | | A missing 'global' declaration means that this feature does not currently work. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
* | buildman: Separate out display of warnings and errorsSimon Glass2014-09-052-23/+91
| | | | | | | | | | | | | | | | | | | | | | Some boards unfortunately build with warnings and it is useful to be able to easily distinguish the warnings from the errors. Use a simple pattern match to categorise gcc output into warnings and errors, and display each separately. New warnings are shown in magenta (with a w+ prefix) and fixed warnings are shown in yellow with a w- prefix. Signed-off-by: Simon Glass <sjg@chromium.org>
* | buildman: Add an option to show which boards caused which errorsSimon Glass2014-09-054-13/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a -l option to display a list of offending boards against each error/warning line. The information will be shown in brackets as below: 02: wip sandbox: + sandbox arm: + seaboard +(sandbox) arch/sandbox/cpu/cpu.c: In function 'timer_get_us': +(sandbox) arch/sandbox/cpu/cpu.c:40:9: warning: unused variable 'i' [-Wunused-variable] +(seaboard) board/nvidia/seaboard/seaboard.c: In function 'pin_mux_mmc': +(seaboard) board/nvidia/seaboard/seaboard.c:36:9: warning: unused variable 'fred' [-Wunused-variable] +(seaboard) int fred; +(seaboard) ^ Signed-off-by: Simon Glass <sjg@chromium.org>
* | buildman: Remove the directory prefix from each error lineSimon Glass2014-09-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The full path is long and also includes buildman private directories. Clean this up, so that only a relative U-Boot path is shown. This will change warnings like these: /home/sjg/c/src/third_party/u-boot/buildman5/.bm-work/00/arch/sandbox/cpu/cpu.c: In function 'timer_get_us': /home/sjg/c/src/third_party/u-boot/buildman5/.bm-work/00/arch/sandbox/cpu/cpu.c:40:9: warning: unused variable 'i' [-Wunused-variable] /home/sjg/c/src/third_party/u-boot/files/arch/sandbox/cpu/cpu.c: In function 'timer_get_us': /home/sjg/c/src/third_party/u-boot/files/arch/sandbox/cpu/cpu.c:40:9: warning: unused variable 'i' [-Wunused-variable] to: arch/sandbox/cpu/cpu.c: In function 'timer_get_us': arch/sandbox/cpu/cpu.c:40:9: warning: unused variable 'i' [-Wunused-variable] Signed-off-by: Simon Glass <sjg@chromium.org>
* | buildman: Implement an option to exclude boards from the buildSimon Glass2014-09-054-8/+41
| | | | | | | | | | | | | | | | | | | | | | | | Some boards are known to be broken and it is convenient to be able to exclude them from the build. Add an --exclude option to specific boards to exclude. This uses the same matching rules as the normal 'include' arguments, and is a comma- separated list of regular expressions. Suggested-by: York Sun <yorksun@freescale.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* | buildman: Allow make-flags variables to include '-' and '_'Simon Glass2014-09-052-2/+4
| | | | | | | | | | | | | | | | These characters are commonly used in variables, so permit them. Also document the permitted characters. Reported-by: Tom Rini <trini@ti.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* | buildman: Set the return code to indicate build resultSimon Glass2014-09-054-3/+20
| | | | | | | | | | | | | | | | When buildman finds errors/warnings when building, set the return code to indicate this. Suggested-by: York Sun <yorksun@freescale.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* | patman: Avoid changing the order of tagsSimon Glass2014-09-051-13/+1
| | | | | | | | | | | | | | | | | | | | patman collects tags that it sees in the commit and places them nicely sorted at the end of the patch. However, this is not really necessary and in fact is apparently not desirable. Suggested-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* | patman: Use --no-pager' to stop git from forking a pagerSimon Glass2014-09-051-1/+1
| | | | | | | | | | | | | | | | In a headless environment the pager can apparently hang. We don't want a pager anyway so let's request that none be used. Reported-by: Tom Rini <trini@ti.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* | patman: Remove the -a optionSimon Glass2014-09-052-95/+0
| | | | | | | | | | | | | | | | | | It seems that this is no longer needed, since checkpatch.pl will catch whitespace problems in patches. Also the option is not widely used, so it seems safe to just remove it. Suggested-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* | patman: Correct unit tests to run correctlySimon Glass2014-09-054-14/+22
| | | | | | | | | | | | | | | | | | | | It seems that doctest behaves differently now, and some of the unit tests do not run. Adjust the tests to work correctly. ./tools/patman/patman --test <unittest.result.TestResult run=10 errors=0 failures=0> Signed-off-by: Simon Glass <sjg@chromium.org>
* | patman: Fix indentation in terminal.pySimon Glass2014-09-051-53/+55
|/ | | | | | | This code came from a different project with 2-character indentation. Fix it for U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org>
* tools/genboardscfg.py: change shebang into /usr/bin/env python2Masahiro Yamada2014-08-281-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-281-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-281-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-281-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-281-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-281-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-281-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>
OpenPOWER on IntegriCloud