aboutsummaryrefslogtreecommitdiffstats
path: root/patches/misc/pnmtologo-use-relocatable-file-name.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/misc/pnmtologo-use-relocatable-file-name.patch')
-rw-r--r--patches/misc/pnmtologo-use-relocatable-file-name.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/patches/misc/pnmtologo-use-relocatable-file-name.patch b/patches/misc/pnmtologo-use-relocatable-file-name.patch
new file mode 100644
index 00000000..bcfb5904
--- /dev/null
+++ b/patches/misc/pnmtologo-use-relocatable-file-name.patch
@@ -0,0 +1,52 @@
+From 4da597cafebb4d6743da1dd54099dadb6c356e08 Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@gmail.com>
+Date: Thu, 14 Jul 2022 14:43:46 -0400
+Subject: [PATCH] pnmtologo: use relocatable file name
+
+The logo generation utility is capturing the source of the logo
+in the generated .c file. The source file is absolute (as passed
+by make), so the full path is captured.
+
+This makes the source fail reproducibility tests.
+
+We use basename() to just get the source file name, and use
+that in the generated .c file.
+
+Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
+---
+ drivers/video/logo/pnmtologo.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/video/logo/pnmtologo.c b/drivers/video/logo/pnmtologo.c
+index ada5ef6e51b7..7527be845443 100644
+--- a/drivers/video/logo/pnmtologo.c
++++ b/drivers/video/logo/pnmtologo.c
+@@ -13,7 +13,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+-
++#include <libgen.h>
+
+ static const char *programname;
+ static const char *filename;
+@@ -223,6 +223,7 @@ static inline int is_equal(struct color c1, struct color c2)
+
+ static void write_header(void)
+ {
++ char *filename_basename = basename(filename);
+ /* open logo file */
+ if (outputname) {
+ out = fopen(outputname, "w");
+@@ -235,7 +236,7 @@ static void write_header(void)
+ fputs("/*\n", out);
+ fputs(" * DO NOT EDIT THIS FILE!\n", out);
+ fputs(" *\n", out);
+- fprintf(out, " * It was automatically generated from %s\n", filename);
++ fprintf(out, " * It was automatically generated from %s\n", filename_basename);
+ fputs(" *\n", out);
+ fprintf(out, " * Linux logo %s\n", logoname);
+ fputs(" */\n\n", out);
+--
+2.34.1
+