• WAP手机版 保存到桌面加入收藏设为首页
路由器

pandavan源码添加新应用实例

时间:2016-06-30 09:21:17   作者:哎丫丫转载   阅读:1929   评论:0
内容摘要:这里原文作者是新加添了一个addtorwithprivoxy代理程序
这里原文作者是新加添了一个

add tor with privoxy代理程序

原文地址:https://b*i*t*b*u*c*k*e*t.org/padavan/rt-n56u/pull-requests/12/add-tor-with-privoxy/diff

请尽量到原文地址查看资源。复制过来的排版会出错

Files changed (31)

File trunk/.config

 View file
 

Conflict: File modified in both source and destination

To be able to merge you will need to resolve the conflicts manually. Learn how.
 ### Include Aria2 download manager. openssl ~1.2MB, aria2 ~3.5MB
 #CONFIG_FIRMWARE_INCLUDE_ARIA=y
 
+<<<<<<< destination:cc58fc34409c16284e71021125e1e7bae5fcdd80
 ### Include Aria2 WEB control. ~0.7MB
 #CONFIG_FIRMWARE_INCLUDE_ARIA_WEB_CONTROL=y
 
+=======
+### Include TOR proxy ~2.3MB
+#CONFIG_FIRMWARE_INCLUDE_TOR=y
+
+### Include privoxy proxy ~0.3MB
+#CONFIG_FIRMWARE_INCLUDE_PRIVOXY=y
+>>>>>>> source:83b06a519b93c04a704db27d9de14f575e5a910f

File trunk/libs/Makefile

 View file
 
 LIBS_INCLUDE_LIBICONV=n
 LIBS_INCLUDE_LIBUSB_0=n
 LIBS_INCLUDE_LIBUSB_1=n
+LIBS_INCLUDE_LIBEVENT=n
 LIBS_INCLUDE_MEDIA=n
 STORAGE_ENABLED=n
 
 ifeq ($(STORAGE_ENABLED),y)
 ifeq ($(CONFIG_FIRMWARE_INCLUDE_TRANSMISSION),y)
 LIBS_INCLUDE_LIBSSL=y
+LIBS_INCLUDE_LIBEVENT=y
 endif
 ifeq ($(CONFIG_FIRMWARE_INCLUDE_ARIA),y)
 LIBS_INCLUDE_LIBSSL=y
 LIBS_INCLUDE_LIBLZO=y
 endif
 
+ifeq ($(CONFIG_FIRMWARE_INCLUDE_TOR),y)
+LIBS_INCLUDE_LIBSSL=y
+LIBS_INCLUDE_LIBEVENT=y
+endif
+
 dir_y						+= libz
 dir_$(LIBS_INCLUDE_LIBLZO)			+= liblzo
 dir_$(LIBS_INCLUDE_LIBICONV)			+= libiconv
 dir_$(LIBS_INCLUDE_LIBSSL)			+= libssl
 dir_$(LIBS_INCLUDE_LIBUSB_0)			+= libusb
 dir_$(LIBS_INCLUDE_LIBUSB_1)			+= libusb-1.0
+dir_$(LIBS_INCLUDE_LIBEVENT)			+= libevent
 dir_y						+= libnfnetlink
 
 # ipset shared libs
 
 # transmission shared libs
 dir_$(CONFIG_FIRMWARE_INCLUDE_TRANSMISSION)	+= libcurl
-dir_$(CONFIG_FIRMWARE_INCLUDE_TRANSMISSION)	+= libevent
 
 # aria2 shared libs
 dir_$(CONFIG_FIRMWARE_INCLUDE_ARIA)		+= libxml2
 
+# privoxy shared libs
+dir_$(CONFIG_FIRMWARE_INCLUDE_PRIVOXY)	+= libpcre
+
 all:
 	for i in $(dir_y) ; do \
 		[ -d $$i ] && \

