发布于2015的文章

Dec 30

先配置下选项,我这里以 PolarSSL 为例:
./configure --prefix=/opt --with-crypto-library=polarssl --with-polarssl=/mmc/lib --with-polarssl-include=/mmc/include

为了解决编译时出现的 epoll 相关错误(应为 uClibc 版本低的原因),需要:
sed -i "s/epoll_create1/epoll_create/g" ./libev/ev_epoll.c

使用 ldtools 的话,可以在编译二进制文件时指定 -all-static:
sed -i "s/LDFLAGS = /LDFLAGS = -all-static/g" ./src/Makefile

然后就可以:

make
strip ./src/ss-*
make install

Dec 14

在 DD-WRT 下非交互式状态执行脚本时,所执行的脚本最好加上下面的内容:

export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/jffs/sbin: 
/jffs/bin:/jffs/usr/sbin:/jffs/usr/bin:/mmc/sbin:/mmc/bin: 
/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin: 
/opt/usr/bin
export LD_LIBRARY_PATH=/lib:/usr/lib:/jffs/lib:/jffs/usr/lib: 
/jffs/usr/local/lib:/mmc/lib:/mmc/usr/lib:/opt/lib:/opt/usr/lib

特别是 LD_LIBRARY_PATH 这个环境变量,要不很多脚本在 shell 下可以执行,一旦放到计划任务等非交互状态下就不能执行了,还不好调试!

Tags: ,

Nov 24

下载编译 libsodium:

git clone https://github.com/jedisct1/libsodium.git
cd libsodium
./autogen.sh
./configure --enable-minimal --enable-static --disable-shared --prefix=/mmc
make && make install

静态编译 dnscrypt-proxy:

git clone https://github.com/jedisct1/dnscrypt-proxy.git
cd dnscrypt-proxy
./autogen.sh
./configure LDFLAGS='-Wl,-static -static -static-libgcc -s -Wl,--gc-sections' --prefix=/opt
#1.7.0+
LDFLAGS='-Wl,-static -static -static-libgcc -s' ./configure --prefix=/opt --with-included-ltdl && make -j2
make

:twisted: :twisted: :twisted:


Nov 05

使用 Tomato 固件,先下载 tomatoware:

CMake:
./bootstrap --prefix=/mmc && make && make install

libsodium:
./configure --prefix=/mmc && make && make install

然后静态编译 DNSProxy" title="Pcap_DNSProxy GITHUB" rel="external">Pcap_DNSProxy ,需要修改下源码的 /Pcap_DNSProxy/Source/Pcap_DNSProxy/CMakeLists.txt 文件:

Executable file name
#static
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
SET(BUILD_SHARED_LIBRARIES OFF)
SET(CMAKE_EXE_LINKER_FLAGS "-static -pthread -Wl,--whole-archive 
-lpthread -Wl,--no-whole-archive")
#static
add_executable(Pcap_DNSProxy ${MAIN_SRC_FILES})
IF(PLATFORM_OPENWRT)
INSTALL(TARGETS Pcap_DNSProxy RUNTIME DESTINATION sbin)
ENDIF(PLATFORM_OPENWRT)

注意:单独使用 -static 编译出来的文件执行会出错,要结合后面那堆参数:

terminate called after throwing an instance of 'std::system_error'
what(): Enable multithreading to use std::thread: Operation not permitted

Pcap_DNSProxy

当然还是希望作者加一个静态编译的开关选项。

已提交,作者已添加:

* 使用 ./Linux_Build.sh 执行编译程序
* 添加参数 --enable-static 即 ./Linux_Build.sh --enable-static 可启用静态编译


Jul 17

Charter 是国外一个 ISP,它们提供给客户一个 OEM 版本的 R6300 V2,硬件构成和 Netgear R6300 V2 完全相同。外观上,Charter 版本为磨砂面,"NETGEAR" 字样的 Logo 不发光(实际上内部印刷版上有 LED,但是由于外壳不透光所以...),而 Negear 零售版本是镜面 + 发光 Logo。

进入管理界面,Charter 的固件版本显示为 V1.0.3.6_1.0.63CH,注意后面的 CH 字样,不能升级 Netgear 官方固件,也不能直接刷针对 R6300 V2 的 DD-WRT 或者 Tomato 固件,会提示类似信息:

This firmware file is incorrect! Please get the firmware file again and make sure it is the correct firmware for this product.

1. 刷 Kong 的 DD-WRT K3 固件预刷版本,下载地址:dd-wrt.K3_R6300V2CH.chk

2. 登陆 DD-WRT,开启 SSH 服务,用 SSH 客户端登陆路由器,键入以下命令:

burnboardid U12H240T00_NETGEAR

重启路由器,重启完成后,你的路由器已经变成标准版的 Netgear R6300V2

3. 如果只是想刷 DD-WRT,到这一步就可以刷标准 Netgear R6300V2 的 DD-WRT 固件了,包括 BS 版本;

4. 在 DD-WRT 界面刷入 Netgear 官方的 R6300V2 固件,去官方下载即可;

5. 刷入 Shibby Tomato 固件的预刷版本:tomato-R6300v2-initial.chk

6. 刷 Tomato ARM 其他版本。


[1/2]  1 2 >