From d62cf1119cb7769960930c57f420683e0223c960 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 06 2019 11:57:55 +0000 Subject: import grub2-2.02-0.80.el7 --- diff --git a/.gitignore b/.gitignore index 1118eab..8173666 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ SOURCES/grub-2.02~beta2.tar.xz SOURCES/unifont-5.1.20080820.pcf.gz -SOURCES/centos.cer diff --git a/.grub2.metadata b/.grub2.metadata index c59c687..a7bf121 100644 --- a/.grub2.metadata +++ b/.grub2.metadata @@ -1,3 +1,2 @@ 1bf580f1e8bce4909a7ac7ca485cee02b00ed383 SOURCES/grub-2.02~beta2.tar.xz 87f8600ba24e521b5d20bdf6c4b71af8ae861e3a SOURCES/unifont-5.1.20080820.pcf.gz -6e9105eb51e55a46761838f289a917611cad8091 SOURCES/centos.cer diff --git a/SOURCES/0289-efidisk-prevent-errors-from-diskfilter-scan-of-remov.patch b/SOURCES/0289-efidisk-prevent-errors-from-diskfilter-scan-of-remov.patch new file mode 100644 index 0000000..70abdb9 --- /dev/null +++ b/SOURCES/0289-efidisk-prevent-errors-from-diskfilter-scan-of-remov.patch @@ -0,0 +1,54 @@ +From 8f4dc1510c0f42a549b91c28eda74fe8a1e2a5d4 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Fri, 26 Feb 2016 21:44:37 +0300 +Subject: [PATCH] efidisk: prevent errors from diskfilter scan of removable + drives + +Map EFI_NO_MEDIA to GRUB_ERR_OUT_OF_RANGE that is ignored by diskfilter. This +actually matches pretty close (we obviously attempt to read outside of media) +and avoids adding more error codes. + +This affects only internally initiated scans. If read/write from removable is +explicitly requested, we still return an error and text explanation is more +clear for user than generic error. + +Reported and tested by Andreas Loew +--- + grub-core/disk/efi/efidisk.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c +index f04f20b84ff..41adc1b0421 100644 +--- a/grub-core/disk/efi/efidisk.c ++++ b/grub-core/disk/efi/efidisk.c +@@ -575,9 +575,11 @@ grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t sector, + + status = grub_efidisk_readwrite (disk, sector, size, buf, 0); + +- if (status != GRUB_EFI_SUCCESS) ++ if (status == GRUB_EFI_NO_MEDIA) ++ return grub_error (GRUB_ERR_OUT_OF_RANGE, "no media in `%s'", disk->name); ++ else if (status != GRUB_EFI_SUCCESS) + return grub_error (GRUB_ERR_READ_ERROR, +- N_("failure reading sector 0x%llx from `%s'"), ++ "failure reading sector 0x%llx from `%s'", + (unsigned long long) sector, + disk->name); + +@@ -596,9 +598,11 @@ grub_efidisk_write (struct grub_disk *disk, grub_disk_addr_t sector, + + status = grub_efidisk_readwrite (disk, sector, size, (char *) buf, 1); + +- if (status != GRUB_EFI_SUCCESS) ++ if (status == GRUB_EFI_NO_MEDIA) ++ return grub_error (GRUB_ERR_OUT_OF_RANGE, "no media in `%s'", disk->name); ++ else if (status != GRUB_EFI_SUCCESS) + return grub_error (GRUB_ERR_WRITE_ERROR, +- N_("failure writing sector 0x%llx to `%s'"), ++ "failure writing sector 0x%llx to `%s'", + (unsigned long long) sector, disk->name); + + return GRUB_ERR_NONE; +-- +2.20.1 + diff --git a/SOURCES/centos-ca-secureboot.der b/SOURCES/centos-ca-secureboot.der deleted file mode 100644 index 44a2563..0000000 Binary files a/SOURCES/centos-ca-secureboot.der and /dev/null differ diff --git a/SOURCES/centossecureboot001.crt b/SOURCES/centossecureboot001.crt deleted file mode 100644 index c67b0f3..0000000 --- a/SOURCES/centossecureboot001.crt +++ /dev/null @@ -1,81 +0,0 @@ -Certificate: - Data: - Version: 3 (0x2) - Serial Number: - b6:16:15:71:72:fb:31:7e - Signature Algorithm: sha256WithRSAEncryption - Issuer: CN=CentOS Secure Boot (CA key 1)/emailAddress=security@centos.org - Validity - Not Before: Aug 1 11:47:30 2018 GMT - Not After : Dec 31 11:47:30 2037 GMT - Subject: CN=CentOS Secure Boot (key 1)/emailAddress=security@centos.org - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (2048 bit) - Modulus (2048 bit): - 00:c1:a3:6a:f4:2d:71:83:6c:21:ca:0c:b7:ac:fa: - 76:80:43:03:40:87:5d:de:e9:1e:df:ad:e7:2b:51: - cb:f8:31:0f:9a:db:ab:23:25:04:11:05:57:7d:f2: - 4b:8d:1e:b3:75:78:1d:b9:57:8b:18:0b:bb:7e:e3: - 24:0f:6a:40:5f:2b:4f:03:a5:85:94:d2:f9:08:a0: - bc:db:a5:ea:4f:7f:e8:7c:d1:a9:f8:f0:9c:25:18: - 00:14:c4:c4:35:7d:1d:4c:8a:8d:95:f8:ed:65:97: - a5:a4:da:7d:cb:f0:33:3b:b7:03:94:68:47:05:57: - 6c:96:91:ac:14:f2:e3:f6:6d:4a:18:cf:68:8a:35: - 6f:8e:26:99:7f:db:c9:83:54:c2:c3:bf:ad:45:a0: - aa:a0:86:5f:20:b1:86:1b:ae:b7:28:15:11:f9:65: - 53:5d:70:33:9b:a3:c7:b5:c8:11:ff:55:3b:e7:46: - f1:6c:6b:8c:bb:f2:9f:36:23:b1:2d:23:2f:8f:4f: - 6c:a8:cc:ae:f5:56:9e:22:6c:0e:9a:4a:b1:bd:b2: - 76:15:5c:05:85:b8:5e:dc:8c:a5:c3:e0:75:51:a4: - 94:9b:03:2e:7b:f8:d3:b9:dd:7f:88:ce:2e:2f:28: - 4c:b4:92:2f:e6:e0:67:0a:d0:ff:c5:d2:79:a6:ef: - 94:0f - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Basic Constraints: critical - CA:FALSE - X509v3 Key Usage: - Digital Signature - X509v3 Subject Key Identifier: - F0:37:C6:EA:EC:36:D4:05:7A:52:6C:0E:C6:D5:A9:5B:32:4E:E1:29 - X509v3 Authority Key Identifier: - keyid:54:EC:81:85:89:3E:E9:1A:DB:08:F7:44:88:54:7E:8E:3F:74:3A:F3 - - Signature Algorithm: sha256WithRSAEncryption - 97:97:ba:a6:0b:5b:bb:84:39:2e:ef:8b:51:9a:89:bb:65:3c: - dc:15:d0:5a:88:c5:af:ce:93:f5:c1:74:98:15:59:a9:38:da: - 11:fd:46:d5:4f:23:7c:03:1f:ae:0c:70:93:94:a7:61:2f:4b: - 2f:5f:bb:cc:8a:d7:4a:24:66:73:85:b4:19:13:fc:6a:61:4a: - 28:1f:a2:38:f4:72:90:03:c4:3e:64:63:8b:fb:15:22:22:4e: - b9:43:d9:b4:3d:3a:60:c1:4d:3a:09:85:68:7a:bc:3b:f9:ef: - f3:f5:e9:c9:4f:80:8c:c6:e9:cb:ef:28:44:b0:5d:d4:9e:4f: - 0f:02:9a:65:aa:98:35:b4:6f:d2:80:e3:08:ef:12:d0:17:56: - a6:a1:42:1e:1d:ab:e5:33:c0:fd:88:0d:40:42:81:c8:27:30: - 17:07:57:3e:05:9d:aa:05:0e:5b:3a:79:b4:29:aa:7c:42:5a: - ad:43:59:fb:34:4d:dc:62:58:63:e4:fb:de:bb:fd:6c:4e:97: - 58:f4:b9:99:4a:71:fe:7f:16:50:55:25:46:39:96:9b:88:6c: - 75:19:33:9e:70:b3:04:82:fe:16:a8:8e:22:47:83:6d:16:77: - da:26:ad:31:d8:06:6d:c5:7e:46:4b:21:ab:ae:ec:2a:93:71: - da:7f:89:1d ------BEGIN CERTIFICATE----- -MIIDdTCCAl2gAwIBAgIJALYWFXFy+zF+MA0GCSqGSIb3DQEBCwUAMEwxJjAkBgNV -BAMMHUNlbnRPUyBTZWN1cmUgQm9vdCAoQ0Ega2V5IDEpMSIwIAYJKoZIhvcNAQkB -FhNzZWN1cml0eUBjZW50b3Mub3JnMB4XDTE4MDgwMTExNDczMFoXDTM3MTIzMTEx -NDczMFowSTEjMCEGA1UEAxMaQ2VudE9TIFNlY3VyZSBCb290IChrZXkgMSkxIjAg -BgkqhkiG9w0BCQEWE3NlY3VyaXR5QGNlbnRvcy5vcmcwggEiMA0GCSqGSIb3DQEB -AQUAA4IBDwAwggEKAoIBAQDBo2r0LXGDbCHKDLes+naAQwNAh13e6R7frecrUcv4 -MQ+a26sjJQQRBVd98kuNHrN1eB25V4sYC7t+4yQPakBfK08DpYWU0vkIoLzbpepP -f+h80an48JwlGAAUxMQ1fR1Mio2V+O1ll6Wk2n3L8DM7twOUaEcFV2yWkawU8uP2 -bUoYz2iKNW+OJpl/28mDVMLDv61FoKqghl8gsYYbrrcoFRH5ZVNdcDObo8e1yBH/ -VTvnRvFsa4y78p82I7EtIy+PT2yozK71Vp4ibA6aSrG9snYVXAWFuF7cjKXD4HVR -pJSbAy57+NO53X+Izi4vKEy0ki/m4GcK0P/F0nmm75QPAgMBAAGjXTBbMAwGA1Ud -EwEB/wQCMAAwCwYDVR0PBAQDAgeAMB0GA1UdDgQWBBTwN8bq7DbUBXpSbA7G1alb -Mk7hKTAfBgNVHSMEGDAWgBRU7IGFiT7pGtsI90SIVH6OP3Q68zANBgkqhkiG9w0B -AQsFAAOCAQEAl5e6pgtbu4Q5Lu+LUZqJu2U83BXQWojFr86T9cF0mBVZqTjaEf1G -1U8jfAMfrgxwk5SnYS9LL1+7zIrXSiRmc4W0GRP8amFKKB+iOPRykAPEPmRji/sV -IiJOuUPZtD06YMFNOgmFaHq8O/nv8/XpyU+AjMbpy+8oRLBd1J5PDwKaZaqYNbRv -0oDjCO8S0BdWpqFCHh2r5TPA/YgNQEKByCcwFwdXPgWdqgUOWzp5tCmqfEJarUNZ -+zRN3GJYY+T73rv9bE6XWPS5mUpx/n8WUFUlRjmWm4hsdRkznnCzBIL+FqiOIkeD -bRZ32iatMdgGbcV+Rkshq67sKpNx2n+JHQ== ------END CERTIFICATE----- diff --git a/SOURCES/grub.macros b/SOURCES/grub.macros index 728b23f..20a2f97 100644 --- a/SOURCES/grub.macros +++ b/SOURCES/grub.macros @@ -101,6 +101,16 @@ -e 's/-m64//g' \\\ ) %{nil} %endif +%ifarch %{ix86} +%global target_cpu_name %{_arch} +%global grub_target_name %{_arch}-pc + +%global legacy_target_cpu_name i386 +%global legacy_package_arch pc +%global platform pc + +%global with_legacy_arch 0 +%endif %ifarch aarch64 %global efiarch aa64 @@ -152,6 +162,14 @@ %global with_efi_common 1 %global with_legacy_common 0 %endif +%ifarch %{ix86} +%global with_efi_arch 0 +%global with_alt_efi_arch 0 +%global with_efi_common 0 +%global with_legacy_common 1 +%global with_legacy_utils 1 +%global with_legacy_arch 0 +%endif %if 0%{with_efi_common} %global common_srcdir grub-%{grubefiarch}-%{tarversion} @@ -327,7 +345,7 @@ GRUB_MODULES=" all_video boot btrfs cat chain configfile echo \\\ gzio halt hfsplus iso9660 jpeg loadenv loopback \\\ lvm mdraid09 mdraid1x minicmd normal part_apple \\\ part_msdos part_gpt password_pbkdf2 png reboot \\\ - search search_fs_uuid search_fs_file \\\ + regexp search search_fs_uuid search_fs_file \\\ search_label serial sleep syslinuxcfg test tftp \\\ video xfs" \ GRUB_MODULES+=%{efi_modules} \ @@ -472,11 +490,11 @@ cd .. \ %{expand:%%files %{1}} \ %defattr(-,root,root,-) \ %config(noreplace) %{_sysconfdir}/%{name}-efi.cfg \ -%dir %attr(0700,root,root)/boot/efi/EFI/%{efidir} \ -%attr(0700,root,root)/boot/efi/EFI/%{efidir}/%{2} \ -%attr(0700,root,root)/boot/efi/EFI/%{efidir}/fonts \ -%ghost %config(noreplace) %attr(0700,root,root)/boot/efi/EFI/%{efidir}/grub.cfg \ -/boot/grub2/grubenv \ +%verify(not mtime) %dir %attr(0700,root,root)/boot/efi/EFI/%{efidir} \ +%verify(not mtime) %attr(0700,root,root)/boot/efi/EFI/%{efidir}/%{2} \ +%verify(not mtime) %attr(0700,root,root)/boot/efi/EFI/%{efidir}/fonts \ +%ghost %config(noreplace) %verify(not mtime) %attr(0700,root,root)/boot/efi/EFI/%{efidir}/grub.cfg \ +%config(noreplace) /boot/grub2/grubenv \ %ghost %config(noreplace) %attr(0700,root,root)/boot/efi/EFI/%{efidir}/grubenv \ \ %{expand:%%files %{1}-modules} \ @@ -487,6 +505,6 @@ cd .. \ \ %{expand:%%files %{1}-cdboot} \ %defattr(-,root,root,-) \ -%attr(0700,root,root)/boot/efi/EFI/%{efidir}/%{3} \ -%attr(0700,root,root)/boot/efi/EFI/%{efidir}/fonts \ +%verify(not mtime) %attr(0700,root,root)/boot/efi/EFI/%{efidir}/%{3} \ +%verify(not mtime) %attr(0700,root,root)/boot/efi/EFI/%{efidir}/fonts \ %{nil} diff --git a/SOURCES/grub.patches b/SOURCES/grub.patches index 26b949d..5fda75b 100644 --- a/SOURCES/grub.patches +++ b/SOURCES/grub.patches @@ -285,4 +285,5 @@ Patch0284: 0284-arm64-setjmp-Add-missing-license-macro.patch Patch0285: 0285-editenv-handle-relative-symlinks.patch Patch0286: 0286-efinet-also-use-the-firmware-acceleration-for-http.patch Patch0287: 0287-Make-root_url-reflect-the-protocol-hostname-of-our-b.patch -Patch0289: 0288-efi-uga-Fix-PCIe-LER-when-GRUB2-accesses-non-enabled.patch +Patch0288: 0288-efi-uga-Fix-PCIe-LER-when-GRUB2-accesses-non-enabled.patch +Patch0289: 0289-efidisk-prevent-errors-from-diskfilter-scan-of-remov.patch diff --git a/SPECS/grub2.spec b/SPECS/grub2.spec index 2bd5c4e..60122d1 100644 --- a/SPECS/grub2.spec +++ b/SPECS/grub2.spec @@ -1,23 +1,12 @@ %undefine _hardened_build -%global flagday 1:2.02-0.76.el7.centos + %global tarversion 2.02~beta2 %undefine _missing_build_ids_terminate_build -%define pesign_name centossecureboot001 - -%ifarch i686 -%define platform pc -%define legacy_package_arch i386 -%define legacy_target_cpu_name i386 -%define target_cpu_name i386 -%endif -%ifarch x86_64 -%define mock 1 -%endif Name: grub2 Epoch: 1 Version: 2.02 -Release: 0.76%{?dist}%{?buildid}.1 +Release: 0.80%{?dist}%{?buildid} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base License: GPLv3+ @@ -26,9 +15,8 @@ Source0: ftp://alpha.gnu.org/gnu/grub/grub-%{tarversion}.tar.xz #Source0: ftp://ftp.gnu.org/gnu/grub/grub-%%{tarversion}.tar.xz Source1: grub.macros Source2: grub.patches -Source3: centos-ca-secureboot.der -Source4: centossecureboot001.crt -#(source removed) +Source3: securebootca.cer +Source4: secureboot.cer Source5: http://unifoundry.com/unifont-5.1.20080820.pcf.gz Source6: gitignore @@ -47,13 +35,6 @@ BuildRequires: /usr/lib64/crt1.o glibc-static glibc-devel %else %ifarch x86_64 BuildRequires: /usr/lib64/crt1.o glibc-static(x86-64) glibc-devel(x86-64) -# glibc32 is what will be in the buildroots, but glibc-static(x86-32) is what -# will be in an epel-7 (i.e. centos) mock root. I think. -%if 0%{?centos}%{?mock} -BuildRequires: /usr/lib/crt1.o glibc-static(x86-32) glibc-devel(x86-32) -%else -BuildRequires: /usr/lib/crt1.o glibc32 -%endif %else # ppc64 builds need the ppc crt1.o BuildRequires: /usr/lib/crt1.o glibc-static glibc-devel @@ -70,11 +51,8 @@ BuildRequires: pesign >= 0.99-8 %if %{?_with_ccache: 1}%{?!_with_ccache: 0} BuildRequires: ccache %endif -%if 0%{?centos} -%global efidir centos -%endif -ExcludeArch: s390 s390x %{arm} +ExcludeArch: s390 s390x %{arm} %{?ix86} Obsoletes: %{name} <= %{flagday} %if 0%{with_legacy_arch} @@ -157,11 +135,6 @@ This subpackage provides tools for support of all platforms. %prep %setup -T -c -n grub-%{tarversion} %do_common_setup -sed -i.orig -e 's@/efi/EFI/redhat/@/efi/EFI/%{efidir}/@' \ - grub-%{tarversion}/util/grub-setpassword.in -touch --reference=grub-%{tarversion}/util/grub-setpassword.in.orig \ - grub-%{tarversion}/util/grub-setpassword.in -rm -f grub-%{tarversion}/util/grub-setpassword.in.orig %if 0%{with_efi_arch} %do_setup %{grubefiarch} %endif @@ -174,10 +147,10 @@ rm -f grub-%{tarversion}/util/grub-setpassword.in.orig %build %if 0%{with_efi_arch} -%do_primary_efi_build %{grubefiarch} %{grubefiname} %{grubeficdname} %{_target_platform} "'%{efi_cflags}'" %{SOURCE3} %{SOURCE4} %{pesign_name} +%do_primary_efi_build %{grubefiarch} %{grubefiname} %{grubeficdname} %{_target_platform} "'%{efi_cflags}'" %{SOURCE3} %{SOURCE4} redhatsecureboot301 %endif %if 0%{with_alt_efi_arch} -%do_alt_efi_build %{grubaltefiarch} %{grubaltefiname} %{grubalteficdname} %{_alt_target_platform} "'%{alt_efi_cflags}'" %{SOURCE3} %{SOURCE4} %{pesign_name} +%do_alt_efi_build %{grubaltefiarch} %{grubaltefiname} %{grubalteficdname} %{_alt_target_platform} "'%{alt_efi_cflags}'" %{SOURCE3} %{SOURCE4} redhatsecureboot301 %endif %if 0%{with_legacy_arch}%{with_legacy_utils} %do_legacy_build %{grublegacyarch} @@ -336,7 +309,7 @@ fi %exclude /boot/%{name}/themes/system/* %attr(0700,root,root) %dir /boot/grub2 %exclude /boot/grub2/* -%dir %attr(0700,root,root)/boot/efi/EFI/%{efidir} +%dir %verify(not mtime) %attr(0700,root,root)/boot/efi/EFI/%{efidir} %exclude /boot/efi/EFI/%{efidir}/* %license %{common_srcdir}/COPYING %ghost %config(noreplace) /boot/grub2/grubenv @@ -489,13 +462,25 @@ fi %endif %changelog -* Tue Jan 29 2019 CentOS Sources - 2.02-0.76.el7.centos.1 -- Roll in CentOS Secureboot keys -- Move the edidir to be CentOS, so people can co-install fedora, rhel and centos +* Wed Mar 27 2019 Javier Martinez Canillas - 2.02-0.80 +- Rebuild with correct build target for signing + Resolves: rhbz#1693213 + +* Tue Mar 26 2019 Javier Martinez Canillas - 2.02-0.79 +- Ignore the modification time when doing RPM verification of /boot/efi files + Resolves: rhbz#1496952 + +* Wed Mar 20 2019 Javier Martinez Canillas - 2.02-0.78 +- Prevent errors from diskfilter scan of removable drives + Resolves: rhbz#1446418 +- Avoid grub2-efi package to overwrite existing /boot/grub2/grubenv file + Resolves: rhbz#1497918 +- Remove glibc32 and glibc-static(x86-32) BuildRequires + Resolves: rhbz#1614259 -* Mon Nov 12 2018 Javier Martinez Canillas - 2.02-0.76.e7_6.1 +* Thu Oct 25 2018 Javier Martinez Canillas - 2.02-0.77 - Re-enable regexp module - Resolves: rhbz#1647527 + Resolves: rhbz#1630678 * Mon Jul 30 2018 pjones - 2.02.0.76 - Fix PCIe probing in EFI UGA driver.