File trunk/libs/libevent/Makefile

 View file
 
 	( cd $(SRC_NAME) ; \
 	./configure \
 		--prefix=$(STAGEDIR) \
-		--enable-static \
-		--disable-shared \
+		--disable-static \
+		--enable-shared \
 		--disable-debug-mode \
 		--host=$(HOST_TARGET) \
 		--build=$(HOST_BUILD) ; \
 	$(MAKE) -C $(SRC_NAME) install DESTDIR=""
 
 romfs:
+	cp -fP $(DESTDIR)/lib/libevent-2.0.so* $(ROMFSDIR)/lib
 

File trunk/libs/libpcre/Makefile

 View file
 
+SRC_NAME=pcre-8.38
+
+all: config_test
+	$(MAKE) -C $(SRC_NAME)
+
+config_test:
+	( if [ -f ./config_done ]; then \
+		echo "the same configuration"; \
+	else \
+		make configure && touch config_done; \
+	fi ) 
+
+configure:
+	( test -d $(SRC_NAME) || tar -xzf $(SRC_NAME).tar.gz; \
+	cd $(SRC_NAME) ; \
+	./configure \
+		--prefix=$(STAGEDIR) \
+		--disable-static \
+		--enable-shared \
+		--disable-cpp \
+		--host=$(HOST_TARGET) \
+		--build=$(HOST_BUILD) ; \
+	)
+
+clean:
+	rm -rf $(SRC_NAME)
+	rm -f config_done
+
+install:
+	$(MAKE) -C $(SRC_NAME) install DESTDIR=""
+
+romfs:
+	cp -fP $(DESTDIR)/lib/libpcre.so* $(ROMFSDIR)/lib
+	cp -fP $(DESTDIR)/lib/libpcreposix.so* $(ROMFSDIR)/lib
+

File trunk/libs/libpcre/pcre-8.38.tar.gz

 
Binary file added.

File trunk/libs/libssl/Makefile

 View file
 

Conflict: File modified in both source and destination

To be able to merge you will need to resolve the conflicts manually. Learn how.
 
 OPENSSL_APPS =
 
+<<<<<<< destination:cc58fc34409c16284e71021125e1e7bae5fcdd80
 OPENSSL_CIPHERS = no-capieng no-cms no-gmp no-jpake no-rfc3779 no-seed \
                   no-ec2m no-err no-threads no-idea no-rc2 no-rc5 no-ripemd no-rmd160 \
                   no-static-engine no-hw no-md2 no-sse2 no-dso no-ts no-sha0 no-mdc2 no-krb5 \
 else
 OPENSSL_APPS += no-speed
 OPENSSL_CIPHERS += no-engine
+=======
+OPENSSL_CIPHERS = no-camellia no-capieng no-cms no-gmp no-jpake no-rfc3779 no-seed \
+                  no-ec2m no-err no-idea no-rc2 no-rc5 no-ripemd no-rmd160 \
+                  no-hw no-md2 no-sse2 no-dso no-ts no-sha0 no-mdc2 no-krb5 \
+                  no-smime no-ans1 no-cast no-whirlpool no-sctp no-srp no-ssl2 no-ssl3
+
+ifeq ($(CONFIG_FIRMWARE_INCLUDE_TOR),y)
+CONFIG_FIRMWARE_INCLUDE_OPENSSL_EC=y
+else
+OPENSSL_CIPHERS += no-engine no-threads
+>>>>>>> source:83b06a519b93c04a704db27d9de14f575e5a910f
 endif
 
 ifneq ($(CONFIG_FIRMWARE_INCLUDE_OPENSSL_EC),y)

File trunk/user/Makefile

 View file
 
 dir_$(CONFIG_FIRMWARE_INCLUDE_XUPNPD)		+= xupnpd
 dir_$(CONFIG_FIRMWARE_INCLUDE_TCPDUMP)		+= tcpdump
 dir_$(SAMBA_ENABLED)				+= samba3
+dir_$(CONFIG_FIRMWARE_INCLUDE_TOR)	+= tor
+dir_$(CONFIG_FIRMWARE_INCLUDE_PRIVOXY)	+= privoxy
 
 ifdef CONFIG_BLK_DEV_SD
 dir_$(CONFIG_FIRMWARE_INCLUDE_HDPARM)		+= hdparm

File trunk/user/httpd/common.h

 View file
 
 #define EVM_RESTART_ITUNES		(1ULL << 40)
 #define EVM_RESTART_TRMD		(1ULL << 41)
 #define EVM_RESTART_ARIA		(1ULL << 42)
+#define EVM_RESTART_TOR			(1ULL << 43)
+#define EVM_RESTART_PRIVOXY		(1ULL << 44)
 #define EVM_RESTART_REBOOT		(1ULL << 62)
 
 #define EVM_BLOCK_UNSAFE		(1ULL << 63) /* special case */
 #define EVT_RESTART_ITUNES		2
 #define EVT_RESTART_TRMD		3
 #define EVT_RESTART_ARIA		3
+#define EVT_RESTART_TOR			1
+#define EVT_RESTART_PRIVOXY		1
 #define EVT_RESTART_REBOOT		40
 
 struct variable

File trunk/user/httpd/httpd.h

 View file
 
 #define STORAGE_DNSMASQ_DIR	"/etc/storage/dnsmasq"
 #define STORAGE_SCRIPTS_DIR	"/etc/storage"
 #define STORAGE_CRONTAB_DIR	"/etc/storage/cron/crontabs"
+#define STORAGE_TORCONF_DIR	"/etc/storage/tor"
+#define STORAGE_PRIVOXY_DIR	"/etc/storage/privoxy"
+ 
 
 #define PROFILE_FIFO_UPLOAD	"/tmp/settings_u.prf"
 #define PROFILE_FIFO_DOWNLOAD	"/tmp/settings_d.prf"

File trunk/user/httpd/variables.c

 View file
 
 #endif
 			{"telnetd", "", NULL, EVM_RESTART_TELNETD},
 			{"sshd_enable", "", NULL, EVM_RESTART_SSHD},
+#if defined(APP_TOR)
+			{"tor_enable", "", NULL, EVM_RESTART_TOR},
+			{"torconf.torrc", "File", NULL, EVM_RESTART_TOR|EVM_BLOCK_UNSAFE},
+#endif
+#if defined(APP_PRIVOXY)
+			{"privoxy_enable", "", NULL, EVM_RESTART_PRIVOXY},
+			{"privoxy.config", "File", NULL, EVM_RESTART_PRIVOXY|EVM_BLOCK_UNSAFE},
+			{"privoxy.user.action", "File", NULL, EVM_RESTART_PRIVOXY|EVM_BLOCK_UNSAFE},
+			{"privoxy.user.filter", "File", NULL, EVM_RESTART_PRIVOXY|EVM_BLOCK_UNSAFE},
+			{"privoxy.user.trust", "File", NULL, EVM_RESTART_PRIVOXY|EVM_BLOCK_UNSAFE},
+#endif
 			{"wins_enable", "", NULL, EVM_RESTART_WINS|EVM_REAPPLY_VPNSVR},
 			{"lltd_enable", "", NULL, EVM_RESTART_LLTD},
 			{"adsc_enable", "", NULL, EVM_RESTART_ADSC},
 		{EVM_RESTART_VPNCLI,		EVT_RESTART_VPNCLI,		RCN_RESTART_VPNCLI,	EVM_RESTART_FIREWALL},
 		{EVM_RESTART_HTTPD,		EVT_RESTART_HTTPD,		RCN_RESTART_HTTPD,	EVM_RESTART_FIREWALL},
 		{EVM_RESTART_SSHD,		EVT_RESTART_SSHD,		RCN_RESTART_SSHD,	EVM_RESTART_FIREWALL},
+#if defined(APP_TOR)
+		{EVM_RESTART_TOR,		EVT_RESTART_TOR,		RCN_RESTART_TOR,	EVM_RESTART_FIREWALL},
+#endif
+#if defined(APP_PRIVOXY)
+		{EVM_RESTART_PRIVOXY,		EVT_RESTART_PRIVOXY,		RCN_RESTART_PRIVOXY,	EVM_RESTART_FIREWALL},
+#endif
 		{EVM_RESTART_TELNETD,		EVT_RESTART_TELNETD,		RCN_RESTART_TELNETD,	0},
 #if defined(APP_SMBD) || defined(APP_NMBD)
 		{EVM_RESTART_WINS,		EVT_RESTART_WINS,		RCN_RESTART_WINS,	EVM_RESTART_DHCPD|EVM_RESTART_NMBD|EVM_REAPPLY_VPNSVR},

File trunk/user/httpd/web_ex.c

 View file
 
 			else
 				chmod(real_path, 0644);
 			ret = 1;
+			if (nvram_get_int("nvram_manual") != 1)
+				doSystem("/sbin/mtd_storage.sh %s", "save");			
 		}
 	}
 
 		snprintf(filename, sizeof(filename), "%s/%s", STORAGE_SCRIPTS_DIR, file+8);
 	else if (strncmp(file, "crontab.", 8)==0)
 		snprintf(filename, sizeof(filename), "%s/%s", STORAGE_CRONTAB_DIR, nvram_safe_get("http_username"));
