feat: allow specialisations to set their own sort keys #479

Open
r-vdp wants to merge 3 commits from r-vdp/rvdp/specialisation_sort_keys into master
r-vdp commented 2025-08-31 12:29:07 +00:00 (Migrated from github.com)

This fixes https://github.com/DeterminateSystems/bootspec/issues/147 by vendoring the bootspec crate and changing the type of specialisations from Generation to BootJson.
Upstream PR pending: https://github.com/DeterminateSystems/bootspec/pull/207

This means that we now capture the full recursive JSON schema for specialisations, including extensions, while the previous type threw this information away.

This is essential for features like boot counting so that users can set separate sort keys for specialisations, to avoid the boot loader falling back to specialisations when a new generation fails to boot.
Often specialisations are special cases that we don't want to boot automatically, so they can now be sorted below all normal generations so that if a generation fails to boot, the boot loader will fall back onto the previous generation.

CC: @blitz @raitobezarius

This fixes https://github.com/DeterminateSystems/bootspec/issues/147 by vendoring the bootspec crate and changing the type of specialisations from `Generation` to `BootJson`. Upstream PR pending: https://github.com/DeterminateSystems/bootspec/pull/207 This means that we now capture the full recursive JSON schema for specialisations, including extensions, while the previous type threw this information away. This is essential for features like boot counting so that users can set separate sort keys for specialisations, to avoid the boot loader falling back to specialisations when a new generation fails to boot. Often specialisations are special cases that we don't want to boot automatically, so they can now be sorted below all normal generations so that if a generation fails to boot, the boot loader will fall back onto the previous generation. CC: @blitz @raitobezarius
blitz commented 2025-09-01 16:47:05 +00:00 (Migrated from github.com)

Thanks for all the effort here! I wouldn't vendor the bootspec library though unless there is a clear sign that upstream and us have some unresolvable issues. Let's give the upstream PR a bit of time!

Thanks for all the effort here! I wouldn't vendor the bootspec library though unless there is a clear sign that upstream and us have some unresolvable issues. Let's give the upstream PR a bit of time!
r-vdp commented 2025-09-03 11:05:14 +00:00 (Migrated from github.com)

Thanks for all the effort here! I wouldn't vendor the bootspec library though unless there is a clear sign that upstream and us have some unresolvable issues. Let's give the upstream PR a bit of time!

Yeah, @RaitoBezarius suggested on matrix to vendor this crate when I discussed the issue with specialisation sort keys with him. He mentioned that there is some other lanzaboote-related work already in the pipeline that would also likely require either vendoring this crate or switching upstreams.

I don't know the details though, so I just followed his suggestion.

> Thanks for all the effort here! I wouldn't vendor the bootspec library though unless there is a clear sign that upstream and us have some unresolvable issues. Let's give the upstream PR a bit of time! Yeah, @RaitoBezarius suggested on matrix to vendor this crate when I discussed the issue with specialisation sort keys with him. He mentioned that there is some other lanzaboote-related work already in the pipeline that would also likely require either vendoring this crate or switching upstreams. I don't know the details though, so I just followed his suggestion.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin r-vdp/rvdp/specialisation_sort_keys:r-vdp/rvdp/specialisation_sort_keys
git switch r-vdp/rvdp/specialisation_sort_keys

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff r-vdp/rvdp/specialisation_sort_keys
git switch r-vdp/rvdp/specialisation_sort_keys
git rebase master
git switch master
git merge --ff-only r-vdp/rvdp/specialisation_sort_keys
git switch r-vdp/rvdp/specialisation_sort_keys
git rebase master
git switch master
git merge --no-ff r-vdp/rvdp/specialisation_sort_keys
git switch master
git merge --squash r-vdp/rvdp/specialisation_sort_keys
git switch master
git merge --ff-only r-vdp/rvdp/specialisation_sort_keys
git switch master
git merge r-vdp/rvdp/specialisation_sort_keys
git push origin master
Sign in to join this conversation.
No description provided.