public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH zfsonlinux] d/patches: add patch to fetch zfs_gitrev from d/changelog
Date: Fri, 30 Oct 2026 12:09:06 +0100	[thread overview]
Message-ID: <20261030110910.615366-1-s.ivanov@proxmox.com> (raw)

This is a purely cosmetic fix for inconsistencies in the ouput of
`sysctl kernel.spl.gitrev` for our kernels.

Tested by building kernels via sbuild and directly via make deb, and
checking the results.

Difference can for example be observed in 7.0.14-19-pve vs.
7.0.14-26-pve.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 ...rev.sh-prefer-version-from-d-changel.patch | 46 +++++++++++++++++++
 debian/patches/series                         |  1 +
 2 files changed, 47 insertions(+)
 create mode 100644 debian/patches/0026-scripts-make_gitrev.sh-prefer-version-from-d-changel.patch

diff --git a/debian/patches/0026-scripts-make_gitrev.sh-prefer-version-from-d-changel.patch b/debian/patches/0026-scripts-make_gitrev.sh-prefer-version-from-d-changel.patch
new file mode 100644
index 000000000..53bc6917c
--- /dev/null
+++ b/debian/patches/0026-scripts-make_gitrev.sh-prefer-version-from-d-changel.patch
@@ -0,0 +1,46 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Stoiko Ivanov <s.ivanov@proxmox.com>
+Date: Thu, 29 Oct 2026 13:18:53 +0100
+Subject: [PATCH] scripts/make_gitrev.sh: prefer version from d/changelog
+
+make_gitrev.sh is called by make to create zfs_gitrev.h, which is
+used to identify the source-version of a build in the sysctl
+`kernel.spl.gitrev`. I noticed the discrepancy between kernel's
+build via `sbuild` (kernel.spl.gitrev = unknown) or directly
+(kernel.spl.gitrev looks like zfs-2.4.4-0-g71a9f95786).
+
+afaict the issue is purely cosmetic, and I ran into while comparing
+sysctl output of 2 kernels.
+
+make_gitrev.sh relies on having a .git for finding the information,
+which is available (as pointer to the submodule) in a checkout of
+pve-kernel, but not in the source-package used by sbuild.
+
+creating the file and commiting it to the source-package would be an
+alternative - but having the version from d/changelog conveys the
+same information for our released kernels.
+
+keeping the fallback to the git revision for direct builds which don't
+have debian/ copied inside.
+
+Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
+---
+ scripts/make_gitrev.sh | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/scripts/make_gitrev.sh b/scripts/make_gitrev.sh
+index f85c9db097f0049bc83d06c988085b9f446df892..2b50cf4bcb9d414892fe958199a5032b563912ab 100755
+--- a/scripts/make_gitrev.sh
++++ b/scripts/make_gitrev.sh
+@@ -50,8 +50,10 @@ case "${GITREV}" in
+ 	*) ;;
+ esac
+ 
++# prefer the version from debian/changelog for our in-kernel builds
+ ZFS_GITREV=$({ cd "${top_srcdir}" &&
+-	git describe --always --long --dirty 2>/dev/null; } || :)
++	dpkg-parsechangelog -S Version 2>/dev/null ||
++	git describe --always --long --dirty 2>/dev/null;} ||:)
+ 
+ if [ -z "${ZFS_GITREV}" ]
+ then
diff --git a/debian/patches/series b/debian/patches/series
index 9a550e1c2..6438a77f1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -23,3 +23,4 @@
 0023-L2ARC-Preserve-L2HDR-in-arc_release-for-in-flight-wr.patch
 0024-arc-fix-race-between-arc_release-and-arc_read_done.patch
 0025-Linux-drop-cached-pages-in-zfs_rezget.patch
+0026-scripts-make_gitrev.sh-prefer-version-from-d-changel.patch
-- 
2.47.3





                 reply	other threads:[~2026-10-30 11:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261030110910.615366-1-s.ivanov@proxmox.com \
    --to=s.ivanov@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal