|
本帖最后由 footlog 于 2018-9-25 16:41 编辑
tinyproxy是个轻量级的代理服务器,有时候无线路由器也用的到
padavan的应用程序是放在trunk/user下
要想加入自己的软件,就放在这个目录下
1.建目录,下载源代码
cd trunk/user
mkdir tinyproxy;
cd tinyproxy
git clone https://github.com/tinyproxy/tinyproxy.git
2.创建Makefile
创建Makefile,从别的目录考一个过来修改一下
SRC_NAME=tinyproxy
#说实话,这两个FLAG啥意思,不明白,-O3是自己加的,最高级优化性能,padavan默认是Os,按尺寸优化
CFLAGS += -O3 -ffunction-sections -fdata-sections
LDFLAGS += -Wl,--gc-sections
all: config_test
$(MAKE) -C $(SRC_NAME)
#测试是否已经config
#这个地方先这样,应该先执行SRC/.autoget.sh,然后头文件有个地方需要修改一下
config_test:
( if [ -f ./config_done ]; then \
echo "the same configuration"; \
else \
make configure && touch config_done; \
fi )
configure:
( cd $(SRC_NAME) ; \
./configure \
--prefix=/usr \
--host=$(HOST_TARGET) \
--build=$(HOST_BUILD) ; \
)
clean:
if [ -f $(SRC_NAME)/Makefile ] ; then \
$(MAKE) -C $(SRC_NAME) distclean ; \
fi ; \
rm -f config_done
romfs:
$(ROMFSINST) $(SRC_NAME)/src/tinyproxy /sbin/tinyproxy
$(ROMFSINST) $(SRC_NAME)/etc/tinyproxy.conf /etc/storage/tinyproxy.conf
3.修改user下的Makefile,把tinyproxy加入
dir_y += tinyproxy
当然也可以在trunk/.config中加入配置开关
4.编译tinyproxy
./build_firmware
编译的时候可能会出现
undefined reference to `rpl_malloc'
这是因为用rpl代替了malloc
找到config.h.in
/* Define to rpl_malloc if the replacement function should be used. */
#define malloc rpl_malloc
/* Define to rpl_realloc if the replacement function should be used. */
#define realloc rpl_realloc
把这两个define注释掉就可以了
5.升级固件,运行
tinyproxy -c /etc/storage/tinyproxy.conf
其中tinyproxy.conf中的user,Group都改成root
Allow 127.0.0.1根据自己的情况修改,或者直接注释掉
OK.
编译好的tinyproxy
链接:https://pan.baidu.com/s/1xexk5rnuZEnFsC0Kiz-NHQ 密码:bnop
可以下载后直接上传到路由器,手工运行./tinyproxy -c tinyproxy.conf
|
评分
-
查看全部评分
|