+	else if (strncmp(file, "torconf.", 8)==0)
+		snprintf(filename, sizeof(filename), "%s/%s", STORAGE_TORCONF_DIR, file+8);
+	else if (strncmp(file, "privoxy.", 8)==0)
+		snprintf(filename, sizeof(filename), "%s/%s", STORAGE_PRIVOXY_DIR, file+8);
 	else
 		snprintf(filename, sizeof(filename), "%s/%s", "/tmp", file);
 
 					restart_needed_bits |= event_mask;
 			}
 #endif
+#if defined(APP_TOR)
+			else if (!strncmp(v->name, "torconf.", 8)) {
+				if (write_textarea_to_file(value, STORAGE_TORCONF_DIR, file_name))
+					restart_needed_bits |= event_mask;
+			}
+#endif
+#if defined(APP_PRIVOXY)
+			else if (!strncmp(v->name, "privoxy.", 8)) {
+				if (write_textarea_to_file(value, STORAGE_PRIVOXY_DIR, file_name))
+					restart_needed_bits |= event_mask;
+			}
+#endif
 			continue;
 		}
 		
 #else
 	int found_app_sshd = 0;
 #endif
+#if defined(APP_TOR)
+	int found_app_tor = 1;
+#else
+	int found_app_tor = 0;
+#endif
+#if defined(APP_PRIVOXY)
+	int found_app_privoxy = 1;
+#else
+	int found_app_privoxy = 0;
+#endif
 #if defined(APP_XUPNPD)
 	int found_app_xupnpd = 1;
 #else
 		"function found_srv_u2ec() { return %d;}\n"
 		"function found_srv_lprd() { return %d;}\n"
 		"function found_app_sshd() { return %d;}\n"
