mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@barebox.org>
To: barebox@lists.infradead.org
Subject: [PATCH 0/5] blspec: sort entries according to specification
Date: Mon,  9 Feb 2026 10:08:50 +0100	[thread overview]
Message-ID: <20260209090911.3561875-1-a.fatoum@barebox.org> (raw)

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




             reply	other threads:[~2026-02-09  9:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-09  9:08 Ahmad Fatoum [this message]
2026-02-09  9:08 ` [PATCH 1/5] boot: aggregate bootentry provider entries one by one Ahmad Fatoum
2026-02-09  9:08 ` [PATCH 2/5] blspec: sort entries according to specification Ahmad Fatoum
2026-02-09  9:08 ` [PATCH 3/5] boot: give struct bootentry a path member Ahmad Fatoum
2026-02-09  9:08 ` [PATCH 4/5] commands: boot: support file path in boot -M for default entry Ahmad Fatoum
2026-02-09  9:08 ` [PATCH 5/5] test: self: add bootloader spec files test Ahmad Fatoum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260209090911.3561875-1-a.fatoum@barebox.org \
    --to=a.fatoum@barebox.org \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox