summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-12-19 14:35:40 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-01-04 11:45:46 +0000
commit28dfda38e157d9ea59883784a0191ddeeb8666ac (patch)
treece3f27075a5921120618a73ff75996c284000172
parentb274b3434f89dfc1f06589fc530b64b592cfedd7 (diff)
downloadpoky-28dfda38e157d9ea59883784a0191ddeeb8666ac.tar.gz
grub: Fix build reproducibility issue
We're seeing reproducibility issue on the autobuilder due to changing module dependency ordering. Add some sorting to an awk script to fix this. (From OE-Core rev: c494d69efbc9035d6d9ff8dae8a606aeaf378adc) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 925ddd5edccbfec52ff45c1b54ab2ae1bfe0d57c) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-bsp/grub/files/determinism.patch24
-rw-r--r--meta/recipes-bsp/grub/grub2.inc1
2 files changed, 25 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/files/determinism.patch b/meta/recipes-bsp/grub/files/determinism.patch
new file mode 100644
index 0000000000..c4b1d3a2a8
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/determinism.patch
@@ -0,0 +1,24 @@
1The output in moddep.lst generated from syminfo.lst using genmoddep.awk is
2not deterministic since the order of the dependencies on each line can vary
3depending on how awk sorts the values in the array.
4
5Be deterministic in the output by sorting the dependencies on each line.
6
7Upstream-Status: Pending
8Richard Purdie <richard.purdie@linuxfoundation.org>
9
10Index: grub-2.04/grub-core/genmoddep.awk
11===================================================================
12--- grub-2.04.orig/grub-core/genmoddep.awk
13+++ grub-2.04/grub-core/genmoddep.awk
14@@ -59,7 +59,9 @@ END {
15 }
16 modlist = ""
17 depcount[mod] = 0
18- for (depmod in uniqmods) {
19+ n = asorti(uniqmods, w)
20+ for (i = 1; i <= n; i++) {
21+ depmod = w[i]
22 modlist = modlist " " depmod;
23 inverse_dependencies[depmod] = inverse_dependencies[depmod] " " mod
24 depcount[mod]++
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc
index ff17dbe8b7..95c25d78f9 100644
--- a/meta/recipes-bsp/grub/grub2.inc
+++ b/meta/recipes-bsp/grub/grub2.inc
@@ -27,6 +27,7 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \
27 file://script-Remove-unused-fields-from-grub_script_functio.patch \ 27 file://script-Remove-unused-fields-from-grub_script_functio.patch \
28 file://CVE-2020-15706-script-Avoid-a-use-after-free-when-redefining-a-func.patch \ 28 file://CVE-2020-15706-script-Avoid-a-use-after-free-when-redefining-a-func.patch \
29 file://CVE-2020-15707-linux-Fix-integer-overflows-in-initrd-size-handling.patch \ 29 file://CVE-2020-15707-linux-Fix-integer-overflows-in-initrd-size-handling.patch \
30 file://determinism.patch \
30" 31"
31SRC_URI[md5sum] = "5ce674ca6b2612d8939b9e6abed32934" 32SRC_URI[md5sum] = "5ce674ca6b2612d8939b9e6abed32934"
32SRC_URI[sha256sum] = "f10c85ae3e204dbaec39ae22fa3c5e99f0665417e91c2cb49b7e5031658ba6ea" 33SRC_URI[sha256sum] = "f10c85ae3e204dbaec39ae22fa3c5e99f0665417e91c2cb49b7e5031658ba6ea"