+		"function found_app_tor() { return %d;}\n"
+		"function found_app_privoxy() { return %d;}\n"
 		"function found_app_xupnpd() { return %d;}\n",
 		found_utl_hdparm,
 		found_app_ovpn,
 		found_srv_u2ec,
 		found_srv_lprd,
 		found_app_sshd,
+		found_app_tor,
+		found_app_privoxy,
 		found_app_xupnpd
 	);
 

File trunk/user/privoxy/Makefile

 View file
 
+SRC_NAME=privoxy-3.0.24-stable
+
+CFLAGS += -Os -ffunction-sections -fdata-sections
+#CFLAGS += -I$(STAGEDIR)/include
+LDFLAGS += -Wl,--gc-sections
+
+all: config_test build
+
+config_test:
+	( if [ -f ./config_done ]; then \
+		echo "the same configuration"; \
+	else \
+		make configure && touch config_done; \
+	fi )
+
+configure:
+	( test -d $(SRC_NAME) || tar -xzf $(SRC_NAME)-src.tar.gz; \
+	cd $(SRC_NAME) ; \
+	export CPPFLAGS="-I$(STAGEDIR)/include"; \
+	autoheader; \
+	autoconf; \
+	./configure \
+		--prefix=/usr \
+		--sysconfdir=/etc/storage/privoxy \
+		--host=$(HOST_TARGET) \
+		--build=$(HOST_BUILD); \
+	)
+
+build:
+	$(MAKE) V=1 -C $(SRC_NAME)
+
+clean:
+	rm -rf config_done privoxy configs $(SRC_NAME)
+
+romfs:
+	cp $(SRC_NAME)/privoxy .
+	$(STRIP) privoxy
+	$(ROMFSINST) /usr/sbin/privoxy
+	$(ROMFSINST) /usr/bin/privoxy.sh
+	mkdir -p $(INSTALLDIR)/usr/share/privoxy/templates
+	$(ROMFSINST) $(SRC_NAME)/templates /usr/share/privoxy/templates
+	rm -rf configs
+	mkdir -p configs
+	cp -af $(SRC_NAME)/config \
+		$(SRC_NAME)/default.filter \
+	 	$(SRC_NAME)/user.filter \
+		$(SRC_NAME)/default.action \
+		$(SRC_NAME)/match-all.action \
+		$(SRC_NAME)/user.action \
+		configs
+	cp -af $(SRC_NAME)/trust configs/user.trust
+	sed -i '/^##/d;/^#\s/d;/^#$$/d' configs/*
+	sed -i 's/^\(logfile.*\)/#\1/;s/^logdir.*/logdir \/tmp/;s/^confdir.*/confdir \/etc\/storage\/privoxy/;s/^#trustfile.*/#trustfile user.trust/;s/^enable-edit-actions.*/enable-edit-actions 1/' configs/config
+	echo -e "\n## Forward to TOR\n#forward-socks5t / 127.0.0.1:9050 .\n#forward-socks5t .onion 127.0.0.1:9050 .\n#forward 192.168.*.*/ .\n#forward 10.*.*.*/ .\n" >>configs/config
+	mkdir -p $(INSTALLDIR)/usr/share/privoxy/privoxy
+	ln -s /usr/share/privoxy/templates $(INSTALLDIR)/usr/share/privoxy/privoxy/templates
+	$(ROMFSINST) configs /usr/share/privoxy/privoxy
+

