diff mbox series

gem5/linux-yocto: upgrade to 5.4.205 and fix buildpaths in binaries

Message ID 20220906152604.238831-1-ross.burton@arm.com
State New
Headers show
Series gem5/linux-yocto: upgrade to 5.4.205 and fix buildpaths in binaries | expand

Commit Message

Ross Burton Sept. 6, 2022, 3:26 p.m. UTC
Upgrade to the latest 5.4 release (.205), and backport two patches to
fix buildpath errors:

File /usr/src/debug/linux-yocto/5.4.205+gitAUTOINC+e8c675c7e1_8a59dfded8-r0/lib/oid_registry_data.c in package linux-yocto-src contains reference to TMPDIR
File /usr/src/debug/linux-yocto/5.4.205+gitAUTOINC+e8c675c7e1_8a59dfded8-r0/drivers/tty/vt/consolemap_deftbl.c in package linux-yocto-src contains reference to TMPDIR [buildpaths]

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 ..._registry-fix-reproducibility-issues.patch | 46 +++++++++++++++
 ...-conmakehash-improve-reproducibility.patch | 56 +++++++++++++++++++
 .../recipes-kernel/linux/linux-yocto_5.4.bb   |  9 ++-
 3 files changed, 108 insertions(+), 3 deletions(-)
 create mode 100644 meta-gem5/recipes-kernel/linux/files/0001-lib-build_OID_registry-fix-reproducibility-issues.patch
 create mode 100644 meta-gem5/recipes-kernel/linux/files/0002-vt-conmakehash-improve-reproducibility.patch

Comments

Jon Mason Sept. 7, 2022, 3:14 a.m. UTC | #1
On Tue, 6 Sep 2022 16:26:04 +0100, Ross Burton wrote:
> Upgrade to the latest 5.4 release (.205), and backport two patches to
> fix buildpath errors:
> 
> File /usr/src/debug/linux-yocto/5.4.205+gitAUTOINC+e8c675c7e1_8a59dfded8-r0/lib/oid_registry_data.c in package linux-yocto-src contains reference to TMPDIR
> File /usr/src/debug/linux-yocto/5.4.205+gitAUTOINC+e8c675c7e1_8a59dfded8-r0/drivers/tty/vt/consolemap_deftbl.c in package linux-yocto-src contains reference to TMPDIR [buildpaths]

Applied, thanks!

[1/1] gem5/linux-yocto: upgrade to 5.4.205 and fix buildpaths in binaries
      commit: 1f7e8b6de90a794a8740594e2f150d371949ccc6

Best regards,
diff mbox series

Patch

