免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 11659 | 回复: 6
打印 上一主题 下一主题

编译自己写的模块时出现modules disabled错误,请求帮忙 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-11-13 09:13 |只看该作者 |倒序浏览
我的Makefile是这样的
obj-m:=a.o
ssr-objs:=b.o c.o d.o

KDIR:=/lib/modules/$(shell uname -r)/build
PWD:=$(shell pwd)
EXTRA_CFLAGS := -ffast-math -DREDHAT9 -mhard-float -O2 -Wall -fomit-frame-pointer
#EXTRA_CFLAGS := -ffast-math -mhard-float -O2 -Wall -fomit-frame-pointer
default:
        $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:
        rm -rf *.o


[root@mytest kernel]# make
make -C /lib/modules/2.4.20-8/build SUBDIRS=/home/ssr_linux/src/kernel 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: *** [default] Error 2

论坛徽章:
0
2 [报告]
发表于 2007-11-13 09:44 |只看该作者
原帖由 honggaoyan 于 2007-11-13 09:13 发表
我的Makefile是这样的
obj-m:=a.o
ssr-objs:=b.o c.o d.o

KDIR:=/lib/modules/$(shell uname -r)/build
PWD:=$(shell pwd)
EXTRA_CFLAGS := -ffast-math -DREDHAT9 -mhard-float -O2 -Wall -fomit-fram ...

make menuconfig
然后进入Loadable module support, 选中Enable loadable module support

论坛徽章:
0
3 [报告]
发表于 2007-11-13 13:05 |只看该作者

上午重新编译内核....失败,,,我把过程写上

1:  cd /usr/src/linux-2.4.20-8
2:  make mrproper
3:  make menuconfig (那个Enable loadable module support本来就是*的,我没做其它的就直接保存退出)

4:  make dep  
5:  make bzImage
6:  make modules
7:  make modules_install
8:  cp System.map /boot/System.map-2.4.20-8-10-new
   cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.20-8-10-new
10: cd /boot
    rm -rf System.map
    rm -rf vmlinuz
11:  ln -s System.map-2.4.20-8-10-new System.map
     ln -s vmlinuz-2.4.20-8-10-new vmlinuz

12:  vi /boot/grub.grub.conf
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-
        root (hd0,0)
        kernel /vmlinuz-2.4.20-8 ro root=LABEL=/
        initrd /initrd-2.4.20-8.img
                                                                                                               
title Red Hat Linux (2.4.20-8-new)
        root (hd0,0)
        kernel /vmlinuz-2.4.20-8-10-new ro root=LABEL=/
        initrd /initrd-2.4.20-8.img

重启系统:进2.4.20-8-new失败
进原来的内核2.4.20-8之后
obj-m:=a.o
dsa-objs:=b.o c.o d.o

KDIR:=/lib/modules/$(shell uname -r)/build
PWD:=$(shell pwd)
EXTRA_CFLAGS := -ffast-math -DREDHAT9 -mhard-float -O2 -Wall -fomit-frame-pointer
#EXTRA_CFLAGS := -ffast-math -mhard-float -O2 -Wall -fomit-frame-pointer
default:
        $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:
        rm -rf *.o


[root@mytest kernel]# make
make -C /lib/modules/2.4.20-8/build SUBDIRS=/home/ssr_linux/src/kernel modules
make[1]: Entering directory `/usr/src/linux-2.4.20-8'
make -r -f tmp_include_depends all
make[2]: Entering directory `/usr/src/linux-2.4.20-8'
make[2]: Circular /usr/src/linux-2.4.20-8/include/asm/smplock.h <- /usr/src/linux-2.4.20-8/include/linux/interrupt.h dependency dropped.
make[2]: Circular /usr/src/linux-2.4.20-8/include/linux/netfilter_ipv4/ip_conntrack.h <- /usr/src/linux-2.4.20-8/include/linux/netfilter_ipv4/ip_conntrack_helper.h dependency dropped.
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/usr/src/linux-2.4.20-8'
make -C  /home/kernel CFLAGS="-D__KERNEL__ -I/usr/src/linux-2.4.20-8/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i686 -DMODULE -DMODVERSIONS -include /usr/src/linux-2.4.20-8/include/linux/modversions.h" MAKING_MODULES=1 modules
make[2]: Entering directory `/home/ssr_linux/src/kernel'
make[2]: *** No rule to make target `modules'.  Stop.
make[2]: Leaving directory `/home/ssr_linux/src/kernel'
make[1]: *** [_mod_/home/ssr_linux/src/kernel] Error 2
make[1]: Leaving directory `/usr/src/linux-2.4.20-8'
make: *** [all] Error 2




这是怎么 回事阿

论坛徽章:
0
4 [报告]
发表于 2009-05-14 16:08 |只看该作者

回复 #1 honggaoyan 的帖子

>obj-m:=a.o
>ssr-objs:=b.o c.o d.o

ssr-objs:模块名称好像不对,应该是a-objs,同上面的a.o

论坛徽章:
0
5 [报告]
发表于 2011-03-23 16:00 |只看该作者
遇到同样的问题,准备升级内核试试

论坛徽章:
0
6 [报告]
发表于 2011-03-23 16:02 |只看该作者
make menuconfig
然后进入Loadable module support, 选中Enable loadable module support
web_surf 发表于 2007-11-13 09:44



    进入menuconfig Enable loadable module support本身就是已经被选中的

论坛徽章:
0
7 [报告]
发表于 2011-03-23 17:01 |只看该作者
4楼说的对,楼主检查下Makefile.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP