mirror of
https://src.fedoraproject.org/rpms/grub2.git
synced 2024-11-27 23:34:51 +00:00
grub.cfg: Fix rpm grub.cfg verification issues
Fix the rpm verificaton issues (see below) introduced in 2.06.123 [1]. On the other hand, 2.06.125 [2] introduced a change on grub2-mkconfig where it prevents overwritting {EFI_HOME}/grub.cfg with side effects on the %posttrans spec script, where it tries to recreate it in case this file does not exist but due to [2] the {EFI}/grub.cfg file is never created. Fix the %posttrans code with the logic but applied to {GRUB_HOME}/grub.cfg. Issue detected on RHEL CI but also reproduced on fedora since 2.06.123, where this change fixes it. $ rpm -Vqa . . .M....... c /boot/grub2/grub.cfg .M....... c /boot/efi/EFI/fedora/grub.cfg .M....... c /boot/grub2/grub.cfg .M....... c /boot/efi/EFI/fedora/grub.cfg .M....... c /boot/grub2/grub.cfg [1]a137559e71
[2]f28d50ee44
Signed-off-by: Leo Sandoval <lsandova@redhat.com>
This commit is contained in:
parent
f28d50ee44
commit
7b5da77f73
2 changed files with 10 additions and 8 deletions
|
@ -674,7 +674,8 @@ install -d -m 0700 ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig \
|
||||||
touch ${RPM_BUILD_ROOT}%{_sysconfdir}/default/grub \
|
touch ${RPM_BUILD_ROOT}%{_sysconfdir}/default/grub \
|
||||||
ln -sf ../default/grub \\\
|
ln -sf ../default/grub \\\
|
||||||
${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/grub \
|
${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/grub \
|
||||||
touch ${RPM_BUILD_ROOT}/boot/grub2/grub.cfg \
|
touch grub.cfg \
|
||||||
|
install -m 0600 grub.cfg ${RPM_BUILD_ROOT}/boot/grub2/ \
|
||||||
ln -s ../boot/grub2/grub.cfg \\\
|
ln -s ../boot/grub2/grub.cfg \\\
|
||||||
${RPM_BUILD_ROOT}%{_sysconfdir}/grub2.cfg \
|
${RPM_BUILD_ROOT}%{_sysconfdir}/grub2.cfg \
|
||||||
%{nil}
|
%{nil}
|
||||||
|
@ -719,7 +720,7 @@ ln -s ../boot/grub2/grub.cfg \\\
|
||||||
%attr(0700,root,root)/boot/grub2/fonts \
|
%attr(0700,root,root)/boot/grub2/fonts \
|
||||||
%dir %attr(0700,root,root)/boot/loader/entries \
|
%dir %attr(0700,root,root)/boot/loader/entries \
|
||||||
%ghost %config(noreplace) %attr(0600,root,root)/boot/grub2/grub.cfg \
|
%ghost %config(noreplace) %attr(0600,root,root)/boot/grub2/grub.cfg \
|
||||||
%ghost %config(noreplace) %verify(not mtime) %attr(0600,root,root)%{efi_esp_dir}/grub.cfg \
|
%ghost %config(noreplace) %verify(not mtime) %attr(0700,root,root)%{efi_esp_dir}/grub.cfg \
|
||||||
%config(noreplace) %verify(not size mode md5 mtime) /boot/grub2/grubenv \
|
%config(noreplace) %verify(not size mode md5 mtime) /boot/grub2/grubenv \
|
||||||
%attr(0644,root,root) %config(noreplace) /etc/dnf/protected.d/grub2-%{1}.conf \
|
%attr(0644,root,root) %config(noreplace) /etc/dnf/protected.d/grub2-%{1}.conf \
|
||||||
%{expand:%if 0%{?without_efi_modules} \
|
%{expand:%if 0%{?without_efi_modules} \
|
||||||
|
|
13
grub2.spec
13
grub2.spec
|
@ -17,7 +17,7 @@
|
||||||
Name: grub2
|
Name: grub2
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
Version: 2.06
|
Version: 2.06
|
||||||
Release: 125%{?dist}
|
Release: 126%{?dist}
|
||||||
Summary: Bootloader with support for Linux, Multiboot and more
|
Summary: Bootloader with support for Linux, Multiboot and more
|
||||||
License: GPL-3.0-or-later
|
License: GPL-3.0-or-later
|
||||||
URL: http://www.gnu.org/software/grub/
|
URL: http://www.gnu.org/software/grub/
|
||||||
|
@ -356,11 +356,9 @@ if ! mountpoint -q ${ESP_PATH}; then
|
||||||
exit 0 # no ESP mounted, nothing to do
|
exit 0 # no ESP mounted, nothing to do
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test ! -f ${EFI_HOME}/grub.cfg; then
|
if test ! -f ${GRUB_HOME}/grub.cfg; then
|
||||||
# there's no config in ESP, create one
|
# there's no config in GRUB home, create one
|
||||||
grub2-mkconfig -o ${EFI_HOME}/grub.cfg
|
grub2-mkconfig -o ${GRUB_HOME}/grub.cfg
|
||||||
cp -a ${EFI_HOME}/grub.cfg ${EFI_HOME}/grub.cfg.rpmsave
|
|
||||||
cp -a ${EFI_HOME}/grub.cfg ${GRUB_HOME}/
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (((grep -q "configfile" ${EFI_HOME}/grub.cfg && grep -q "root-dev-only" ${EFI_HOME}/grub.cfg) || grep -q "source" ${EFI_HOME}/grub.cfg) && ! grep -q "# It is automatically generated by grub2-mkconfig using templates" ${EFI_HOME}/grub.cfg); then
|
if (((grep -q "configfile" ${EFI_HOME}/grub.cfg && grep -q "root-dev-only" ${EFI_HOME}/grub.cfg) || grep -q "source" ${EFI_HOME}/grub.cfg) && ! grep -q "# It is automatically generated by grub2-mkconfig using templates" ${EFI_HOME}/grub.cfg); then
|
||||||
|
@ -555,6 +553,9 @@ mv ${EFI_HOME}/grub.cfg.stb ${EFI_HOME}/grub.cfg
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Jul 22 2024 Leo Sandoval <lsandova@redhat.com> - 2.06.126
|
||||||
|
- grub.cfg: Fix rpm grub.cfg verification issues
|
||||||
|
|
||||||
* Tue Jul 16 2024 Nicolas Frayer <nfrayer@redhat.com> - 2.06-125
|
* Tue Jul 16 2024 Nicolas Frayer <nfrayer@redhat.com> - 2.06-125
|
||||||
- grub2-mkconfig: Prevent mkconfig from overwriting grub cfg stub
|
- grub2-mkconfig: Prevent mkconfig from overwriting grub cfg stub
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue