Linux-fbdev Archive mirror
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: Helge Deller <deller@gmx.de>
Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
	kernel@pengutronix.de, patchwork-lst@pengutronix.de
Subject: [PATCH] drivers: video: logo: Don't mention the full path of the input in output
Date: Thu,  4 Apr 2024 14:18:24 +0200	[thread overview]
Message-ID: <20240404121824.3330254-1-l.stach@pengutronix.de> (raw)

This change strips $abs_srctree of the input file containing the
PNM data in the generated output. The motivation for this change
is Yocto emitting a build warning

    WARNING: linux-foo-6.8-r0 do_package_qa: QA Issue:
    File /usr/src/debug/linux-foo/6.8-r0/drivers/video/logo/logo_linux_clut224.c
    in package linux-foo-src contains reference to TMPDIR

So this change brings us one step closer to make the build result
reproducible independent of the build path.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/video/logo/pnmtologo.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/video/logo/pnmtologo.c b/drivers/video/logo/pnmtologo.c
index 2434a25afb64..59ccd721e8af 100644
--- a/drivers/video/logo/pnmtologo.c
+++ b/drivers/video/logo/pnmtologo.c
@@ -223,6 +223,18 @@ static inline int is_equal(struct color c1, struct color c2)
 
 static void write_header(void)
 {
+	const char *abs_srctree = getenv("abs_srctree");
+	const char *rel_filename;
+
+	if (abs_srctree &&
+	    !strncmp(abs_srctree, filename, strlen(abs_srctree))) {
+		rel_filename = filename + strlen(abs_srctree);
+		while (*rel_filename == '/')
+			++rel_filename;
+	} else {
+		rel_filename = filename;
+	}
+
 	/* open logo file */
 	if (outputname) {
 		out = fopen(outputname, "w");
@@ -235,7 +247,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", rel_filename);
 	fputs(" *\n", out);
 	fprintf(out, " *  Linux logo %s\n", logoname);
 	fputs(" */\n\n", out);
-- 
2.39.2


             reply	other threads:[~2024-04-04 12:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-04 12:18 Lucas Stach [this message]
2024-04-04 13:15 ` [PATCH] drivers: video: logo: Don't mention the full path of the input in output Helge Deller
2024-04-04 16:44   ` Lucas Stach
2024-04-04 17:56     ` Helge Deller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240404121824.3330254-1-l.stach@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=patchwork-lst@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).