diff --git a/meta-gem5/recipes-kernel/linux/files/0001-lib-build_OID_registry-fix-reproducibility-issues.patch b/meta-gem5/recipes-kernel/linux/files/0001-lib-build_OID_registry-fix-reproducibility-issues.patch
new file mode 100644
index 00000000..4c95a415
--- /dev/null
+++ b/meta-gem5/recipes-kernel/linux/files/0001-lib-build_OID_registry-fix-reproducibility-issues.patch
@@ -0,0 +1,46 @@ 
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+
+From f678d79b3bede48c9e095e6e9c46bd3542f23077 Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@gmail.com>
+Date: Sun, 10 Jul 2022 22:56:53 -0400
+Subject: [PATCH 1/2] lib/build_OID_registry: fix reproducibility issues
+
+The script build_OID_registry captures the full path of itself
+in the generated data. This causes reproduciblity issues as the
+path is captured and packaged.
+
+We use the basename of the script instead, and that allows us
+to be reprodicible, with slightly less information captured in
+the output data (but the generating script can still easily
+be found).
+
+Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
+---
+ lib/build_OID_registry | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/lib/build_OID_registry b/lib/build_OID_registry
+index d7fc32ea8ac2..f6de0a7f7457 100755
+--- a/lib/build_OID_registry
++++ b/lib/build_OID_registry
+@@ -8,6 +8,7 @@
+ #
+ 
+ use strict;
++use File::Basename;
+ 
+ my @names = ();
+ my @oids = ();
+@@ -35,7 +36,7 @@ close IN_FILE || die;
+ #
+ open C_FILE, ">$ARGV[1]" or die;
+ print C_FILE "/*\n";
+-print C_FILE " * Automatically generated by ", $0, ".  Do not edit\n";
++print C_FILE " * Automatically generated by ", basename $0, ".  Do not edit\n";
+ print C_FILE " */\n";
+ 
+ #
+-- 
+2.34.1
+
diff --git a/meta-gem5/recipes-kernel/linux/files/0002-vt-conmakehash-improve-reproducibility.patch b/meta-gem5/recipes-kernel/linux/files/0002-vt-conmakehash-improve-reproducibility.patch
new file mode 100644
index 00000000..74156afe
--- /dev/null
+++ b/meta-gem5/recipes-kernel/linux/files/0002-vt-conmakehash-improve-reproducibility.patch
@@ -0,0 +1,56 @@ 
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+
+From 10a09290f97d0435b9b304d3ef980b0cafa87bd2 Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@gmail.com>
+Date: Sun, 10 Jul 2022 21:37:07 -0400
+Subject: [PATCH 2/2] vt/conmakehash: improve reproducibility
+
+The file generated by conmakehash capture the application
+path used to generate the file. While that can be informative,
+it varies based on where the kernel was built, as the full
+path is captured.
+
+We tweak the application to use a second input as the "capture
+name", and then modify the Makefile to pass the basename of
+the source, making it reproducible.
+
+This could be improved by using some sort of path mapping,
+or the application manipualing argv[1] itself, but for now
+this solves the reprodicibility issue.
+
+Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
+---
+ drivers/tty/vt/Makefile | 2 +-
+ scripts/conmakehash.c   | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/tty/vt/Makefile b/drivers/tty/vt/Makefile
+index edbbe0ccdb83..19e21968f8de 100644
+--- a/drivers/tty/vt/Makefile
++++ b/drivers/tty/vt/Makefile
+@@ -13,7 +13,7 @@ obj-$(CONFIG_HW_CONSOLE)		+= vt.o defkeymap.o
+ clean-files := consolemap_deftbl.c defkeymap.c
+ 
+ quiet_cmd_conmk = CONMK   $@
+-      cmd_conmk = scripts/conmakehash $< > $@
++      cmd_conmk = scripts/conmakehash $< $(shell basename $<) > $@
+ 
+ $(obj)/consolemap_deftbl.c: $(src)/$(FONTMAPFILE)
+ 	$(call cmd,conmk)
+diff --git a/scripts/conmakehash.c b/scripts/conmakehash.c
+index cddd789fe46e..d62510b280e9 100644
+--- a/scripts/conmakehash.c
++++ b/scripts/conmakehash.c
+@@ -253,7 +253,7 @@ int main(int argc, char *argv[])
+ #include <linux/types.h>\n\
+ \n\
+ u8 dfont_unicount[%d] = \n\
+-{\n\t", argv[1], fontlen);
++{\n\t", argv[2], fontlen);
+ 
+   for ( i = 0 ; i < fontlen ; i++ )
+     {
+-- 
+2.34.1
+
diff --git a/meta-gem5/recipes-kernel/linux/linux-yocto_5.4.bb b/meta-gem5/recipes-kernel/linux/linux-yocto_5.4.bb
index 99a16690..a1a301cc 100644
--- a/meta-gem5/recipes-kernel/linux/linux-yocto_5.4.bb
+++ b/meta-gem5/recipes-kernel/linux/linux-yocto_5.4.bb
@@ -2,14 +2,17 @@  KBRANCH ?= "v5.4/standard/base"
 
 require recipes-kernel/linux/linux-yocto.inc
 
-SRCREV_machine ?= "e2020dbe2ccaef50d7e8f37a5bf08c68a006a064"
+SRCREV_machine ?= "8a59dfded81659402005acfb06fbb00b71c8ce86"
 SRCREV_meta ?= "e8c675c7e11fbd96cd812dfb9f4f6fb6f92b6abb"
 
 SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRANCH}; \
-           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.4;destsuffix=${KMETA}"
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.4;destsuffix=${KMETA} \
+           file://0001-lib-build_OID_registry-fix-reproducibility-issues.patch \
+           file://0002-vt-conmakehash-improve-reproducibility.patch \
+           "
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
-LINUX_VERSION ?= "5.4.178"
+LINUX_VERSION ?= "5.4.205"
 
 DEPENDS += "openssl-native util-linux-native"