目前日期文章:201507 (26)

瀏覽方式: 標題列表 簡短摘要

今天在測試 VPN Passthrough,發現找不到 ip_conntrack_pptp.ko。google 了半天也找不到資料,在 linux menuconfig 也找不到相關設定,最後只找到一個 PPTP protocol support,死馬當活馬醫,結果編出來變成 nf_conntrack_pptp.ko。最後去 google nf_conntrack_pptp.ko+ip_conntrack_pptp.ko 才知道兩者是一樣的東西,主要是 net/netfilter/Kconfig 的名稱變成 CONFIG_NF_CONNTRACK 而不是 CONFIG_NF_CONNTRACK_SUPPORT,所以造成抓錯檔了。

  • [*] Networking support --->
  •   Network options --->
  •     [*] Network packet filtering framework (Netfilter) --->
  •       [*] Advanced netfilter configuration
  •       Core Netfilter Configuration --->
  •         [*] Netfilter connection tracking support
  •         [M] PPTP protocol support
修改 user/rt2880_app/scripts/vpn-passthru.sh
--- user-old/rt2880_app/scripts/vpn-passthru.sh 2015-07-31 14:31:13.158474337 +0800
+++ user/rt2880_app/scripts/vpn-passthru.sh     2015-07-31 14:31:49.765942167 +0800
@@ -9,7 +9,7 @@


 # note: they must be removed in order
-if [ "$CONFIG_NF_CONNTRACK_SUPPORT" = "y" ]; then
+if [ "$CONFIG_NF_CONNTRACK" = "y" ]; then
        rmmod nf_nat_pptp 1>/dev/null 2>&1
        rmmod nf_conntrack_pptp 1>/dev/null 2>&1
        rmmod nf_nat_proto_gre 1>/dev/null 2>&1
@@ -20,7 +20,7 @@
 fi

 if [ "$pptp_pt" = "1" -o "$l2tp_pt" = "1" -o "$ipsec_pt" = "1" ]; then
-if [ "$CONFIG_NF_CONNTRACK_SUPPORT" = "y" ]; then
+if [ "$CONFIG_NF_CONNTRACK" = "y" ]; then
        insmod -q nf_conntrack_proto_gre
        insmod -q nf_nat_proto_gre

另外因為 VPN Passthrough 全都是用 nf_conntrack_proto_gre.ko 及 nf_nat_proto_gre.ko 來管理,所以只要開啟一個等於三個全都通。要單獨開啟一個選項,就變成要從 firewall 去禁止另一個 portocol。

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

iptables -A web_filter -p tcp -m tcp -m webstr --url  yahoo -j REJECT --reject-with tcp-reset
iptables: No chain/target/match by that name.
今天在測試鎖 URL 功能時一直出現錯誤 "No chain/target/match by that name",我想應該還是 kernel 沒開權限的問題,果然 bingo。
  • [*] Networking support --->
  •   Network options --->
  •     [*] Network packet filtering framework (Netfilter) --->
  •       [*] Advanced netfilter configuration
  •       Core Netfilter Configuration --->
  •         [*] "webstr" match support

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

iptables -A macipport_filter -m mac --mac-source 40:8D:5C:16:20:54 -j DROP
iptables: No chain/target/match by that name.
今天在測試鎖 mac 功能時一直出現錯誤 "No chain/target/match by that name",google 也找不到答案,突然想到會不會是 kernel 沒開權限,果然 bingo。
  • [*] Networking support --->
  •   Network options --->
  •     [*] Network packet filtering framework (Netfilter) --->
  •       Core Netfilter Configuration --->
  •         [*] "mac" address match support

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

