summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2021-07-05Docker/CI: Update to "focal" and latest buildTom Rini
Move us up to being based on Ubuntu 20.04 "focal" and the latest tag from Ubuntu for this release. For this, we make sure that "python" is now python3 but still include python2.7 for the rx51 qemu build as that is very old and does not support python3. Signed-off-by: Tom Rini <[email protected]>
2021-07-05tools: docker: Install a readable kernel for libguestfs-toolsAlper Nebi Yasak
The filesystem and EFI (capsule and secure boot) test setups try to use guestmount and virt-make-fs respectively to prepare disk images to run tests on. However, these libguestfs tools need a kernel image and fail with the following message (revealed in debug/trace mode) if it can't find one: supermin: failed to find a suitable kernel (host_cpu=x86_64). I looked for kernels in /boot and modules in /lib/modules. If this is a Xen guest, and you only have Xen domU kernels installed, try installing a fullvirt kernel (only for supermin use, you shouldn't boot the Xen guest with it). This failure then causes these tests to be skipped in CIs. Install a kernel package in the Docker containers so the CIs can run these tests with libguestfs tools again (assuming the container is run with necessary host devices and privileges). As this kernel would be only used for virtualization, we can use the kernel package specialized for that. On Ubuntu systems kernel images are not readable by non-root users, so explicitly add read permissions with chmod as well. Signed-off-by: Alper Nebi Yasak <[email protected]> Acked-by: Heinrich Schuchardt <[email protected]>
2021-06-11tools: k3_fit_atf: add DM binary to the FIT imageTero Kristo
Add DM (device manager) firmware image to the fit image that is loaded by R5 SPL. This is needed with the HSM rearch where the firmware allocation has been changed slightly. Signed-off-by: Tero Kristo <[email protected]> Signed-off-by: Tero Kristo <[email protected]>
2021-06-09tools: k3_fit_atf: Add support for providing ATF load address using a ↵Aswath Govindraju
Kconfig symbol Add support for providing ATF load address with a Kconfig symbol. Signed-off-by: Aswath Govindraju <[email protected]> Signed-off-by: Lokesh Vutla <[email protected]> Reviewed-by: Suman Anna <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-05-19binman: Support packaging U-Boot for scenarios like OF_BOARD or OF_PRIOR_STAGEBin Meng
For scenarios like OF_BOARD or OF_PRIOR_STAGE, no device tree blob is provided in the U-Boot build phase hence the binman node information is not available. In order to support such use case, a new Kconfig option BINMAN_STANDALONE_FDT is introduced, to tell the build system that a device tree blob containing binman node is explicitly required when using binman to package U-Boot. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2021-05-19binman: Add support for RISC-V OpenSBI fw_dynamic blobBin Meng
Add an entry for RISC-V OpenSBI's 'fw_dynamic' firmware payload. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Rick Chen <[email protected]> Reviewed-by: Rick Chen <[email protected]>
2021-05-19binman: test: Rename 172_fit_fdt.dts to 170_fit_fdt.dtsBin Meng
Currently there are 2 binman test cases using the same 172 number. It seems that 172_fit_fdt.dts was originally named as 170_, but commit c0f1ebe9c1b9 ("binman: Allow selecting default FIT configuration") changed its name to 172_ for no reason. Let's change it back. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2021-05-19binman: Correct the comment for ATF entry typeBin Meng
This is wrongly referring to Intel ME, which should be ATF. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2021-05-19binman: Correct '-a' description in the docBin Meng
It needs a space around '-a'. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Rick Chen <[email protected]>
2021-04-29buildman: Use bytes for the environmentSimon Glass
At present we sometimes see problems in gitlab where the environment has 0x80 characters or sequences which are not valid UTF-8. Avoid this by using bytes for the environment, both internal to buildman and when writing out the 'env' file. Add a test to make sure this works as expected. Reported-by: Marek Vasut <[email protected]> Fixes: e5fc79ea718 ("buildman: Write the environment out to an 'env' file") Signed-off-by: Simon Glass <[email protected]>
2021-04-29buildman: Handle exceptions in threads gracefullySimon Glass
There have been at least a few cases where an exception has occurred in a thread and resulted in buildman hanging: running out of disk space and getting a unicode error. Handle these by collecting a list of exceptions, printing them out and reporting failure if any are found. Add a test for this. Signed-off-by: Simon Glass <[email protected]>
2021-04-29buildman: Use common code to send an resultSimon Glass
At present the code to report a build result is duplicated. Put it in a common function to avoid this. Signed-off-by: Simon Glass <[email protected]>
2021-04-29buildman: Tidy up a few commentsSimon Glass
Add some function comments which are missing, or missing arguments. Signed-off-by: Simon Glass <[email protected]>
2021-04-29binman: Support adding sections to FMAPsSimon Glass
When used with hierarchical images, use the Chromium OS convention of adding a section before all the subentries it contains. Signed-off-by: Simon Glass <[email protected]>
2021-04-29binman: Tweak implementation of fmapSimon Glass
Use an interator in two of the fmap tests so it is easier to add new items. Also check the name first since that is the first indication that something is wrong. Use a variable for the expected size of the fmap to avoid repeating the code. Signed-off-by: Simon Glass <[email protected]>
2021-04-29patman: Parse checkpatch by message instead of by lineEvan Benn
Parse each empty-line-delimited message separately. This saves having to deal with all the different line content styles, we only care about the header ERROR | WARNING | NOTE... Also make checkpatch print line information for a uboot specific warning. Signed-off-by: Evan Benn <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2021-04-29patman: Assume we always have pygit2 for testsTom Rini
Given that we have tests that require pygit2 and it can be installed like any other python module, fail much more loudly if it is missing. Cc: Simon Glass <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2021-04-29dtoc: Correct dtoc output when testingSimon Glass
At present each invocation of run_steps() updates OUTPUT_FILES_COMMON, since it does not make a copy of the dict. This is fine for a single invocation, but for tests, run_steps() is invoked many times. As a result it may include unwanted items from the previous run, if it happens that a test runs twice on the same CPU. The problem has not been noticied previously, as there are few enough tests and enough CPUs that is is rare for the 'wrong' combination of tests to run together. Fix this by making a copy of the dict, before updating it. Update the tests to suit, taking account of the files that are no-longer generated. With this fix, we no-longer generate files which are not needed for a particular state of OF_PLATDATA_INST, so the check_instantiate() function is not needed anymore. It has become dead code and so fails the code-coverage test (dtoc -T). Remove it. Signed-off-by: Simon Glass <[email protected]>
2021-04-29binman: Correct testSplNoDtb() and Tpl alsoSimon Glass
These two tests require an ELF image so that symbol information can be written into the SPL/TPL binary. At present they rely on other tests having set it up first, but every test must run independently. This can cause occasional errors in CI. Fix this by setting up the required files, as other tests do. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2021-04-14mkimage: Add a 'keyfile' argument for image signingAlexandru Gagniuc
It's not always desirable to use 'keydir' and some ad-hoc heuristics to get the filename of the signing key. More often, just passing the filename is the simpler, easier, and logical thing to do. Since mkimage doesn't use long options, we're slowly running out of letters. I've chosen '-G' because it was available. Signed-off-by: Alexandru Gagniuc <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2021-04-14lib: Add support for ECDSA image signingAlexandru Gagniuc
mkimage supports rsa2048, and rsa4096 signatures. With newer silicon now supporting hardware-accelerated ECDSA, it makes sense to expand signing support to elliptic curves. Implement host-side ECDSA signing and verification with libcrypto. Device-side implementation of signature verification is beyond the scope of this patch. Signed-off-by: Alexandru Gagniuc <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2021-04-14lib/rsa: Make fdt_add_bignum() available outside of RSA codeAlexandru Gagniuc
fdt_add_bignum() is useful for algorithms other than just RSA. To allow its use for ECDSA, move it to a common file under lib/. The new file is suffixed with '-libcrypto' because it has a direct dependency on openssl. This is due to the use of the "BIGNUM *" type. Signed-off-by: Alexandru Gagniuc <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2021-04-14lib: Rename rsa-checksum.c to hash-checksum.cAlexandru Gagniuc
rsa-checksum.c sontains the hash_calculate() implementations. Despite the "rsa-" file prefix, this function is useful for other algorithms. To prevent confusion, move this file to lib/, and rename it to hash-checksum.c, to give it a more "generic" feel. Signed-off-by: Alexandru Gagniuc <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2021-04-12moveconfig.py: add to the "do not process" listTrevor Woerner
Skip the processing of *.aml and *.dat files while iterating through the source in order to process header files. Signed-off-by: Trevor Woerner <[email protected]>
2021-04-12checkpatch: Add warnings for using strn(cat|cpy)Sean Anderson
strn(cat|cpy) has a bad habit of not nul-terminating the destination, resulting in constructions like strncpy(foo, bar, sizeof(foo) - 1); foo[sizeof(foo) - 1] = '\0'; However, it is very easy to forget about this behavior and accidentally leave a string unterminated. This has shown up in some recent coverity scans [1, 2] (including code recently touched by yours truly). Fortunately, the guys at OpenBSD came up with strl(cat|cpy), which always nul-terminate strings. These functions are already in U-Boot, so we should encourage new code to use them instead of strn(cat|cpy). [1] https://lists.denx.de/pipermail/u-boot/2021-March/442888.html [2] https://lists.denx.de/pipermail/u-boot/2021-January/438073.html Signed-off-by: Sean Anderson <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2021-04-10tools/mkeficapsule: improve online helpHeinrich Schuchardt
Show short arguments along with long arguments in online help: $ tools/mkeficapsule -h Usage: mkeficapsule [options] <output file> Options: -f, --fit <fit image> new FIT image file -r, --raw <raw image> new raw image file -i, --index <index> update image index -I, --instance <instance> update hardware instance -K, --public-key <key file> public key esl file -D, --dtb <dtb file> dtb file -O, --overlay the dtb file is an overlay -h, --help print a help message Signed-off-by: Heinrich Schuchardt <[email protected]>
2021-04-08imx6: icorem6: chmod 644 enigcam.bmpHeinrich Schuchardt
Bitmap files should not be executable. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Michael Trimarchi <[email protected]>
2021-04-08tools: imx image: fix write warningPeng Fan
Fix the warning by set the variable zero to uint64_t "warning: ‘write’ reading 5 bytes from a region of size 4" Signed-off-by: Peng Fan <[email protected]>
2021-04-07tools: Integrate the Dockerfile used for CITom Rini
Integrate the Dockerfile from https://source.denx.de/u-boot/gitlab-ci-runner.git as of commit bc6130d572f1 ("Dockerfile: Remove high UID/GID") and introduce a short rST on how to build the container. Cc: Heinrich Schuchardt <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2021-04-06moveconfig: Handle binary files cleanlySimon Glass
Some files are not actually source code and thus can produce unicode errors. Report this and continue. Signed-off-by: Simon Glass <[email protected]>
2021-04-06dtoc: Improve handling of reg propertiesSimon Glass
This existing code assumes that a reg property is larger than one cell, but this is not always the case. Fix this assumption. Also if a node's parent is missing the #address-cells and #size-cells properties we use 2 as a default for each. But this should not happen in practice. More likely the properties were removed for SPL due to there being no 'u-boot,dm-pre-reloc' property, or similar. Add a warning for this as the failure can be very confusing. Signed-off-by: Simon Glass <[email protected]>
2021-04-06dtoc: Adjust detection of 64-bit propertiesSimon Glass
At present an empty size is considered to be a 64-bit value. This does not seem useful and wastes space. Limit the 64-bit detection to where one or both of the addr/size is two cells or more. Signed-off-by: Simon Glass <[email protected]>
2021-04-06dtoc: Show driver warnings once at the endSimon Glass
At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <[email protected]>
2021-04-06buildman: Add an encoding to the out-env fileSimon Glass
The environment may contain some unicode characters. At least that is what seemed to happen on one commit: Building current source for 1 boards (0 threads, 64 jobs per thread) 0 0 0 /1 -1 (starting) Traceback (most recent call last): File ".../tools/buildman/buildman", line 64, in <module> ret_code = control.DoBuildman(options, args) File "tools/buildman/control.py", line 372, in DoBuildman options.keep_outputs, options.verbose) File ".../tools/buildman/builder.py", line 1704, in BuildBoards results = self._single_builder.RunJob(job) File ".../tools/buildman/builderthread.py", line 526, in RunJob self._WriteResult(result, job.keep_outputs, job.work_in_output) File ".../tools//buildman/builderthread.py", line 349, in _WriteResult print('%s="%s"' % (var, env[var]), file=fd) UnicodeEncodeError: 'ascii' codec can't encode characters in position 311-312: ordinal not in range(128) The problem defies repetition with any change at all to buildman. But let's set an encoding in any case. Signed-off-by: Simon Glass <[email protected]>
2021-04-06patman: Continue on if warnings are found outside a commitSimon Glass
While we cannot know which commit the warning relates to, this should not be fatal. Print the warning and carry on. Signed-off-by: Simon Glass <[email protected]>
2021-03-29Merge tag 'v2021.04-rc5' into nextTom Rini
Prepare v2021.04-rc5
2021-03-28Support building on macOS/arm64Jessica Clarke
On Arm-based Macs, -no_pie is ignored and gives a linker warning. Moreover, the build falls over with: ld: Absolute addressing not allowed in arm64 code but used in '_image_type_ptr_aisimage' referencing '_image_type_aisimage' for dumpimage and mkimage, since we put data structs in text sections not data sections and so cannot have dynamic relocations. Instead, move the sections to __DATA and drop disabling PIE. Signed-off-by: Jessica Clarke <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2021-03-27dtoc: Add new check that offsets are correctSimon Glass
Add a few more internal checks to make sure offsets are correct, before updating the dtb. To make this easier, update the functions which add a property to return that property,. Signed-off-by: Simon Glass <[email protected]>
2021-03-27dtoc: Support adding subnodes alongside existing onesSimon Glass
So far we have only needed to add subnodes to empty notds, so have not had to deal with ordering. However this feature is needed for binman's expanded nodes, since there may be another node in the same section. While libfdt adds new properties after existing properties, it adds new subnodes before existing subnodes. This means that we must reorder the nodes in the cached version, so that the ordering remains consistent. Update the sync implementation to sync existing subnodes first, then add new ones, then tidy up the ordering in the cached version. Update the test to cover this behaviour. Also improve the comment about property syncing while we are here. Signed-off-by: Simon Glass <[email protected]>
2021-03-27dtoc: Add a subnode test for multiple nodesSimon Glass
Add a new test that adds a subnode alongside an existing one, as well as adding properties to a subnode. This will expand to adding multiple subnodes in future patches. Put a node after the one we are adding to so we can check that things sync correctly. The testAddNode() test should be in the TestNode class since it is a node test, so move it. Signed-off-by: Simon Glass <[email protected]>
2021-03-27dtoc: Tweak ordering of fdt-offsets refreshingSimon Glass
Once the tree has been synced, thus potentially moving things around in the fdt, we set _cached_offsets to False so that a refresh will happen next time a property is accessed. This 'lazy' refresh doesn't really save much time, since refresh is a very fast operation, just a single walk of the tree. Also, having the refresh happen in the bowels of property access it makes it harder to figure out what is going on. Simplify the code by always doing a refresh before and after a sync. Set _cached_offsets to True immediately after this, in the Refresh() function, since this makes more sense than doing it in the caller. Signed-off-by: Simon Glass <[email protected]>
2021-03-27dtoc: Tidy up property-offset handlingSimon Glass
If a property does not yet have an offset, then that means it exists in the cache'd fdt but has not yet been synced back to the flat tree. Use the dirty flag for this so we don't need to check the offset too. Improve the comments for Prop and Node to make it clear what an offset of None means. Also clear the dirty flag after the property is synced. Signed-off-by: Simon Glass <[email protected]>
2021-03-27dtoc: Improve internal error for Refresh()Simon Glass
Add the node name too so it is easy to see which node failed. Signed-off-by: Simon Glass <[email protected]>
2021-03-27binman: Support default alignment for sectionsSimon Glass
Sometimes it is useful to specify the default alignment for all entries in a section, such as when word-alignment is necessary, for example. It is tedious and error-prone to specify this individually for each section. Add a property to control this for a section. Signed-off-by: Simon Glass <[email protected]>
2021-03-27binman: Support obtaining section contents immediatelySimon Glass
Generally the content of sections is not built until the final assembly of the image. This is partly to avoid wasting time, since the entries within sections may change multiple times as binman works through its various stages. This works quite well since sections exist in a strict hierarchy, so they can be processed in a depth-first manner. However the 'collection' entry type does not have this luxury. If it contains a section within its 'content' list, then it must produce the section contents, if available. That section is typically a sibling node, i.e. not part oc the collection's hierarchy. Add a new 'required' argument to section.GetData() to support this. When required is True, any referenced sections are immediately built. If this is not possible (because one of the subentries does not have its data yet) then an error is produced. The test for this uses a 'collection' entry type, referencing a section as its first member. This forces a call to _BuildSectionData() with required set to False, at first, then True later, when the image is assembled. Signed-off-by: Simon Glass <[email protected]>
2021-03-27binman: Add support for a collection of entriesSimon Glass
The vblock entry type includes code to collect the data from a number of other entries (not necessarily subentries) and concatenating it. This is a useful feature for other entry types. Make it a base class, so that vblock can use it, along with other entry types. Signed-off-by: Simon Glass <[email protected]>
2021-03-27binman: Allow disabling expanding an entrySimon Glass
At present there is a command-line flag to disable substitution of expanded entries. Add an option to the entry node as well, so it can be controlled at the node level. Add a test to cover this. Fix up the comment to the checkSymbols() function it uses, while we are here. Signed-off-by: Simon Glass <[email protected]>
2021-03-27binman: Use a unique number for the symbols test fileSimon Glass
Two test devicetree files currently have 192 as their unique number. Fix this by separating them out. Signed-off-by: Simon Glass <[email protected]>
2021-03-26binman: Update various pieces of the documentationSimon Glass
A few sections are a little out of date now. Update them. Signed-off-by: Simon Glass <[email protected]>
2021-03-26binman: Drop repetitive heading for each entrySimon Glass
Many entries start 'Entry containing a'. This looks fine in the source code but is annoying when viewed in the htmldocs table of contents. Drop these unnecessary words. Signed-off-by: Simon Glass <[email protected]>