0007-netifd-update-to-latest-git-add-UCI-config-path-patch.patch 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Thu, 13 Feb 2014 15:12:37 +0100
  3. Subject: netifd: update to latest git, add UCI config path patch
  4. diff --git a/package/netifd/Makefile b/package/netifd/Makefile
  5. index 6f6f30e..d5fa7f0 100644
  6. --- a/package/netifd/Makefile
  7. +++ b/package/netifd/Makefile
  8. @@ -1,13 +1,13 @@
  9. include $(TOPDIR)/rules.mk
  10. PKG_NAME:=netifd
  11. -PKG_VERSION:=2013-12-29
  12. +PKG_VERSION:=2014-02-13
  13. PKG_RELEASE=$(PKG_SOURCE_VERSION)
  14. PKG_SOURCE_PROTO:=git
  15. PKG_SOURCE_URL:=git://nbd.name/luci2/netifd.git
  16. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  17. -PKG_SOURCE_VERSION:=7d79d0a8aa5a5b4c1ed987af119356438d98fe7b
  18. +PKG_SOURCE_VERSION:=88b3e92933925c09cfb6e95e9c8645727654ddf7
  19. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
  20. PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
  21. # PKG_MIRROR_MD5SUM:=
  22. diff --git a/package/netifd/patches/001-musl_af_inet_include.patch b/package/netifd/patches/001-musl_af_inet_include.patch
  23. index 510ee05..0dbe645 100644
  24. --- a/package/netifd/patches/001-musl_af_inet_include.patch
  25. +++ b/package/netifd/patches/001-musl_af_inet_include.patch
  26. @@ -1,11 +1,10 @@
  27. -diff -urN netifd-2012-10-29/utils.c netifd-2012-10-29.new/utils.c
  28. ---- netifd-2012-10-29/utils.c 2012-11-23 17:15:39.000000000 +0100
  29. -+++ netifd-2012-10-29.new/utils.c 2012-11-23 17:16:53.409244361 +0100
  30. +--- a/utils.c
  31. ++++ b/utils.c
  32. @@ -17,6 +17,7 @@
  33. #include <arpa/inet.h>
  34. #include <netinet/in.h>
  35. +#include <sys/socket.h>
  36. - void
  37. - __vlist_simple_init(struct vlist_simple_tree *tree, int offset)
  38. + #ifdef __APPLE__
  39. + #include <libproc.h>
  40. 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
  41. new file mode 100644
  42. index 0000000..7561dd5
  43. --- /dev/null
  44. +++ b/package/netifd/patches/101-allow-setting-the-uci-config-path.patch
  45. @@ -0,0 +1,86 @@
  46. +From addf95eebc22afd78c516664ae27f955277e3ee8 Mon Sep 17 00:00:00 2001
  47. +Message-Id: <addf95eebc22afd78c516664ae27f955277e3ee8.1392300589.git.mschiffer@universe-factory.net>
  48. +From: Matthias Schiffer <mschiffer@universe-factory.net>
  49. +Date: Thu, 13 Feb 2014 15:02:18 +0100
  50. +Subject: [PATCH] Allow setting the UCI config path
  51. +
  52. +---
  53. + config.c | 4 +++-
  54. + main.c | 7 ++++++-
  55. + netifd.h | 3 +++
  56. + 3 files changed, 12 insertions(+), 2 deletions(-)
  57. +
  58. +--- a/config.c
  59. ++++ b/config.c
  60. +@@ -190,8 +190,10 @@ config_init_package(const char *config)
  61. + ctx = uci_alloc_context();
  62. + uci_ctx = ctx;
  63. +
  64. ++ if (config_path)
  65. ++ uci_set_confdir(ctx, config_path);
  66. ++
  67. + #ifdef DUMMY_MODE
  68. +- uci_set_confdir(ctx, "./config");
  69. + uci_set_savedir(ctx, "./tmp");
  70. + #endif
  71. + } else {
  72. +--- a/main.c
  73. ++++ b/main.c
  74. +@@ -27,6 +27,7 @@
  75. +
  76. + unsigned int debug_mask = 0;
  77. + const char *main_path = DEFAULT_MAIN_PATH;
  78. ++const char *config_path = DEFAULT_CONFIG_PATH;
  79. + const char *resolv_conf = DEFAULT_RESOLV_CONF;
  80. + static char **global_argv;
  81. +
  82. +@@ -235,6 +236,7 @@ static int usage(const char *progname)
  83. + " -d <mask>: Mask for debug messages\n"
  84. + " -s <path>: Path to the ubus socket\n"
  85. + " -p <path>: Path to netifd addons (default: %s)\n"
  86. ++ " -c <path>: Path to UCI configuration\n"
  87. + " -h <path>: Path to the hotplug script\n"
  88. + " -r <path>: Path to resolv.conf\n"
  89. + " -l <level>: Log output level (default: %d)\n"
  90. +@@ -284,7 +286,7 @@ int main(int argc, char **argv)
  91. +
  92. + global_argv = argv;
  93. +
  94. +- while ((ch = getopt(argc, argv, "d:s:p:h:r:l:S")) != -1) {
  95. ++ while ((ch = getopt(argc, argv, "d:s:p:c:h:r:l:S")) != -1) {
  96. + switch(ch) {
  97. + case 'd':
  98. + debug_mask = strtoul(optarg, NULL, 0);
  99. +@@ -295,6 +297,9 @@ int main(int argc, char **argv)
  100. + case 'p':
  101. + main_path = optarg;
  102. + break;
  103. ++ case 'c':
  104. ++ config_path = optarg;
  105. ++ break;
  106. + case 'h':
  107. + hotplug_cmd_path = optarg;
  108. + break;
  109. +--- a/netifd.h
  110. ++++ b/netifd.h
  111. +@@ -30,10 +30,12 @@
  112. +
  113. + #ifdef DUMMY_MODE
  114. + #define DEFAULT_MAIN_PATH "./examples"
  115. ++#define DEFAULT_CONFIG_PATH "./config"
  116. + #define DEFAULT_HOTPLUG_PATH "./examples/hotplug-cmd"
  117. + #define DEFAULT_RESOLV_CONF "./tmp/resolv.conf"
  118. + #else
  119. + #define DEFAULT_MAIN_PATH "/lib/netifd"
  120. ++#define DEFAULT_CONFIG_PATH NULL /* use the default set in libuci */
  121. + #define DEFAULT_HOTPLUG_PATH "/sbin/hotplug-call"
  122. + #define DEFAULT_RESOLV_CONF "/tmp/resolv.conf.auto"
  123. + #endif
  124. +@@ -94,6 +96,7 @@ struct device;
  125. + struct interface;
  126. +
  127. + extern const char *main_path;
  128. ++extern const char *config_path;
  129. + void netifd_restart(void);
  130. + void netifd_reload(void);
  131. +