File trunk/user/privoxy/privoxy-3.0.24-stable-src.tar.gz

 
Binary file added.

File trunk/user/privoxy/privoxy.sh

 View file
 
+#!/bin/sh
+
+dir_storage="/etc/storage"
+
+func_create_config()
+{
+	ip_address=`ip address show br0 | grep -w inet | sed 's|.* \(.*\)/.*|\1|'`
+	cp -af /usr/share/privoxy/privoxy $dir_storage
+	chmod 755 $dir_storage/privoxy
+	chmod 644 $dir_storage/privoxy/*
+	sed -i "s/^listen-address.*/listen-address  ${ip_address}:8118/" $dir_storage/privoxy/config
+	/sbin/mtd_storage.sh save
+}
+
+func_start()
+{
+	if [ ! -d "$dir_storage/privoxy" ] ; then
+		func_create_config
+	fi
+	/usr/bin/logger -t privoxy Start privoxy
+	/usr/sbin/privoxy --pidfile /var/run/privoxy.pid $dir_storage/privoxy/config
+}
+
+func_stop()
+{
+	/usr/bin/logger -t privoxy Stop privoxy
+	killall -q privoxy
+}
+
+case "$1" in
+start)
+	func_start $2
+	;;
+stop)
+	func_stop
+	;;
+*)
+	echo "Usage: $0 {start|stop}"
+	exit 1
+	;;
+esac
+
+exit 0

File trunk/user/rc/rc.c

 View file
 
 			restart_sshd();
 		}
 #endif
