修改 Makefile

  • CFLAGS:=-Wall -Wunused -Werror 改成 CFLAGS:=-Wall -Wunused
  • CC:=gcc 改成 CC:=/opt/buildroot-gcc342/bin/mipsel-linux-gcc
  • KERNEL_INCLUDES?=include/ 改成 KERNEL_INCLUDES?=../../linux-2.6.36.x/include/

build code

  • 修改 Makefile
  • 修改 extensions/ebt_ip6.c 把 EBT_IP6_ICMP6 相關程式碼移除
  • make
  • make static

install

  • 把 ethertypes 拷貝到 /etc/ethertypes
  • make static 後會產生一個 static 的執行檔,可以直接執行不用其它 .so 檔。
  • ebtables 為另一個執行檔,需要 .so 檔,把 extensions/*.so 拷貝到 /lib 即可。

問題排解

/opt/buildroot-gcc342/bin/mipsel-linux-gcc -Wall -Wunused -Werror -fPIC -O3 -DPROGVERSION=\"2.0.10-4\" -DPROGNAME=\"ebtables\" -DPROGDATE=\"December\ 2011\" -D_PATH_ETHERTYPES=\"/etc/ethertypes\" -DEBTD_ARGC_MAX=50 -DEBTD_CMDLINE_MAXLN=2048 -DLOCKFILE=\"/var/lib/ebtables/lock\" -DLOCKDIR=\"/var/lib/ebtables/\" -c -o extensions/ebt_nat.o extensions/ebt_nat.c -I/home/enos/FGN-R3/RT288x_SDK/source/linux-2.6.36.x/include/ extensions/ebt_nat.c: In function `parse_s': extensions/ebt_nat.c:95: warning: 'tmp' might be used uninitialized in this function make: *** [extensions/ebt_nat.o] Error 1 CFLAGS:=-Wall -Wunused -Werror 改成 CFLAGS:=-Wall -Wunused /opt/buildroot-gcc342/bin/mipsel-linux-gcc -Wall -Wunused -fPIC -O3 -DPROGVERSION=\"2.0.10-4\" -DPROGNAME=\"ebtables\" -DPROGDATE=\"December\ 2011\" -D_PATH_ETHERTYPES=\"/etc/ethertypes\" -DEBTD_ARGC_MAX=50 -DEBTD_CMDLINE_MAXLN=2048 -DLOCKFILE=\"/var/lib/ebtables/lock\" -DLOCKDIR=\"/var/lib/ebtables/\" -c -o extensions/ebt_ip6.o extensions/ebt_ip6.c -I/home/enos/FGN-R3/RT288x_SDK/source/linux-2.6.36.x/include/ extensions/ebt_ip6.c: In function `parse': extensions/ebt_ip6.c:369: error: `EBT_IP6_ICMP6' undeclared (first use in this function) extensions/ebt_ip6.c:369: error: (Each undeclared identifier is reported only once extensions/ebt_ip6.c:369: error: for each function it appears in.) extensions/ebt_ip6.c:373: error: structure has no member named `icmpv6_type' extensions/ebt_ip6.c:373: error: structure has no member named `icmpv6_code' extensions/ebt_ip6.c: In function `final_check': extensions/ebt_ip6.c:430: error: `EBT_IP6_ICMP6' undeclared (first use in this function) extensions/ebt_ip6.c: In function `print': extensions/ebt_ip6.c:488: error: `EBT_IP6_ICMP6' undeclared (first use in this function) extensions/ebt_ip6.c:492: error: structure has no member named `icmpv6_type' extensions/ebt_ip6.c:492: error: structure has no member named `icmpv6_code' extensions/ebt_ip6.c: In function `compare': extensions/ebt_ip6.c:536: error: `EBT_IP6_ICMP6' undeclared (first use in this function) extensions/ebt_ip6.c:537: error: structure has no member named `icmpv6_type' extensions/ebt_ip6.c:537: error: structure has no member named `icmpv6_type' extensions/ebt_ip6.c:538: error: structure has no member named `icmpv6_type' extensions/ebt_ip6.c:538: error: structure has no member named `icmpv6_type' extensions/ebt_ip6.c:539: error: structure has no member named `icmpv6_code' extensions/ebt_ip6.c:539: error: structure has no member named `icmpv6_code' extensions/ebt_ip6.c:540: error: structure has no member named `icmpv6_code' extensions/ebt_ip6.c:540: error: structure has no member named `icmpv6_code' make: *** [extensions/ebt_ip6.o] Error 1 由於 linux-2.6.36.x 不支援 EBT_IP6_ICMP6,所以必須把 EBT_IP6_ICMP6 相關程式碼移除。

台南小新 發表在 痞客邦 PIXNET 留言(0) 人氣()