blob: 74156afe8e0e30d5038861d85fd837ab81c5914e [file] [log] [blame]
Patrick Williams8dd68482022-10-04 07:57:18 -05001Upstream-Status: Backport
2Signed-off-by: Ross Burton <ross.burton@arm.com>
3
4From 10a09290f97d0435b9b304d3ef980b0cafa87bd2 Mon Sep 17 00:00:00 2001
5From: Bruce Ashfield <bruce.ashfield@gmail.com>
6Date: Sun, 10 Jul 2022 21:37:07 -0400
7Subject: [PATCH 2/2] vt/conmakehash: improve reproducibility
8
9The file generated by conmakehash capture the application
10path used to generate the file. While that can be informative,
11it varies based on where the kernel was built, as the full
12path is captured.
13
14We tweak the application to use a second input as the "capture
15name", and then modify the Makefile to pass the basename of
16the source, making it reproducible.
17
18This could be improved by using some sort of path mapping,
19or the application manipualing argv[1] itself, but for now
20this solves the reprodicibility issue.
21
22Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
23---
24 drivers/tty/vt/Makefile | 2 +-
25 scripts/conmakehash.c | 2 +-
26 2 files changed, 2 insertions(+), 2 deletions(-)
27
28diff --git a/drivers/tty/vt/Makefile b/drivers/tty/vt/Makefile
29index edbbe0ccdb83..19e21968f8de 100644
30--- a/drivers/tty/vt/Makefile
31+++ b/drivers/tty/vt/Makefile
32@@ -13,7 +13,7 @@ obj-$(CONFIG_HW_CONSOLE) += vt.o defkeymap.o
33 clean-files := consolemap_deftbl.c defkeymap.c
34
35 quiet_cmd_conmk = CONMK $@
36- cmd_conmk = scripts/conmakehash $< > $@
37+ cmd_conmk = scripts/conmakehash $< $(shell basename $<) > $@
38
39 $(obj)/consolemap_deftbl.c: $(src)/$(FONTMAPFILE)
40 $(call cmd,conmk)
41diff --git a/scripts/conmakehash.c b/scripts/conmakehash.c
42index cddd789fe46e..d62510b280e9 100644
43--- a/scripts/conmakehash.c
44+++ b/scripts/conmakehash.c
45@@ -253,7 +253,7 @@ int main(int argc, char *argv[])
46 #include <linux/types.h>\n\
47 \n\
48 u8 dfont_unicount[%d] = \n\
49-{\n\t", argv[1], fontlen);
50+{\n\t", argv[2], fontlen);
51
52 for ( i = 0 ; i < fontlen ; i++ )
53 {
54--
552.34.1
56