+#if defined(APP_TOR)
+		else if (strcmp(entry->d_name, RCN_RESTART_TOR) == 0)
+		{
+			restart_tor();
+		}
+#endif
+#if defined(APP_PRIVOXY)
+		else if (strcmp(entry->d_name, RCN_RESTART_PRIVOXY) == 0)
+		{
+			restart_privoxy();
+		}
+#endif
 #if defined(APP_SMBD) || defined(APP_NMBD)
 		else if (strcmp(entry->d_name, RCN_RESTART_NMBD) == 0)
 		{
 		{
 			stop_logger();
 			start_logger(0);
+			restart_crond();
 		}
 		else if (strcmp(entry->d_name, RCN_RESTART_WDG) == 0)
 		{

File trunk/user/rc/rc.h

 View file
 
 void stop_services_lan_wan(void);
 void stop_misc(void);
 
+#if defined(APP_TOR)
+int is_tor_run(void);
+void stop_tor(void);
+void run_tor(void);
+void restart_tor(void);
+#endif
+#if defined(APP_PRIVOXY)
+int is_privoxy_run(void);
+void stop_privoxy(void);
+void run_privoxy(void);
+void restart_privoxy(void);
+#endif
+
 /* services_ex.c */
 int fill_dnsmasq_servers(void);
 int is_dns_dhcpd_run(void);

File trunk/user/rc/services.c

 View file
 
 }
 #endif
 
+#if defined(APP_TOR)
+int
+is_tor_run(void)
+{
+	if (check_if_file_exist("/usr/sbin/tor"))
+	{
+		if (pids("tor"))
+			return 1;
+	}
+	
+	return 0;
+}
+
+void
+stop_tor(void)
+{
+	eval("/usr/bin/tor.sh", "stop");
+}
+
+void
+start_tor(void)
+{
+	int tor_mode = nvram_get_int("tor_enable");
+
+	if (tor_mode == 1)
+		eval("/usr/bin/tor.sh", "start");
+}
+
+void
+restart_tor(void)
+{
+	int is_run_before = is_tor_run();
+	int is_run_after;
+
+	stop_tor();
+	start_tor();
+
+	is_run_after = is_tor_run();
+}
+#endif
+#if defined(APP_PRIVOXY)
+int
+is_privoxy_run(void)
+{
+	if (check_if_file_exist("/usr/sbin/privoxy"))
+	{
+		if (pids("privoxy"))
+			return 1;
+	}
+	
+	return 0;
+}
+
+void
+stop_privoxy(void)
+{
+	eval("/usr/bin/privoxy.sh", "stop");
+}
+
+void
+start_privoxy(void)
+{
+	int privoxy_mode = nvram_get_int("privoxy_enable");
+
+	if (privoxy_mode == 1)
+		eval("/usr/bin/privoxy.sh", "start");
+}
+
+void
+restart_privoxy(void)
+{
+	int is_run_before = is_privoxy_run();
+	int is_run_after;
+
+	stop_privoxy();
+	start_privoxy();
+
+	is_run_after = is_privoxy_run();
+}
+#endif
+
 void
 start_httpd(int restart_fw)
 {
 #if defined(APP_SSHD)
 	start_sshd();
 #endif
+#if defined(APP_TOR)
+	start_tor();
+#endif
+#if defined(APP_PRIVOXY)
+	start_privoxy();
+#endif
 	start_vpn_server();
 	start_watchdog();
 	start_infosvr();
 	stop_u2ec();
 #endif
 #endif
+#if defined(APP_TOR)
+	stop_tor();
+#endif
+#if defined(APP_PRIVOXY)
+	stop_privoxy();
+#endif
 	stop_networkmap();
 	stop_lltd();
 	stop_detect_internet();

File trunk/user/shared/cflags.mk

 View file
 

Conflict: File modified in both source and destination

To be able to merge you will need to resolve the conflicts manually. Learn how.
 CFLAGS += -DAPP_SSHD
 endif
 
+<<<<<<< destination:cc58fc34409c16284e71021125e1e7bae5fcdd80
 ifeq ($(CONFIG_FIRMWARE_INCLUDE_RPL2TP),y)
 CFLAGS += -DAPP_RPL2TP
+=======
+ifeq ($(CONFIG_FIRMWARE_INCLUDE_TOR),y)
+CFLAGS += -DAPP_TOR
+endif
+
+ifeq ($(CONFIG_FIRMWARE_INCLUDE_PRIVOXY),y)
+CFLAGS += -DAPP_PRIVOXY
+>>>>>>> source:83b06a519b93c04a704db27d9de14f575e5a910f
 endif
 
 ifeq ($(CONFIG_FIRMWARE_INCLUDE_DDNS_SSL),y)

File trunk/user/shared/defaults.c

 View file
 
 	{ "telnetd", "1" },
 	{ "sshd_enable", "0" },
 	{ "wins_enable", "0" },
+	{ "tor_enable", "0" },
+	{ "privoxy_enable", "0" },
 	{ "lltd_enable", "1" },
 	{ "adsc_enable", "0" },
 	{ "crond_enable", "0" },

File trunk/user/shared/notify_rc.h

 View file
 
 #define RCN_RESTART_HTTPD		"restart_httpd"
 #define RCN_RESTART_TELNETD		"restart_telnetd"
 #define RCN_RESTART_SSHD		"restart_sshd"
+#define RCN_RESTART_TOR			"restart_tor"
+#define RCN_RESTART_PRIVOXY		"restart_privoxy"
 #define RCN_RESTART_WINS		"restart_wins"
 #define RCN_RESTART_LLTD		"restart_lltd"
 #define RCN_RESTART_ADSC		"restart_adsc"

File trunk/user/tor/Makefile

 View file
 
+SRC_NAME=tor-0.2.7.6
+
+CFLAGS += -Os -ffunction-sections -fdata-sections
+LDFLAGS += -Wl,--gc-sections
+
+
+all: config_test build
+
+config_test:
+	( if [ -f ./config_done ]; then \
+		echo "the same configuration"; \
+	else \
+		make configure && touch config_done; \
+	fi )
+
+configure:
+	( test -d $(SRC_NAME) || tar -xzf $(SRC_NAME).tar.gz; \
+	cd $(SRC_NAME) ; \
+	./configure \
+		--prefix=/usr \
+		--host=$(HOST_TARGET) \
+		--build=$(HOST_BUILD) \
+		--prefix=/usr \
+		--sysconfdir=/etc/storage \
+		--disable-tool-name-check \
+		--disable-gcc-hardening \
+		--disable-asciidoc \
+		--disable-systemd; \
+	)
+
+build:
+	$(MAKE) V=1 -C $(SRC_NAME)
+
+clean:
+	rm -rf config_done tor $(SRC_NAME) GeoLite2-Country.mmdb*
+
+romfs:
+	cp $(SRC_NAME)/src/or/tor .
+	$(STRIP) tor
+	$(ROMFSINST) /usr/sbin/tor
+	$(ROMFSINST) -p +x /usr/bin/tor.sh
+	mkdir -p $(INSTALLDIR)/usr/share/tor
+	$(ROMFSINST) /usr/share/tor/geoip
+	$(ROMFSINST) /usr/share/tor/geoip6
+
   版权声明,所有转载都有注明出处,本站不负责承担任何法律责往。若有侵权,请联系我。我会及时删除。

电脑维护,系统安装,软 、硬件维修,电脑配件,零售业务,网站建设,路由器安装设置 服务器维护,电脑、网络维护,智能手机刷机,安装WIFI 调试!郴州网站建设 小程序搭建 郴州电脑维修

        咨询电话:18175576644  点击这里给我发消 息
   扫描二维码。关注公众号,小程序
       享受星级服务   

手机点击二维码关注
      


手机点击打开小程序
      


相关评论
免责申明:本站部分资料来源互联网,如果侵犯了您的版权,请作者速来电或QQ与本站联系,我们将第一时间给予以改正或删除。

Copyright © 2020 哎丫丫电脑 All Rights Reserved 
 工信部备案:湘ICP备14010293号-1