Add -p/--push option to the apply command to push the cherry-pick branch
to GitLab and create a merge request. Uses the python-gitlab library.
Options:
-p, --push Push branch and create GitLab MR
-r, --remote Git remote for push (default: ci)
-t, --target Target branch for MR (default: master)
Requires GITLAB_TOKEN environment variable to be set.
Also record cherry-pick history in .pickman-history file on successful
apply. Each entry includes the date, source branch, commits, and the
agent's conversation log. This file is committed automatically and
included in the MR description when using -p.
Name the module gitlab_api.py to avoid shadowing the python-gitlab
library.
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add gitlab_api module with functions for interacting with GitLab:
- check_available(): Check if python-gitlab is installed
- get_token(): Get GitLab API token from environment
- get_remote_url(): Get URL for a git remote
- parse_url(): Parse GitLab URLs (SSH and HTTPS formats)
- push_branch(): Push a branch to a remote
- create_mr(): Create a merge request via GitLab API
- push_and_create_mr(): Combined push and MR creation
Requires python-gitlab library and GITLAB_TOKEN environment variable.
Name the module gitlab_api.py to avoid shadowing the python-gitlab
library.
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add a command that automates cherry-picking commits using the agent
module. The apply command:
- Gets the next set of commits (same as next-set)
- Creates a new branch for the cherry-picks (-b/--branch option)
- Runs the agent to execute the cherry-picks
- Returns to the original branch after completion
The database is not updated automatically; use 'commit-source' to update
after reviewing the cherry-picked branch.
Also refactor control.py to extract get_next_commits() for reuse and
use a dispatch table for commands.
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add an agent which uses the Claude Agent SDK to automate cherry-picking
commits.
The agent module provides an async interface to the Claude Agent SDK
with a synchronous wrapper for easy use from the CLI.
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add new database tables to track individual commits and merge requests:
- pcommit: tracks commits being cherry-picked with status, author,
subject, and optional link to merge request
- mergereq: tracks GitLab merge requests with branch name, MR ID,
status, and URL
Also add helper functions for both tables and update control.py to
write commit status to the database during apply operations.
Update README.rst with documentation for all database tables.
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add a command that finds the next set of commits to cherry-pick from a
source branch. It lists commits from the last cherry-picked commit up
to and including the next merge commit, which typically represents a
logical grouping (e.g., a pull request).
If no merge commit is found, it lists all remaining commits with a note
indicating this.
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add a command to list all tracked source branches and their last
cherry-picked commits from the database.
Usage: ./tools/pickman/pickman list-sources
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add a command to register a source branch in the database. This finds
the merge-base commit between master and the source branch and stores
it as the starting point for cherry-picking.
Usage: ./tools/pickman/pickman add-source <branch>
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add an sqlite3 database module to track the state of cherry-picking
commits between branches. The database uses .pickman.db and includes:
- source table: tracks source branches and their last cherry-picked
commit into master
- Schema versioning for future migrations
The database code is mostly lifted from patman
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add subcommand support:
- compare: Compare branches (existing functionality)
- test: Run the functional tests
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add a tool to check the number of commits in a source branch
(us/next) that are not in the master branch (ci/master), and find
the last common commit between them.
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
- a8c07ac497 alist: Mention the error condition in alist_add_placeholder()
- 13bd298499 alist: Add a comment for alist_init_struct()
- 6668d860f7 alist: Expand the comment for alist_get()
- 2ce146a3de alist: Add a way to get the next element
- 83bc5989fc alist: Add for-loop helpers
- 70f5f17415 alist: Add a function to empty the list
- d01c58acb7 alist: Add a way to efficiently filter an alist
- b84c13f37d alist: Add maintainer
- cedf9ccaa2 dm: core: Add a function to see if a device exists
- 6e625484f5 test: boot: Use a consistent name for the script bootmeth
- 57e77dc80e arm: dts: e850-96: Remove TRNG node from appended dts
- 33ddfc059e driver: sifive ccache: enable TRUNKCLOCKGATE and REGIONCLOCKGATE
- e83a99cb67 configs: visionfive2: re-enable SPL_SYS_MMCSD_RAW_MODE
- d86ff34285 xilinx: mbv: Place DTB by default to DDR location
- e4b8d8be4e xilinx: mbv: Align smode_defconfig with upstream QEMU
- d5f5e77818 riscv: Introduce configuration for 64bit version Microblaze V
- a7a96a37cb Merge https://source.denx.de/u-boot/custodians/u-boot-riscv
To restore MMC boot, enable SPL_SYS_MMCSD_RAW_MODE and recover
SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION and
SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION.
Fixes: 2a00d73d08 ("spl: mmc: Try to clean up raw-mode options")
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
(cherry picked from commit e83a99cb67)
The x250 and SE250 are series of 10G L2+ switches from Allied Telesis.
There are a number of them in the range but as far as U-Boot is
concerned all the CPU block components are the same so there's only one
board defined.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
(cherry picked from commit 7446e29db5)
Enable IPV6 support for the x530 board.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
(cherry picked from commit f337b5aaad)
The x530 board doesn't use EFI and our toolchains don't include gnutls
so disable the tool in the defconfig.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
(cherry picked from commit c6b17af142)
As things have been moved to Kconfig there are a number of dead comments
left over in x530.h. Remove them.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
(cherry picked from commit 1b46176532)
Enable IPV6 support for the x240 board.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
(cherry picked from commit b25b2d4f67)
The x240 board doesn't use EFI and our toolchains don't include gnutls
so disable the tool in the defconfig.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
(cherry picked from commit cbbfa8d778)
Use standard boot instead of the distro boot scripts. Regenerate the
board defconfig now that some options are selected automatically.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
(cherry picked from commit 27b2488735)
Remove CFG_SYS_BAUDRATE_TABLE as there's no reason not to use the
defaults defined via config_fallbacks.h.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
(cherry picked from commit 3eef899b57)
In getvar_partition_type() we attempt to find a filesystem driver for
the partition (of the list of driver enabled in U-Boot), on failure we
return the error to fastboot and completely bail out of the operation.
However, this should not be a failure, instead we should just default to
"raw". This allows commands like "fastboot format:ext4 userdata" to work
if userdata didn't already have an ext4 partition table (or if FS_EXT4
is disabled in U-Boot), as failing to determine the current partition
type is not an error in this case.
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20241113050607.1850472-1-caleb.connolly@linaro.org
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
(cherry picked from commit 06b8aafd68)
Commit 136b7b6d2e ("Subtree merge tag 'v6.11-dts' of dts repo [1] into
dts/upstream") updates the upstream dts for E850-96 board, bringing
upstream TRNG node. There is no need to keep TRNG node in appended dts
anymore, so remove it.
Tested on E850-96 board by running 'rng' command in U-Boot shell.
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
(cherry picked from commit 57e77dc80e)
unsigned int count is used to capture return of dev_read_string_count.
When an error occurs dev_read_string_count returns -ve, which can
hence not be handled correctly. Use int instead of unsigned int so
that errors are detected.
Fixes: 16ca80adc5 ("pinctrl: Add pinctrl driver support for Exynos7420 SoC")
Signed-off-by: Henrik Grimler <henrik@grimler.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
(cherry picked from commit e5565c24bb)
Add a description of how test parameters work. This helps to make it
easier to write C tests which need setup to be done in Python.
Series-to: concept
Series-cc: heinrich
Cover-letter:
test: Add support for passing arguments to C unit tests
This series adds infrastructure for passing runtime arguments from Python
tests to C unit tests. This makes it easier to support a hybrid testing
approach where Python handles complex setup (filesystem images,
environment configuration) while C handles the actual test logic with
better debuggability.
A few other things are included to make this work:
- A fix for linker list alignment that was causing garbage values like
"Running -858993444 bloblist tests" due to GCC's magic-number division
optimization failing when padding breaks exact multiples
- A fix fix for serial output with sandbox, since it sometimes misses
output at the end when running tests with gnome terminal
- Improvements to the linker-list script to detect padding and
pointer-arithmetic bugs
- A new UNIT_TEST_ARGS() macro for declaring tests with typed arguments,
along with argument parsing in the ut command (name=value format)
- Argument-accessor macros ut_str(), ut_int(), and ut_bool() with
type-checking and bounds validation
- A private buffer (uts->priv) for test-local temporary data, which
makes it a little easier to write shorter tests
- Tests for the argument feature (test_args) covering type checking,
bounds checking, and argument-parsing failures
As an example, the basic filesystem tests are converted from pure Python
to C with Python wrappers.
Some improved printf documentation and support for Linux's %pV format
are provided.
The slight increase in size causes qemu-riscv64_spl to fail, so this
series also includes a patch to increase the SPL-malloc() space.
END
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Update test_basic.py to call the new C-based filesystem tests via the
'ut' command. This allows tests to run more directly, calling the actual
FS layer, without having to go through the command interface and
worrying about which filesystem command to use.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add C implementations of filesystem tests that can be called via
the 'ut fs' command. These tests use UTF_MANUAL flag since they require
external setup, i.e. creation of filesystem images.
This covers the existing TestFsBasic tests.
The tests use typed arguments (fs_type, fs_image, md5 values) passed
via the command line.
Add a few helpers to make the code easier to read.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add a set of tests to check the behaviour of test arguments and the ut
command. This includes failure cases, where the wrong type or a
non-existent argument is requested.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Update the 'ut' command to have a -R command option to prevent ut_fail()
and ut_failf() from clearing GD_FLG_RECORD. This is useful when testing
the test framework itself, where error messages need to be captured.
Refactor ut_fail() and ut_failf() to call ut_unsilence_console() instead
of duplicating the flag-clearing logic.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add a priv[] buffer to struct unit_test_state that tests can use for
their own data. This avoids the need to allocate memory or use global
variables for test-specific state.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add ut_get_str(), ut_get_int(), and ut_get_bool() functions with
corresponding ut_str(), ut_int(), and ut_bool() macros for accessing
test arguments with type checking.
These functions check that the argument index is within bounds and the
type matches what was requested.
The first failure for a test is reported via ut_failf() which should
make it fairly easy to debug the test.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Update the ut command to permit passing arguments to tests.
Usage: ut -f fs test_name key1=value1 key2=value2
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add support for passing key=value arguments to unit tests. The test
framework parses arguments based on definitions provided by each test
and makes them available via uts->args[]
For now the 'ut' command does not support this new feature.
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add a UNIT_TEST_ARGS() macro to declare and register a test with inline
argument definitions. The variadic arguments use struct ut_arg_def and
a NULL terminator is added automatically to the list.
Example usage:
static int my_test(struct unit_test_state *uts) { ... }
UNIT_TEST_ARGS(my_test, UTF_CONSOLE, my_suite,
{ "path", UT_ARG_STR },
{ "count", UT_ARG_INT, UT_ARGF_OPTIONAL, { .vint = 10 } });
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add types for declaring and storing unit test arguments:
- enum ut_arg_type: INT, BOOL, STR types
- enum ut_arg_flags: OPTIONAL flag for non-required args
- struct ut_arg_def: declares expected args with defaults
- struct ut_arg: holds parsed argument values
This prepares for passing key=value arguments to tests via the 'ut'
command instead of needing to use environment variables.
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add a new ut_assert_nextline_regex() macro and ut_check_console_line_regex()
helper to check console output against a regex pattern. This is useful when
the exact output varies (e.g., file paths or line numbers in error messages).
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Move the -f flag before the suite name since ut parses flags
before the suite argument.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Change the alignment of end markers in ll_entry_end() and ll_end_decl()
from __aligned(4) and __aligned(CONFIG_LINKER_LIST_ALIGN) respectively
to __aligned(1).
The linker places zero-size end markers at aligned boundaries based on
what follows them. When the next list's start marker has a high alignment
requirement (e.g., 32 bytes), padding gets inserted before the end marker.
This causes the byte span (end - start) to not be an exact multiple of
the struct size.
The compiler optimizes pointer subtraction (end - start) using magic-number
multiplication for division. This optimization only produces correct results
when the byte span is an exact multiple of the struct size. With padding,
the result is garbage (e.g., -858993444 instead of 15).
By using __aligned(1), the end marker is placed immediately after the last
entry with no padding, ensuring (end - start) equals exactly n * sizeof
where n is the number of entries. This makes ll_entry_count() and direct
pointer arithmetic work correctly.
Fixes: 0b2fa98aa5 ("linker_lists: Fix alignment issue")
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
When linker-inserted padding breaks list integrity, pointer arithmetic
like (end - start) / sizeof(struct) produces garbage. GCC optimizes
division by constants using multiplicative inverses, which only works
when the dividend is an exact multiple. With padding, outputs like
"Running -858993444 bloblist tests" appear instead of the correct count.
Enhance the linker list checking script to detect these problems by
adding symbol size tracking using nm -S. This enables:
1. Padding detection: Compare symbol sizes to gaps. If gap > size,
padding was inserted, breaking contiguous array assumptions.
2. Pointer arithmetic bugs: Check if (end - start) marker span is a
multiple of struct size.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add support for the %pV format-specifier which allows printing a
struct va_format. This is used by the Linux kernel for recursive
printf() formatting and is needed by the ext4l filesystem driver.
Add the struct to include/linux/printk.h to match the kernel location.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>