Skip to content
Snippets Groups Projects
Commit 28d49e98 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

Update netifd from Barrier Breaker

This allows us to drop our config mode patch.
parent 02b4f0c5
No related branches found
No related tags found
No related merge requests found
Showing
with 263 additions and 136 deletions
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sat, 11 Jan 2014 11:47:31 +0100
Subject: Update netifd from Barrier Breaker
Subject: Update netifd and its dependencies from Barrier Breaker
diff --git a/package/libubox/Makefile b/package/libubox/Makefile
index bcf4481..fc9834a 100644
--- a/package/libubox/Makefile
+++ b/package/libubox/Makefile
@@ -1,13 +1,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libubox
-PKG_VERSION:=2013-10-19
+PKG_VERSION:=2014-03-18
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=git://nbd.name/luci2/libubox.git
+PKG_SOURCE_URL:=http://git.openwrt.org/project/libubox.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=734d28eb1a46358743cf8837c91e5d46695c3b91
+PKG_SOURCE_VERSION:=4f44401ae8d23465261cef80b87630ffccd5a864
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_MD5SUM:=
CMAKE_INSTALL:=1
@@ -26,6 +26,7 @@ define Package/libubox
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Basic utility library
+ ABI_VERSION:=$(PKG_VERSION)
DEPENDS:=
endef
@@ -54,6 +55,13 @@ define Package/libjson-script
TITLE:=Minimalistic JSON based scripting engine
endef
+define Package/libubox-lua
+ SECTION:=libs
+ CATEGORY:=Libraries
+ DEPENDS:=+libubox +liblua
+ TITLE:=Lua binding for the OpenWrt Basic utility library
+endef
+
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
CMAKE_OPTIONS = \
-DLUAPATH=/usr/lib/lua
@@ -79,7 +87,13 @@ define Package/libjson-script/install
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libjson_script.so $(1)/lib/
endef
+define Package/libubox-lua/install
+ $(INSTALL_DIR) $(1)/usr/lib/lua
+ $(CP) $(PKG_BUILD_DIR)/lua/uloop.so $(1)/usr/lib/lua/
+endef
+
$(eval $(call BuildPackage,libubox))
$(eval $(call BuildPackage,libblobmsg-json))
$(eval $(call BuildPackage,jshn))
$(eval $(call BuildPackage,libjson-script))
+$(eval $(call BuildPackage,libubox-lua))
diff --git a/package/netifd/Makefile b/package/netifd/Makefile
index 5f2ee03..6f6f30e 100644
index 5f2ee03..21137d0 100644
--- a/package/netifd/Makefile
+++ b/package/netifd/Makefile
@@ -1,13 +1,13 @@
......@@ -11,17 +68,27 @@ index 5f2ee03..6f6f30e 100644
PKG_NAME:=netifd
-PKG_VERSION:=2013-07-16
+PKG_VERSION:=2013-12-29
+PKG_VERSION:=2014-04-11
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=git://nbd.name/luci2/netifd.git
-PKG_SOURCE_URL:=git://nbd.name/luci2/netifd.git
+PKG_SOURCE_URL:=http://git.openwrt.org/project/netifd.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=2674941b06c1ec67f1aff1bff9212e1372106641
+PKG_SOURCE_VERSION:=7d79d0a8aa5a5b4c1ed987af119356438d98fe7b
+PKG_SOURCE_VERSION:=d2a33f3f0fe704e4396fa2ada08401cb955ba7cb
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
# PKG_MIRROR_MD5SUM:=
@@ -24,7 +24,7 @@ include $(INCLUDE_DIR)/cmake.mk
define Package/netifd
SECTION:=base
CATEGORY:=Base system
- DEPENDS:=+libuci +libnl-tiny +libubus +ubus +ubusd +jshn
+ DEPENDS:=+libuci +libnl-tiny +libubus +ubus +ubusd +jshn +libubox
TITLE:=OpenWrt Network Interface Configuration Daemon
endef
@@ -40,7 +40,7 @@ define Package/netifd/install
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/netifd $(1)/sbin/
......@@ -43,10 +110,10 @@ index c50cda6..023025c 100644
uci_toggle_state network "$INTERFACE" device "$(uci -q get network.$INTERFACE.ifname)"
uci_toggle_state network "$INTERFACE" ifname "$DEVICE"
diff --git a/package/netifd/files/lib/netifd/dhcp.script b/package/netifd/files/lib/netifd/dhcp.script
index 50163da..77b77f5 100755
index 50163da..948c3cd 100755
--- a/package/netifd/files/lib/netifd/dhcp.script
+++ b/package/netifd/files/lib/netifd/dhcp.script
@@ -44,19 +44,18 @@ setup_interface () {
@@ -44,19 +44,20 @@ setup_interface () {
ip6rd="${ip6rd#* }"
local ip6rdbr="${ip6rd%% *}"
......@@ -68,6 +135,8 @@ index 50163da..77b77f5 100755
+ json_add_string ip6prefix "$ip6rdprefix"
+ json_add_int ip6prefixlen "$ip6rdprefixlen"
+ json_add_string tunlink "$INTERFACE"
+ [ -n "$IFACE6RD_DELEGATE" ] && json_add_boolean delegate "$IFACE6RD_DELEGATE"
+ [ -n "$ZONE6RD" ] && json_add_string zone "$ZONE6RD"
+ json_close_object
- ifdown "$IFACE6RD"
......@@ -78,14 +147,33 @@ index 50163da..77b77f5 100755
# TODO
diff --git a/package/netifd/files/lib/netifd/proto/dhcp.sh b/package/netifd/files/lib/netifd/proto/dhcp.sh
index a270c68..0117b27 100755
index a270c68..2e58c19 100755
--- a/package/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/netifd/files/lib/netifd/proto/dhcp.sh
@@ -13,20 +13,25 @@ proto_dhcp_init_config() {
proto_config_add_boolean "broadcast"
proto_config_add_string "reqopts"
proto_config_add_string "iface6rd"
+ proto_config_add_string "sendopts"
@@ -5,31 +5,42 @@
init_proto "$@"
proto_dhcp_init_config() {
- proto_config_add_string "ipaddr"
- proto_config_add_string "netmask"
- proto_config_add_string "hostname"
- proto_config_add_string "clientid"
- proto_config_add_string "vendorid"
- proto_config_add_boolean "broadcast"
- proto_config_add_string "reqopts"
- proto_config_add_string "iface6rd"
+ renew_handler=1
+
+ proto_config_add_string 'ipaddr:ipaddr'
+ proto_config_add_string 'hostname:hostname'
+ proto_config_add_string clientid
+ proto_config_add_string vendorid
+ proto_config_add_boolean 'broadcast:bool'
+ proto_config_add_string 'reqopts:list(string)'
+ proto_config_add_string iface6rd
+ proto_config_add_string sendopts
+ proto_config_add_boolean delegate
+ proto_config_add_string zone6rd
}
proto_dhcp_setup() {
......@@ -94,8 +182,8 @@ index a270c68..0117b27 100755
- local ipaddr hostname clientid vendorid broadcast reqopts iface6rd
- json_get_vars ipaddr hostname clientid vendorid broadcast reqopts iface6rd
+ local ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts
+ json_get_vars ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts
+ local ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd
+ json_get_vars ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd
local opt dhcpopts
for opt in $reqopts; do
......@@ -109,6 +197,26 @@ index a270c68..0117b27 100755
[ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
[ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"
[ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"
+ [ -n "$iface6rd" ] && append dhcpopts "-O 212"
+ [ -n "$zone6rd" ] && proto_export "ZONE6RD=$zone6rd"
+ [ "$delegate" = "0" ] && proto_export "IFACE6RD_DELEGATE=0"
proto_export "INTERFACE=$config"
proto_run_command "$config" udhcpc \
@@ -42,6 +53,13 @@ proto_dhcp_setup() {
$clientid $broadcast $dhcpopts
}
+proto_dhcp_renew() {
+ local interface="$1"
+ # SIGUSR1 forces udhcpc to renew its lease
+ local sigusr1="$(kill -l SIGUSR1)"
+ [ -n "$sigusr1" ] && proto_kill_command "$interface" $sigusr1
+}
+
proto_dhcp_teardown() {
local interface="$1"
proto_kill_command "$interface"
diff --git a/package/netifd/patches/001-musl_af_inet_include.patch b/package/netifd/patches/001-musl_af_inet_include.patch
new file mode 100644
index 0000000..510ee05
......@@ -126,3 +234,30 @@ index 0000000..510ee05
+
+ void
+ __vlist_simple_init(struct vlist_simple_tree *tree, int offset)
diff --git a/package/uci/Makefile b/package/uci/Makefile
index 54ad80b..29f9ef3 100644
--- a/package/uci/Makefile
+++ b/package/uci/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2008-2013 OpenWrt.org
+# Copyright (C) 2008-2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@@ -7,13 +7,13 @@
include $(TOPDIR)/rules.mk
-UCI_VERSION=2013-06-11
+UCI_VERSION=2014-04-11
UCI_RELEASE=1
PKG_NAME:=uci
PKG_VERSION:=$(UCI_VERSION)$(if $(UCI_RELEASE),.$(UCI_RELEASE))
PKG_RELEASE:=1
-PKG_REV:=c9c9d5cb085acc58b6579ace83fb79c085a9db27
+PKG_REV:=e339407372ffc70b1451e4eda218c01aa95a6a7f
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=git://nbd.name/uci.git
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 13 Feb 2014 15:12:37 +0100
Subject: netifd: update to latest git, add UCI config path patch
diff --git a/package/netifd/Makefile b/package/netifd/Makefile
index 6f6f30e..d5fa7f0 100644
--- a/package/netifd/Makefile
+++ b/package/netifd/Makefile
@@ -1,13 +1,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=netifd
-PKG_VERSION:=2013-12-29
+PKG_VERSION:=2014-02-13
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=git://nbd.name/luci2/netifd.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=7d79d0a8aa5a5b4c1ed987af119356438d98fe7b
+PKG_SOURCE_VERSION:=88b3e92933925c09cfb6e95e9c8645727654ddf7
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
# PKG_MIRROR_MD5SUM:=
diff --git a/package/netifd/patches/001-musl_af_inet_include.patch b/package/netifd/patches/001-musl_af_inet_include.patch
index 510ee05..0dbe645 100644
--- a/package/netifd/patches/001-musl_af_inet_include.patch
+++ b/package/netifd/patches/001-musl_af_inet_include.patch
@@ -1,11 +1,10 @@
-diff -urN netifd-2012-10-29/utils.c netifd-2012-10-29.new/utils.c
---- netifd-2012-10-29/utils.c 2012-11-23 17:15:39.000000000 +0100
-+++ netifd-2012-10-29.new/utils.c 2012-11-23 17:16:53.409244361 +0100
+--- a/utils.c
++++ b/utils.c
@@ -17,6 +17,7 @@
#include <arpa/inet.h>
#include <netinet/in.h>
+#include <sys/socket.h>
- void
- __vlist_simple_init(struct vlist_simple_tree *tree, int offset)
+ #ifdef __APPLE__
+ #include <libproc.h>
diff --git a/package/netifd/patches/101-allow-setting-the-uci-config-path.patch b/package/netifd/patches/101-allow-setting-the-uci-config-path.patch
new file mode 100644
index 0000000..7561dd5
--- /dev/null
+++ b/package/netifd/patches/101-allow-setting-the-uci-config-path.patch
@@ -0,0 +1,86 @@
+From addf95eebc22afd78c516664ae27f955277e3ee8 Mon Sep 17 00:00:00 2001
+Message-Id: <addf95eebc22afd78c516664ae27f955277e3ee8.1392300589.git.mschiffer@universe-factory.net>
+From: Matthias Schiffer <mschiffer@universe-factory.net>
+Date: Thu, 13 Feb 2014 15:02:18 +0100
+Subject: [PATCH] Allow setting the UCI config path
+
+---
+ config.c | 4 +++-
+ main.c | 7 ++++++-
+ netifd.h | 3 +++
+ 3 files changed, 12 insertions(+), 2 deletions(-)
+
+--- a/config.c
++++ b/config.c
+@@ -190,8 +190,10 @@ config_init_package(const char *config)
+ ctx = uci_alloc_context();
+ uci_ctx = ctx;
+
++ if (config_path)
++ uci_set_confdir(ctx, config_path);
++
+ #ifdef DUMMY_MODE
+- uci_set_confdir(ctx, "./config");
+ uci_set_savedir(ctx, "./tmp");
+ #endif
+ } else {
+--- a/main.c
++++ b/main.c
+@@ -27,6 +27,7 @@
+
+ unsigned int debug_mask = 0;
+ const char *main_path = DEFAULT_MAIN_PATH;
++const char *config_path = DEFAULT_CONFIG_PATH;
+ const char *resolv_conf = DEFAULT_RESOLV_CONF;
+ static char **global_argv;
+
+@@ -235,6 +236,7 @@ static int usage(const char *progname)
+ " -d <mask>: Mask for debug messages\n"
+ " -s <path>: Path to the ubus socket\n"
+ " -p <path>: Path to netifd addons (default: %s)\n"
++ " -c <path>: Path to UCI configuration\n"
+ " -h <path>: Path to the hotplug script\n"
+ " -r <path>: Path to resolv.conf\n"
+ " -l <level>: Log output level (default: %d)\n"
+@@ -284,7 +286,7 @@ int main(int argc, char **argv)
+
+ global_argv = argv;
+
+- while ((ch = getopt(argc, argv, "d:s:p:h:r:l:S")) != -1) {
++ while ((ch = getopt(argc, argv, "d:s:p:c:h:r:l:S")) != -1) {
+ switch(ch) {
+ case 'd':
+ debug_mask = strtoul(optarg, NULL, 0);
+@@ -295,6 +297,9 @@ int main(int argc, char **argv)
+ case 'p':
+ main_path = optarg;
+ break;
++ case 'c':
++ config_path = optarg;
++ break;
+ case 'h':
+ hotplug_cmd_path = optarg;
+ break;
+--- a/netifd.h
++++ b/netifd.h
+@@ -30,10 +30,12 @@
+
+ #ifdef DUMMY_MODE
+ #define DEFAULT_MAIN_PATH "./examples"
++#define DEFAULT_CONFIG_PATH "./config"
+ #define DEFAULT_HOTPLUG_PATH "./examples/hotplug-cmd"
+ #define DEFAULT_RESOLV_CONF "./tmp/resolv.conf"
+ #else
+ #define DEFAULT_MAIN_PATH "/lib/netifd"
++#define DEFAULT_CONFIG_PATH NULL /* use the default set in libuci */
+ #define DEFAULT_HOTPLUG_PATH "/sbin/hotplug-call"
+ #define DEFAULT_RESOLV_CONF "/tmp/resolv.conf.auto"
+ #endif
+@@ -94,6 +96,7 @@ struct device;
+ struct interface;
+
+ extern const char *main_path;
++extern const char *config_path;
+ void netifd_restart(void);
+ void netifd_reload(void);
+
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment