summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRafael Aquini <aquini@redhat.com>2024-07-16 14:25:05 +0200
committerMasahiro Yamada <masahiroy@kernel.org>2024-07-20 09:33:44 +0200
commit301c10908e42657c3e6142055aa772adab6a6ef7 (patch)
treed1433abb898b4e8b2d22d7a92d65487a878964df /scripts
parentkallsyms: get rid of code for absolute kallsyms (diff)
downloadlinux-301c10908e42657c3e6142055aa772adab6a6ef7.tar.xz
linux-301c10908e42657c3e6142055aa772adab6a6ef7.zip
kbuild: rpm-pkg: introduce a simple changelog section for kernel.spec
Fix the following rpmbuild warning: $ make srcrpm-pkg ... RPM build warnings: source_date_epoch_from_changelog set but %changelog is missing Signed-off-by: Rafael Aquini <aquini@redhat.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/package/mkspec23
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index 77d25dda37e3..ead54d67a024 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -30,3 +30,26 @@ cat<<EOF
EOF
cat "${srctree}/scripts/package/kernel.spec"
+
+# collect the user's name and email address for the changelog entry
+if [ "$(command -v git)" ]; then
+ name=$(git config user.name) || true
+ email=$(git config user.email) || true
+fi
+
+if [ ! "${name:+set}" ]; then
+ name=${KBUILD_BUILD_USER:-$(id -nu)}
+fi
+
+if [ ! "${email:+set}" ]; then
+ buildhost=${KBUILD_BUILD_HOST:-$(hostname -f 2>/dev/null || hostname)}
+ builduser=${KBUILD_BUILD_USER:-$(id -nu)}
+ email="${builduser}@${buildhost}"
+fi
+
+cat << EOF
+
+%changelog
+* $(LC_ALL=C; date +'%a %b %d %Y') ${name} <${email}>
+- Custom built Linux kernel.
+EOF