rhel as4 下iptables的模块升级Windows系统 -电脑资料

电脑资料 时间:2019-01-01 我要投稿
【www.unjs.com - 电脑资料】

    在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.

    在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 trulyLinux-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世界.

    原文转自:http://www.ltesting.net

最新文章