3 include /usr
/share
/dpkg
/architecture.mk
5 # Other vendors, add your certs here. No sense in using
6 # dpkg-vendor --derives-from, because only Canonical-generated binaries will
7 # be signed with this key; so if you are building your own shim binary you
8 # should be building the other binaries also.
9 ifeq ($(shell dpkg-vendor
--is ubuntu
&& echo yes
),yes
)
10 cert
=debian
/canonical-uefi-ca.der
12 COMMON_OPTIONS ?
= ENABLE_SHIM_CERT
=1 ENABLE_SBSIGN
=1
14 cert
=debian
/debian-uefi-ca.der
18 deb_version
:= $(shell dpkg-parsechangelog | sed
-ne
"s/^Version: \(.*\)/\1/p")
19 upstream_version
:= $(shell echo
$(deb_version
) | sed
-e
"s/-[^-]*$$//")
20 plain_upstream_version
:= $(shell echo
$(upstream_version
) | sed
-e
"s/+dfsg.*//")
23 DBX_HASHES
= debian
/$(distributor
)-dbx.hashes
24 SBAT_IN
= debian
/sbat.
$(distributor
).csv.in
25 SBAT_DATA
= data
/sbat.
$(distributor
).csv
27 include /usr
/share
/dpkg
/architecture.mk
29 ifeq ($(DEB_HOST_ARCH
),amd64
)
30 export EFI_ARCH
:= x64
32 ifeq ($(DEB_HOST_ARCH
),arm64
)
33 export EFI_ARCH
:= aa64
35 ifeq ($(DEB_HOST_ARCH
),i386
)
36 export EFI_ARCH
:= ia32
40 RELEASE
=$(plain_upstream_version
) \
41 COMMIT_ID
=657b2483ca6e9fcf2ad8ac7ee577ff546d24c3aa \
43 ENABLE_HTTPBOOT
=true \
44 VENDOR_CERT_FILE
=$(cert
) \
45 VENDOR_DBX_FILE
=$(DBX_LIST
) \
46 EFIDIR
=$(distributor
) \
47 CROSS_COMPILE
=$(DEB_HOST_GNU_TYPE
)- \
48 CC
=$(DEB_HOST_GNU_TYPE
)-gcc-12 \
51 $(DBX_LIST
): $(DBX_HASHES
)
52 .
/debian
/generate_dbx_list
$(EFI_ARCH
) $< $@
54 $(SBAT_DATA
): $(SBAT_IN
)
57 sed
-e
"s/@DEB_VERSION@/$(deb_version)/g" \
58 -e
"s/@UPSTREAM_VERSION@/$(plain_upstream_version)/g" \
59 < $(SBAT_IN
) > $(SBAT_DATA
)
60 # If we have an empty $(SBAT_DATA), delete
61 if
[ ! -s
$(SBAT_DATA
) ]; then
rm -f
$(SBAT_DATA
); fi
66 override_dh_auto_clean
:
67 dh_auto_clean
-- MAKELEVEL
=0
68 rm -f
$(DBX_LIST
) $(SBAT_DATA
) sbat.
*.csv BOOT
*.CSV test-csv test-sbat test-str
70 override_dh_auto_build
: $(DBX_LIST
) $(SBAT_DATA
)
71 dh_auto_build
-- INSTALL
=install $(COMMON_OPTIONS
)
73 override_dh_auto_test
: $(DBX_LIST
) $(SBAT_DATA
)
74 dh_auto_test
-- INSTALL
=install $(COMMON_OPTIONS
)
76 override_dh_auto_install
:
77 dh_auto_install
--destdir
=debian
/tmp
-- INSTALL
=install $(COMMON_OPTIONS
)
78 # Remove the copy of the source that's installed - we have git
81 # And remove the extra removable-media copy of shim too, it's
82 # not needed for our build and causes debhelper to complain
83 rm -f debian
/tmp
/boot
/efi
/EFI
/BOOT
/BOOT
*.EFI
84 .
/debian
/signing-template.generate
88 git
-C gnu-efi archive
--prefix=gnu-efi
/ HEAD | xz
-9 \
89 > ..
/shim_
$(plain_upstream_version
).orig-gnu-efi.
tar.xz