0003-Update-netifd-and-its-dependencies-from-Barrier-Breaker-r41888.patch 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Sat, 11 Jan 2014 11:47:31 +0100
  3. Subject: Update netifd and its dependencies from Barrier Breaker (r41888)
  4. diff --git a/package/libubox/Makefile b/package/libubox/Makefile
  5. index bcf4481..6cbfc08 100644
  6. --- a/package/libubox/Makefile
  7. +++ b/package/libubox/Makefile
  8. @@ -1,13 +1,13 @@
  9. include $(TOPDIR)/rules.mk
  10. PKG_NAME:=libubox
  11. -PKG_VERSION:=2013-10-19
  12. +PKG_VERSION:=2014-07-16
  13. PKG_RELEASE=$(PKG_SOURCE_VERSION)
  14. PKG_SOURCE_PROTO:=git
  15. -PKG_SOURCE_URL:=git://nbd.name/luci2/libubox.git
  16. +PKG_SOURCE_URL:=http://git.openwrt.org/project/libubox.git
  17. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  18. -PKG_SOURCE_VERSION:=734d28eb1a46358743cf8837c91e5d46695c3b91
  19. +PKG_SOURCE_VERSION:=bd388d2b6c2c151bf513c1e449417d18ce02d10b
  20. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
  21. PKG_MIRROR_MD5SUM:=
  22. CMAKE_INSTALL:=1
  23. @@ -26,6 +26,7 @@ define Package/libubox
  24. SECTION:=libs
  25. CATEGORY:=Libraries
  26. TITLE:=Basic utility library
  27. + ABI_VERSION:=$(PKG_VERSION)
  28. DEPENDS:=
  29. endef
  30. @@ -54,6 +55,13 @@ define Package/libjson-script
  31. TITLE:=Minimalistic JSON based scripting engine
  32. endef
  33. +define Package/libubox-lua
  34. + SECTION:=libs
  35. + CATEGORY:=Libraries
  36. + DEPENDS:=+libubox +liblua
  37. + TITLE:=Lua binding for the OpenWrt Basic utility library
  38. +endef
  39. +
  40. TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
  41. CMAKE_OPTIONS = \
  42. -DLUAPATH=/usr/lib/lua
  43. @@ -79,7 +87,13 @@ define Package/libjson-script/install
  44. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libjson_script.so $(1)/lib/
  45. endef
  46. +define Package/libubox-lua/install
  47. + $(INSTALL_DIR) $(1)/usr/lib/lua
  48. + $(CP) $(PKG_BUILD_DIR)/lua/uloop.so $(1)/usr/lib/lua/
  49. +endef
  50. +
  51. $(eval $(call BuildPackage,libubox))
  52. $(eval $(call BuildPackage,libblobmsg-json))
  53. $(eval $(call BuildPackage,jshn))
  54. $(eval $(call BuildPackage,libjson-script))
  55. +$(eval $(call BuildPackage,libubox-lua))
  56. diff --git a/package/netifd/Makefile b/package/netifd/Makefile
  57. index 5f2ee03..faf3e09 100644
  58. --- a/package/netifd/Makefile
  59. +++ b/package/netifd/Makefile
  60. @@ -1,13 +1,13 @@
  61. include $(TOPDIR)/rules.mk
  62. PKG_NAME:=netifd
  63. -PKG_VERSION:=2013-07-16
  64. +PKG_VERSION:=2014-07-29
  65. PKG_RELEASE=$(PKG_SOURCE_VERSION)
  66. PKG_SOURCE_PROTO:=git
  67. -PKG_SOURCE_URL:=git://nbd.name/luci2/netifd.git
  68. +PKG_SOURCE_URL:=http://git.openwrt.org/project/netifd.git
  69. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  70. -PKG_SOURCE_VERSION:=2674941b06c1ec67f1aff1bff9212e1372106641
  71. +PKG_SOURCE_VERSION:=4bf89afc22b43d5bd155d32d3998348a77179c1a
  72. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
  73. PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
  74. # PKG_MIRROR_MD5SUM:=
  75. @@ -24,7 +24,7 @@ include $(INCLUDE_DIR)/cmake.mk
  76. define Package/netifd
  77. SECTION:=base
  78. CATEGORY:=Base system
  79. - DEPENDS:=+libuci +libnl-tiny +libubus +ubus +ubusd +jshn
  80. + DEPENDS:=+libuci +libnl-tiny +libubus +ubus +ubusd +jshn +libubox
  81. TITLE:=OpenWrt Network Interface Configuration Daemon
  82. endef
  83. @@ -40,7 +40,7 @@ define Package/netifd/install
  84. $(INSTALL_DIR) $(1)/sbin
  85. $(INSTALL_BIN) $(PKG_BUILD_DIR)/netifd $(1)/sbin/
  86. $(CP) ./files/* $(1)/
  87. - $(CP) $(PKG_BUILD_DIR)/dummy/netifd-proto.sh $(1)/lib/netifd/
  88. + $(CP) $(PKG_BUILD_DIR)/scripts/* $(1)/lib/netifd/
  89. endef
  90. $(eval $(call BuildPackage,netifd))
  91. diff --git a/package/netifd/files/etc/hotplug.d/iface/00-netstate b/package/netifd/files/etc/hotplug.d/iface/00-netstate
  92. index c50cda6..023025c 100644
  93. --- a/package/netifd/files/etc/hotplug.d/iface/00-netstate
  94. +++ b/package/netifd/files/etc/hotplug.d/iface/00-netstate
  95. @@ -1,6 +1,5 @@
  96. [ ifup = "$ACTION" ] && {
  97. uci_toggle_state network "$INTERFACE" up 1
  98. - uci_toggle_state network "$INTERFACE" connect_time $(sed -ne 's![^0-9].*$!!p' /proc/uptime)
  99. [ -n "$DEVICE" ] && {
  100. uci_toggle_state network "$INTERFACE" device "$(uci -q get network.$INTERFACE.ifname)"
  101. uci_toggle_state network "$INTERFACE" ifname "$DEVICE"
  102. diff --git a/package/netifd/files/lib/netifd/dhcp.script b/package/netifd/files/lib/netifd/dhcp.script
  103. index 50163da..db3fc01 100755
  104. --- a/package/netifd/files/lib/netifd/dhcp.script
  105. +++ b/package/netifd/files/lib/netifd/dhcp.script
  106. @@ -33,9 +33,15 @@ setup_interface () {
  107. for domain in $domain; do
  108. proto_add_dns_search "$domain"
  109. done
  110. +
  111. + proto_add_data
  112. + [ -n "$ZONE" ] && json_add_string zone "$ZONE"
  113. + proto_close_data
  114. +
  115. proto_send_update "$INTERFACE"
  116. - if [ -n "$IFACE6RD" -a -n "$ip6rd" ]; then
  117. +
  118. + if [ "$IFACE6RD" != 0 -a -n "$ip6rd" ]; then
  119. local v4mask="${ip6rd%% *}"
  120. ip6rd="${ip6rd#* }"
  121. local ip6rdprefixlen="${ip6rd%% *}"
  122. @@ -44,19 +50,24 @@ setup_interface () {
  123. ip6rd="${ip6rd#* }"
  124. local ip6rdbr="${ip6rd%% *}"
  125. -uci -q batch <<-EOF >/dev/null
  126. -set network.$IFACE6RD.proto=6rd
  127. -set network.$IFACE6RD.auto=0
  128. -set network.$IFACE6RD.peeraddr=$ip6rdbr
  129. -set network.$IFACE6RD.ip4prefixlen=$v4mask
  130. -set network.$IFACE6RD.ip6prefix=$ip6rdprefix
  131. -set network.$IFACE6RD.ip6prefixlen=$ip6rdprefixlen
  132. -commit network
  133. -EOF
  134. -
  135. - ifdown "$IFACE6RD"
  136. - /etc/init.d/network reload
  137. - ifup "$IFACE6RD"
  138. + [ -n "$ZONE" ] || ZONE=$(fw3 network $INTERFACE)
  139. + [ -z "$IFACE6RD" -o "$IFACE6RD" = 1 ] && IFACE6RD=${INTERFACE}_6rd
  140. +
  141. + json_init
  142. + json_add_string name "$IFACE6RD"
  143. + json_add_string ifname "@$INTERFACE"
  144. + json_add_string proto "6rd"
  145. + json_add_string peeraddr "$ip6rdbr"
  146. + json_add_int ip4prefixlen "$v4mask"
  147. + json_add_string ip6prefix "$ip6rdprefix"
  148. + json_add_int ip6prefixlen "$ip6rdprefixlen"
  149. + json_add_string tunlink "$INTERFACE"
  150. + [ -n "$IFACE6RD_DELEGATE" ] && json_add_boolean delegate "$IFACE6RD_DELEGATE"
  151. + [ -n "$ZONE6RD" ] || ZONE6RD=$ZONE
  152. + [ -n "$ZONE6RD" ] && json_add_string zone "$ZONE6RD"
  153. + json_close_object
  154. +
  155. + ubus call network add_dynamic "$(json_dump)"
  156. fi
  157. # TODO
  158. diff --git a/package/netifd/files/lib/netifd/proto/dhcp.sh b/package/netifd/files/lib/netifd/proto/dhcp.sh
  159. index a270c68..b14f7be 100755
  160. --- a/package/netifd/files/lib/netifd/proto/dhcp.sh
  161. +++ b/package/netifd/files/lib/netifd/proto/dhcp.sh
  162. @@ -5,31 +5,44 @@
  163. init_proto "$@"
  164. proto_dhcp_init_config() {
  165. - proto_config_add_string "ipaddr"
  166. - proto_config_add_string "netmask"
  167. - proto_config_add_string "hostname"
  168. - proto_config_add_string "clientid"
  169. - proto_config_add_string "vendorid"
  170. - proto_config_add_boolean "broadcast"
  171. - proto_config_add_string "reqopts"
  172. - proto_config_add_string "iface6rd"
  173. + renew_handler=1
  174. +
  175. + proto_config_add_string 'ipaddr:ipaddr'
  176. + proto_config_add_string 'hostname:hostname'
  177. + proto_config_add_string clientid
  178. + proto_config_add_string vendorid
  179. + proto_config_add_boolean 'broadcast:bool'
  180. + proto_config_add_string 'reqopts:list(string)'
  181. + proto_config_add_string iface6rd
  182. + proto_config_add_string sendopts
  183. + proto_config_add_boolean delegate
  184. + proto_config_add_string zone6rd
  185. + proto_config_add_string zone
  186. }
  187. proto_dhcp_setup() {
  188. local config="$1"
  189. local iface="$2"
  190. - local ipaddr hostname clientid vendorid broadcast reqopts iface6rd
  191. - json_get_vars ipaddr hostname clientid vendorid broadcast reqopts iface6rd
  192. + local ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd zone
  193. + json_get_vars ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd zone
  194. local opt dhcpopts
  195. for opt in $reqopts; do
  196. append dhcpopts "-O $opt"
  197. done
  198. + for opt in $sendopts; do
  199. + append dhcpopts "-x $opt"
  200. + done
  201. +
  202. [ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
  203. [ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"
  204. [ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"
  205. + [ -n "$iface6rd" ] && append dhcpopts "-O 212"
  206. + [ -n "$zone6rd" ] && proto_export "ZONE6RD=$zone6rd"
  207. + [ -n "$zone" ] && proto_export "ZONE=$zone"
  208. + [ "$delegate" = "0" ] && proto_export "IFACE6RD_DELEGATE=0"
  209. proto_export "INTERFACE=$config"
  210. proto_run_command "$config" udhcpc \
  211. @@ -42,10 +55,16 @@ proto_dhcp_setup() {
  212. $clientid $broadcast $dhcpopts
  213. }
  214. +proto_dhcp_renew() {
  215. + local interface="$1"
  216. + # SIGUSR1 forces udhcpc to renew its lease
  217. + local sigusr1="$(kill -l SIGUSR1)"
  218. + [ -n "$sigusr1" ] && proto_kill_command "$interface" $sigusr1
  219. +}
  220. +
  221. proto_dhcp_teardown() {
  222. local interface="$1"
  223. proto_kill_command "$interface"
  224. }
  225. add_protocol dhcp
  226. -
  227. diff --git a/package/netifd/patches/001-musl_af_inet_include.patch b/package/netifd/patches/001-musl_af_inet_include.patch
  228. new file mode 100644
  229. index 0000000..510ee05
  230. --- /dev/null
  231. +++ b/package/netifd/patches/001-musl_af_inet_include.patch
  232. @@ -0,0 +1,11 @@
  233. +diff -urN netifd-2012-10-29/utils.c netifd-2012-10-29.new/utils.c
  234. +--- netifd-2012-10-29/utils.c 2012-11-23 17:15:39.000000000 +0100
  235. ++++ netifd-2012-10-29.new/utils.c 2012-11-23 17:16:53.409244361 +0100
  236. +@@ -17,6 +17,7 @@
  237. +
  238. + #include <arpa/inet.h>
  239. + #include <netinet/in.h>
  240. ++#include <sys/socket.h>
  241. +
  242. + void
  243. + __vlist_simple_init(struct vlist_simple_tree *tree, int offset)
  244. diff --git a/package/netifd/patches/002-fix_compile_with_old_includes.patch b/package/netifd/patches/002-fix_compile_with_old_includes.patch
  245. new file mode 100644
  246. index 0000000..361b2d1
  247. --- /dev/null
  248. +++ b/package/netifd/patches/002-fix_compile_with_old_includes.patch
  249. @@ -0,0 +1,34 @@
  250. +--- a/system-linux.c
  251. ++++ b/system-linux.c
  252. +@@ -43,6 +43,31 @@
  253. + #define RTN_FAILED_POLICY 12
  254. + #endif
  255. +
  256. ++
  257. ++#ifndef IFLA_IPTUN_MAX
  258. ++enum {
  259. ++ IFLA_IPTUN_UNSPEC,
  260. ++ IFLA_IPTUN_LINK,
  261. ++ IFLA_IPTUN_LOCAL,
  262. ++ IFLA_IPTUN_REMOTE,
  263. ++ IFLA_IPTUN_TTL,
  264. ++ IFLA_IPTUN_TOS,
  265. ++ IFLA_IPTUN_ENCAP_LIMIT,
  266. ++ IFLA_IPTUN_FLOWINFO,
  267. ++ IFLA_IPTUN_FLAGS,
  268. ++ IFLA_IPTUN_PROTO,
  269. ++ IFLA_IPTUN_PMTUDISC,
  270. ++ IFLA_IPTUN_6RD_PREFIX,
  271. ++ IFLA_IPTUN_6RD_RELAY_PREFIX,
  272. ++ IFLA_IPTUN_6RD_PREFIXLEN,
  273. ++ IFLA_IPTUN_6RD_RELAY_PREFIXLEN,
  274. ++ __IFLA_IPTUN_MAX,
  275. ++};
  276. ++#define IFLA_IPTUN_MAX (__IFLA_IPTUN_MAX - 1)
  277. ++#endif
  278. ++
  279. ++
  280. ++
  281. + #include <string.h>
  282. + #include <fcntl.h>
  283. + #include <glob.h>
  284. diff --git a/package/ubus/Makefile b/package/ubus/Makefile
  285. index be18fb5..ba96b3b 100644
  286. --- a/package/ubus/Makefile
  287. +++ b/package/ubus/Makefile
  288. @@ -1,13 +1,13 @@
  289. include $(TOPDIR)/rules.mk
  290. PKG_NAME:=ubus
  291. -PKG_VERSION:=2013-08-08
  292. +PKG_VERSION:=2014-07-03
  293. PKG_RELEASE=$(PKG_SOURCE_VERSION)
  294. PKG_SOURCE_PROTO:=git
  295. PKG_SOURCE_URL:=git://nbd.name/luci2/ubus.git
  296. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  297. -PKG_SOURCE_VERSION:=b20a8a01c7faea5bcc9d34d10dcf7736589021b8
  298. +PKG_SOURCE_VERSION:=f688c7ad0b2435a89bfd13f5496cabf596b54c8f
  299. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
  300. PKG_MIRROR_MD5SUM:=
  301. CMAKE_INSTALL:=1
  302. @@ -38,6 +38,7 @@ define Package/libubus
  303. SECTION:=libs
  304. CATEGORY:=Libraries
  305. DEPENDS:=+libubox
  306. + ABI_VERSION:=$(PKG_VERSION)
  307. TITLE:=OpenWrt RPC client library
  308. endef
  309. @@ -66,7 +67,7 @@ endef
  310. define Package/libubus/install
  311. $(INSTALL_DIR) $(1)/lib
  312. - $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/lib/
  313. + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so $(1)/lib/
  314. endef
  315. define Package/libubus-lua/install
  316. @@ -74,8 +75,7 @@ define Package/libubus-lua/install
  317. $(CP) $(PKG_BUILD_DIR)/lua/ubus.so $(1)/usr/lib/lua/
  318. endef
  319. -$(eval $(call BuildPackage,ubus))
  320. -$(eval $(call BuildPackage,ubusd))
  321. $(eval $(call BuildPackage,libubus))
  322. $(eval $(call BuildPackage,libubus-lua))
  323. -
  324. +$(eval $(call BuildPackage,ubus))
  325. +$(eval $(call BuildPackage,ubusd))
  326. diff --git a/package/uci/Makefile b/package/uci/Makefile
  327. index 54ad80b..29f9ef3 100644
  328. --- a/package/uci/Makefile
  329. +++ b/package/uci/Makefile
  330. @@ -1,5 +1,5 @@
  331. #
  332. -# Copyright (C) 2008-2013 OpenWrt.org
  333. +# Copyright (C) 2008-2014 OpenWrt.org
  334. #
  335. # This is free software, licensed under the GNU General Public License v2.
  336. # See /LICENSE for more information.
  337. @@ -7,13 +7,13 @@
  338. include $(TOPDIR)/rules.mk
  339. -UCI_VERSION=2013-06-11
  340. +UCI_VERSION=2014-04-11
  341. UCI_RELEASE=1
  342. PKG_NAME:=uci
  343. PKG_VERSION:=$(UCI_VERSION)$(if $(UCI_RELEASE),.$(UCI_RELEASE))
  344. PKG_RELEASE:=1
  345. -PKG_REV:=c9c9d5cb085acc58b6579ace83fb79c085a9db27
  346. +PKG_REV:=e339407372ffc70b1451e4eda218c01aa95a6a7f
  347. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  348. PKG_SOURCE_URL:=git://nbd.name/uci.git