commit:     f879895488b938b704ebbde3f444df3d3cce8a0a
Author:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Fri Mar  1 15:32:13 2024 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Fri Mar  1 16:58:09 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f8798954

sys-boot/grub: install an sbat for grub-install --sbat ...

Booting with sys-boot/shim requires that an sbat section is present in
the EFI executable. Add an sbat.csv file that can optionally be
included when building the grub EFI executable.

Closes: https://bugs.gentoo.org/925902
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/35588
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 sys-boot/grub/files/sbat.csv                               | 3 +++
 sys-boot/grub/{grub-2.12-r1.ebuild => grub-2.12-r2.ebuild} | 4 ++++
 sys-boot/grub/grub-9999.ebuild                             | 4 ++++
 3 files changed, 11 insertions(+)

diff --git a/sys-boot/grub/files/sbat.csv b/sys-boot/grub/files/sbat.csv
new file mode 100644
index 000000000000..2b87b532556c
--- /dev/null
+++ b/sys-boot/grub/files/sbat.csv
@@ -0,0 +1,3 @@
+sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md
+grub,3,Free Software Foundation,grub,%PV%,https//www.gnu.org/software/grub/
+grub.gentoo,1,Gentoo,grub,%PV%,https://bugs.gentoo.org/

diff --git a/sys-boot/grub/grub-2.12-r1.ebuild 
b/sys-boot/grub/grub-2.12-r2.ebuild
similarity index 98%
rename from sys-boot/grub/grub-2.12-r1.ebuild
rename to sys-boot/grub/grub-2.12-r2.ebuild
index c6cb75fc4b02..e156b1b4754a 100644
--- a/sys-boot/grub/grub-2.12-r1.ebuild
+++ b/sys-boot/grub/grub-2.12-r2.ebuild
@@ -315,6 +315,10 @@ src_install() {
        # https://bugs.gentoo.org/231935
        dostrip -x /usr/lib/grub
 
+       sed -e "s/%PV%/${PV}/" "${FILESDIR}/sbat.csv" > "${T}/sbat.csv" || die
+       insinto /usr/share/grub
+       doins "${T}/sbat.csv"
+
        if use elibc_musl; then
                # https://bugs.gentoo.org/900348
                QA_CONFIG_IMPL_DECL_SKIP=( 
re_{compile_pattern,match,search,set_syntax} )

diff --git a/sys-boot/grub/grub-9999.ebuild b/sys-boot/grub/grub-9999.ebuild
index 0ba8261571a5..44bb51e767ee 100644
--- a/sys-boot/grub/grub-9999.ebuild
+++ b/sys-boot/grub/grub-9999.ebuild
@@ -311,6 +311,10 @@ src_install() {
        # https://bugs.gentoo.org/231935
        dostrip -x /usr/lib/grub
 
+       sed -e "s/%PV%/${PV}/" "${FILESDIR}/sbat.csv" > "${T}/sbat.csv" || die
+       insinto /usr/share/grub
+       doins "${T}/sbat.csv"
+
        if use elibc_musl; then
                # https://bugs.gentoo.org/900348
                QA_CONFIG_IMPL_DECL_SKIP=( 
re_{compile_pattern,match,search,set_syntax} )

Reply via email to