Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x86固件做好了,但是很纠结,help! #37

Open
GoogleCodeExporter opened this issue May 28, 2015 · 7 comments
Open

x86固件做好了,但是很纠结,help! #37

GoogleCodeExporter opened this issue May 28, 2015 · 7 comments

Comments

@GoogleCodeExporter
Copy link

不明白~~我是用https://dev.openwrt.org/ticket/9467这个makefile编译k
o的,但是不论用rg100还是x86平台(就算识别了双网卡)还是��
�down机然后自动重启,真的搞不定了……我说说都做过哪些实
践
===============================================
1、双网卡x86主机刷官方rc5,uname 
-r查到内核是2.6.32.27,固件版本可以看到是r27608,然后我用ubu
ntu来svn co 
-r27608来下载源码,将napt66的makefile放进pakage/下面,make 
menuconfig的时候选上napt66,编译完之后就得到napt66的ipkg安装包
和独立的napt66.ko了,然后scp上传到x86的openwrt,安装后立即加�
��没有问题,lsmod也看得到napt66,但是内网机器还是上不了v6��
�然后重启openwrt,/etc/init.d/napt66 start(或者inmod napt66.ko 
wan_if=eth1.1)都会死机重启!!……

2、rg100a刷官方rc5,后面的操作和现象同上……

3、这次成功了……
一 svn co svn://svn.openwrt.org/openwrt/branches/backfire/
二 ./scripts/feeds update -a &&./scripts/feeds install -a&&make defconfig
三 将napt66的makefile放进pakage/下面,make 
menuconfig的时候选上napt66
四 make 

这次(就是昨晚orz)编译的是x86平台的固件……直接拿自己��
�译出来固件刷到机器上面,openwrt开机后lsmod惊讶地发现napt66�
��常运行,然后radvd防火墙等等各种设置……………………然�
��这台x86主机就变成带vsftpd/ushare/samba/napt66/脱机下载等功能的
openwrt路由器了……现在在工作中。

尽管x86成功了,但是我不明白啊!为什么直接用编译出来的��
�件napt66就能工作,单独上传napt66.ipkg或者ko再加载就会死机啊
~~!going mad!

还有一台rg100a~刷这里的固件的话会变得很奇怪,路由器能pi
ng6通www.kame.net和ipv6.google.com但是六维空间和52v6就不行~tracero
ute可以看到是有环路跳不出去,(据我的观察,与此同时我��
�ubuntu也是相同的症状,有些v6网站ping不通,而windows没有问题
,我发现两个系统获取到的v6ip不同,于是我将ubuntu的ip手动��
�置为windows下面获取的ip,然后就正常了),我推测应该是学�
��的dhcp分配变成了有状态,而这个固件不能在这个环境下获��
�到正确的ip?另外upnp的表现也不是很好————鉴于这两个�
��因我还是想刷一个新一点的固件~~但是就遇到了上面的死
机问题~~~

i need help!!

Original issue reported on code.google.com by aurora6...@gmail.com on 19 Sep 2011 at 5:23

@GoogleCodeExporter
Copy link
Author

就算是用http://code.google.com/p/napt66/issues/detail?id=26的方法编译��
�模块也是会导致自动重启。
究竟加载napt66.ko有些什么前提条件?

Original comment by aurora6...@gmail.com on 19 Sep 2011 at 5:39

@GoogleCodeExporter
Copy link
Author

编译内核模块需要对应内核的源代码,
> 双网卡x86主机刷官方rc5,uname -r查到内核是2.6.32.27
所以你需要这个版本的内核源码才能编译出匹配的内核模块��
�

Original comment by Mzwei...@gmail.com on 19 Sep 2011 at 10:51

@GoogleCodeExporter
Copy link
Author

[deleted comment]

1 similar comment
@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

我知道要相应的内核源码,所以我是用svn  co  
-r27608来获取openwrt源码的,这样得到的源码里面的内核版本和
uname 
-r看到的是一致的~我再描述一下我的思路和实践吧,麻烦你
再帮忙看看,感谢~

