From 2e3b3e3a2ed7a299c29ce0460823e865f6226c45 Mon Sep 17 00:00:00 2001 From: Rich Ercolani <214141+rincebrain@users.noreply.github.com> Date: Fri, 17 Dec 2021 15:43:13 -0500 Subject: [PATCH] Workaround Debian's fake System.map behavior MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Debian ships fake System.map files by default, leading to the invocation of depmod with them to flood you with errors about missing symbols. Let's notice and not do that. Reviewed-by: Ahelenia ZiemiaƄska Reviewed-by: Brian Behlendorf Signed-off-by: Rich Ercolani Closes #12862 --- module/Makefile.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/module/Makefile.in b/module/Makefile.in index b15ab91097..b47ee73b87 100644 --- a/module/Makefile.in +++ b/module/Makefile.in @@ -90,7 +90,15 @@ modules_install-Linux: if [ -n "$(DESTDIR)" ]; then \ find $$kmoddir -name 'modules.*' | xargs $(RM); \ fi + @# Debian ships tiny fake System.map files that are + @# syntactically valid but just say + @# "if you want system.map go install this package" + @# Naturally, depmod is less than amused by this. + @# So if we find it missing or with one of these present, + @# we check for the alternate path for the System.map sysmap=$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \ + { [ -f "$$sysmap" ] && [ $$(wc -l < "$$sysmap") -ge 100 ]; } || \ + sysmap=$(INSTALL_MOD_PATH)/usr/lib/debug/boot/System.map-@LINUX_VERSION@; \ if [ -f $$sysmap ]; then \ depmod -ae -F $$sysmap @LINUX_VERSION@; \ fi