红联Linux门户
Linux帮助

内核模块make时出现的错误是如何解决?

发布时间:2010-08-14 15:27:54来源:红联作者:308534826
[i=s] 本帖最后由 308534826 于 2010-8-17 13:15 编辑 [/i]

麻烦大家帮忙看看,谢谢了。
make是提示模块在内核中没有被配置??请问各位大大,这个怎么解决啊??我用的red hat 9编译的。
这个是Makefile的程序:
ifneq ($(KERNELRELEASE),)

obj-m := hello.o

else

KDIR := /lib/modules/2.4.20-8/build
all:
make -C $(KDIR) M=$(PWD) modules
clean:
rm -f *.ko *.o *.mod.o *.mod.c *.symvers

endif
下面的是错误提示:
make -C /lib/modules/2.4.20-8/build M=/home/cjx/module/hello modules
make[1]: Entering directory `/usr/src/linux-2.4.20-8'

The present kernel configuration has modules disabled.
Type 'make config' and enable loadable module support.
Then build a kernel with module support enabled.

make[1]: *** [modules] Error 1
make[1]: Leaving directory `/usr/src/linux-2.4.20-8'
make: *** [all] Error 2
文章评论

共有 5 条评论

  1. 308534826 于 2010-08-17 13:14:46发表:

    谢谢了~~我换成REDHAT5.5版本的,就可以用了。{:2_93:}

  2. yanlong938 于 2010-08-17 02:11:06发表:

    内核编译好像很复杂 啊

  3. shenhao0129 于 2010-08-16 09:52:11发表:

    把make config 换成make menuconfig,然后开启模块加载

  4. 308534826 于 2010-08-14 22:43:43发表:

    谢谢,在/usr/src/linux2.4.20-8目录下make config & enable loadable module support 后,出现下面这个问题:
    /bin/sh scripts/Configure arch/i386/config.in
    #
    # Using defaults found in .config
    #
    *
    * Code maturity level options
    *
    Prompt for development and/or incomplete code/drivers (CONFIG_EXPERIMENTAL) [Y/n/?] y
    bash: y: command not found

    [6]+ Stopped make config
    按照提示输入y后,提示无法找到指令?这个是怎么回事?而且再次编译内核出现下面这个错误提示:
    ma600.c:303:40: warning: pasting ";" and "return" does not give a valid preprocessing token
    ma600.c:306: warning: concatenation of string literals with __FUNCTION__ is deprecated
    ma600.c:329: warning: concatenation of string literals with __FUNCTION__ is deprecated
    rm -f irda.o
    ld -m elf_i386 -r -o irda.o irtty.o irport.o irda-usb.o nsc-ircc.o w83977af_ir.o toshoboe.o donauboe.o smc-ircc.o ali-ircc.o vlsi_ir.o esi.o tekram.o actisys.o girbil.o litelink.o old_belkin.o mcp2120.o act200l.o ma600.o
    donauboe.o(.text.init+0x0): In function `toshoboe_init':
    : multiple definition of `toshoboe_init'
    toshoboe.o(.text.init+0x0): first defined here
    make[4]: *** [irda.o] Error 1
    make[4]: Leaving directory `/usr/src/linux-2.4.20-8/drivers/net/irda'
    make[3]: *** [first_rule] Error 2
    make[3]: Leaving directory `/usr/src/linux-2.4.20-8/drivers/net/irda'
    make[2]: *** [_subdir_irda] Error 2
    make[2]: Leaving directory `/usr/src/linux-2.4.20-8/drivers/net'
    make[1]: *** [_subdir_net] Error 2
    make[1]: Leaving directory `/usr/src/linux-2.4.20-8/drivers'
    make: *** [_dir_drivers] Error 2
    麻烦了~~~刚刚接触Linux不久,很多都不懂。小弟在此谢过了!

  5. shenhao0129 于 2010-08-14 17:45:05发表:

    提示已经很明显了,说当前的内核配置disable了modules这个特性,所以你需要make config & enable loadable module support 然后在重新编译内核