-
Notifications
You must be signed in to change notification settings - Fork 689
feat(fwupd-efi): add AZL SBAT line, keep upstream provenance #18227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| [components.fwupd-efi] | ||
|
|
||
| # SBAT (AB#20493): add an Azure Linux vendor line to the fwupd EFI binary. | ||
| # | ||
| # fwupd-efi has no sbat.csv.in; its .sbat section is generated at build time by | ||
| # efi/generate_sbat.py, which emits exactly one downstream "distro" line from the | ||
| # -Defi_sbat_distro_* meson options (upstream ships that slot as "fedora"). There | ||
| # is no meson knob for a second distro line. | ||
| # | ||
| # Azure Linux is the distributor, so we retarget that slot to azurelinux -- the | ||
| # sanctioned build path then emits the fwupd-efi.azurelinux line natively. We then | ||
| # re-insert the upstream Fedora provenance line onto the finished binary with | ||
| # objcopy, ahead of the azurelinux line, mirroring grub2 (grub.rh before | ||
| # grub.azurelinux). SBAT ordering is not functionally significant. | ||
|
|
||
| # Preserve the upstream Fedora provenance SBAT line as a macro (single source of | ||
| # truth for the objcopy step below). | ||
| [[components.fwupd-efi.overlays]] | ||
| description = "SBAT: define the interim upstream-EVR macro and the Fedora provenance line" | ||
| type = "spec-search-replace" | ||
| regex = '%global debug_package %\{nil\}' | ||
| replacement = '''%global debug_package %{nil} | ||
|
|
||
| # Interim upstream-EVR macro, pinned to the Fedora fwupd-efi NEVR we import from | ||
| # (fwupd-efi-1.8-1.fc43). The provenance line below must carry the *upstream* | ||
| # EVR, not the Azure Linux one; swap this for the azldev upstream-EVR macro once | ||
| # bug 21798 lands (mirrors grub2's upstream_version_release). | ||
| %global upstream_version_release 1.8-1.fc43 | ||
|
|
||
| # Upstream Fedora provenance SBAT line, preserved for revocation lineage (AB#20493). | ||
| %global sbat_fedora_line fwupd-efi.fedora,1,The Fedora Project,fwupd-efi,%{upstream_version_release},https://src.fedoraproject.org/rpms/fwupd-efi''' | ||
|
|
||
| # Retarget the single meson distro SBAT slot from Fedora to Azure Linux. | ||
| [[components.fwupd-efi.overlays]] | ||
| description = "SBAT: retarget meson distro id to azurelinux" | ||
| type = "spec-search-replace" | ||
| regex = '-Defi_sbat_distro_id="fedora"' | ||
| replacement = '-Defi_sbat_distro_id="azurelinux"' | ||
|
|
||
| [[components.fwupd-efi.overlays]] | ||
| description = "SBAT: retarget meson distro summary to Microsoft" | ||
| type = "spec-search-replace" | ||
| regex = '-Defi_sbat_distro_summary="The Fedora Project"' | ||
| replacement = '-Defi_sbat_distro_summary="Microsoft"' | ||
|
|
||
| [[components.fwupd-efi.overlays]] | ||
| description = "SBAT: retarget meson distro url to the Azure Linux repo" | ||
| type = "spec-search-replace" | ||
| regex = '-Defi_sbat_distro_url="https://src\.fedoraproject\.org/rpms/%\{name\}"' | ||
| replacement = '-Defi_sbat_distro_url="https://github.com/microsoft/azurelinux/issues"' | ||
|
|
||
| # Re-insert the Fedora provenance line ahead of the azurelinux line, before signing | ||
| # so the pesign signature covers the final .sbat section. | ||
| [[components.fwupd-efi.overlays]] | ||
| description = "SBAT: re-inject the Fedora provenance line via objcopy before pesign" | ||
| type = "spec-search-replace" | ||
| regex = '%pesign -s -i %\{fwup_efi_fn\} -o %\{fwup_efi_fn\}\.tmp' | ||
| replacement = '''# Re-inject the upstream Fedora provenance SBAT line, ahead of the azurelinux line | ||
| # emitted by the meson distro slot (AB#20493). | ||
| objcopy --dump-section .sbat=%{_builddir}/fwupd-efi-sbat.csv %{fwup_efi_fn} | ||
| sed -i '/^fwupd-efi\.azurelinux,/i %{sbat_fedora_line}' %{_builddir}/fwupd-efi-sbat.csv | ||
| objcopy --update-section .sbat=%{_builddir}/fwupd-efi-sbat.csv %{fwup_efi_fn} | ||
| %pesign -s -i %{fwup_efi_fn} -o %{fwup_efi_fn}.tmp''' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.