Skip to content

Commit f49c769

Browse files
Add obsoletes and provides to fix errors in shim-unsigned upgrade to shim (#11245)
Prior ARM64 images and installations historically used "shim-unsigned" v15.4 in order to boot without Secure Boot enforcing. To ensure a seamless upgrade experience from the older unsigned shim to this new signed shim, include additional RPM dependency logic (Obsoletes on "shim-unsigned" so older installations with "shim-unsigned" installed will upgrade cleanly from the unsigned shim v15.4 to this new signed version of the shim v15.8+ Unlike dnf, our current tdnf does not gracefully handle Obsoletes properly. When the user runs "tdnf install shim-unsigned". The proper behavior with Obsoletes only in place is for this transaction to complete with nothing to do, which is what dnf does. However tdnf still attempts to perform the transaction, which yields undesired results. As a workaround to tdnf's lack of correct support of Obsoletes, add an additional Provides to the shim package to have it "provide" for shim-unsigned as well. This workaround can be removed when tdnf is updated with proper RPM Obsoletes behavior. Signed-off-by: Chris Co <chrco@microsoft.com>
1 parent 73929e3 commit f49c769

3 files changed

Lines changed: 42 additions & 4 deletions

File tree

SPECS/shim-unsigned-aarch64/shim-unsigned-aarch64.spec

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Name: shim-unsigned-aarch64
3232
Provides: shim-unsigned-%{efiarch}
3333

3434
Version: 15.8
35-
Release: 3%{?dist}
35+
Release: 5%{?dist}
3636
Summary: First-stage UEFI bootloader
3737
ExclusiveArch: aarch64
3838
License: BSD
@@ -160,6 +160,12 @@ HASH=$(cat %{buildroot}%{shimdir}/shim%{efiarch}.hash | cut -d ' ' -f 1)
160160
%files debugsource -f build-%{efiarch}/debugsource.list
161161

162162
%changelog
163+
* Thu Nov 28 2024 Chris Co <chrco@microsoft.com> - 15.8-5
164+
- Bump to match shim release
165+
166+
* Tue Nov 26 2024 Chris Co <chrco@microsoft.com> - 15.8-4
167+
- Bump to match shim release
168+
163169
* Tue Mar 12 2024 Dan Streetman <ddstreet@microsoft.com> - 15.8-3
164170
- Initial CBL-Mariner import from Fedora 40 (license: MIT).
165171
- license verified

SPECS/shim-unsigned-x64/shim-unsigned-x64.spec

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
Name: shim-unsigned-%{efiarch}
3838
Version: 15.8
39-
Release: 3%{?dist}
39+
Release: 5%{?dist}
4040
Summary: First-stage UEFI bootloader
4141
ExclusiveArch: x86_64
4242
License: BSD
@@ -221,6 +221,12 @@ HASH=$(cat %{buildroot}%{shimdir}/shim%{efiarch}.hash | cut -d ' ' -f 1)
221221
%files debugsource -f build-%{efiarch}/debugsource.list
222222

223223
%changelog
224+
* Thu Nov 28 2024 Chris Co <chrco@microsoft.com> - 15.8-5
225+
- Bump to match shim release
226+
227+
* Tue Nov 26 2024 Chris Co <chrco@microsoft.com> - 15.8-4
228+
- Bump to match shim release
229+
224230
* Thu Feb 08 2024 Dan Streetman <ddstreet@microsoft.com> - 15.8-3
225231
- Initial CBL-Mariner import from Fedora 40 (license: MIT).
226232
- license verified

SPECS/shim/shim.spec

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
Summary: First stage UEFI bootloader
3838
Name: shim
3939
Version: 15.8
40-
Release: 3%{?dist}
40+
Release: 5%{?dist}
4141
License: BSD
4242
Vendor: Microsoft Corporation
4343
Distribution: Azure Linux
@@ -49,6 +49,26 @@ Provides: shim = %{version}-%{release}
4949
Obsoletes: shim < %{version}-%{release}
5050
Provides: shim-signed = %{version}-%{release}
5151
Provides: shim-signed-%{efiarch} = %{version}-%{release}
52+
# Prior images and installations historically used "shim-unsigned" v15.4
53+
# in order to boot without Secure Boot enforcing.
54+
# To ensure a seamless upgrade experience from the older unsigned shim to
55+
# this new signed shim, include additional RPM dependency logic so older
56+
# installations will upgrade cleanly from the unsigned shim v15.4 to this new
57+
# signed version of the shim v15.8+
58+
Obsoletes: shim-unsigned <= 15.4
59+
# Unlike dnf, our current tdnf does not gracefully handle Obsoletes properly.
60+
# When the user runs "tdnf install shim-unsigned". The proper
61+
# behavior with Obsoletes only in place is for this transaction to
62+
# complete with nothing to do, which is what dnf does. However tdnf still
63+
# attempts to perform the transaction, which yields undesired results and
64+
# potential RPM transaction errors.
65+
#
66+
# As a workaround to tdnf's lack of correct support of Obsoletes, add an
67+
# additional Provides to the shim package to have it "provide" for
68+
# shim-unsigned as well.
69+
# This workaround can be removed when tdnf is updated with proper RPM
70+
# Obsoletes behavior.
71+
Provides: shim-unsigned = %{version}-%{release}
5272

5373
# This is when grub was updated to be signed with the newer Azure Linux certificate
5474
Conflicts: grub2-efi-binary < 2.06-22
@@ -167,7 +187,13 @@ fi
167187
/boot/efi/EFI/%{efidir}/*
168188

169189
%changelog
170-
* Wed Nov 10 2024 Chris Co <chrco@microsoft.com> - 15.8-3
190+
* Thu Nov 28 2024 Chris Co <chrco@microsoft.com> - 15.8-5
191+
- Add Provides for shim-unsigned
192+
193+
* Tue Nov 26 2024 Chris Co <chrco@microsoft.com> - 15.8-4
194+
- Add obsoletes for shim-unsigned v15.4 package
195+
196+
* Sun Nov 10 2024 Chris Co <chrco@microsoft.com> - 15.8-3
171197
- update to 15.8
172198
- include mm
173199
- protect from dnf removal

0 commit comments

Comments
 (0)