編譯步驟

  • ----- 解壓 --------
  • cd toolchain
  • tar jxvf buildroot-gcc463-src.tar.bz2
  • cd buildroot-2012.11.1
  • ----- 修正 gcc bug --------
  • cd dl
  • tar jxvf gcc-4.6.3.tar.bz2
  • vi gcc-4.6.3/gcc/ira-int.h
    --- gcc-4.6.3-old/gcc/ira-int.h 2015-07-27 12:51:58.898656272 +0800
    +++ gcc-4.6.3/gcc/ira-int.h     2015-07-27 12:53:33.644588455 +0800
    @@ -1123,8 +1123,13 @@
     ira_allocno_object_iter_cond (ira_allocno_object_iterator *i, ira_allocno_t a,
                                  ira_object_t *o)
     {
    -  *o = ALLOCNO_OBJECT (a, i->n);
    -  return i->n++ < ALLOCNO_NUM_OBJECTS (a);
    +  int n = i->n++;
    +  if (n < ALLOCNO_NUM_OBJECTS (a))
    +    {
    +      *o = ALLOCNO_OBJECT (a, n);
    +      return true;
    +    }
    +  return false;
     }
    
     /* Loop over all objects associated with allocno A.  In each
    
  • rm gcc-4.6.3.tar.bz2
  • tar cjvf gcc-4.6.3.tar.bz2 gcc-4.6.3
  • cd ..
  • ----- 安裝所需套件 --------
  • sudo apt-get install make gcc g++ bison flex gettext unzip
  • wget http://ftp.gnu.org/gnu/texinfo/texinfo-4.13a.tar.gz
  • tar zxvf texinfo-4.13a.tar.gz
  • cd texinfo-4.13
  • ./configure
  • make
  • sudo make install
  • cd ..
  • ----- 開始編譯 --------
  • sudo make clean
  • sudo make
  • sudo mv /opt/buildroot-gcc463/usr /opt/buildroot-gcc342
  • cd ..
  • ----- build mksquash_lzma --------
  • vi mksquash_lzma-3.2/squashfs3.2-r2/squashfs-tools/Makefile
    --- mksquash_lzma-3.2-old/squashfs3.2-r2/squashfs-tools/Makefile        2015-07-27 15:22:39.617734535 +0800
    +++ mksquash_lzma-3.2/squashfs3.2-r2/squashfs-tools/Makefile    2015-07-27 15:23:24.100545345 +0800
    @@ -7,7 +7,7 @@
     DebugFlags = -g -Wall -Wno-unused-variable -O0 -UNDEBUG
     endif
     CFLAGS += -I${Sqlzma} -D_REENTRANT -DNDEBUG ${DebugFlags}
    -LDLIBS += -lz -L${LzmaAlone} -L${LzmaC}
    +LDLIBS += -L${LzmaAlone} -L${LzmaC}
     Tgt = mksquashfs unsquashfs
    
     all: ${Tgt}
    @@ -21,14 +21,14 @@
            ${Sqlzma}/sqlzma.h ${Sqlzma}/sqmagic.h \
            ${LzmaAlone}/liblzma_r.a ${LzmaC}/libunlzma_r.a
    
    -mksquashfs: LDLIBS += -lpthread -lunlzma_r -llzma_r -lstdc++
    +mksquashfs: LDLIBS += -lpthread -lunlzma_r -llzma_r -lstdc++ -lz -lm
     mksquashfs: mksquashfs.o read_fs.o sort.o
    
     unsquashfs.o: CFLAGS += -U_REENTRANT
     unsquashfs.o: unsquashfs.c squashfs_fs.h read_fs.h global.h \
            ${Sqlzma}/sqlzma.h ${Sqlzma}/sqmagic.h ${LzmaC}/libunlzma.a
    
    -unsquashfs: LDLIBS += -lunlzma
    +unsquashfs: LDLIBS += -lunlzma -lz
     unsquashfs: unsquashfs.o
    
     clean:
    
  • cd mksquash_lzma-3.2
  • make
  • sudo make install
  • cd ..
  • ----- build lzma --------
  • tar zxvf lzma-4.32.7.tar.gz
  • cd lzma-4.32.7
  • ./configure --prefix=/opt/lzma
  • make
  • sudo make install
  • cd ..
  • ----- 修正 new lzma Makefile bug --------
  • cd ../source
  • vi vendors/Ralink/MT7620/Makefile
    --- vendors-old/Ralink/MT7620/Makefile  2015-07-30 16:18:43.458566161 +0800
    +++ vendors/Ralink/MT7620/Makefile      2015-07-30 14:11:38.416326082 +0800
    @@ -150,7 +150,7 @@
    
     image: mkimage
            $(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S $(ROOTDIR)/$(LINUXDIR)/vmlinux  $(KERNELZ)
    -       cd $(IMAGEDIR) ; rm -f $(KERNELZ).*; $(COMP) -9 -f -S .$(COMP) $(KERNELZ)
    +       cd $(IMAGEDIR) ; rm -f $(KERNELZ).*; /opt/lzma/bin/$(COMP) -9 -f -S .$(COMP) $(KERNELZ)
    
     ifeq   ($(CONFIG_BLK_DEV_INITRD),)
     ifeq   ($(CONFIG_ROOTFS_IN_FLASH_NO_PADDING),)
    
  • ----- 修正 busybox Makefile --------
  • vi user/busybox/Makefile
    --- user-old/busybox/Makefile   2015-07-27 13:47:37.904017728 +0800
    +++ user/busybox/Makefile       2015-07-27 13:49:20.712446619 +0800
    @@ -418,7 +418,7 @@
     -include $(srctree)/arch/$(ARCH)/Makefile
     export KBUILD_DEFCONFIG
    
    -config %config: scripts_basic outputmakefile FORCE
    +%config: scripts_basic outputmakefile FORCE
            $(Q)mkdir -p include
            $(Q)$(MAKE) $(build)=scripts/kconfig $@
            $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease
    
  • ----- 修正 uClibc++ _associative_citer bug --------
  • vi uClibc++/include/associative_base
    --- uClibc++_old/include/associative_base       2015-07-27 14:34:10.973985418 +0800
    +++ uClibc++/include/associative_base   2015-07-27 14:37:23.036954612 +0800
    @@ -320,7 +320,7 @@
            typedef std::list listtype;
    
            typename listtype::iterator base_iter;
    -       typedef _associative_citer _associative_citer;
    +       typedef _associative_citer __associative_citer;
    
    
     public:
    @@ -349,13 +349,13 @@
            bool operator==(const _associative_iter & m) const{
                    return m.base_iter == base_iter;
            }
    -       bool operator==(const _associative_citer & m) const{
    +       bool operator==(const __associative_citer & m) const{
                    return m.base_iter == base_iter;
            }
            bool operator!=(const _associative_iter & m) const{
                    return m.base_iter != base_iter;
            }
    -       bool operator!=(const _associative_citer & m) const{
    +       bool operator!=(const __associative_citer & m) const{
                    return m.base_iter != base_iter;
            }
            _associative_iter & operator++(){
    @@ -380,8 +380,8 @@
                    --base_iter;
                    return temp;
            }
    -       operator _associative_citer() const{
    -               return _associative_citer(base_iter);
    +       operator __associative_citer() const{
    +               return __associative_citer(base_iter);
            }
            typename listtype::iterator base_iterator(){
                    return base_iter;
    

問題排解

  • $ make
    The program 'make' can be found in the following packages:
     * make
     * make-guile
    Try: sudo apt-get install
    
    解決方法: sudo apt-get install make
  • $ sudo make
    /bin/bash: gcc: command not found
    /bin/bash: line 0: test: -lt: unary operator expected
    mkdir -p /home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/output/target
    if ! [ -d "/home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/output/target/bin" ]; then \
            if [ -d "/home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/system/skeleton" ]; then \
                    cp -fa /home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/system/skeleton/* /home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/output/target/; \
            fi; \
    fi
    cp support/misc/target-dir-warning.txt /home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/output/target/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM
    find /home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/output/target -type d -name CVS -print0 -o -name .svn -print0 | xargs -0 rm -rf
    find /home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/output/target -type f \( -name .empty -o -name '*~' \) -print0 | xargs -0 rm -rf
    touch /home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/output/build/.root
    
    You must install 'gcc' on your build machine
    
    support/dependencies/dependencies.mk:24: recipe for target 'core-dependencies' failed
    make: *** [core-dependencies] Error 1
    
    解決方法: sudo apt-get install gcc
  • $ sudo make
    
    You may have to install 'g++' on your build machine
    
    
    You must install 'bison' on your build machine
    
    
    support/dependencies/dependencies.mk:24: recipe for target 'core-dependencies' failed
    make: *** [core-dependencies] Error 1
    
    解決方法: sudo apt-get install g++ bison
  • $ sudo make
    
    You must install 'flex' on your build machine
    
    
    support/dependencies/dependencies.mk:24: recipe for target 'core-dependencies' failed
    make: *** [core-dependencies] Error 1
    
    解決方法: sudo apt-get install flex
  • $ sudo make
    
    You must install 'msgfmt' on your build machine
    msgfmt is usually part of the gettext package in your distribution
    
    support/dependencies/dependencies.mk:24: recipe for target 'core-dependencies' failed
    make: *** [core-dependencies] Error 1
    
    解決方法: sudo apt-get install gettext
  • $ sudo make
    
    You must install 'makeinfo' on your build machine
    makeinfo is usually part of the texinfo package in your distribution
    
    support/dependencies/dependencies.mk:24: recipe for target 'core-dependencies' failed
    make: *** [core-dependencies] Error 1
    
    解決方法: sudo apt-get install texinfo
  • $ sudo make
    
    You must install 'unzip' on your build machine
    
    
    support/dependencies/dependencies.mk:24: recipe for target 'core-dependencies' failed
    make: *** [core-dependencies] Error 1
    
    解決方法: sudo apt-get install unzip
  • /home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/output/toolchain/gcc-4.6.3/gcc/doc/service.texi:6: warning: node up `Service' in menu `Bugs' and in sectioning `Top' differ
    Makefile:4270: recipe for target 'doc/gcc.info' failed
    make[2]: *** [doc/gcc.info] Error 1
    rm gcc.pod
    make[2]: Leaving directory '/home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/output/toolchain/gcc-4.6.3-initial/gcc'
    Makefile:5252: recipe for target 'all-gcc' failed
    make[1]: *** [all-gcc] Error 2
    make[1]: Leaving directory '/home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/output/toolchain/gcc-4.6.3-initial'
    toolchain/gcc/gcc-uclibc-4.x.mk:318: recipe for target '/home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/output/toolchain/gcc-4.6.3-initial/.compiled' failed
    make: *** [/home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/output/toolchain/gcc-4.6.3-initial/.compiled] Error 2
    
    這個主要是 apt-get install texinfo 的版本是 5.2.0,而 gcc 4.6.3 當時的環境是用 texinfo 4.x 的版本,但是很不幸的是 texinfo 4.x 跟 5.x 並不相容,所以只能安裝舊版本才能解決。
  • *** Error in `/home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/output/toolchain/gcc-4.6.3-intermediate/./gcc/cc1': double free or corruption (fasttop): 0x00000000028cf280 ***
    /home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/output/toolchain/gcc-4.6.3/libgcc/../gcc/libgcc2.c: In function '__muldi3':
    /home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/output/toolchain/gcc-4.6.3/libgcc/../gcc/libgcc2.c:558:1: internal compiler error: Aborted
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See  for instructions.
    Makefile:377: recipe for target '_muldi3.o' failed
    make[2]: *** [_muldi3.o] Error 1
    make[2]: *** Waiting for unfinished jobs....
    /home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/output/toolchain/gcc-4.6.3/libgcc/../gcc/libgcc2.c: In function '__negdi2':
    /home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/output/toolchain/gcc-4.6.3/libgcc/../gcc/libgcc2.c:72:1: internal compiler error: Segmentation fault
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See  for instructions.
    Makefile:377: recipe for target '_negdi2.o' failed
    make[2]: *** [_negdi2.o] Error 1
    make[2]: Leaving directory '/home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/output/toolchain/gcc-4.6.3-intermediate/mipsel-buildroot-linux-uclibc/libgcc'
    Makefile:12668: recipe for target 'all-target-libgcc' failed
    make[1]: *** [all-target-libgcc] Error 2
    make[1]: Leaving directory '/home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/output/toolchain/gcc-4.6.3-intermediate'
    toolchain/gcc/gcc-uclibc-4.x.mk:383: recipe for target '/home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/output/toolchain/gcc-4.6.3-intermediate/.compiled' failed
    make: *** [/home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/output/toolchain/gcc-4.6.3-intermediate/.compiled] Error 2
    
    解決方法: 修正 gcc bug
  • terminal.o:/home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/texinfo-4.13/info/terminal.c:272: more undefined references to `tputs' follow
    collect2: error: ld returned 1 exit status
    Makefile:556: recipe for target 'ginfo' failed
    make[3]: *** [ginfo] Error 1
    make[3]: Leaving directory '/home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/texinfo-4.13/info'
    Makefile:496: recipe for target 'all' failed
    make[2]: *** [all] Error 2
    make[2]: Leaving directory '/home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/texinfo-4.13/info'
    Makefile:516: recipe for target 'all-recursive' failed
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory '/home/enos/RT288x_SDK/toolchain/buildroot-2012.11.1/texinfo-4.13'
    Makefile:455: recipe for target 'all' failed
    make: *** [all] Error 2
    
    解決方法: 重新做 ./configure make clean make 即可。
  • make[3]: Entering directory '/home/enos/RT288x_SDK/source/user/busybox'
    Makefile:1262: *** mixed implicit and normal rules: deprecated syntax
    /home/enos/RT288x_SDK/source/user/busybox/Makefile:421: *** mixed implicit and normal rules: deprecated syntax
    /home/enos/RT288x_SDK/source/user/busybox/Makefile:1262: *** mixed implicit and normal rules: deprecated syntax
    make[4]: *** No rule to make target 'silentoldconfig'.  Stop.
    Makefile:497: recipe for target 'include/autoconf.h' failed
    make[3]: *** [include/autoconf.h] Error 2
    make[3]: Leaving directory '/home/enos/RT288x_SDK/source/user/busybox'
    Makefile:177: recipe for target 'busybox' failed
    make[2]: *** [busybox] Error 2
    make[2]: Leaving directory '/home/enos/RT288x_SDK/source/user'
    Makefile:169: recipe for target 'all' failed
    make[1]: *** [all] Error 2
    make[1]: Leaving directory '/home/enos/RT288x_SDK/source/user'
    Makefile:427: recipe for target 'user_only' failed
    make: *** [user_only] Error 2
    
    解決方法: 修正 busybox Makefile
  • /opt/buildroot-gcc342/bin/mipsel-linux-g++ -fno-builtin -nostdinc++ -DGCC_HASCLASSVISIBILITY -I../include -Wall -Wno-trigraphs -pedantic -ansi -O0 -g3 -fPIC -o map.o -c map.cpp
    In file included from ../include/map:26:0,
                     from map.cpp:20:
    ../include/associative_base:323:60: error: declaration of 'typedef class std::_associative_citer std::_associative_iter::_associative_citer' [-fpermissive]
    ../include/associative_base:242:65: error: changes meaning of '_associative_citer' from 'class std::_associative_citer' [-fpermissive]
    Makefile:74: recipe for target 'map.o' failed
    make[2]: *** [map.o] Error 1
    make[2]: Leaving directory '/home/enos/RT288x_SDK/source/uClibc++/src'
    Makefile:16: recipe for target 'all' failed
    make[1]: *** [all] Error 2
    make[1]: Leaving directory '/home/enos/RT288x_SDK/source/uClibc++'
    Makefile:427: recipe for target 'uClibc++_only' failed
    make: *** [uClibc++_only] Error 2
    
    解決方法: 修正 uClibc++ _associative_citer bug
  • "/opt/buildroot-gcc342/bin"/mipsel-linux-gcc -Wl,--warn-common -Wl,--warn-once -Wl,-z,combreloc -Wl,-z,defs -nodefaultlibs -shared -Wl,-soname,libstdc++.so.0 `echo ""` -o libstdc++-0.2.2.so algorithm.o iomanip.o streambuf.o numeric.o map.o fstream.o bitset.o eh_alloc.o set.o new_op.o ostream.o char_traits.o limits.o associative_base.o stack.o stdexcept.o eh_globals.o string.o func_exception.o new_opv.o new_opnt.o deque.o exception.o new_handler.o iostream.o queue.o locale.o list.o ios.o del_opvnt.o valarray.o del_op.o complex.o del_opv.o utility.o iterator.o new_opvnt.o sstream.o vector.o istream.o del_opnt.o abi/abi.o abi/libsupc/eh_throw.o abi/libsupc/cp-demangle.o abi/libsupc/hash_bytes.o abi/libsupc/bad_alloc.o abi/libsupc/pmem_type_info.o abi/libsupc/tinfo.o abi/libsupc/eh_terminate.o abi/libsupc/eh_personality.o abi/libsupc/dyncast.o abi/libsupc/eh_type.o abi/libsupc/vec.o abi/libsupc/guard_error.o abi/libsupc/eh_exception.o abi/libsupc/eh_unex_handler.o abi/libsupc/atexit_arm.o abi/libsupc/class_type_info.o abi/libsupc/vterminate.o abi/libsupc/pointer_type_info.o abi/libsupc/si_class_type_info.o abi/libsupc/pbase_type_info.o abi/libsupc/bad_typeid.o abi/libsupc/guard.o abi/libsupc/bad_cast.o abi/libsupc/function_type_info.o abi/libsupc/eh_term_handler.o abi/libsupc/eh_arm.o abi/libsupc/eh_call.o abi/libsupc/tinfo2.o abi/libsupc/fundamental_type_info.o abi/libsupc/eh_ptr.o abi/libsupc/enum_type_info.o abi/libsupc/eh_aux_runtime.o abi/libsupc/array_type_info.o abi/libsupc/nested_exception.o abi/libsupc/eh_catch.o abi/libsupc/vmi_class_type_info.o   -L/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/4.6.3/ -lc -lgcc -Wl,--as-needed -lgcc_s -Wl,--no-as-needed
    /opt/buildroot-gcc342/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/4.6.3/../../../../mipsel-buildroot-linux-uclibc/bin/ld: abi/libsupc/eh_throw.o: relocation R_MIPS_HI16 against `__gnu_local_gp' can not be used when making a shared object; recompile with -fPIC
    abi/libsupc/eh_throw.o: could not read symbols: Bad value
    collect2: ld returned 1 exit status
    Makefile:64: recipe for target 'libstdc++-0.2.2.so' failed
    make[2]: *** [libstdc++-0.2.2.so] Error 1
    make[2]: Leaving directory '/home/enos/RT288x_SDK/source/uClibc++/src'
    Makefile:16: recipe for target 'all' failed
    make[1]: *** [all] Error 2
    make[1]: Leaving directory '/home/enos/RT288x_SDK/source/uClibc++'
    Makefile:427: recipe for target 'uClibc++_only' failed
    make: *** [uClibc++_only] Error 2
    
    解決方法: cd uClibc++; make menuconfig 選項 Library Installation Options ---> Build static library 及 Build only static library 二個都打勾。
  • make[1]: Entering directory '/home/enos/RT288x_SDK/source/linux-2.6.36.x'
      CHK     include/linux/version.h
      CHK     include/generated/utsrelease.h
      CALL    scripts/checksyscalls.sh
      CC      init/main.o
      CHK     include/generated/compile.h
      CC      init/version.o
      CC      init/do_mounts.o
      CC      init/do_mounts_rd.o
      CC      init/do_mounts_initrd.o
      LD      init/mounts.o
      CC      init/initramfs.o
      CC      init/calibrate.o
      LD      init/built-in.o
      HOSTCC  usr/gen_init_cpio
      GEN     usr/initramfs_data.cpio.lzma
    /home/enos/RT288x_SDK/source/linux-2.6.36.x/scripts/gen_initramfs_list.sh: line 300: /opt/buildroot-gcc342/bin/lzma_alone: No such file or directory
    /home/enos/RT288x_SDK/source/linux-2.6.36.x/usr/Makefile:65: recipe for target 'usr/initramfs_data.cpio.lzma' failed
    make[2]: *** [usr/initramfs_data.cpio.lzma] Error 1
    Makefile:893: recipe for target 'usr' failed
    make[1]: *** [usr] Error 2
    make[1]: Leaving directory '/home/enos/RT288x_SDK/source/linux-2.6.36.x'
    Makefile:346: recipe for target 'linux' failed
    make: *** [linux] Error 1
    
    解決方法: 安裝 mksquash_lzma
  • cc   mksquashfs.o read_fs.o sort.o  -lz -L/home/enos/RT288x_SDK/toolchain/mksquash_lzma-3.2/lzma443/C/7zip/Compress/LZMA_Alone -L/home/enos/RT288x_SDK/toolchain/mksquash_lzma-3.2/lzma443/C/7zip/Compress/LZMA_C -lpthread -lunlzma_r -llzma_r -lstdc++ -o mksquashfs
    /usr/bin/ld: mksquashfs.o: undefined reference to symbol 'log10@@GLIBC_2.2.5'
    /lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
    collect2: error: ld returned 1 exit status
    : recipe for target 'mksquashfs' failed
    make[1]: *** [mksquashfs] Error 1
    make[1]: Leaving directory '/home/enos/RT288x_SDK/toolchain/mksquash_lzma-3.2/squashfs3.2-r2/squashfs-tools'
    Makefile:28: recipe for target 'all' failed
    make: *** [all] Error 2
    
    解決方法: 修正 mksquash_lzma Makefile bug

參考資料


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

$ make menuconfig
The program 'make' can be found in the following packages:
 * make
 * make-guile
Try: sudo apt-get install
解決方法: sudo apt-get install make
$ make menuconfig
Makefile:345: *** mixed implicit and normal rules: deprecated syntax
config/mkconfig > config.in
make -C /home/enos/RT288x_SDK/source/config/scripts/lxdialog all
make[1]: Entering directory '/home/enos/RT288x_SDK/source/config/scripts/lxdialog'
/bin/sh: 1: cc: not found
-e
>> Unable to find the Ncurses libraries.
>>
>> You must have Ncurses installed in order
>> to use 'make menuconfig'

Makefile:31: recipe for target 'ncurses' failed
make[1]: *** [ncurses] Error 1
make[1]: Leaving directory '/home/enos/RT288x_SDK/source/config/scripts/lxdialog'
Makefile:213: recipe for target 'menuconfig' failed
make: *** [menuconfig] Error 2
解決方法: sudo apt-get install gcc libncurses5-dev
make -C /home/enos/RT288x_SDK/source/vendors/Ralink/MT7620/. dir_v=/home/enos/RT288x_SDK/source/vendors/Ralink/MT7620/. -f /home/enos/RT288x_SDK/source/vendors/vendors-common.mak image
make[2]: Entering directory '/home/enos/RT288x_SDK/source/vendors/Ralink/MT7620'
cc  -DUSE_HOSTCC -o mkimage -I/home/enos/RT288x_SDK/source/user/mkimage/include /home/enos/RT288x_SDK/source/user/mkimage/crc32.c /home/enos/RT288x_SDK/source/user/mkimage/mkimage.c
/home/enos/RT288x_SDK/source/user/mkimage/crc32.c:15:18: fatal error: zlib.h: No such file or directory
 #include "zlib.h"
                  ^
compilation terminated.
/home/enos/RT288x_SDK/source/vendors/Ralink/MT7620/./Makefile:149: recipe for target 'mkimage' failed
make[2]: *** [mkimage] Error 1
make[2]: Leaving directory '/home/enos/RT288x_SDK/source/vendors/Ralink/MT7620'
Makefile:29: recipe for target 'image' failed
make[1]: *** [image] Error 2
make[1]: Leaving directory '/home/enos/RT288x_SDK/source/vendors'
Makefile:323: recipe for target 'image' failed
make: *** [image] Error 2
解決方法: sudo apt-get install zlib1g-dev
/home/enos/RT288x_SDK/source/user/iptables-1.4.10/libtool: 1: eval: libtool_args+=: not found
/home/enos/RT288x_SDK/source/user/iptables-1.4.10/libtool: 1: eval: libtool_args+=: not found
libtool: link: /opt/buildroot-gcc342/bin/mipsel-linux-gcc  libiptc/.libs/libip4tc.so extensions/libext4.a ./.libs/libxtables.so -lm
/opt/buildroot-gcc342/bin/../mipsel-buildroot-linux-uclibc/sysroot/usr/lib/crt1.o: In function `__start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
Makefile:531: recipe for target 'iptables-multi' failed
make[5]: *** [iptables-multi] Error 1
make[5]: Leaving directory '/home/enos/RT288x_SDK/source/user/iptables-1.4.10'
Makefile:833: recipe for target 'all-recursive' failed
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory '/home/enos/RT288x_SDK/source/user/iptables-1.4.10'
Makefile:385: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/home/enos/RT288x_SDK/source/user/iptables-1.4.10'
Makefile:177: recipe for target 'iptables-1.4.10' failed
make[2]: *** [iptables-1.4.10] Error 2
make[2]: Leaving directory '/home/enos/RT288x_SDK/source/user'
Makefile:169: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/enos/RT288x_SDK/source/user'
Makefile:427: recipe for target 'user_only' failed
make: *** [user_only] Error 2
解決方法: sudo ln -fs /bin/bash /bin/sh
Image Name:   Linux Kernel Image
Created:      Fri Jul 24 10:53:48 2015
Image Type:   MIPS Linux Kernel Image (lzma compressed)
Data Size:    4316615 Bytes = 4215.44 kB = 4.12 MB
Load Address: 0x80000000
Entry Point:  0x8000C150
Kernel Size:  0x00000000
make[2]: Leaving directory '/home/enos/RT288x_SDK/source/vendors/Ralink/MT7620'
make[1]: Leaving directory '/home/enos/RT288x_SDK/source/vendors'
cp /home/enos/RT288x_SDK/source/images/enos_uImage /tftpboot
cp: cannot create regular file ‘/tftpboot’: Permission denied
Makefile:323: recipe for target 'image' failed
解決方法: sudo mkdir /tftpboot; sudo chmod 777 /tftpboot
bison -y  -d gram.y && mv y.tab.c gram.c
/bin/sh: bison: command not found
Makefile:31: recipe for target 'gram.c' failed
make[3]: *** [gram.c] Error 127
make[3]: Leaving directory '/home/enos/RT288x_SDK/source/user/radvd-1.0'
Makefile:177: recipe for target 'radvd-1.0' failed
make[2]: *** [radvd-1.0] Error 2
make[2]: Leaving directory '/home/enos/RT288x_SDK/source/user'
Makefile:169: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/enos/RT288x_SDK/source/user'
Makefile:427: recipe for target 'user_only' failed
make: *** [user_only] Error 2
解決方法: sudo apt-get install bison
flex   scanner.l && mv lex.yy.c scanner.c
/bin/sh: flex: command not found
Makefile:28: recipe for target 'scanner.c' failed
make[3]: *** [scanner.c] Error 127
make[3]: Leaving directory '/home/enos/RT288x_SDK/source/user/radvd-1.0'
Makefile:177: recipe for target 'radvd-1.0' failed
make[2]: *** [radvd-1.0] Error 2
make[2]: Leaving directory '/home/enos/RT288x_SDK/source/user'
Makefile:169: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/enos/RT288x_SDK/source/user'
Makefile:427: recipe for target 'user_only' failed
make: *** [user_only] Error 2
解決方法: sudo apt-get install flex

ubuntu 15.04 才有的問題

make[3]: Entering directory '/home/enos/RT288x_SDK/source/user/busybox'
Makefile:1262: *** mixed implicit and normal rules: deprecated syntax
/home/enos/RT288x_SDK/source/user/busybox/Makefile:421: *** mixed implicit and normal rules: deprecated syntax
/home/enos/RT288x_SDK/source/user/busybox/Makefile:1262: *** mixed implicit and normal rules: deprecated syntax
make[4]: *** No rule to make target 'silentoldconfig'.  Stop.
Makefile:497: recipe for target 'include/autoconf.h' failed
make[3]: *** [include/autoconf.h] Error 2
make[3]: Leaving directory '/home/enos/RT288x_SDK/source/user/busybox'
Makefile:177: recipe for target 'busybox' failed
make[2]: *** [busybox] Error 2
make[2]: Leaving directory '/home/enos/RT288x_SDK/source/user'
Makefile:169: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/enos/RT288x_SDK/source/user'
Makefile:427: recipe for target 'user_only' failed
make: *** [user_only] Error 2
解決方法: vi user/busybox/Makefile
--- user-old/busybox/Makefile   2015-07-27 13:47:37.904017728 +0800
+++ user/busybox/Makefile       2015-07-27 13:49:20.712446619 +0800
@@ -418,7 +418,7 @@
 -include $(srctree)/arch/$(ARCH)/Makefile
 export KBUILD_DEFCONFIG

-config %config: scripts_basic outputmakefile FORCE
+%config: scripts_basic outputmakefile FORCE
        $(Q)mkdir -p include
        $(Q)$(MAKE) $(build)=scripts/kconfig $@
        $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease
改完記得要 make clean 再 make, 不然會有奇怪的錯誤。
## Booting image at bc050000 ...
raspi_read: from:50000 len:40
   Image Name:   Linux Kernel Image
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    5757730 Bytes =  5.5 MB
   Load Address: 80000000
   Entry Point:  8000c150
raspi_read: from:50040 len:57db22
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... LZMA ERROR 1 - must RESET board to recover
解決方法: 這個問題是在於 ubuntu 15.04 的 lzma 版本為 5.1.x,而 Ralink bootcode 的開發環境的 lzma 版本為 4.32.7,很不幸的是 lzma 的 5.x 並無法相容於 4.x,所以會造成 bootloader 無法解壓的問題。只要重新安裝 Ralink SDK 的 toolchain 目錄中的 lzma 版本即可。

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

  • sudo fdisk /dev/sdb
    切割 partition
  • sudo mkfs.ext4 /dev/sdb1

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

參考資料


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

Kernel

  • File systems --->
  •   [*] Network File Systems --->
  •     [*] CIFS support (advanced network filesystem, SMBFS successor)
  •       [*] CIFS Statistics
  •         [*] Extended Statistics
  •       [*] CIFS Extended Attributes
  •         [*] CIFS POSIX Extentions

Busybox

  • Linux System Utilities --->
  •   [*] mount
  •     [*] Support mounting CIFS/SMB file systems

問題排解

  • # ls /mnt
    ls: can't open '/mnt': Value too large for defined data type
    
    這個問題常出現在 windows 分享的資料夾,只要在 -o 加上 "nounix,noserverino" 就可以解決問題。

參考資料


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

每一個專案的 trac.ini 有很多相同的地方,所以把相同的地方寫在一個檔案,再利用 inherit file 方式加到 trac.ini,就不用每次寫一堆了。新增一個檔案 /var/trac/trac.ini,寫入下列資料。

[components]
# Subversion
tracopt.versioncontrol.svn.* = enabled
tracopt.ticket.commit_updater.* = enabled
# TracWiki WYSIWYG Editor Plugin
tracwysiwyg.* = enabled
# Trac Ticket Template Plugin
tickettemplate.* = enabled
# CC selector plugin
cc_selector.* = enabled
# Account Manager Plugin
acct_mgr.admin.* = enabled
acct_mgr.api.* = enabled
acct_mgr.htfile.htpasswdstore = enabled
acct_mgr.notification.* = enabled
acct_mgr.pwhash.* = enabled
acct_mgr.web_ui.* = enabled
acct_mgr.web_ui.resetpwstore = disabled
trac.web.auth.loginmodule = disabled

[cc_selector]
show_fullname = true
username_blacklist =

[tickettemplate]
field_list = summary, description, reporter, owner, priority, cc, milestone, component, version, type
enable_custom = true

[account-manager]
htpasswd_file = /var/svn/account
htpasswd_hash_type = md5
password_store = HtPasswdStore
register_check =
  • su

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

功用

  • Refs #123
    在做 svn commit 只要在 --message 訊息裏加入 refs #no 就可以在 #no ticket 新增一筆 comment。
  • Fixes #123

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

要記住專案所有人的帳號真的有點困難,如果有一個帳號清單可供選擇,那就真的太方便了,CC selector plugin 就是為了做這件事,讓你不用麻煩腦袋不夠用了。

安裝步驟

  • easy_install https://trac-hacks.org/svn/ccselectorplugin/trunk/

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

每次新增一個 ticket,都是從空白頁面開始,對於習慣的人是無所謂,但對於新手就有困難了。Trac Ticket Template Plugin 可以先幫各種 ticket type 建立一個模板,讓新手也有一個依循。

安裝步驟

  • easy_install https://trac-hacks.org/svn/tractickettemplateplugin/1.0/

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

要編輯 Trac 的 wiki 還要學習專用的語法,實在有夠不方便。這個 plugin 就是用來給不想學 wiki 語法的懶人。所見即所得的編輯頁面,不用去記任何 wiki 語法,真是太方便了。

安裝步驟

  • easy_install https://trac-hacks.org/svn/tracwysiwygplugin/0.12

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

  • source/user/rt2880_app/mii_mgr
  • mii_mgr -g -p [phy number] -r [register number]
    讀取 mii 值(16進位)
  • mii_mgr -s -p [phy number] -r [register number] -v [0xvalue]

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

function nvram software
802.1d Spanning Tree stpEnabled brctl stp br0 1
LLTD lltdEnabled lld2d
IGMP Proxy igmpEnabled igmpproxy
UPNP upnpEnabled miniupnpd
Router Advertisement radvdEnabled radvd
PPPOE relay pppoeREnabled pppoe-relay
DNS Proxy dnsPEnabled dnsmasq

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

Kernel

  • File systems --->
  •   [*] Network File Systems --->
  •     [*] NFS client support
  •       [*] NFS client support for NFS version 3
  •       [*] NFS client support for NFS version 4

Busybox

  • Linux System Utilities --->
  •   [*] mount
  •     [*] Support mounting NFS file systems

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

source/lib/libnvram

  • -I/home/xxx/RT288x_SDK/source/lib/libnvram
  • -L/home/xxx/RT288x_SDK/source/romfs/lib
  • nvram_init
  • nvram_get
  • nvram_bufget
  • nvram_set
  • nvram_bufset
  • nvram_commit
  • nvram_close
  • nvram_clear

source/user/rt2880_app/nvram

  • nvram_daemon: 針對第一次開機寫入初始值,另外還有監控 wps 及 reset 按鈕並做出對應動作。
  • nvram_get: 調用 ralink_init 讀取設定值,nvram_get 。
  • nvram_set: 調用 ralink_init 寫入設定值,nvram_set 。
  • ralink_init: nvram tools
    • ralink_init show 2860
      顯示所有 2860(2.4g wifi) 設定值
    • ralink_init show rtdev

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

修改 init/init.c

static const char *const environment[] = {
        "HOME=/",
        bb_PATH_root_path,
        "SHELL=/bin/sh",
        "USER=root",
        NULL
};

修改 shell/ash.c

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

source/vendors/Ralink/MT7620/
  • /etc_ro/rcS
  • /etc_ro/inittab
  • /etc_ro/motd
  • /etc/fstab
  • /etc_ro/Wireless/*
  • /etc_ro/wlan/*
source/user/rt2880_app/scripts
  • /sbin/*.sh

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

修改 image 檔名


根據 Ralink Products 型號,去修改 vendors 目錄下的 Makefile,比如我的型號是 MT7620,所以必須修改 source/vendors/Ralink/MT7620/Makefile。

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

1 2