Comment 6 for bug 2034253

Revision history for this message
Julian Andres Klode (juliank) wrote :

I don't plan to keep a delta, so I'm thinking

diff --git a/debian/default/grub b/debian/default/grub
index 03f98ec7f..5068a6566 100644
--- a/debian/default/grub
+++ b/debian/default/grub
@@ -5,7 +5,7 @@

 GRUB_DEFAULT=0
 GRUB_TIMEOUT=@DEFAULT_TIMEOUT@
-GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
+GRUB_DISTRIBUTOR=`. /etc/os-release && echo $NAME || echo @DPKG_VENDOR@`
 GRUB_CMDLINE_LINUX_DEFAULT="@DEFAULT_CMDLINE@"
 GRUB_CMDLINE_LINUX=""

diff --git a/debian/rules b/debian/rules
index 0da34cae0..5cfd8bf4e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -145,6 +145,7 @@ endif
 # rebuild grub, need a programmatic way to get the vendor, as it's used by build-efi-images
 # to create the monolithic Grub image and thus is needed to create the partitions on the EFI
 # media. Add it to the control file user metadata: XB-Efi-Vendor: $vendor
+DPKG_VENDOR ?= $(shell dpkg-vendor --query vendor)
 SB_EFI_VENDOR ?= $(shell dpkg-vendor --query vendor | tr '[:upper:]' '[:lower:]')

 %:
@@ -355,6 +356,7 @@ platform_subst = \
        if [ -e debian/$(1) ]; then \
                debian/platform-subst \
                        PACKAGE="$(2)" \
+ DPKG_VENDOR="$(DPKG_VENDOR)" \
                        DEFAULT_CMDLINE="$(DEFAULT_CMDLINE)" \
                        DEFAULT_TIMEOUT="$(DEFAULT_TIMEOUT)" \
                        DEFAULT_HIDDEN_TIMEOUT_BOOL="$(DEFAULT_HIDDEN_TIMEOUT_BOOL)" \

But maybe also just drop dynamic lookup entirely because that breaks expectations in some ways, e.g. shim can't find grub anymore if you change grub distributor.