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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  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
  4. diff --git a/package/libubox/Makefile b/package/libubox/Makefile
  5. index bcf4481..fc9834a 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-03-18
  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:=4f44401ae8d23465261cef80b87630ffccd5a864
  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..1d7f363 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-04-19
  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:=ede9739fe90f5da09f14481d10a4f11c000072de
  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..948c3cd 100755
  104. --- a/package/netifd/files/lib/netifd/dhcp.script
  105. +++ b/package/netifd/files/lib/netifd/dhcp.script
  106. @@ -44,19 +44,20 @@ setup_interface () {
  107. ip6rd="${ip6rd#* }"
  108. local ip6rdbr="${ip6rd%% *}"
  109. -uci -q batch <<-EOF >/dev/null
  110. -set network.$IFACE6RD.proto=6rd
  111. -set network.$IFACE6RD.auto=0
  112. -set network.$IFACE6RD.peeraddr=$ip6rdbr
  113. -set network.$IFACE6RD.ip4prefixlen=$v4mask
  114. -set network.$IFACE6RD.ip6prefix=$ip6rdprefix
  115. -set network.$IFACE6RD.ip6prefixlen=$ip6rdprefixlen
  116. -commit network
  117. -EOF
  118. + json_init
  119. + json_add_string name "$IFACE6RD"
  120. + json_add_string ifname "@$INTERFACE"
  121. + json_add_string proto "6rd"
  122. + json_add_string peeraddr "$ip6rdbr"
  123. + json_add_int ip4prefixlen "$v4mask"
  124. + json_add_string ip6prefix "$ip6rdprefix"
  125. + json_add_int ip6prefixlen "$ip6rdprefixlen"
  126. + json_add_string tunlink "$INTERFACE"
  127. + [ -n "$IFACE6RD_DELEGATE" ] && json_add_boolean delegate "$IFACE6RD_DELEGATE"
  128. + [ -n "$ZONE6RD" ] && json_add_string zone "$ZONE6RD"
  129. + json_close_object
  130. - ifdown "$IFACE6RD"
  131. - /etc/init.d/network reload
  132. - ifup "$IFACE6RD"
  133. + ubus call network add_dynamic "$(json_dump)"
  134. fi
  135. # TODO
  136. diff --git a/package/netifd/files/lib/netifd/proto/dhcp.sh b/package/netifd/files/lib/netifd/proto/dhcp.sh
  137. index a270c68..2e58c19 100755
  138. --- a/package/netifd/files/lib/netifd/proto/dhcp.sh
  139. +++ b/package/netifd/files/lib/netifd/proto/dhcp.sh
  140. @@ -5,31 +5,42 @@
  141. init_proto "$@"
  142. proto_dhcp_init_config() {
  143. - proto_config_add_string "ipaddr"
  144. - proto_config_add_string "netmask"
  145. - proto_config_add_string "hostname"
  146. - proto_config_add_string "clientid"
  147. - proto_config_add_string "vendorid"
  148. - proto_config_add_boolean "broadcast"
  149. - proto_config_add_string "reqopts"
  150. - proto_config_add_string "iface6rd"
  151. + renew_handler=1
  152. +
  153. + proto_config_add_string 'ipaddr:ipaddr'
  154. + proto_config_add_string 'hostname:hostname'
  155. + proto_config_add_string clientid
  156. + proto_config_add_string vendorid
  157. + proto_config_add_boolean 'broadcast:bool'
  158. + proto_config_add_string 'reqopts:list(string)'
  159. + proto_config_add_string iface6rd
  160. + proto_config_add_string sendopts
  161. + proto_config_add_boolean delegate
  162. + proto_config_add_string zone6rd
  163. }
  164. proto_dhcp_setup() {
  165. local config="$1"
  166. local iface="$2"
  167. - local ipaddr hostname clientid vendorid broadcast reqopts iface6rd
  168. - json_get_vars ipaddr hostname clientid vendorid broadcast reqopts iface6rd
  169. + local ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd
  170. + json_get_vars ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd
  171. local opt dhcpopts
  172. for opt in $reqopts; do
  173. append dhcpopts "-O $opt"
  174. done
  175. + for opt in $sendopts; do
  176. + append dhcpopts "-x $opt"
  177. + done
  178. +
  179. [ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
  180. [ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"
  181. [ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"
  182. + [ -n "$iface6rd" ] && append dhcpopts "-O 212"
  183. + [ -n "$zone6rd" ] && proto_export "ZONE6RD=$zone6rd"
  184. + [ "$delegate" = "0" ] && proto_export "IFACE6RD_DELEGATE=0"
  185. proto_export "INTERFACE=$config"
  186. proto_run_command "$config" udhcpc \
  187. @@ -42,6 +53,13 @@ proto_dhcp_setup() {
  188. $clientid $broadcast $dhcpopts
  189. }
  190. +proto_dhcp_renew() {
  191. + local interface="$1"
  192. + # SIGUSR1 forces udhcpc to renew its lease
  193. + local sigusr1="$(kill -l SIGUSR1)"
  194. + [ -n "$sigusr1" ] && proto_kill_command "$interface" $sigusr1
  195. +}
  196. +
  197. proto_dhcp_teardown() {
  198. local interface="$1"
  199. proto_kill_command "$interface"
  200. diff --git a/package/netifd/patches/001-musl_af_inet_include.patch b/package/netifd/patches/001-musl_af_inet_include.patch
  201. new file mode 100644
  202. index 0000000..510ee05
  203. --- /dev/null
  204. +++ b/package/netifd/patches/001-musl_af_inet_include.patch
  205. @@ -0,0 +1,11 @@
  206. +diff -urN netifd-2012-10-29/utils.c netifd-2012-10-29.new/utils.c
  207. +--- netifd-2012-10-29/utils.c 2012-11-23 17:15:39.000000000 +0100
  208. ++++ netifd-2012-10-29.new/utils.c 2012-11-23 17:16:53.409244361 +0100
  209. +@@ -17,6 +17,7 @@
  210. +
  211. + #include <arpa/inet.h>
  212. + #include <netinet/in.h>
  213. ++#include <sys/socket.h>
  214. +
  215. + void
  216. + __vlist_simple_init(struct vlist_simple_tree *tree, int offset)
  217. diff --git a/package/ubus/Makefile b/package/ubus/Makefile
  218. index be18fb5..53fb586 100644
  219. --- a/package/ubus/Makefile
  220. +++ b/package/ubus/Makefile
  221. @@ -1,13 +1,13 @@
  222. include $(TOPDIR)/rules.mk
  223. PKG_NAME:=ubus
  224. -PKG_VERSION:=2013-08-08
  225. +PKG_VERSION:=2014-03-18
  226. PKG_RELEASE=$(PKG_SOURCE_VERSION)
  227. PKG_SOURCE_PROTO:=git
  228. PKG_SOURCE_URL:=git://nbd.name/luci2/ubus.git
  229. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  230. -PKG_SOURCE_VERSION:=b20a8a01c7faea5bcc9d34d10dcf7736589021b8
  231. +PKG_SOURCE_VERSION:=1d5ac421a5b3dca60562e876ba70d0c2fe46b3d2
  232. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
  233. PKG_MIRROR_MD5SUM:=
  234. CMAKE_INSTALL:=1
  235. @@ -38,6 +38,7 @@ define Package/libubus
  236. SECTION:=libs
  237. CATEGORY:=Libraries
  238. DEPENDS:=+libubox
  239. + ABI_VERSION:=$(PKG_VERSION)
  240. TITLE:=OpenWrt RPC client library
  241. endef
  242. @@ -66,7 +67,7 @@ endef
  243. define Package/libubus/install
  244. $(INSTALL_DIR) $(1)/lib
  245. - $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/lib/
  246. + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so $(1)/lib/
  247. endef
  248. define Package/libubus-lua/install
  249. @@ -74,8 +75,7 @@ define Package/libubus-lua/install
  250. $(CP) $(PKG_BUILD_DIR)/lua/ubus.so $(1)/usr/lib/lua/
  251. endef
  252. -$(eval $(call BuildPackage,ubus))
  253. -$(eval $(call BuildPackage,ubusd))
  254. $(eval $(call BuildPackage,libubus))
  255. $(eval $(call BuildPackage,libubus-lua))
  256. -
  257. +$(eval $(call BuildPackage,ubus))
  258. +$(eval $(call BuildPackage,ubusd))
  259. diff --git a/package/uci/Makefile b/package/uci/Makefile
  260. index 54ad80b..29f9ef3 100644
  261. --- a/package/uci/Makefile
  262. +++ b/package/uci/Makefile
  263. @@ -1,5 +1,5 @@
  264. #
  265. -# Copyright (C) 2008-2013 OpenWrt.org
  266. +# Copyright (C) 2008-2014 OpenWrt.org
  267. #
  268. # This is free software, licensed under the GNU General Public License v2.
  269. # See /LICENSE for more information.
  270. @@ -7,13 +7,13 @@
  271. include $(TOPDIR)/rules.mk
  272. -UCI_VERSION=2013-06-11
  273. +UCI_VERSION=2014-04-11
  274. UCI_RELEASE=1
  275. PKG_NAME:=uci
  276. PKG_VERSION:=$(UCI_VERSION)$(if $(UCI_RELEASE),.$(UCI_RELEASE))
  277. PKG_RELEASE:=1
  278. -PKG_REV:=c9c9d5cb085acc58b6579ace83fb79c085a9db27
  279. +PKG_REV:=e339407372ffc70b1451e4eda218c01aa95a6a7f
  280. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  281. PKG_SOURCE_URL:=git://nbd.name/uci.git