Workaround Debian's fake System.map behavior

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 <nabijaczleweli@nabijaczleweli.xyz>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #12862
This commit is contained in:
Rich Ercolani 2021-12-17 15:43:13 -05:00 committed by GitHub
parent eecd3f1a21
commit f68b9c81c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -90,7 +90,15 @@ modules_install-Linux:
if [ -n "$(DESTDIR)" ]; then \ if [ -n "$(DESTDIR)" ]; then \
find $$kmoddir -name 'modules.*' | xargs $(RM); \ find $$kmoddir -name 'modules.*' | xargs $(RM); \
fi 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@; \ 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 \ if [ -f $$sysmap ]; then \
depmod -ae -F $$sysmap @LINUX_VERSION@; \ depmod -ae -F $$sysmap @LINUX_VERSION@; \
fi fi