[转]rhel as4 下iptables的模块升级

 

在rhel as4 上,KERNEL版本是2.6.9-5.EL.

升级到iptables-1.3.0和patch-o-magic 20050302版

做法是按照http://bbs.chinaunix.net/forum/4/050304/505370.html来做的.其中有一点小问题.是关于little_endian.h的

1.先到ftp.redhat.com 处下载kernel-2.6.9-5.EL.src.i386.rpm,因为没有在RHEL光盘上找到.

2.将上述RPM安装到/usr/src/redhat/SOURCE/下,将linux-2.6.9.tar.bz2解压缩

3.也要安装kernel-devel-2.6.9-5.EL这个包,因为需要几个文件.而且需要用这个包里的include头文件替换掉src.RPM包里的头文件.

莫名其妙是kernel-2.6.9-5.EL.src.i386这个包的头文件居然会有问题.

另外也要拷这几个文件是

cp /usr/src/kernels/2.6.9-5.EL-i686/scripts/genksyms/genksysms /usr/src/redhat/SOURCES/linux-2.6.9/scripts/genksyms

cp /usr/src/kernels/2.6.9-5.EL-i686/scripts/mod/modpost /usr/src/redhat/SOURCES/linux-2.6.9/scripts/mod

cp /usr/src/kernels/2.6.9-5.EL-i686/include/linux/types.h  /usr/src/redhat/SOURCES/linux-2.6.9/include/linux/ 

关键的关键:这个types.h要打一个小补丁.否则做到编译iptables时会报little_endian.h出很多错.

我是参照如下文件打补丁的:

--- linux-2.6.9-rc2/include/linux/types.h 2004-09-13 02:33:23.000000000 -0300
+++ linux/include/linux/types.h 2004-09-18 14:16:27.000000000 -0300
@@ -140,6 +140,13 @@
#define pgoff_t unsigned long
#endif

+#endif /* __KERNEL_STRICT_NAMES */
+
+/*
+ * Below are truly Linux-specific types that should never collide with
+ * any application/library that wants linux/types.h.
+ */
+
#ifdef __CHECKER__
#define __bitwise __attribute__((bitwise))
#else
@@ -153,13 +160,6 @@
typedef __u64 __bitwise __le64;
typedef __u64 __bitwise __be64;

-#endif /* __KERNEL_STRICT_NAMES */
-
-/*
- * Below are truly Linux-specific types that should never collide with
- * any application/library that wants linux/types.h.
- */
-
struct ustat {
__kernel_daddr_t f_tfree;
__kernel_ino_t f_tinode;

以上补丁来自 http://readlist.com/lists/vger.kernel.org/linux-kernel/9/46837.html 

 

 4. ln -s /usr/src/redhat/SOURCES/linux-2.6.9/include/asm-i386 /usr/src/redhat/SOURCES/linux-2.6.9/include/asm

做个链接,否则会找不到这个目录.

5.其余按照http://bbs.chinaunix.net/forum/4/050304/505370.html一步步做.

编译到ipt_connlimit时会报错.没找到解决办法.只好在Makefile中把这个选项关掉,编译才通过.

错误是:

net/ipv4/netfilter/ipt_connlimit.c: In function `count_them':
net/ipv4/netfilter/ipt_connlimit.c:100: error: structure has no member named `infos'
net/ipv4/netfilter/ipt_connlimit.c:107: error: structure has no member named `infos'

感谢一切给予我帮助的人,包括文中所参考的文章作者以及所有为LINUX奋斗的人.是他们无私的奉献赐于我们如此美丽的LINUX世界.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值