I'm trying to compile a kernel module named DAHDI in a FreePBX (RHEL). I get the following make output error:

You do not appear to have the sources for the 3.10.0-957.21.3.el7.x86_64 kernel installed.

But I don't think that is the problem, cuz I already checked my kernel version, headers, config file and they all match. In the Makefile, I have this block:

ifneq (,$(wildcard $(KCONFIG)))
  include $(KCONFIG)

$(KCONFIG) returns "/.config". $(HAS_KSRC) return "no". $(wildcard $(KCONFIG)) doesn't return anything. This error comes from ifeq (no,$(HAS_KSRC)). In other words, it finds the kernel config file until it applies the "wildcard".

What does this wildcard (command??) do?

# cat /proc/version
Linux version 3.10.0-957.21.3.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Tue Jun 18 16:35:19 UTC 2019
  • 1
    It expands its argument as a shell filename globbing pattern. Since your variable $(KSRC) is empty, the pattern resolves as /.config, and since that pathname does not exist on your system, HAS_KSRC is set to no. The solution, it seems, is to make sure that KSRC is set correctly, or to make sure that the sources are installed properly and that /.config exists (with the correct contents). As I'm not on Linux, I have no way of testing this and will thus not turn this into an answer.
    – Kusalananda
    Oct 22, 2019 at 15:53

1 Answer 1


Look like you have the source tree but it is currently unconfigured (that's why .config is missing).


  1. To copy /boot/config- to ${KSRC}/.config


  1. To run make oldconfig from kernel source-tree

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .