From 8edecd3110e65ca96a50a37bf7ca65ed45070452 Mon Sep 17 00:00:00 2001 From: John Keeping Date: Tue, 20 Apr 2021 19:19:44 +0100 Subject: [PATCH 1/6] fit: Fix verification of images with external data The "-E" option to mkimage generates a FIT with external data using the data-size and data-offset properties which must both be ignored when verifying a signature. Add "data-offset" to the list of excluded properties for signature verification; since the line is now too long, re-format the list to one-per-line and make it static since the data is constant. Signed-off-by: John Keeping Reviewed-by: Simon Glass --- common/image-fit-sig.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/image-fit-sig.c b/common/image-fit-sig.c index 55ddf1879e..b979cd2a4b 100644 --- a/common/image-fit-sig.c +++ b/common/image-fit-sig.c @@ -245,7 +245,13 @@ static int fit_config_check_sig(const void *fit, int noffset, int required_keynode, int conf_noffset, char **err_msgp) { - char * const exc_prop[] = {"data", "data-size", "data-position"}; + static char * const exc_prop[] = { + "data", + "data-size", + "data-position", + "data-offset" + }; + const char *prop, *end, *name; struct image_sign_info info; const uint32_t *strings; From a1ff2cb4d433f983b25a2b2920dbfcea5dc4555c Mon Sep 17 00:00:00 2001 From: Campbell Suter Date: Fri, 30 Apr 2021 16:45:46 +1200 Subject: [PATCH 2/6] fs/squashfs: Fix some hardlinks reading the wrong inode In SquashFS, the contents of a directory is stored by squashfs_directory_entry structures which contain the file's name, inode and position within the filesystem. The inode number is not stored directly; instead each directory has one or more headers which set a base inode number, and files store the offset from that to the file's inode number. In mksquashfs, each inode is allocated a number in the same order as they are written to the directory table; thus the offset from the header's base inode number to the file's inode number is usually positive. Hardlinks are simply stored with two directory entries referencing the same file. This means the second entry will thus have an inode number much lower than the surrounding files. Since the header's base inode number comes from the first entry that uses the header, this delta will usually be negative. Previously, U-Boot's squashfs_directory_entry.inode_offset field was declared as an unsigned value. Thus when a negative value was found, it would either resolve to an invalid inode number or to that of an unrelated file. A squashfs image to test this can be created like so: echo hi > sqfs_test_files/001-root-file mkdir sqfs_test_files/002-subdir touch sqfs_test_files/002-subdir/003-file ln sqfs_test_files/{001-root-file,002-subdir/004-link} mksquashfs sqfs_test_files/ test.sqfs -noappend Note that squashfs sorts the files ASCIIbetacally, so we can use the names to control the order they appear in. The ordering is important - the first reference to the file must have a lower inode number than the directory in which the second reference resides, and the second reference cannot be the first file in the directory. Listing this sample image in U-Boot results in: => sqfsls virtio 2 002-subdir 0 003-file Inode not found. 0 004-link Signed-off-by: Campbell Suter Reviewed-by: Miquel Raynal --- fs/squashfs/sqfs_filesystem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/squashfs/sqfs_filesystem.h b/fs/squashfs/sqfs_filesystem.h index 856cd15e34..5440b6c0e0 100644 --- a/fs/squashfs/sqfs_filesystem.h +++ b/fs/squashfs/sqfs_filesystem.h @@ -231,7 +231,7 @@ union squashfs_inode { struct squashfs_directory_entry { u16 offset; - u16 inode_offset; + s16 inode_offset; u16 type; u16 name_size; char name[0]; From 08e8bc8a7fd253a45ed97b46afc4046809bfda22 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Tue, 27 Jul 2021 13:01:44 -0400 Subject: [PATCH 3/6] doc: Add basic information about running CI tests Start out by documenting general expectations on when CI is run, how anyone can run Azure pipelines, and how GitLab CI pipelines can be run. Signed-off-by: Tom Rini --- doc/develop/ci_testing.rst | 70 ++++++++++++++++++++++++++++++++++++++ doc/develop/index.rst | 1 + 2 files changed, 71 insertions(+) create mode 100644 doc/develop/ci_testing.rst diff --git a/doc/develop/ci_testing.rst b/doc/develop/ci_testing.rst new file mode 100644 index 0000000000..b9a9a516c1 --- /dev/null +++ b/doc/develop/ci_testing.rst @@ -0,0 +1,70 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +Continuous Integration testing +============================== + +All changes require passing our continuous integration tests prior to being +merged in to mainline. To help facilitate merges being accepted quickly, +custodians are encouraged but not required to run a pipeline prior to sending a +pull request. Individual developers submitting significant or widespread +changes are encouraged to run a pipeline themselves prior to posting. + +In order to make this process as easy as possible, the ability to run a CI +pipeline is provided in both Azure and GitLab. Both of these pipelines perform +their Linux build jobs on the same Docker container image and to cover the same +platforms. In addition, Azure is also used to confirm that our host tools can +be built with mingw to run on Windows. + +Each of the pipelines is written in such as way as to be a "world build" style +test and as such we try and build all possible platforms. In addition, for all +platforms that support being run in QEMU we run them in QEMU and use our pytest +suite. See :doc:`py_testing` for more information about those tests. + +Azure Pipelines +--------------- + +This pipeline is defined in the top-level ``.azure-pipelines.yml`` file. +Currently there are two ways to run a Microsoft Azure Pipeline test for U-Boot. + +The first way is to create an account with Microsoft at +https://azure.microsoft.com/en-us/services/devops/ and then use the +``.azure-pipelines.yml`` file in the U-Boot repository as the pipeline +description. + +The second way is to use GitHub. This requires a GitHub account +and to fork the repository at https://github.com/u-boot/u-boot and to then +submit a pull request as this will trigger an Azure pipeline run. Clicking on +your pull request on the list at https://github.com/u-boot/u-boot/pulls and +then the "Checks" tab will show the results. + +GitLab CI Pipelines +------------------- + +This pipeline is defined in the top-level ``.gitlab-ci.yml`` file. Currently, +we support running GitLab CI pipelines only for custodians, due to the +resources the project has available. For Custodians, it is a matter of +enabling the pipeline feature in your project repository following the standard +GitLab documentation. For non-custodians, the pipeline itself is part of the +tree and should be able to be used on any GitLab instance, with whatever +runners you are able to provide. While it is intended to be able to run this +pipeline on the free public instances provided at https://gitlab.com/ a problem +with our squashfs tests currently prevents this. + +Docker container +---------------- + +As previously stated, both of the above pipelines build using the same Docker +container image. This is maintained in the U-Boot source tree at +``tools/docker/Dockerfile`` and new images are made as needed to support new +tests or features. This file needs to be updated whenever adding new external +tool requirements to tests. + +Customizing CI +-------------- + +As noted above, the CI pipelines perform a world build. While this is good for +overall project testing, it can be less useful for testing specific cases or +developing features. In that case, it can be useful as part of your own +testing cycle to edit these pipelines in separate local commits to pair them +down to just the jobs you're interested in. These changes must be removed +prior to submission. diff --git a/doc/develop/index.rst b/doc/develop/index.rst index 3ead7bda8f..1203409db7 100644 --- a/doc/develop/index.rst +++ b/doc/develop/index.rst @@ -9,6 +9,7 @@ Implementation .. toctree:: :maxdepth: 1 + ci_testing commands driver-model/index global_data From e02c082287fd3d9ca90da95476d64a4bc4395a54 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Thu, 29 Jul 2021 20:27:17 +0200 Subject: [PATCH 4/6] config: MPC8548CDS: eliminate symbol CONFIG_SYS_ID_EEPROM Symbol CONFIG_SYS_ID_EEPROM is defined in include/configs/MPC8548CDS.h but never used. Remove it here and from the whitelist. Signed-off-by: Heinrich Schuchardt --- include/configs/MPC8548CDS.h | 1 - scripts/config_whitelist.txt | 1 - 2 files changed, 2 deletions(-) diff --git a/include/configs/MPC8548CDS.h b/include/configs/MPC8548CDS.h index 2046bf215b..32e19259cb 100644 --- a/include/configs/MPC8548CDS.h +++ b/include/configs/MPC8548CDS.h @@ -310,7 +310,6 @@ extern unsigned long get_clock_freq(void); /* EEPROM */ #define CONFIG_ID_EEPROM #define CONFIG_SYS_I2C_EEPROM_CCID -#define CONFIG_SYS_ID_EEPROM #define CONFIG_SYS_I2C_EEPROM_ADDR 0x57 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 812d8f2836..a6507edd9f 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -2441,7 +2441,6 @@ CONFIG_SYS_ICACHE_INV CONFIG_SYS_ICS8N3QV01_I2C CONFIG_SYS_IDE_MAXBUS CONFIG_SYS_IDE_MAXDEVICE -CONFIG_SYS_ID_EEPROM CONFIG_SYS_IFC_ADDR CONFIG_SYS_IFC_CCR CONFIG_SYS_INIT_DBCR From f86eba03fa2314e13ff91591ad762d0df2c6e9fe Mon Sep 17 00:00:00 2001 From: Adarsh Babu Kalepalli Date: Wed, 30 Jun 2021 23:57:45 +0530 Subject: [PATCH 5/6] cmd:Elaborate 'blkcache' cmd HELP statement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HELP description is provided for ‘configure’ sub-command of ‘blkcache’. Signed-off-by: Adarsh Babu Kalepalli Reviewed-by: Simon Glass --- cmd/blkcache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/blkcache.c b/cmd/blkcache.c index 25f252e455..47ea1ec0b9 100644 --- a/cmd/blkcache.c +++ b/cmd/blkcache.c @@ -83,5 +83,6 @@ U_BOOT_CMD( blkcache, 4, 0, do_blkcache, "block cache diagnostics and control", "show - show and reset statistics\n" - "blkcache configure blocks entries\n" + "blkcache configure " + "- set max blocks per entry and max cache entries\n" ); From 1fdafebdfc948f87af40980c6c5135afd96ecdf1 Mon Sep 17 00:00:00 2001 From: Adarsh Babu Kalepalli Date: Mon, 24 May 2021 13:35:39 +0530 Subject: [PATCH 6/6] cmd:(cosmetic)Mentioned in 'chpart' command HELP text that it is for MTD devices Modified the help text of 'chpart' command ,mentioning that it is for MTD devices. Signed-off-by: Adarsh Babu Kalepalli Reviewed-by: Simon Glass --- cmd/mtdparts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/mtdparts.c b/cmd/mtdparts.c index ed373a8c4d..3048700778 100644 --- a/cmd/mtdparts.c +++ b/cmd/mtdparts.c @@ -2077,9 +2077,9 @@ static int do_mtdparts(struct cmd_tbl *cmdtp, int flag, int argc, /***************************************************/ U_BOOT_CMD( chpart, 2, 0, do_chpart, - "change active partition", + "change active partition of a MTD device", "part-id\n" - " - change active partition (e.g. part-id = nand0,1)" + " - change active partition (e.g. part-id = nand0,1) of a MTD device" ); #ifdef CONFIG_SYS_LONGHELP