From 19242f4deb047ea32b6d4fa9fc57a96d2fef702b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer <mschiffer@universe-factory.net> Date: Mon, 8 Feb 2016 20:58:28 +0100 Subject: [PATCH] Remove all uses of batman-adv-visdata Should be redundant after 0bd0df6f9303e5d553790ff49dc703b957fdac1d --- package/gluon-mesh-batman-adv-core/Makefile | 2 +- .../gluon-mesh-batman-adv-core/src/respondd.c | 2 +- .../lib/autoupdater/abort.d/50gluon-respondd | 1 - .../autoupdater/download.d/50gluon-respondd | 1 - package/gluon-status-page-api/Makefile | 2 +- .../src/neighbours-batadv.c | 2 +- .../0004-alfred-use-batman-adv-visdata.patch | 83 ------------------- 7 files changed, 4 insertions(+), 89 deletions(-) delete mode 100644 patches/packages/routing/0004-alfred-use-batman-adv-visdata.patch diff --git a/package/gluon-mesh-batman-adv-core/Makefile b/package/gluon-mesh-batman-adv-core/Makefile index 365ccbca7..7ae7c3050 100644 --- a/package/gluon-mesh-batman-adv-core/Makefile +++ b/package/gluon-mesh-batman-adv-core/Makefile @@ -12,7 +12,7 @@ define Package/gluon-mesh-batman-adv-core SECTION:=gluon CATEGORY:=Gluon TITLE:=Support for batman-adv meshing (core) - DEPENDS:=+gluon-core +libgluonutil +gluon-client-bridge +firewall +libiwinfo +batman-adv-visdata + DEPENDS:=+gluon-core +libgluonutil +gluon-client-bridge +firewall +libiwinfo endef define Build/Prepare diff --git a/package/gluon-mesh-batman-adv-core/src/respondd.c b/package/gluon-mesh-batman-adv-core/src/respondd.c index 7ffb94c11..83f25e303 100644 --- a/package/gluon-mesh-batman-adv-core/src/respondd.c +++ b/package/gluon-mesh-batman-adv-core/src/respondd.c @@ -468,7 +468,7 @@ static struct json_object * ifnames2addrs(struct json_object *interfaces) { } static struct json_object * get_batadv(void) { - FILE *f = fopen("/tmp/batman-adv-visdata/bat0/originators", "r"); + FILE *f = fopen("/sys/kernel/debug/batman_adv/bat0/originators", "r"); if (!f) return NULL; diff --git a/package/gluon-respondd/files/usr/lib/autoupdater/abort.d/50gluon-respondd b/package/gluon-respondd/files/usr/lib/autoupdater/abort.d/50gluon-respondd index 1a5e14e42..d29af306a 100755 --- a/package/gluon-respondd/files/usr/lib/autoupdater/abort.d/50gluon-respondd +++ b/package/gluon-respondd/files/usr/lib/autoupdater/abort.d/50gluon-respondd @@ -3,5 +3,4 @@ . /lib/gluon/autoupdater/lib.sh -start_enabled batman-adv-visdata start_enabled gluon-respondd diff --git a/package/gluon-respondd/files/usr/lib/autoupdater/download.d/50gluon-respondd b/package/gluon-respondd/files/usr/lib/autoupdater/download.d/50gluon-respondd index 05f56fae9..3edd5f1d6 100755 --- a/package/gluon-respondd/files/usr/lib/autoupdater/download.d/50gluon-respondd +++ b/package/gluon-respondd/files/usr/lib/autoupdater/download.d/50gluon-respondd @@ -4,4 +4,3 @@ stop gluon-respondd -stop batman-adv-visdata diff --git a/package/gluon-status-page-api/Makefile b/package/gluon-status-page-api/Makefile index 17abab297..174e2e857 100644 --- a/package/gluon-status-page-api/Makefile +++ b/package/gluon-status-page-api/Makefile @@ -13,7 +13,7 @@ define Package/gluon-status-page-api SECTION:=gluon CATEGORY:=Gluon TITLE:=API for gluon-status-page - DEPENDS:=+gluon-core +uhttpd +sse-multiplex +batman-adv-visdata +gluon-neighbour-info +gluon-respondd +libiwinfo +libjson-c + DEPENDS:=+gluon-core +uhttpd +sse-multiplex +gluon-neighbour-info +gluon-respondd +libiwinfo +libjson-c endef define Build/Prepare diff --git a/package/gluon-status-page-api/src/neighbours-batadv.c b/package/gluon-status-page-api/src/neighbours-batadv.c index fb7be7769..f0a484b2f 100644 --- a/package/gluon-status-page-api/src/neighbours-batadv.c +++ b/package/gluon-status-page-api/src/neighbours-batadv.c @@ -12,7 +12,7 @@ static json_object *neighbours(void) { FILE *f; - f = fopen("/tmp/batman-adv-visdata/bat0/originators" , "r"); + f = fopen("/sys/kernel/debug/batman_adv/bat0/originators" , "r"); if (f == NULL) return NULL; diff --git a/patches/packages/routing/0004-alfred-use-batman-adv-visdata.patch b/patches/packages/routing/0004-alfred-use-batman-adv-visdata.patch deleted file mode 100644 index 48b720be6..000000000 --- a/patches/packages/routing/0004-alfred-use-batman-adv-visdata.patch +++ /dev/null @@ -1,83 +0,0 @@ -From: Matthias Schiffer <mschiffer@universe-factory.net> -Date: Mon, 14 Dec 2015 03:08:42 +0100 -Subject: alfred: use batman-adv-visdata - -diff --git a/alfred/Makefile b/alfred/Makefile -index 504fddd..f356f55 100644 ---- a/alfred/Makefile -+++ b/alfred/Makefile -@@ -28,7 +28,7 @@ define Package/alfred - SECTION:=net - CATEGORY:=Network - TITLE:=A.L.F.R.E.D. - Almighty Lightweight Fact Remote Exchange Daemon -- DEPENDS:= +libc +kmod-ipv6 +librt \ -+ DEPENDS:= +libc +kmod-ipv6 +librt +batman-adv-visdata \ - +ALFRED_NEEDS_lua:lua \ - +ALFRED_NEEDS_libgps:libgps - endef -diff --git a/alfred/patches/0002-alfred-use-batman-adv-visdata.patch b/alfred/patches/0002-alfred-use-batman-adv-visdata.patch -new file mode 100644 -index 0000000..a28b6a4 ---- /dev/null -+++ b/alfred/patches/0002-alfred-use-batman-adv-visdata.patch -@@ -0,0 +1,60 @@ -+--- a/batadv_query.c -++++ b/batadv_query.c -+@@ -91,8 +91,10 @@ int ipv6_to_mac(const struct in6_addr *a -+ int batadv_interface_check(const char *mesh_iface) -+ { -+ char *debugfs_mnt; -++#if 0 -+ char full_path[MAX_PATH + 1]; -+ FILE *f; -++#endif -+ -+ debugfs_mnt = debugfs_mount(NULL); -+ if (!debugfs_mnt) { -+@@ -100,6 +102,7 @@ int batadv_interface_check(const char *m -+ return -1; -+ } -+ -++#if 0 -+ debugfs_make_path(DEBUG_BATIF_PATH_FMT "/" DEBUG_TRANSTABLE_GLOBAL, -+ mesh_iface, full_path, sizeof(full_path)); -+ f = fopen(full_path, "r"); -+@@ -121,6 +124,7 @@ int batadv_interface_check(const char *m -+ return -1; -+ } -+ fclose(f); -++#endif -+ -+ return 0; -+ } -+@@ -150,8 +154,7 @@ struct ether_addr *translate_mac(const c -+ if (!debugfs_mnt) -+ goto out; -+ -+- debugfs_make_path(DEBUG_BATIF_PATH_FMT "/" DEBUG_TRANSTABLE_GLOBAL, -+- mesh_iface, full_path, sizeof(full_path)); -++ snprintf(full_path, sizeof(full_path), "/tmp/batman-adv-visdata/%s/transtable_global", mesh_iface); -+ -+ f = fopen(full_path, "r"); -+ if (!f) -+@@ -232,8 +235,7 @@ uint8_t get_tq(const char *mesh_iface, s -+ if (!debugfs_mnt) -+ goto out; -+ -+- debugfs_make_path(DEBUG_BATIF_PATH_FMT "/" DEBUG_ORIGINATORS, -+- mesh_iface, full_path, sizeof(full_path)); -++ snprintf(full_path, sizeof(full_path), "/tmp/batman-adv-visdata/%s/originators", mesh_iface); -+ -+ f = fopen(full_path, "r"); -+ if (!f) -+--- a/vis/vis.c -++++ b/vis/vis.c -+@@ -325,7 +325,7 @@ static int parse_orig_list(struct global -+ char path[1024]; -+ struct vis_list_entry *v_entry; -+ -+- snprintf(path, sizeof(path), "/sys/kernel/debug/batman_adv/%s/originators", globals->interface); -++ snprintf(path, sizeof(path), "/tmp/batman-adv-visdata/%s/originators", globals->interface); -+ fbuf = read_file(path); -+ if (!fbuf) -+ return -1; -- GitLab