Patrick Williams | 8dd6848 | 2022-10-04 07:57:18 -0500 | [diff] [blame^] | 1 | Upstream-Status: Backport |
| 2 | Signed-off-by: Ross Burton <ross.burton@arm.com> |
| 3 | |
| 4 | From 10a09290f97d0435b9b304d3ef980b0cafa87bd2 Mon Sep 17 00:00:00 2001 |
| 5 | From: Bruce Ashfield <bruce.ashfield@gmail.com> |
| 6 | Date: Sun, 10 Jul 2022 21:37:07 -0400 |
| 7 | Subject: [PATCH 2/2] vt/conmakehash: improve reproducibility |
| 8 | |
| 9 | The file generated by conmakehash capture the application |
| 10 | path used to generate the file. While that can be informative, |
| 11 | it varies based on where the kernel was built, as the full |
| 12 | path is captured. |
| 13 | |
| 14 | We tweak the application to use a second input as the "capture |
| 15 | name", and then modify the Makefile to pass the basename of |
| 16 | the source, making it reproducible. |
| 17 | |
| 18 | This could be improved by using some sort of path mapping, |
| 19 | or the application manipualing argv[1] itself, but for now |
| 20 | this solves the reprodicibility issue. |
| 21 | |
| 22 | Signed-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 | |
| 28 | diff --git a/drivers/tty/vt/Makefile b/drivers/tty/vt/Makefile |
| 29 | index 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) |
| 41 | diff --git a/scripts/conmakehash.c b/scripts/conmakehash.c |
| 42 | index 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 | -- |
| 55 | 2.34.1 |
| 56 | |