8

when i try to run make install on my custom built kernel, I get following error-

root@localhost [ /home/avi/dd/labs/lab1_compile_and_load ]$ make install V=1

make -C /lib/modules/3.12.17/build SUBDIRS=/home/avi/dd/labs/lab1_compile_and_load modules_install

make[1]: Entering directory `/home/avi/kernel/linux-3.12.17'
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (        \
echo >&2;                           \
echo >&2 "  ERROR: Kernel configuration is invalid.";       \
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";  \
echo >&2 ;                          \
/bin/false)
mkdir -p /lib/modules/3.12.17/extra
make -f /home/avi/kernel/linux-3.12.17/scripts/Makefile.modinst
  /bin/sh /home/avi/kernel/linux-3.12.17/scripts/depmod.sh /sbin/depmod 3.12.17 ""
make[1]: Leaving directory `/home/avi/kernel/linux-3.12.17'

Content of my Makefile is as below:

obj-m := lab1_char_driver.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)

all:
        $(MAKE) -C $(KDIR) SUBDIRS=$(PWD)  modules
install:
        $(MAKE) -C $(KDIR) SUBDIRS=$(PWD)  modules_install

clean:
        $(MAKE) -C $(KDIR) SUBDIRS=$(PWD)  clean

I tried 'make oldconfig && make preapare' as suggested in the error message but to no avail. I have tried this on fedora20 and ubuntu12.04 both. If a do Make then it works just fine but make install fails. Please help. Any relevant answer would be greatly appreciated.

avee137
  • 421
  • 2
  • 7
  • 15
  • 1. does this file exits /lib/modules/$(shell uname -r)/build/include/generated/autoconf.h ?. 2. Did you do "make distclean" after doing make install? – Sasi V Apr 20 '14 at 17:09
  • yes those two files exist. Running 'make distclean' does not help either. – avee137 Apr 21 '14 at 17:01
  • usually you get this error when you do some changes to kernel source code after installing modules and kernel. /lib/modules/$(shell uname -r)/build/ is a softlink to your kernel source code. – Sasi V Apr 21 '14 at 17:11
  • /lib/modules/$(shell uname -r)/build/ is pointing rightly to the kernel source I built from. Everything appears to be just in place. Can't get a clue, where it's going wrong! – avee137 Apr 21 '14 at 17:20

1 Answers1

8

You are including the V=1 which causes Make to show the commands as they're being run (see this question). From the looks of it, you're not actually seeing the error itself, but you're seeing the test that it's running to check if those files exist:

test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \ ... echo error messages here ... \ )

That test is being run, and if it fails, it would echo those messages to standard error, which it's not. If your module isn't building it's probably due to some other issue.

Community
  • 1
  • 1
Chris Mendez
  • 222
  • 3
  • 9
  • I'm new to kernel (module) development and this was freaking me out. Indeed, using `V=1`. Thanks, I feel better now! – ahogen Sep 07 '21 at 20:42