summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denys@konsulko.com>2024-07-15 19:45:39 -0400
committerRyan Eatmon <reatmon@ti.com>2024-07-17 09:11:43 -0500
commitc56bdd9ffa0136b5772a1ea5628249f1269f11fa (patch)
tree534aed25bfff101c0a562ce6c0a527fb8f0c0df0
parent5d658dc3907e3b57181641eabbcb65fa054a445e (diff)
downloadmeta-ti-c56bdd9ffa0136b5772a1ea5628249f1269f11fa.tar.gz
linux: add linux-yocto reproducibility patches
Add reproducibility patches from linux-yocto to resolve "buildpaths" QA errors. Signed-off-by: Denys Dmytriyenko <denys@konsulko.com> Signed-off-by: Ryan Eatmon <reatmon@ti.com>
-rw-r--r--meta-ti-bsp/recipes-kernel/linux/files/0001-lib-build_OID_registry-fix-reproducibility-issues.patch46
-rw-r--r--meta-ti-bsp/recipes-kernel/linux/files/0001-pnmtologo-use-relocatable-file-name.patch55
-rw-r--r--meta-ti-bsp/recipes-kernel/linux/files/0001-vt-conmakehash-improve-reproducibility.patch56
-rw-r--r--meta-ti-bsp/recipes-kernel/linux/ti-kernel.inc6
4 files changed, 163 insertions, 0 deletions
diff --git a/meta-ti-bsp/recipes-kernel/linux/files/0001-lib-build_OID_registry-fix-reproducibility-issues.patch b/meta-ti-bsp/recipes-kernel/linux/files/0001-lib-build_OID_registry-fix-reproducibility-issues.patch
new file mode 100644
index 00000000..75477ef8
--- /dev/null
+++ b/meta-ti-bsp/recipes-kernel/linux/files/0001-lib-build_OID_registry-fix-reproducibility-issues.patch
@@ -0,0 +1,46 @@
1From 2fca0fd719812ea2ff67630b01355aa80481623e Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@gmail.com>
3Date: Sun, 10 Jul 2022 22:56:53 -0400
4Subject: [PATCH] lib/build_OID_registry: fix reproducibility issues
5
6The script build_OID_registry captures the full path of itself
7in the generated data. This causes reproduciblity issues as the
8path is captured and packaged.
9
10We use the basename of the script instead, and that allows us
11to be reprodicible, with slightly less information captured in
12the output data (but the generating script can still easily
13be found).
14
15Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
16
17Upstream-Status: Inappropriate
18
19Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
20---
21 lib/build_OID_registry | 3 ++-
22 1 file changed, 2 insertions(+), 1 deletion(-)
23
24diff --git a/lib/build_OID_registry b/lib/build_OID_registry
25index d7fc32ea8ac2..f6de0a7f7457 100755
26--- a/lib/build_OID_registry
27+++ b/lib/build_OID_registry
28@@ -8,6 +8,7 @@
29 #
30
31 use strict;
32+use File::Basename;
33
34 my @names = ();
35 my @oids = ();
36@@ -35,7 +36,7 @@ close IN_FILE || die;
37 #
38 open C_FILE, ">$ARGV[1]" or die;
39 print C_FILE "/*\n";
40-print C_FILE " * Automatically generated by ", $0, ". Do not edit\n";
41+print C_FILE " * Automatically generated by ", basename $0, ". Do not edit\n";
42 print C_FILE " */\n";
43
44 #
45--
462.25.1
diff --git a/meta-ti-bsp/recipes-kernel/linux/files/0001-pnmtologo-use-relocatable-file-name.patch b/meta-ti-bsp/recipes-kernel/linux/files/0001-pnmtologo-use-relocatable-file-name.patch
new file mode 100644
index 00000000..bfc081fa
--- /dev/null
+++ b/meta-ti-bsp/recipes-kernel/linux/files/0001-pnmtologo-use-relocatable-file-name.patch
@@ -0,0 +1,55 @@
1From a40d2daf2795d89e3ef8af0413b25190558831ec Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@gmail.com>
3Date: Thu, 14 Jul 2022 14:43:46 -0400
4Subject: [PATCH] pnmtologo: use relocatable file name
5
6The logo generation utility is capturing the source of the logo
7in the generated .c file. The source file is absolute (as passed
8by make), so the full path is captured.
9
10This makes the source fail reproducibility tests.
11
12We use basename() to just get the source file name, and use
13that in the generated .c file.
14
15Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
16
17Upstream-Status: Inappropriate
18
19Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
20---
21 drivers/video/logo/pnmtologo.c | 5 +++--
22 1 file changed, 3 insertions(+), 2 deletions(-)
23
24diff --git a/drivers/video/logo/pnmtologo.c b/drivers/video/logo/pnmtologo.c
25index ada5ef6e51b7..7527be845443 100644
26--- a/drivers/video/logo/pnmtologo.c
27+++ b/drivers/video/logo/pnmtologo.c
28@@ -13,7 +13,7 @@
29 #include <stdlib.h>
30 #include <string.h>
31 #include <unistd.h>
32-
33+#include <libgen.h>
34
35 static const char *programname;
36 static const char *filename;
37@@ -223,6 +223,7 @@ static inline int is_equal(struct color c1, struct color c2)
38
39 static void write_header(void)
40 {
41+ char *filename_basename = basename(filename);
42 /* open logo file */
43 if (outputname) {
44 out = fopen(outputname, "w");
45@@ -235,7 +236,7 @@ static void write_header(void)
46 fputs("/*\n", out);
47 fputs(" * DO NOT EDIT THIS FILE!\n", out);
48 fputs(" *\n", out);
49- fprintf(out, " * It was automatically generated from %s\n", filename);
50+ fprintf(out, " * It was automatically generated from %s\n", filename_basename);
51 fputs(" *\n", out);
52 fprintf(out, " * Linux logo %s\n", logoname);
53 fputs(" */\n\n", out);
54--
552.25.1
diff --git a/meta-ti-bsp/recipes-kernel/linux/files/0001-vt-conmakehash-improve-reproducibility.patch b/meta-ti-bsp/recipes-kernel/linux/files/0001-vt-conmakehash-improve-reproducibility.patch
new file mode 100644
index 00000000..211460c1
--- /dev/null
+++ b/meta-ti-bsp/recipes-kernel/linux/files/0001-vt-conmakehash-improve-reproducibility.patch
@@ -0,0 +1,56 @@
1From 0f586f4ee8adacac79b64d1f3d47799a5eb7fbea Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@gmail.com>
3Date: Sun, 10 Jul 2022 21:37:07 -0400
4Subject: [PATCH] vt/conmakehash: improve reproducibility
5
6The file generated by conmakehash capture the application
7path used to generate the file. While that can be informative,
8it varies based on where the kernel was built, as the full
9path is captured.
10
11We tweak the application to use a second input as the "capture
12name", and then modify the Makefile to pass the basename of
13the source, making it reproducible.
14
15This could be improved by using some sort of path mapping,
16or the application manipualing argv[1] itself, but for now
17this solves the reprodicibility issue.
18
19Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
20
21Upstream-Status: Inappropriate
22
23Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
24---
25 drivers/tty/vt/Makefile | 2 +-
26 drivers/tty/vt/conmakehash.c | 2 +-
27 2 files changed, 2 insertions(+), 2 deletions(-)
28
29diff --git a/drivers/tty/vt/Makefile b/drivers/tty/vt/Makefile
30index fe30ce512819..cb51c21b58f9 100644
31--- a/drivers/tty/vt/Makefile
32+++ b/drivers/tty/vt/Makefile
33@@ -15,7 +15,7 @@ clean-files := consolemap_deftbl.c defkeymap.c
34 hostprogs += conmakehash
35
36 quiet_cmd_conmk = CONMK $@
37- cmd_conmk = $(obj)/conmakehash $< > $@
38+ cmd_conmk = $(obj)/conmakehash $< $(shell basename $<) > $@
39
40 $(obj)/consolemap_deftbl.c: $(src)/$(FONTMAPFILE) $(obj)/conmakehash
41 $(call cmd,conmk)
42diff --git a/drivers/tty/vt/conmakehash.c b/drivers/tty/vt/conmakehash.c
43index cddd789fe46e..d62510b280e9 100644
44--- a/drivers/tty/vt/conmakehash.c
45+++ b/drivers/tty/vt/conmakehash.c
46@@ -253,7 +253,7 @@ int main(int argc, char *argv[])
47 #include <linux/types.h>\n\
48 \n\
49 u8 dfont_unicount[%d] = \n\
50-{\n\t", argv[1], fontlen);
51+{\n\t", argv[2], fontlen);
52
53 for ( i = 0 ; i < fontlen ; i++ )
54 {
55--
562.25.1
diff --git a/meta-ti-bsp/recipes-kernel/linux/ti-kernel.inc b/meta-ti-bsp/recipes-kernel/linux/ti-kernel.inc
index dd5578f5..43d2341a 100644
--- a/meta-ti-bsp/recipes-kernel/linux/ti-kernel.inc
+++ b/meta-ti-bsp/recipes-kernel/linux/ti-kernel.inc
@@ -12,3 +12,9 @@ EXTRA_DTC_ARGS += "${@get_extra_dtc_args(d)}"
12# the kernel. 12# the kernel.
13KERNEL_DTBDEST = "${KERNEL_IMAGEDEST}/dtb" 13KERNEL_DTBDEST = "${KERNEL_IMAGEDEST}/dtb"
14KERNEL_DTBVENDORED = "1" 14KERNEL_DTBVENDORED = "1"
15
16SRC_URI += " \
17file://0001-lib-build_OID_registry-fix-reproducibility-issues.patch \
18file://0001-vt-conmakehash-improve-reproducibility.patch \
19file://0001-pnmtologo-use-relocatable-file-name.patch \
20"