diff options
author | Denys Dmytriyenko <denys@konsulko.com> | 2024-07-15 19:45:39 -0400 |
---|---|---|
committer | Ryan Eatmon <reatmon@ti.com> | 2024-07-17 09:11:43 -0500 |
commit | c56bdd9ffa0136b5772a1ea5628249f1269f11fa (patch) | |
tree | 534aed25bfff101c0a562ce6c0a527fb8f0c0df0 | |
parent | 5d658dc3907e3b57181641eabbcb65fa054a445e (diff) | |
download | meta-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>
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 @@ | |||
1 | From 2fca0fd719812ea2ff67630b01355aa80481623e Mon Sep 17 00:00:00 2001 | ||
2 | From: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
3 | Date: Sun, 10 Jul 2022 22:56:53 -0400 | ||
4 | Subject: [PATCH] lib/build_OID_registry: fix reproducibility issues | ||
5 | |||
6 | The script build_OID_registry captures the full path of itself | ||
7 | in the generated data. This causes reproduciblity issues as the | ||
8 | path is captured and packaged. | ||
9 | |||
10 | We use the basename of the script instead, and that allows us | ||
11 | to be reprodicible, with slightly less information captured in | ||
12 | the output data (but the generating script can still easily | ||
13 | be found). | ||
14 | |||
15 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
16 | |||
17 | Upstream-Status: Inappropriate | ||
18 | |||
19 | Signed-off-by: Denys Dmytriyenko <denys@konsulko.com> | ||
20 | --- | ||
21 | lib/build_OID_registry | 3 ++- | ||
22 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
23 | |||
24 | diff --git a/lib/build_OID_registry b/lib/build_OID_registry | ||
25 | index 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 | -- | ||
46 | 2.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 @@ | |||
1 | From a40d2daf2795d89e3ef8af0413b25190558831ec Mon Sep 17 00:00:00 2001 | ||
2 | From: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
3 | Date: Thu, 14 Jul 2022 14:43:46 -0400 | ||
4 | Subject: [PATCH] pnmtologo: use relocatable file name | ||
5 | |||
6 | The logo generation utility is capturing the source of the logo | ||
7 | in the generated .c file. The source file is absolute (as passed | ||
8 | by make), so the full path is captured. | ||
9 | |||
10 | This makes the source fail reproducibility tests. | ||
11 | |||
12 | We use basename() to just get the source file name, and use | ||
13 | that in the generated .c file. | ||
14 | |||
15 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
16 | |||
17 | Upstream-Status: Inappropriate | ||
18 | |||
19 | Signed-off-by: Denys Dmytriyenko <denys@konsulko.com> | ||
20 | --- | ||
21 | drivers/video/logo/pnmtologo.c | 5 +++-- | ||
22 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
23 | |||
24 | diff --git a/drivers/video/logo/pnmtologo.c b/drivers/video/logo/pnmtologo.c | ||
25 | index 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 | -- | ||
55 | 2.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 @@ | |||
1 | From 0f586f4ee8adacac79b64d1f3d47799a5eb7fbea Mon Sep 17 00:00:00 2001 | ||
2 | From: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
3 | Date: Sun, 10 Jul 2022 21:37:07 -0400 | ||
4 | Subject: [PATCH] vt/conmakehash: improve reproducibility | ||
5 | |||
6 | The file generated by conmakehash capture the application | ||
7 | path used to generate the file. While that can be informative, | ||
8 | it varies based on where the kernel was built, as the full | ||
9 | path is captured. | ||
10 | |||
11 | We tweak the application to use a second input as the "capture | ||
12 | name", and then modify the Makefile to pass the basename of | ||
13 | the source, making it reproducible. | ||
14 | |||
15 | This could be improved by using some sort of path mapping, | ||
16 | or the application manipualing argv[1] itself, but for now | ||
17 | this solves the reprodicibility issue. | ||
18 | |||
19 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
20 | |||
21 | Upstream-Status: Inappropriate | ||
22 | |||
23 | Signed-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 | |||
29 | diff --git a/drivers/tty/vt/Makefile b/drivers/tty/vt/Makefile | ||
30 | index 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) | ||
42 | diff --git a/drivers/tty/vt/conmakehash.c b/drivers/tty/vt/conmakehash.c | ||
43 | index 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 | -- | ||
56 | 2.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. |
13 | KERNEL_DTBDEST = "${KERNEL_IMAGEDEST}/dtb" | 13 | KERNEL_DTBDEST = "${KERNEL_IMAGEDEST}/dtb" |
14 | KERNEL_DTBVENDORED = "1" | 14 | KERNEL_DTBVENDORED = "1" |
15 | |||
16 | SRC_URI += " \ | ||
17 | file://0001-lib-build_OID_registry-fix-reproducibility-issues.patch \ | ||
18 | file://0001-vt-conmakehash-improve-reproducibility.patch \ | ||
19 | file://0001-pnmtologo-use-relocatable-file-name.patch \ | ||
20 | " | ||