(我按照issue26的方法编译了x86的napt66.ko):
1、编译一次trunk,编译后生成/trunk/build_dir/(相应的平台目录
)/linux-2.6.39.4,这个是交叉编译后的linux内核源码,其实就是
makefile中“KDIR 
:=”后面应该填的路径吧?(还是我的想法错了?)
2、trunk/staging_dir/(相应的平台)/bin/xxxxx-openwrt-linux-这个就是
工具链,也就是“ARCH=xxxx 
CROSS_COMPILE=”后面应该填写的路径。
3、按照上面得到的路径,修改napt66的makefile,然后make就可以�
��到napt66.ko了

这样得到的ko,上传到openwrt后,insmod就会重启(也就是帖子��
�描述的问题)
=====================================================================
我的makefile(编译openwrt-x86平台的napt66.ko,这个是trunk的,和��
�楼说的内核版本不同)
# Makefile under 2.6.25
ifneq ($(KERNELRELEASE),)
#kbuild syntax. dependency relationshsip of files and target modules are listed 
here.
obj-m := napt66.o
napt66-objs := napt66_main.o napt66_conntrack.o napt66_nat.o 
napt66_hash_table.o napt66_ftp_alg.o
else
PWD  := $(shell pwd)
KVER ?= $(shell uname -r)
KDIR := /media/STsuse/openwrt/trunk/build_dir/linux-x86_generic/linux-2.6.39.4
all:
    $(MAKE) -C $(KDIR) M=$(PWD) modules ARCH=x86 CROSS_COMPILE=/media/STsuse/openwrt/trunk/staging_dir/toolchain-i386_gcc-4.5-linaro_uClibc-0.9.32/bin/i486-openwrt-linux-
clean:
    rm -rf .*.cmd *.o *.mod.c *.ko .tmp_versions *.symvers *.order
endif
===========================================================================

Original comment by aurora6...@gmail.com on 25 Sep 2011 at 6:04

@GoogleCodeExporter
Copy link
Author

我猜测是NAPT66模块的缺陷导致与新内核的兼容性问题。NAPT66��
�核心部分是去年在UBUNTU10.04中开发的,我不敢保证跟现在的Li
nux内核完美兼容。当时赶时间,甚至没有考虑地址转换表资��
�的同步与互斥,也许是一个隐患,欢迎热心网友贡献代码修�
��这个问题。

Original comment by Mzwei...@gmail.com on 25 Sep 2011 at 2:15

@GoogleCodeExporter
Copy link
Author

再反馈:
1、在backfire rc5的固件上面重新操作了一次,平台Broadcom 
BCM6358 
,内核2.6.32.27,是用issue26的方法编译得到napt66.ko,这次没有�
��装ip6tables,直接开启ipv6转发然后insmod napt66 
wan_if=eth1.1,这次成功了,没有出问题。可能之前的情况是因�
��编译的模块和固件太多了,上传的时候没有分清楚内核版本
,所以插入的时候才会down机。
2、我在centos 
6上面也按照wiki的说明编译得到napt66.ko,可以正常工作,但是
要注意ip6tables的规则,我是直接ip6tables -F && service ip6tables 
save。
3、ubuntu10.10 server上面也没有问题,但是ubuntu11.04 
server需要安装linux-headers才能编译,我apt-get安装了对应headers��
�能够编译出ko,但是加载后会死机,这里应该是这个版本的he
aders的兼容性问题。
4、综上,napt66对backfire的支持还是很好的啦~而且在我的ubunt
u10.10 PC上面和centos 
server上面都能正常工作。至于新内核的兼容性问题就等各位��
�手继续完善了。

我是一只做了很多试验的菜鸟,以上经验希望对大家有帮助��
�

Original comment by aurora6...@gmail.com on 27 Sep 2011 at 5:43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant