summaryrefslogtreecommitdiffstats
path: root/source/k/kernel-modules.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/k/kernel-modules.SlackBuild')
-rwxr-xr-xsource/k/kernel-modules.SlackBuild13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/k/kernel-modules.SlackBuild b/source/k/kernel-modules.SlackBuild
index 8d0d48c4d..ff083c16a 100755
--- a/source/k/kernel-modules.SlackBuild
+++ b/source/k/kernel-modules.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2018, 2020 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2018, 2020, 2022 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -37,6 +37,13 @@ KERNEL_NAME=${KERNEL_NAME:-}
KERNEL_SOURCE=${KERNEL_SOURCE:-/usr/src/linux}
KERNEL_CONFIG=${KERNEL_CONFIG:-/usr/src/linux/.config}
BUILD=${BUILD:-1}
+
+# The CONFIG_DEBUG_INFO_BTF_MODULES option adds a huge amount of debugging
+# data to the modules which we don't actually need. We'll strip debugging
+# information from kernel modules by default. If you are building a debug
+# kernel and wish to retain this data, export the variable below set to "NO".
+STRIP_DEBUG=${STRIP_DEBUG:-YES}
+
if [ ! -r "${KERNEL_CONFIG}" ]; then
echo "Error: the KERNEL_CONFIG environment variable needs to be set to the"
echo ".config file to be used to build these modules. Example:"
@@ -109,6 +116,10 @@ fi
make $NUMJOBS modules || exit 1
echo "Installing kernel modules to $PKG..."
make INSTALL_MOD_PATH=$PKG modules_install || exit 1
+ if [ "$STRIP_DEBUG" = "YES" ]; then
+ echo "Stripping debug info from kernel modules..."
+ find $PKG -name "*.ko" -exec strip --strip-debug "{}" \;
+ fi
# Fix build and source symlinks if they are pointing into /tmp:
( cd $PKG/lib/modules/${VERSION}${LOCALVERSION}
for symlink in build source ; do