* [PATCH] kbuild: package: Install System.map to build tree only
@ 2026-11-16 15:52 Nicolas Schier
2026-11-17 15:53 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Schier @ 2026-11-16 15:52 UTC (permalink / raw)
To: Thomas Weißschuh, Christian Heusel, Nathan Chancellor
Cc: linux-kbuild, linux-kernel, Adrián García Casado,
Nicolas Schier
Unify the installation of System.map for all packaging targets and
install it to the packaged kernel build tree.
Kbuild's scripts/depmod.sh expects System.map to be available in the
build tree to allow depmod to check for unresolved symbols in all
installed kmods. The script is called by 'modules_install' for in-tree
as well as for out-of-tree modules.
Adrián García Casado reported [1] that the Debian packages produced by
'deb-pkg' or 'bindeb-pkg' do include System.map at /boot/, where
scripts/depmod.sh does not find them and thus refuses to run depmod
after installation of out-of-tree modules built against a packaged
kernel tree.
The 'pacman-pkg' target already installs System.map to the build tree,
while 'deb-pkg', 'rpm-pkg' and 'tar-pkg' install it to /boot.
Replace installation of System.map from all package target specific
scripts by installing System.map to the build tree via
install-extmod-build.
Suggested-by: Nathan Chancellor <nathan@kernel.org>
Reported-by: Adrián García Casado <adriangarciacasado42@gmail.com>
Closes: https://lore.kernel.org/linux-kbuild/20261016111106.221542-1-adriangarciacasado42@gmail.com/ # [1]
Signed-off-by: Nicolas Schier <nsc@kernel.org>
---
scripts/package/PKGBUILD | 3 +--
scripts/package/builddeb | 1 -
scripts/package/buildtar | 1 -
scripts/package/install-extmod-build | 1 +
scripts/package/kernel.spec | 5 ++---
5 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD
index 66e4b6a37783..ce8e0bff9041 100644
--- a/scripts/package/PKGBUILD
+++ b/scripts/package/PKGBUILD
@@ -90,9 +90,8 @@ _package-headers() {
"${srctree}/scripts/package/install-extmod-build" "${builddir}"
fi
- echo "Installing System.map and config..."
+ echo "Installing config..."
mkdir -p "${builddir}"
- cp System.map "${builddir}/System.map"
cp .config "${builddir}/.config"
echo "Adding symlink..."
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index ba1defc61652..9f8a4a69059c 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -48,7 +48,6 @@ install_linux_image () {
gzip "${pdir}/usr/share/doc/${pname}/config"
else
mkdir -p "${pdir}/boot"
- cp System.map "${pdir}/boot/System.map-${KERNELRELEASE}"
cp ${KCONFIG_CONFIG} "${pdir}/boot/config-${KERNELRELEASE}"
fi
diff --git a/scripts/package/buildtar b/scripts/package/buildtar
index cc87a473c01f..057ca4fc7d71 100755
--- a/scripts/package/buildtar
+++ b/scripts/package/buildtar
@@ -45,7 +45,6 @@ make ARCH="${ARCH}" -f ${srctree}/Makefile INSTALL_MOD_PATH="${tmpdir}" modules_
#
# Install basic kernel files
#
-cp -v -- "${objtree}/System.map" "${tmpdir}/boot/System.map-${KERNELRELEASE}"
cp -v -- "${KCONFIG_CONFIG}" "${tmpdir}/boot/config-${KERNELRELEASE}"
cp -v -- "${objtree}/vmlinux" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}"
diff --git a/scripts/package/install-extmod-build b/scripts/package/install-extmod-build
index f12e1ffe409e..fbf8d3e5ab5f 100755
--- a/scripts/package/install-extmod-build
+++ b/scripts/package/install-extmod-build
@@ -37,6 +37,7 @@ mkdir -p "${destdir}"
fi
echo Module.symvers
+ echo System.map
echo "arch/${SRCARCH}/include/generated"
echo include/config/auto.conf
echo include/config/kernel.release
diff --git a/scripts/package/kernel.spec b/scripts/package/kernel.spec
index 46e80970f723..37a547299a94 100644
--- a/scripts/package/kernel.spec
+++ b/scripts/package/kernel.spec
@@ -114,7 +114,6 @@ cp $(%{make} %{makeflags} -s image_name) %{buildroot}/lib/modules/%{KERNELRELEAS
# DEPMOD=true makes depmod no-op. We do not package depmod-generated files.
%{make} %{makeflags} INSTALL_MOD_PATH=%{buildroot} %{?install_mod_strip:INSTALL_MOD_STRIP=1} DEPMOD=true modules_install
%{make} %{makeflags} INSTALL_HDR_PATH=%{buildroot}/usr headers_install
-cp System.map %{buildroot}/lib/modules/%{KERNELRELEASE}
cp .config %{buildroot}/lib/modules/%{KERNELRELEASE}/config
if %{make} %{makeflags} run-command KBUILD_RUN_COMMAND='test -d ${srctree}/arch/${SRCARCH}/boot/dts' 2>/dev/null; then
%{make} %{makeflags} INSTALL_DTBS_PATH=%{buildroot}/lib/modules/%{KERNELRELEASE}/dtb dtbs_install
@@ -132,7 +131,7 @@ ln -fns /usr/src/kernels/%{KERNELRELEASE} %{buildroot}/lib/modules/%{KERNELRELEA
echo "%ghost /lib/modules/%{KERNELRELEASE}/modules.${x}"
done
- for x in System.map config vmlinuz; do
+ for x in config vmlinuz; do
echo "%ghost /boot/${x}-%{KERNELRELEASE}"
done
@@ -185,7 +184,7 @@ rm -f debugfiles.list debuglinks.list debugsourcefiles.list debugsources.list \
if [ -x /usr/bin/kernel-install ]; then
/usr/bin/kernel-install add %{KERNELRELEASE} /lib/modules/%{KERNELRELEASE}/vmlinuz
fi
-for file in vmlinuz System.map config; do
+for file in vmlinuz config; do
if ! cmp --silent "/lib/modules/%{KERNELRELEASE}/${file}" "/boot/${file}-%{KERNELRELEASE}"; then
cp "/lib/modules/%{KERNELRELEASE}/${file}" "/boot/${file}-%{KERNELRELEASE}"
fi
---
base-commit: 7924b82075ab1aee61be04764152cff49257c449
change-id: 20261106-package-install-system-msp-to-build-dir-2b99d8f0714e
Best regards,
--
Nicolas
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] kbuild: package: Install System.map to build tree only
2026-11-16 15:52 [PATCH] kbuild: package: Install System.map to build tree only Nicolas Schier
@ 2026-11-17 15:53 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-17 15:53 UTC (permalink / raw)
To: Nicolas Schier, Thomas Weißschuh, Christian Heusel,
Nathan Chancellor
Cc: linux-kbuild, Adrián García Casado
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] kbuild: package: System.map dropped from tar-pkg and dir-pkg
in buildtar
--
commit 4e40237f8938f58bf4db63fc401e165ccfea766e
Author: Nicolas Schier <nsc@kernel.org>
kbuild: package: Install System.map to build tree only
This commit removes the target-specific installation of System.map to
/boot and instead installs System.map into the packaged kernel build tree
via scripts/package/install-extmod-build.
> diff --git a/scripts/package/buildtar b/scripts/package/buildtar
> index cc87a473c01f4..057ca4fc7d71f 100755
> --- a/scripts/package/buildtar
> +++ b/scripts/package/buildtar
> @@ -45,7 +45,6 @@ make ARCH="${ARCH}" -f ${srctree}/Makefile INSTALL_MOD_PATH="${tmpdir}" modules_
> #
> # Install basic kernel files
> #
> -cp -v -- "${objtree}/System.map" "${tmpdir}/boot/System.map-${KERNELRELEASE}"
> cp -v -- "${KCONFIG_CONFIG}" "${tmpdir}/boot/config-${KERNELRELEASE}"
> cp -v -- "${objtree}/vmlinux" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}"
[Severity: Medium]
Does removing this copy drop System.map from the tar-pkg and dir-pkg
targets altogether? Unlike PKGBUILD, builddeb, and kernel.spec, buildtar
does not package a kernel build tree or call
scripts/package/install-extmod-build, so System.map is no longer included
anywhere in the resulting tarball or directory.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261116-package-install-system-msp-to-build-dir-v1-1-ec53d3d39146@kernel.org?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-17 15:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16 15:52 [PATCH] kbuild: package: Install System.map to build tree only Nicolas Schier
2026-11-17 15:53 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox