Boot entries generated from bootloader spec are currently sorted by the order the files are read from the file system.
This is inadequate if we have multiple entries with different kernels and we want to sort the newer kernels higher. The UAPI.1 Boot Loader Specification defines an algorithm[1] to order the entries that takes care of this, so implement it into barebox. [1]: https://uapi-group.org/specifications/specs/boot_loader_specification/#sorting Ahmad Fatoum (5): boot: aggregate bootentry provider entries one by one blspec: sort entries according to specification boot: give struct bootentry a path member commands: boot: support file path in boot -M for default entry test: self: add bootloader spec files test commands/boot.c | 62 +++++++++++++---- common/Kconfig | 1 + common/blspec.c | 66 +++++++++++++++++-- common/boot.c | 42 ++++++++---- include/asm-generic/bug.h | 7 ++ include/boot.h | 3 + include/bselftest.h | 20 ++++++ include/fnmatch.h | 9 +++ test/self/Kconfig | 5 ++ test/self/Makefile | 2 + test/self/blspec.c | 46 +++++++++++++ .../data/test/boot/boot.sh | 3 + .../data/test/loader/entries/boarda.conf | 6 ++ .../data/test/loader/entries/boardb.conf | 6 ++ .../data/test/loader/entries/boardc.conf | 6 ++ .../data/test/loader/entries/boardd.conf | 5 ++ 16 files changed, 260 insertions(+), 29 deletions(-) create mode 100644 test/self/blspec.c create mode 100755 test/self/defaultenv-blspec-test/data/test/boot/boot.sh create mode 100644 test/self/defaultenv-blspec-test/data/test/loader/entries/boarda.conf create mode 100644 test/self/defaultenv-blspec-test/data/test/loader/entries/boardb.conf create mode 100644 test/self/defaultenv-blspec-test/data/test/loader/entries/boardc.conf create mode 100644 test/self/defaultenv-blspec-test/data/test/loader/entries/boardd.conf -- 2.47.3
