运行make install时出错 - include / generated / autoconf.h或include / config / auto.conf缺失

时间:2014-04-20 15:28:26

标签: c linux linux-kernel makefile

当我尝试在自定义构建的内核上运行make install时,出现以下错误 -

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'

我的Makefile内容如下:

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

我尝试过制作oldconfig&&制作preapare'正如错误消息中所建议但无济于事。 我在fedora20和ubuntu12.04上都尝试了这个。如果做一个Make然后它工作正常但安装失败。请帮忙。任何相关的答案将不胜感激。

1 个答案:

答案 0 :(得分:4)

您正在使用V=1,这会导致Make在运行时显示命令(see this question)。从它的外观来看,你实际上并没有看到错误本身,但你正在看它正在运行的测试,以检查这些文件是否存在:

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

正在运行该测试,如果它失败,它会将这些消息回显为标准错误,但事实并非如此。如果您的模块没有构建它可能是由于其他一些问题。