Kernel-config-search script

February 23, 2026

Easy kernel module searching.

Create /usr/src/scripts.d/local-$HOSTNAME/kernel-config-search.sh:

#!/bin/bash
if [ $# -eq 0 ]
  then
    echo "No arguments supplied"
    exit 1
fi

FILE="/proc/config.gz"
if ! [[ -f "$FILE" ]]; then
    echo "$FILE doesn't exist, please enable CONFIG_IKCONFIG and CONFIG_IKCONFIG_PROC"
    exit 1
fi

zgrep -i "$1" "$FILE" && exit 0
exit 1

Make it executable:

chmod 755 /usr/src/scripts.d/local-$HOSTNAME/kernel-config-search.sh

Usage:

kernel-config-search.sh nouveau
# CONFIG_DRM_NOUVEAU is not set