With latest rpm version, upon doing `tdnf reinstall -y linux` it removes
initrd because %triggerun gets executed every time.
This patch fixes it by removing initramfs trigger flag files during
%postun by doing some condition checks.
Change-Id: I8323d87a8a9af386ee596850408183d7a20b52d3
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/20028
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Alexey Makhalov <amakhalov@vmware.com>
Reviewed-by: Tapas Kundu <tkundu@vmware.com>
| ... | ... |
@@ -2,9 +2,3 @@ |
| 2 | 2 |
mkdir -p %{_sharedstatedir}/rpm-state/initramfs/pending
|
| 3 | 3 |
touch %{_sharedstatedir}/rpm-state/initramfs/pending/%{uname_r}
|
| 4 | 4 |
echo "initrd generation of kernel %{uname_r} will be triggered later" >&2
|
| 5 |
- |
|
| 6 |
-%triggerun -- initramfs |
|
| 7 |
-rm -f %{_sharedstatedir}/rpm-state/initramfs/pending/%{uname_r} \
|
|
| 8 |
- /boot/initrd.img-%{uname_r}
|
|
| 9 |
- |
|
| 10 |
-echo "initrd of kernel %{uname_r} removed" >&2
|
| ... | ... |
@@ -23,7 +23,7 @@ |
| 23 | 23 |
Summary: Kernel |
| 24 | 24 |
Name: linux-esx |
| 25 | 25 |
Version: 6.1.10 |
| 26 |
-Release: 4%{?kat_build:.kat}%{?dist}
|
|
| 26 |
+Release: 5%{?kat_build:.kat}%{?dist}
|
|
| 27 | 27 |
License: GPLv2 |
| 28 | 28 |
URL: http://www.kernel.org |
| 29 | 29 |
Group: System Environment/Kernel |
| ... | ... |
@@ -496,6 +496,8 @@ ln -sf linux-%{uname_r}.cfg /boot/photon.cfg
|
| 496 | 496 |
%{_usrsrc}/linux-headers-%{uname_r}
|
| 497 | 497 |
|
| 498 | 498 |
%changelog |
| 499 |
+* Tue Mar 21 2023 Shreenidhi Shedi <sshedi@vmware.com> 6.1.10-5 |
|
| 500 |
+- Fix initramfs trigger |
|
| 499 | 501 |
* Thu Mar 16 2023 Keerthana K <keerthanak@vmware.com> 6.1.10-4 |
| 500 | 502 |
- Enable FIPS canister binary usage |
| 501 | 503 |
* Thu Mar 02 2023 Shreenidhi Shedi <sshedi@vmware.com> 6.1.10-3 |
| ... | ... |
@@ -16,7 +16,7 @@ |
| 16 | 16 |
Summary: Kernel |
| 17 | 17 |
Name: linux-rt |
| 18 | 18 |
Version: 6.1.10 |
| 19 |
-Release: 4%{?kat_build:.kat}%{?dist}
|
|
| 19 |
+Release: 5%{?kat_build:.kat}%{?dist}
|
|
| 20 | 20 |
License: GPLv2 |
| 21 | 21 |
URL: http://www.kernel.org |
| 22 | 22 |
Group: System Environment/Kernel |
| ... | ... |
@@ -501,6 +501,8 @@ ln -sf linux-%{uname_r}.cfg /boot/photon.cfg
|
| 501 | 501 |
%{_usrsrc}/linux-headers-%{uname_r}
|
| 502 | 502 |
|
| 503 | 503 |
%changelog |
| 504 |
+* Tue Mar 21 2023 Shreenidhi Shedi <sshedi@vmware.com> 6.1.10-5 |
|
| 505 |
+- Fix initramfs trigger |
|
| 504 | 506 |
* Thu Mar 16 2023 Keerthana K <keerthanak@vmware.com> 6.1.10-4 |
| 505 | 507 |
- Enable FIPS canister binary usage |
| 506 | 508 |
* Thu Mar 02 2023 Shreenidhi Shedi <sshedi@vmware.com> 6.1.10-3 |
| ... | ... |
@@ -16,7 +16,7 @@ |
| 16 | 16 |
Summary: Kernel |
| 17 | 17 |
Name: linux-secure |
| 18 | 18 |
Version: 6.1.10 |
| 19 |
-Release: 6%{?kat_build:.kat}%{?dist}
|
|
| 19 |
+Release: 7%{?kat_build:.kat}%{?dist}
|
|
| 20 | 20 |
License: GPLv2 |
| 21 | 21 |
URL: http://www.kernel.org |
| 22 | 22 |
Group: System Environment/Kernel |
| ... | ... |
@@ -369,6 +369,8 @@ ln -sf linux-%{uname_r}.cfg /boot/photon.cfg
|
| 369 | 369 |
%endif |
| 370 | 370 |
|
| 371 | 371 |
%changelog |
| 372 |
+* Tue Mar 21 2023 Shreenidhi Shedi <sshedi@vmware.com> 6.1.10-7 |
|
| 373 |
+- Fix initramfs trigger |
|
| 372 | 374 |
* Thu Mar 16 2023 Keerthana K <keerthanak@vmware.com> 6.1.10-6 |
| 373 | 375 |
- Build with fips canister binary |
| 374 | 376 |
* Wed Mar 15 2023 Keerthana K <keerthanak@vmware.com> 6.1.10-5 |
| ... | ... |
@@ -23,7 +23,7 @@ |
| 23 | 23 |
Summary: Kernel |
| 24 | 24 |
Name: linux |
| 25 | 25 |
Version: 6.1.10 |
| 26 |
-Release: 6%{?kat_build:.kat}%{?dist}
|
|
| 26 |
+Release: 7%{?kat_build:.kat}%{?dist}
|
|
| 27 | 27 |
License: GPLv2 |
| 28 | 28 |
URL: http://www.kernel.org/ |
| 29 | 29 |
Group: System Environment/Kernel |
| ... | ... |
@@ -706,6 +706,8 @@ ln -sf linux-%{uname_r}.cfg /boot/photon.cfg
|
| 706 | 706 |
%{_datadir}/bash-completion/completions/bpftool
|
| 707 | 707 |
|
| 708 | 708 |
%changelog |
| 709 |
+* Tue Mar 21 2023 Shreenidhi Shedi <sshedi@vmware.com> 6.1.10-7 |
|
| 710 |
+- Fix initramfs trigger |
|
| 709 | 711 |
* Thu Mar 16 2023 Keerthana K <keerthanak@vmware.com> 6.1.10-6 |
| 710 | 712 |
- Enable FIPS canister binary usage |
| 711 | 713 |
* Tue Mar 07 2023 Him Kalyan Bordoloi <bordoloih@vmware.com> 6.1.10-5 |
| ... | ... |
@@ -26,6 +26,12 @@ if [ ! -e /boot/photon.cfg ]; then |
| 26 | 26 |
test -n "$list" && ln -sf "$list" /boot/photon.cfg |
| 27 | 27 |
fi |
| 28 | 28 |
|
| 29 |
+if [ ! -s /boot/linux-%{uname_r}.cfg ]; then
|
|
| 30 |
+ rm -f %{_sharedstatedir}/rpm-state/initramfs/pending/%{uname_r} \
|
|
| 31 |
+ /boot/initrd.img-%{uname_r}
|
|
| 32 |
+ echo "initrd of kernel %{uname_r} removed" >&2
|
|
| 33 |
+fi |
|
| 34 |
+ |
|
| 29 | 35 |
if [ -d "%{modules_backup_loc}" ]; then
|
| 30 | 36 |
if [ ! -s /boot/linux-%{running_kernel_ver}.cfg ]; then
|
| 31 | 37 |
|