Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 0x4A6F-master
  • 0x4A6F-rpi4
  • autinerd/experimental-openwrt-24.10
  • experimental
  • feature/addMikrotikwAP
  • master
  • nrb/airmax-test
  • nrb/ar9344-reset-sequence
  • nrb/ex400-remove-wps
  • nrb/gluon-master-cpe510
  • nrb/test-radv-filter
  • nrbffs/fastd-remove-delay
  • nrbffs/netgear-ex6120
  • v2018.2.2-ffs
  • v2018.2.3-ffs
  • v2019.1-ffs
  • v2019.1.1-ffs
  • v2019.1.2-ffs
  • v2020.1-ffs
  • v2020.1.1-ffs
  • v2020.1.3-ffs
  • v2020.2-ffs
  • v2020.2.1-ffs
  • v2020.2.2-ffs
  • v2020.2.3-ffs
  • v2021.1-ffs
  • v2021.1.1-ffs
  • v2021.1.2-ffs
  • v2022.1.1-ffs
  • v2022.1.3-ffs
  • v2022.1.4-ffs
  • v2023.1-ffs
  • v2023.2-ffs
  • v2023.2.2-ffs
  • v2023.2.3-ffs
  • v2023.2.4-ffs
  • v2023.2.5-ffs
  • experimental-2022-09-24
  • experimental-2022-09-24-base
  • experimental-2023-03-11
  • experimental-2023-03-11-base
  • experimental-2023-03-12
  • experimental-2023-03-12-base
  • experimental-2023-03-16
  • experimental-2023-03-16-base
  • experimental-2023-03-20
  • experimental-2023-03-20-base
  • experimental-2023-03-23
  • experimental-2023-03-23-base
  • experimental-2023-03-25
  • experimental-2023-03-25-base
  • experimental-2023-03-26
  • experimental-2023-03-26-base
  • experimental-2023-03-30
  • experimental-2023-03-30-base
  • experimental-2023-03-31
  • experimental-2023-03-31-base
  • experimental-2023-04-01
  • experimental-2023-04-01-base
  • experimental-2023-04-08
  • experimental-2023-04-08-base
  • experimental-2023-04-10
  • experimental-2023-04-10-base
  • experimental-2023-04-13
  • experimental-2023-04-13-base
  • experimental-2023-04-15
  • experimental-2023-04-15-base
  • experimental-2023-04-16
  • experimental-2023-04-16-base
  • experimental-2023-04-18
  • experimental-2023-04-18-base
  • experimental-2023-04-20
  • experimental-2023-04-20-base
  • experimental-2023-04-26
  • experimental-2023-04-26-base
  • experimental-2023-04-28
  • experimental-2023-04-28-base
  • experimental-2023-04-30
  • experimental-2023-04-30-base
  • experimental-2023-05-02
  • experimental-2023-05-02-base
  • experimental-2023-05-03
  • experimental-2023-05-03-base
  • experimental-2023-05-12
  • experimental-2023-05-12-base
  • experimental-2023-05-21
  • experimental-2023-05-21-base
  • experimental-2023-05-25
  • experimental-2023-05-25-base
  • experimental-2023-07-02
  • experimental-2023-07-02-base
  • experimental-2023-07-04
  • experimental-2023-07-04-base
  • experimental-2023-07-12
  • experimental-2023-07-12-base
  • experimental-2023-07-16
  • experimental-2023-07-16-base
  • experimental-2023-08-04
  • experimental-2023-08-04-base
  • experimental-2023-08-10
  • experimental-2023-08-10-base
  • experimental-2023-09-08
  • experimental-2023-09-08-base
  • experimental-2023-09-09
  • experimental-2023-09-09-base
  • experimental-2023-09-10
  • experimental-2023-09-10-base
  • experimental-2023-09-11
  • experimental-2023-09-11-base
  • experimental-2023-09-12
  • experimental-2023-09-12-base
  • experimental-2023-09-13
  • experimental-2023-09-13-base
  • experimental-2023-09-15
  • experimental-2023-09-15-base
  • experimental-2023-09-16
  • experimental-2023-09-16-base
  • experimental-2023-09-18
  • experimental-2023-09-18-base
  • experimental-2023-09-20
  • experimental-2023-09-20-base
  • experimental-2023-09-27
  • experimental-2023-09-27-base
  • experimental-2023-09-28
  • experimental-2023-09-28-base
  • experimental-2023-09-29
  • experimental-2023-09-29-base
  • experimental-2023-10-02
  • experimental-2023-10-02-base
  • experimental-2023-10-13
  • experimental-2023-10-13-base
  • experimental-2023-10-14
  • experimental-2023-10-14-base
  • experimental-2023-10-16
  • experimental-2023-10-16-base
  • experimental-2023-10-23
  • experimental-2023-10-23-base
137 results

Target

Select target project
  • firmware/gluon
  • 0x4A6F/gluon
  • patrick/gluon
3 results
Select Git revision
  • 0x4A6F-master
  • 0x4A6F-rpi4
  • 2014.3.x
  • 2014.4.x
  • babel
  • hoodselector
  • master
  • radv-filterd
  • v2015.1.x
  • v2016.1.x
  • v2016.2.4-batmanbug
  • v2016.2.x
  • v2018.2.2-ffs
  • v2018.2.x
  • v2014.1
  • v2014.2
  • v2014.3
  • v2014.3.1
  • v2014.4
  • v2015.1
  • v2015.1.1
  • v2015.1.2
  • v2016.1
  • v2016.1.1
  • v2016.1.2
  • v2016.1.3
  • v2016.1.4
  • v2016.1.5
  • v2016.1.6
  • v2016.2
  • v2016.2.1
  • v2016.2.2
  • v2016.2.3
  • v2016.2.4
  • v2016.2.5
  • v2016.2.6
  • v2016.2.7
  • v2017.1
  • v2017.1.1
  • v2017.1.2
  • v2017.1.3
  • v2017.1.4
  • v2017.1.5
  • v2017.1.6
  • v2017.1.7
  • v2017.1.8
  • v2018.1
  • v2018.1.1
  • v2018.1.2
  • v2018.1.3
  • v2018.1.4
  • v2018.2
  • v2018.2-ffs0.1
  • v2018.2.1
  • v2018.2.1-ffs0.1
  • v2018.2.2-ffs0.1
56 results
Show changes
Showing
with 272 additions and 876 deletions
# Defines the following variables:
# JSON_C_FOUND
# JSON_C_INCLUDE_DIR
# JSON_C_LIBRARIES
# JSON_C_CFLAGS_OTHER
# JSON_C_LDFLAGS_OTHER
find_package(PkgConfig REQUIRED QUIET)
pkg_check_modules(_JSON_C json-c)
find_path(JSON_C_INCLUDE_DIR NAMES json-c/json.h HINTS ${_JSON_C_INCLUDE_DIRS})
find_library(JSON_C_LIBRARIES NAMES json-c HINTS ${_JSON_C_LIBRARY_DIRS})
set(JSON_C_CFLAGS_OTHER "${_JSON_C_CFLAGS_OTHER}" CACHE STRING "Additional compiler flags for json-c")
set(JSON_C_LDFLAGS_OTHER "${_JSON_C_LDFLAGS_OTHER}" CACHE STRING "Additional linker flags for json-c")
find_package_handle_standard_args(JSON_C REQUIRED_VARS JSON_C_LIBRARIES JSON_C_INCLUDE_DIR)
mark_as_advanced(JSON_C_INCLUDE_DIR JSON_C_LIBRARIES JSON_C_CFLAGS_OTHER JSON_C_LDFLAGS_OTHER)
/*
Copyright (c) 2016, Matthias Schiffer <mschiffer@universe-factory.net>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* SPDX-FileCopyrightText: 2016 Matthias Schiffer <mschiffer@universe-factory.net> */
/* SPDX-License-Identifier: BSD-2-Clause */
#include "libgluonutil.h"
#include <json-c/json.h>
#include <uci.h>
#include <arpa/inet.h>
#include <errno.h>
#include <glob.h>
#include <libgen.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
/**
* Merges two JSON objects
*
* Both objects are consumed. On conflicts, object b will be preferred.
*/
static struct json_object * merge_json(struct json_object *a, struct json_object *b) {
if (!json_object_is_type(a, json_type_object) || !json_object_is_type(b, json_type_object)) {
json_object_put(a);
return b;
}
json_object *m = json_object_new_object();
json_object_object_foreach(a, key_a, val_a)
json_object_object_add(m, key_a, json_object_get(val_a));
json_object_put(a);
json_object_object_foreach(b, key_b, val_b) {
struct json_object *val_m;
if (json_object_object_get_ex(m, key_b, &val_m))
val_m = merge_json(json_object_get(val_m), json_object_get(val_b));
else
val_m = json_object_get(val_b);
json_object_object_add(m, key_b, val_m);
}
json_object_put(b);
return m;
}
char * gluonutil_read_line(const char *filename) {
FILE *f = fopen(filename, "r");
......@@ -94,6 +111,75 @@ char * gluonutil_get_interface_address(const char *ifname) {
return gluonutil_read_line(path);
}
void gluonutil_get_interface_lower(char out[IF_NAMESIZE], const char *ifname) {
strncpy(out, ifname, IF_NAMESIZE-1);
out[IF_NAMESIZE-1] = 0;
const char *format = "/sys/class/net/%s/lower_*";
char pattern[strlen(format) + IF_NAMESIZE];
while (true) {
snprintf(pattern, sizeof(pattern), format, out);
size_t pattern_len = strlen(pattern);
glob_t lower;
if (glob(pattern, GLOB_NOSORT, NULL, &lower) != 0)
break;
strncpy(out, lower.gl_pathv[0] + pattern_len - 1, IF_NAMESIZE-1);
globfree(&lower);
}
}
enum gluonutil_interface_type lookup_interface_type(const char *devtype) {
if (strcmp(devtype, "wlan") == 0)
return GLUONUTIL_INTERFACE_TYPE_WIRELESS;
if (strcmp(devtype, "l2tpeth") == 0 || strcmp(devtype, "wireguard") == 0)
return GLUONUTIL_INTERFACE_TYPE_TUNNEL;
/* Regular wired interfaces do not set DEVTYPE, so if this point is
* reached, we have something different */
return GLUONUTIL_INTERFACE_TYPE_UNKNOWN;
}
enum gluonutil_interface_type gluonutil_get_interface_type(const char *ifname) {
const char *pattern = "/sys/class/net/%s/%s";
/* Default to wired type when no DEVTYPE is set */
enum gluonutil_interface_type ret = GLUONUTIL_INTERFACE_TYPE_WIRED;
char *line = NULL, path[PATH_MAX];
size_t buflen = 0;
ssize_t len;
FILE *f;
snprintf(path, sizeof(path), pattern, ifname, "tun_flags");
if (access(path, F_OK) == 0)
return GLUONUTIL_INTERFACE_TYPE_TUNNEL;
snprintf(path, sizeof(path), pattern, ifname, "uevent");
f = fopen(path, "r");
if (!f)
return GLUONUTIL_INTERFACE_TYPE_UNKNOWN;
while ((len = getline(&line, &buflen, f)) >= 0) {
if (len == 0)
continue;
if (line[len-1] == '\n')
line[len-1] = '\0';
if (strncmp(line, "DEVTYPE=", 8) == 0) {
ret = lookup_interface_type(line+8);
break;
}
}
free(line);
fclose(f);
return ret;
}
struct json_object * gluonutil_wrap_string(const char *str) {
......@@ -109,6 +195,145 @@ struct json_object * gluonutil_wrap_and_free_string(char *str) {
return ret;
}
bool gluonutil_get_node_prefix6(struct in6_addr *prefix) {
struct json_object *site = gluonutil_load_site_config();
if (!site)
return false;
struct json_object *node_prefix = NULL;
if (!json_object_object_get_ex(site, "node_prefix6", &node_prefix)) {
json_object_put(site);
return false;
}
const char *str_prefix = json_object_get_string(node_prefix);
if (!str_prefix) {
json_object_put(site);
return false;
}
char *prefix_addr = strndup(str_prefix, strchrnul(str_prefix, '/')-str_prefix);
int ret = inet_pton(AF_INET6, prefix_addr, prefix);
free(prefix_addr);
json_object_put(site);
if (ret != 1)
return false;
return true;
}
bool gluonutil_has_domains(void) {
return (access("/lib/gluon/domains/", F_OK) == 0);
}
char * gluonutil_get_domain(void) {
if (!gluonutil_has_domains())
return NULL;
char *ret = NULL;
struct uci_context *ctx = uci_alloc_context();
if (!ctx)
goto uci_fail;
ctx->flags &= ~UCI_FLAG_STRICT;
struct uci_package *p;
if (uci_load(ctx, "gluon", &p))
goto uci_fail;
struct uci_section *s = uci_lookup_section(ctx, p, "core");
if (!s)
goto uci_fail;
const char *domain_code = uci_lookup_option_string(ctx, s, "domain");
if (!domain_code)
goto uci_fail;
ret = strdup(domain_code);
uci_fail:
if (ctx)
uci_free_context(ctx);
return ret;
}
char * gluonutil_get_primary_domain(void) {
if (!gluonutil_has_domains())
return NULL;
char *domain_code = gluonutil_get_domain();
if (!domain_code)
return NULL;
const char *domain_path_fmt = "/lib/gluon/domains/%s.json";
char domain_path[strlen(domain_path_fmt) + strlen(domain_code)];
snprintf(domain_path, sizeof(domain_path), domain_path_fmt, domain_code);
char primary_domain_path[PATH_MAX+1];
char *primary_domain_code;
ssize_t len = readlink(domain_path, primary_domain_path, PATH_MAX);
if (len < 0) {
// EINVAL = file is not a symlink = the domain itself is the primary domain
if (errno != EINVAL) {
free(domain_code);
return NULL;
}
return domain_code;
}
free(domain_code);
primary_domain_path[len] = '\0';
primary_domain_code = basename(primary_domain_path);
char *ext_begin = strrchr(primary_domain_code, '.');
if (!ext_begin)
return NULL;
// strip .json from filename
*ext_begin = '\0';
return strdup(primary_domain_code);
}
struct json_object * gluonutil_load_site_config(void) {
return json_object_from_file("/lib/gluon/site.json");
char *domain_code = NULL;
struct json_object *site = NULL, *domain = NULL;
site = json_object_from_file("/lib/gluon/site.json");
if (!site)
return NULL;
if (!gluonutil_has_domains())
return site;
domain_code = gluonutil_get_domain();
if (!domain_code)
goto err;
{
const char *domain_path_fmt = "/lib/gluon/domains/%s.json";
char domain_path[strlen(domain_path_fmt) + strlen(domain_code)];
snprintf(domain_path, sizeof(domain_path), domain_path_fmt, domain_code);
free(domain_code);
domain = json_object_from_file(domain_path);
}
if (!domain)
goto err;
return merge_json(site, domain);
err:
json_object_put(site);
return NULL;
}
/*
Copyright (c) 2016, Matthias Schiffer <mschiffer@universe-factory.net>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* SPDX-FileCopyrightText: 2016 Matthias Schiffer <mschiffer@universe-factory.net> */
/* SPDX-License-Identifier: BSD-2-Clause */
#ifndef _LIBGLUON_LIBGLUON_H_
#define _LIBGLUON_LIBGLUON_H_
#include <net/if.h>
#include <netinet/in.h>
#include <stdbool.h>
char * gluonutil_read_line(const char *filename);
char * gluonutil_get_sysconfig(const char *key);
char * gluonutil_get_node_id(void);
enum gluonutil_interface_type {
GLUONUTIL_INTERFACE_TYPE_UNKNOWN,
GLUONUTIL_INTERFACE_TYPE_WIRED,
GLUONUTIL_INTERFACE_TYPE_WIRELESS,
GLUONUTIL_INTERFACE_TYPE_TUNNEL,
};
void gluonutil_get_interface_lower(char out[IF_NAMESIZE], const char *ifname);
char * gluonutil_get_interface_address(const char *ifname);
enum gluonutil_interface_type gluonutil_get_interface_type(const char *ifname);
bool gluonutil_get_node_prefix6(struct in6_addr *prefix);
struct json_object * gluonutil_wrap_string(const char *str);
struct json_object * gluonutil_wrap_and_free_string(char *str);
bool gluonutil_has_domains(void);
char * gluonutil_get_domain(void);
char * gluonutil_get_primary_domain(void);
struct json_object * gluonutil_load_site_config(void);
#endif /* _LIBGLUON_LIBGLUON_H_ */
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sat, 14 Jan 2017 18:13:14 +0100
Subject: build: move STAGING_DIR_HOSTPKG and BUILD_DIR_HOST back to a common directory for all targets
$(STAGING_DIR)/host is kept in addition to $(STAGING_DIR_HOSTPKG) in most
places; it is still used as destination for host files in Build/InstallDev.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/Makefile b/Makefile
index b220dfd3c56a11f3e27d70e3d6e58cc6448abd2f..c1a7285c83df310e987eaef8376500d2b614eafb 100644
--- a/Makefile
+++ b/Makefile
@@ -55,7 +55,7 @@ clean: FORCE
rm -rf $(BUILD_DIR) $(STAGING_DIR) $(BIN_DIR) $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES) $(BUILD_LOG_DIR) $(TOPDIR)/staging_dir/packages
dirclean: clean
- rm -rf $(STAGING_DIR_HOST) $(TOOLCHAIN_DIR) $(BUILD_DIR_HOST) $(BUILD_DIR_TOOLCHAIN)
+ rm -rf $(STAGING_DIR_HOST) $(STAGING_DIR_HOSTPKG) $(TOOLCHAIN_DIR) $(BUILD_DIR_BASE)/host $(BUILD_DIR_BASE)/hostpkg $(BUILD_DIR_TOOLCHAIN)
rm -rf $(TMP_DIR)
ifndef DUMP_TARGET_DB
diff --git a/include/autotools.mk b/include/autotools.mk
index c6aa47e0bef311697b4def7a7183d1ac59dcf599..7bd400ab36d052b39fcb76a66873c8673eb189a0 100644
--- a/include/autotools.mk
+++ b/include/autotools.mk
@@ -75,7 +75,7 @@ define autoreconf_target
$(strip $(call autoreconf, \
$(PKG_BUILD_DIR), $(PKG_REMOVE_FILES), \
$(PKG_AUTOMAKE_PATHS), $(PKG_LIBTOOL_PATHS), \
- $(STAGING_DIR)/host/share/aclocal $(STAGING_DIR)/usr/share/aclocal $(PKG_MACRO_PATHS)))
+ $(STAGING_DIR)/host/share/aclocal $(STAGING_DIR_HOSTPKG)/share/aclocal $(STAGING_DIR)/usr/share/aclocal $(PKG_MACRO_PATHS)))
endef
define patch_libtool_target
diff --git a/include/cmake.mk b/include/cmake.mk
index 5a403cbf41e2bbd6bdb843492639a01aff8cf75b..900dae1d4afc6007f8ac04179dd7f0922a07d4fa 100644
--- a/include/cmake.mk
+++ b/include/cmake.mk
@@ -34,7 +34,7 @@ CMAKE_NM:=$(call cmake_tool,$(TARGET_NM))
CMAKE_RANLIB:=$(call cmake_tool,$(TARGET_RANLIB))
CMAKE_FIND_ROOT_PATH:=$(STAGING_DIR)/usr;$(TOOLCHAIN_DIR)$(if $(CONFIG_EXTERNAL_TOOLCHAIN),;$(CONFIG_TOOLCHAIN_ROOT))
-CMAKE_HOST_FIND_ROOT_PATH:=$(STAGING_DIR)/host;$(STAGING_DIR_HOST)
+CMAKE_HOST_FIND_ROOT_PATH:=$(STAGING_DIR)/host;$(STAGING_DIR_HOSTPKG);$(STAGING_DIR_HOST)
CMAKE_SHARED_LDFLAGS:=-Wl,-Bsymbolic-functions
define Build/Configure/Default
diff --git a/include/host-build.mk b/include/host-build.mk
index 70bf6e5a399615edb91edfae3c43a93504d7b5d8..6c2f91581b895bda1ee9f2ee94afc2e5c06de380 100644
--- a/include/host-build.mk
+++ b/include/host-build.mk
@@ -122,7 +122,7 @@ ifneq ($(if $(HOST_QUILT),,$(CONFIG_AUTOREBUILD)),)
endif
define Host/Exports/Default
- $(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR_HOST)/share/aclocal $$(STAGING_DIR_HOST)/share/aclocal-* $(if $(IS_PACKAGE_BUILD),$$(STAGING_DIR)/host/share/aclocal $$(STAGING_DIR)/host/share/aclocal-*)),-I $$(p))
+ $(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR_HOST)/share/aclocal $$(STAGING_DIR_HOST)/share/aclocal-* $(if $(IS_PACKAGE_BUILD),$$(STAGING_DIR)/host/share/aclocal $$(STAGING_DIR_HOSTPKG)/share/aclocal $$(STAGING_DIR)/host/share/aclocal-*)),-I $$(p))
$(1) : export STAGING_PREFIX=$$(HOST_BUILD_PREFIX)
$(1) : export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig
$(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig
diff --git a/include/package.mk b/include/package.mk
index 32485176577b040f6e4a561c5d1144509877bcdf..ea801288eadb139cc0dd2412b4c927c6bd7330e0 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -130,7 +130,7 @@ ifdef USE_SOURCE_DIR
endif
define Build/Exports/Default
- $(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR)/usr/share/aclocal $$(STAGING_DIR)/usr/share/aclocal-* $$(STAGING_DIR)/host/share/aclocal $$(STAGING_DIR)/host/share/aclocal-*),-I $$(p))
+ $(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR)/usr/share/aclocal $$(STAGING_DIR)/usr/share/aclocal-* $$(STAGING_DIR_HOSTPKG)/share/aclocal $$(STAGING_DIR_HOSTPKG)/share/aclocal-* $$(STAGING_DIR)/host/share/aclocal $$(STAGING_DIR)/host/share/aclocal-*),-I $$(p))
$(1) : export STAGING_PREFIX=$$(STAGING_DIR)/usr
$(1) : export PATH=$$(TARGET_PATH_PKG)
$(1) : export CONFIG_SITE:=$$(CONFIG_SITE)
diff --git a/rules.mk b/rules.mk
index 04fd936660bef4af49de5500cd2d7c3601c1b9f6..95b18f9e5c69de479db54c5bdb740103140dcf74 100644
--- a/rules.mk
+++ b/rules.mk
@@ -145,9 +145,9 @@ STAGING_DIR_ROOT:=$(STAGING_DIR)/root-$(BOARD)
BUILD_LOG_DIR:=$(TOPDIR)/logs
PKG_INFO_DIR := $(STAGING_DIR)/pkginfo
-BUILD_DIR_HOST:=$(if $(IS_PACKAGE_BUILD),$(BUILD_DIR)/host,$(BUILD_DIR_BASE)/host)
+BUILD_DIR_HOST:=$(if $(IS_PACKAGE_BUILD),$(BUILD_DIR_BASE)/hostpkg,$(BUILD_DIR_BASE)/host)
STAGING_DIR_HOST:=$(TOPDIR)/staging_dir/host
-STAGING_DIR_HOSTPKG:=$(STAGING_DIR)/host
+STAGING_DIR_HOSTPKG:=$(TOPDIR)/staging_dir/hostpkg
TARGET_PATH:=$(subst $(space),:,$(filter-out .,$(filter-out ./,$(subst :,$(space),$(PATH)))))
TARGET_INIT_PATH:=$(call qstrip,$(CONFIG_TARGET_INIT_PATH))
@@ -206,7 +206,7 @@ ifndef DUMP
endif
endif
endif
-TARGET_PATH_PKG:=$(STAGING_DIR)/host/bin:$(TARGET_PATH)
+TARGET_PATH_PKG:=$(STAGING_DIR)/host/bin:$(STAGING_DIR_HOSTPKG)/bin:$(TARGET_PATH)
ifeq ($(CONFIG_SOFT_FLOAT),y)
SOFT_FLOAT_CONFIG_OPTION:=--with-float=soft
@@ -232,9 +232,9 @@ export PKG_CONFIG
HOSTCC:=gcc
HOSTCXX:=g++
-HOST_CPPFLAGS:=-I$(STAGING_DIR_HOST)/include -I$(STAGING_DIR_HOST)/usr/include $(if $(IS_PACKAGE_BUILD),-I$(STAGING_DIR)/host/include)
+HOST_CPPFLAGS:=-I$(STAGING_DIR_HOST)/include -I$(STAGING_DIR_HOST)/usr/include $(if $(IS_PACKAGE_BUILD),-I$(STAGING_DIR_HOSTPKG)/include -I$(STAGING_DIR)/host/include)
HOST_CFLAGS:=-O2 $(HOST_CPPFLAGS)
-HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib -L$(STAGING_DIR_HOST)/usr/lib $(if $(IS_PACKAGE_BUILD),-L$(STAGING_DIR)/host/lib)
+HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib -L$(STAGING_DIR_HOST)/usr/lib $(if $(IS_PACKAGE_BUILD),-L$(STAGING_DIR_HOSTPKG)/lib -L$(STAGING_DIR)/host/lib)
ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
TARGET_AR:=$(TARGET_CROSS)gcc-ar
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Mon, 27 Jul 2015 20:42:50 +0200
Subject: hostapd: prevent channel switch for 5GHz
hostapd would switch the primary and secondary channel on 5GHz networks in
certain circumstances, completely breaking the adhoc interfaces of the WLAN
adapter (they would lose their configuration).
As a temporary fix, disable this channel switch function.
diff --git a/package/network/services/hostapd/patches/900-no_channel_switch.patch b/package/network/services/hostapd/patches/900-no_channel_switch.patch
new file mode 100644
index 0000000000000000000000000000000000000000..c6145156928ffa5a5195ca145b0655bb88c92091
--- /dev/null
+++ b/package/network/services/hostapd/patches/900-no_channel_switch.patch
@@ -0,0 +1,68 @@
+--- a/src/common/hw_features_common.c
++++ b/src/common/hw_features_common.c
+@@ -171,7 +171,6 @@ int check_40mhz_5g(struct hostapd_hw_mod
+ struct wpa_scan_results *scan_res, int pri_chan,
+ int sec_chan)
+ {
+- int pri_freq, sec_freq, pri_bss, sec_bss;
+ int bss_pri_chan, bss_sec_chan;
+ size_t i;
+ int match;
+@@ -180,57 +179,6 @@ int check_40mhz_5g(struct hostapd_hw_mod
+ pri_chan == sec_chan)
+ return 0;
+
+- pri_freq = hw_get_freq(mode, pri_chan);
+- sec_freq = hw_get_freq(mode, sec_chan);
+-
+- /*
+- * Switch PRI/SEC channels if Beacons were detected on selected SEC
+- * channel, but not on selected PRI channel.
+- */
+- pri_bss = sec_bss = 0;
+- for (i = 0; i < scan_res->num; i++) {
+- struct wpa_scan_res *bss = scan_res->res[i];
+- if (bss->freq == pri_freq)
+- pri_bss++;
+- else if (bss->freq == sec_freq)
+- sec_bss++;
+- }
+- if (sec_bss && !pri_bss) {
+- wpa_printf(MSG_INFO,
+- "Switch own primary and secondary channel to get secondary channel with no Beacons from other BSSes");
+- return 2;
+- }
+-
+- /*
+- * Match PRI/SEC channel with any existing HT40 BSS on the same
+- * channels that we are about to use (if already mixed order in
+- * existing BSSes, use own preference).
+- */
+- match = 0;
+- for (i = 0; i < scan_res->num; i++) {
+- struct wpa_scan_res *bss = scan_res->res[i];
+- get_pri_sec_chan(bss, &bss_pri_chan, &bss_sec_chan);
+- if (pri_chan == bss_pri_chan &&
+- sec_chan == bss_sec_chan) {
+- match = 1;
+- break;
+- }
+- }
+- if (!match) {
+- for (i = 0; i < scan_res->num; i++) {
+- struct wpa_scan_res *bss = scan_res->res[i];
+- get_pri_sec_chan(bss, &bss_pri_chan, &bss_sec_chan);
+- if (pri_chan == bss_sec_chan &&
+- sec_chan == bss_pri_chan) {
+- wpa_printf(MSG_INFO, "Switch own primary and "
+- "secondary channel due to BSS "
+- "overlap with " MACSTR,
+- MAC2STR(bss->bssid));
+- return 2;
+- }
+- }
+- }
+-
+ return 1;
+ }
+
From: Jan-Philipp Litza <janphilipp@litza.de>
Date: Fri, 6 May 2016 16:44:29 +0200
Subject: libjson-c: Add support for custom format strings for doubles
diff --git a/package/libs/libjson-c/patches/002-custom-format-string.patch b/package/libs/libjson-c/patches/002-custom-format-string.patch
new file mode 100644
index 0000000000000000000000000000000000000000..2f454c560ff78c1edd4654b9651f0e6299bd5e6f
--- /dev/null
+++ b/package/libs/libjson-c/patches/002-custom-format-string.patch
@@ -0,0 +1,98 @@
+From 21dc5dc92bd56f5f4dc2c90b9ea6bf1e1407714e Mon Sep 17 00:00:00 2001
+From: Jan-Philipp Litza <janphilipp@litza.de>
+Date: Fri, 6 May 2016 16:12:44 +0200
+Subject: [PATCH] Export json_object_double_to_json_string() and use custom
+ format string
+BCC: janphilipp@litza.de
+
+---
+ json_object.c | 12 ++++++------
+ json_object.h | 28 ++++++++++++++++++++++++++++
+ 2 files changed, 34 insertions(+), 6 deletions(-)
+
+diff --git a/json_object.c b/json_object.c
+index 7d60884..46701e7 100644
+--- a/json_object.c
++++ b/json_object.c
+@@ -55,7 +55,6 @@ static struct json_object* json_object_new(enum json_type o_type);
+ static json_object_to_json_string_fn json_object_object_to_json_string;
+ static json_object_to_json_string_fn json_object_boolean_to_json_string;
+ static json_object_to_json_string_fn json_object_int_to_json_string;
+-static json_object_to_json_string_fn json_object_double_to_json_string;
+ static json_object_to_json_string_fn json_object_string_to_json_string;
+ static json_object_to_json_string_fn json_object_array_to_json_string;
+
+@@ -644,10 +643,10 @@ int64_t json_object_get_int64(const struct json_object *jso)
+
+ /* json_object_double */
+
+-static int json_object_double_to_json_string(struct json_object* jso,
+- struct printbuf *pb,
+- int level,
+- int flags)
++int json_object_double_to_json_string(struct json_object* jso,
++ struct printbuf *pb,
++ int level,
++ int flags)
+ {
+ char buf[128], *p, *q;
+ int size;
+@@ -663,7 +662,8 @@ static int json_object_double_to_json_string(struct json_object* jso,
+ else
+ size = snprintf(buf, sizeof(buf), "-Infinity");
+ else
+- size = snprintf(buf, sizeof(buf), "%.17g", jso->o.c_double);
++ size = snprintf(buf, sizeof(buf),
++ jso->_userdata ? (const char*) jso->_userdata : "%.17g", jso->o.c_double);
+
+ p = strchr(buf, ',');
+ if (p) {
+diff --git a/json_object.h b/json_object.h
+index 2bce454..a89de44 100644
+--- a/json_object.h
++++ b/json_object.h
+@@ -614,6 +614,9 @@ extern int64_t json_object_get_int64(const struct json_object *obj);
+ /* double type methods */
+
+ /** Create a new empty json_object of type json_type_double
++ *
++ * @see json_object_double_to_json_string() for how to set a custom format string.
++ *
+ * @param d the double
+ * @returns a json_object of type json_type_double
+ */
+@@ -642,6 +645,31 @@ extern struct json_object* json_object_new_double(double d);
+ */
+ extern struct json_object* json_object_new_double_s(double d, const char *ds);
+
++
++/** Serialize a json_object of type json_type_double to a string.
++ *
++ * This function isn't meant to be called directly. Instead, you can set a
++ * custom format string for the serialization of this double using the
++ * following call (where "%.17g" actually is the default):
++ *
++ * @code
++ * jso = json_object_new_double(d);
++ * json_object_set_serializer(jso, json_object_double_to_json_string,
++ * "%.17g", NULL);
++ * @endcode
++ *
++ * @see printf(3) man page for format strings
++ *
++ * @param jso The json_type_double object that is serialized.
++ * @param pb The destination buffer.
++ * @param level Ignored.
++ * @param flags Ignored.
++ */
++extern int json_object_double_to_json_string(struct json_object* jso,
++ struct printbuf *pb,
++ int level,
++ int flags);
++
+ /** Get the double floating point value of a json_object
+ *
+ * The type is coerced to a double if the passed object is not a double.
+--
+2.7.4
+
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Tue, 27 Sep 2016 03:55:55 +0200
Subject: dropbear: add a failsafe mode that will always allow password-less root login
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/package/network/services/dropbear/patches/700-failsafe-mode.patch b/package/network/services/dropbear/patches/700-failsafe-mode.patch
new file mode 100644
index 0000000000000000000000000000000000000000..c6e45423e2dba1258549a5bfe4b5a59ac32d73d8
--- /dev/null
+++ b/package/network/services/dropbear/patches/700-failsafe-mode.patch
@@ -0,0 +1,57 @@
+--- a/runopts.h
++++ b/runopts.h
+@@ -97,6 +97,8 @@ typedef struct svr_runopts {
+ int norootpass;
+ int allowblankpass;
+
++ int failsafe_mode;
++
+ #ifdef ENABLE_SVR_REMOTETCPFWD
+ int noremotetcp;
+ #endif
+--- a/svr-auth.c
++++ b/svr-auth.c
+@@ -149,10 +149,11 @@ void recv_msg_userauth_request() {
+ AUTH_METHOD_NONE_LEN) == 0) {
+ TRACE(("recv_msg_userauth_request: 'none' request"))
+ if (valid_user
+- && (svr_opts.allowblankpass || !strcmp(ses.authstate.pw_name, "root"))
+- && !svr_opts.noauthpass
+- && !(svr_opts.norootpass && ses.authstate.pw_uid == 0)
+- && ses.authstate.pw_passwd[0] == '\0')
++ && ((svr_opts.failsafe_mode && !strcmp(ses.authstate.pw_name, "root"))
++ || ((svr_opts.allowblankpass || !strcmp(ses.authstate.pw_name, "root"))
++ && !svr_opts.noauthpass
++ && !(svr_opts.norootpass && ses.authstate.pw_uid == 0)
++ && ses.authstate.pw_passwd[0] == '\0')))
+ {
+ dropbear_log(LOG_NOTICE,
+ "Auth succeeded with blank password for '%s' from %s",
+--- a/svr-runopts.c
++++ b/svr-runopts.c
+@@ -72,6 +72,7 @@ static void printhelp(const char * progn
+ "-s Disable password logins\n"
+ "-g Disable password logins for root\n"
+ "-B Allow blank password logins\n"
++ "-f Failsafe mode: always allow password-less root login\n"
+ #endif
+ #ifdef ENABLE_SVR_LOCALTCPFWD
+ "-j Disable local port forwarding\n"
+@@ -130,6 +131,7 @@ void svr_getopts(int argc, char ** argv)
+ svr_opts.noauthpass = 0;
+ svr_opts.norootpass = 0;
+ svr_opts.allowblankpass = 0;
++ svr_opts.failsafe_mode = 0;
+ svr_opts.inetdmode = 0;
+ svr_opts.portcount = 0;
+ svr_opts.hostkey = NULL;
+@@ -244,6 +246,9 @@ void svr_getopts(int argc, char ** argv)
+ case 'B':
+ svr_opts.allowblankpass = 1;
+ break;
++ case 'f':
++ svr_opts.failsafe_mode = 1;
++ break;
+ #endif
+ case 'h':
+ printhelp(argv[0]);
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 19 Jan 2017 00:03:32 +0100
Subject: rules.mk: export STAGING_DIR_HOSTPKG
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/rules.mk b/rules.mk
index 95b18f9e5c69de479db54c5bdb740103140dcf74..1b9de5f35e3890c2759ab2cdbd98ac80df942124 100644
--- a/rules.mk
+++ b/rules.mk
@@ -223,7 +223,7 @@ else
endif
export PATH:=$(TARGET_PATH)
-export STAGING_DIR STAGING_DIR_HOST
+export STAGING_DIR STAGING_DIR_HOST STAGING_DIR_HOSTPKG
export SH_FUNC:=. $(INCLUDE_DIR)/shell.sh;
PKG_CONFIG:=$(STAGING_DIR_HOST)/bin/pkg-config
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 19 Jan 2017 00:04:09 +0100
Subject: gettext-full: fix to use $STAGING_DIR_HOSTPKG instead of $STAGING_DIR/host
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/package/libs/gettext-full/patches/000-relocatable.patch b/package/libs/gettext-full/patches/000-relocatable.patch
index c14be728367b57c08024d848cf8ff847cfe865be..a95c268f5bc94ed8ec3784ae2044aa77e0322491 100644
--- a/package/libs/gettext-full/patches/000-relocatable.patch
+++ b/package/libs/gettext-full/patches/000-relocatable.patch
@@ -5,8 +5,8 @@
# Set variables
# - gettext_datadir directory where the data files are stored.
-prefix="@prefix@"
-+if [ -n "$STAGING_DIR" ]; then
-+ prefix="$STAGING_DIR/host"
++if [ -n "$STAGING_DIR_HOSTPKG" ]; then
++ prefix="$STAGING_DIR_HOSTPKG"
+else
+ prefix="@prefix@"
+fi
@@ -20,8 +20,8 @@
# Set variables
# - gettext_datadir directory where the data files are stored.
-prefix="@prefix@"
-+if [ -n "$STAGING_DIR" ]; then
-+ prefix="$STAGING_DIR/host"
++if [ -n "$STAGING_DIR_HOSTPKG" ]; then
++ prefix="$STAGING_DIR_HOSTPKG"
+else
+ prefix="@prefix@"
+fi
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Fri, 10 Mar 2017 01:58:42 +0100
Subject: netifd: update to git HEAD version
91810ec system-linux: add VXLAN support
f107656 netifd: Add option to configure locktime for each device
cdc0e80 interface: add prefix assignment priority support
6397f5e device: add veth support
6228d0f wireless: fix _wireless_add_process
7cc2f10 treewide: fix white space errors
diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile
index fb035864017df739a0d0b0c0451fe8488a40c77c..d6d91ba014c67f126176eba8acae5fd2c8b007ba 100644
--- a/package/network/config/netifd/Makefile
+++ b/package/network/config/netifd/Makefile
@@ -5,9 +5,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(LEDE_GIT)/project/netifd.git
-PKG_SOURCE_DATE:=2017-01-25
-PKG_SOURCE_VERSION:=650758b16e5185505a3fbc1307949340af70b611
-PKG_MIRROR_HASH:=d09c740bc1bf6269678bd75c9af52ecd4be3d1d59402a543ceb9d4459cecfa2b
+PKG_SOURCE_DATE:=2017-03-07
+PKG_SOURCE_VERSION:=91810ecc13239f3b18c8299de265b4f3531c0017
+PKG_MIRROR_HASH:=51d0a8866c6b004185f1fb83f37e7aed33fc94b72bd85954c773549a57c3c761
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=GPL-2.0
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Fri, 24 Feb 2017 12:16:33 +0100
Subject: rules.mk: make PKG_CONFIG_DEPENDS properly track string values
The confvar macro is adjusted to not only consider if a variable has a
value or not, but also the value itself. Instead of creating a string of
'y' and 'n' characters, all variable names and values are concatenated
and hashed.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/rules.mk b/rules.mk
index 1b9de5f35e3890c2759ab2cdbd98ac80df942124..626bfca1ba73b96ee0f86a2de4afe643d83b360c 100644
--- a/rules.mk
+++ b/rules.mk
@@ -29,7 +29,7 @@ empty:=
space:= $(empty) $(empty)
comma:=,
merge=$(subst $(space),,$(1))
-confvar=$(call merge,$(foreach v,$(1),$(if $($(v)),y,n)))
+confvar=$(shell echo '$(foreach v,$(1),$(v)=$(subst ','\'',$($(v))))' | $(STAGING_DIR_HOST)/bin/mkhash md5)
strip_last=$(patsubst %.$(lastword $(subst .,$(space),$(1))),%,$(1))
paren_left = (
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 12 Apr 2017 02:31:12 +0200
Subject: netifd: ubus: add interface method to trigger renew event
diff --git a/package/network/config/netifd/patches/0001-ubus-add-interface-method-to-trigger-renew-event.patch b/package/network/config/netifd/patches/0001-ubus-add-interface-method-to-trigger-renew-event.patch
new file mode 100644
index 0000000000000000000000000000000000000000..1f59498d421b7e1d3e76a1a38f604181d11c4649
--- /dev/null
+++ b/package/network/config/netifd/patches/0001-ubus-add-interface-method-to-trigger-renew-event.patch
@@ -0,0 +1,73 @@
+From 8b39c2fce4c1da3f3dcd4c6fd305c124714839e8 Mon Sep 17 00:00:00 2001
+Message-Id: <8b39c2fce4c1da3f3dcd4c6fd305c124714839e8.1491956920.git.mschiffer@universe-factory.net>
+From: Matthias Schiffer <mschiffer@universe-factory.net>
+Date: Wed, 12 Apr 2017 02:25:33 +0200
+Subject: [PATCH] ubus: add interface method to trigger renew event
+
+proto-shell handlers may implement all kinds of renew handlers, there
+should be a way to explicitly trigger such a renew.
+
+Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
+---
+ interface.c | 8 ++++++++
+ interface.h | 1 +
+ ubus.c | 14 ++++++++++++++
+ 3 files changed, 23 insertions(+)
+
+--- a/interface.c
++++ b/interface.c
+@@ -1076,6 +1076,14 @@ interface_set_down(struct interface *ifa
+ return 0;
+ }
+
++int interface_renew(struct interface *iface)
++{
++ if (iface->state == IFS_TEARDOWN || iface->state == IFS_DOWN)
++ return -1;
++
++ return interface_proto_event(iface->proto, PROTO_CMD_RENEW, false);
++}
++
+ void
+ interface_start_pending(void)
+ {
+--- a/interface.h
++++ b/interface.h
+@@ -184,6 +184,7 @@ void interface_set_available(struct inte
+ int interface_set_up(struct interface *iface);
+ int interface_set_down(struct interface *iface);
+ void __interface_set_down(struct interface *iface, bool force);
++int interface_renew(struct interface *iface);
+
+ void interface_set_main_dev(struct interface *iface, struct device *dev);
+ void interface_set_l3_dev(struct interface *iface, struct device *dev);
+--- a/ubus.c
++++ b/ubus.c
+@@ -376,6 +376,19 @@ netifd_handle_down(struct ubus_context *
+ return 0;
+ }
+
++static int
++netifd_handle_renew(struct ubus_context *ctx, struct ubus_object *obj,
++ struct ubus_request_data *req, const char *method,
++ struct blob_attr *msg)
++{
++ struct interface *iface;
++
++ iface = container_of(obj, struct interface, ubus);
++ interface_renew(iface);
++
++ return 0;
++}
++
+ static void
+ netifd_add_interface_errors(struct blob_buf *b, struct interface *iface)
+ {
+@@ -912,6 +925,7 @@ netifd_handle_set_data(struct ubus_conte
+ static struct ubus_method iface_object_methods[] = {
+ { .name = "up", .handler = netifd_handle_up },
+ { .name = "down", .handler = netifd_handle_down },
++ { .name = "renew", .handler = netifd_handle_renew },
+ { .name = "status", .handler = netifd_handle_status },
+ { .name = "prepare", .handler = netifd_handle_iface_prepare },
+ { .name = "dump", .handler = netifd_handle_dump },
From: Hans Dedecker <dedeckeh@gmail.com>
Date: Mon, 6 Mar 2017 17:25:44 +0100
Subject: procd: update to git HEAD version
8f218f5 procd: service gets deleted when its last instance is freed
35209a0 procd: update modprobe path
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile
index fd1bca3f4b9665581f9e9ddd9b9294fa500a9d3d..43ea23aab00918a2b664e9a5da7767f90cd568db 100644
--- a/package/system/procd/Makefile
+++ b/package/system/procd/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(LEDE_GIT)/project/procd.git
-PKG_SOURCE_DATE:=2017-02-15
-PKG_SOURCE_VERSION:=5f9124103410c178d816bb5229fba7dd2286a49b
-PKG_MIRROR_HASH:=ec887b349fc60ad3882fc9eaefb5cd299d64e7d43c062df9f7b7500591ba3e85
+PKG_SOURCE_DATE:=2017-03-05
+PKG_SOURCE_VERSION:=8f218f5626a3cb3900dbe9801ee8ace236b0e4a5
+PKG_MIRROR_HASH:=8ac8691888b64726453bd726fe0c98fc906540bbd2ae666dae6bea592b0b4e4d
CMAKE_INSTALL:=1
PKG_LICENSE:=GPL-2.0
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 4 May 2017 07:00:06 +0200
Subject: sunxi: clean up modules definitions
Module definitions for kmod-wdt-sunxi and kmod-eeprom-sunxi are removed
(wdt-sunxi was builtin anyways; nvmem-sunxi, which is the new name of
eeprom-sunxi is changed to builtin). As kmod-eeprom-sunxi was specified
in DEFAULT_PACKAGES, but not available on kernel 4.4, it was breaking the
image builder.
Support for kmod-sunxi-ir is added for kernel 4.4 (it is unclear why it
was disable before, it builds fine with with kernel 4.4).
Condtionals only relevant for pre-4.4 kernels are removed from modules.mk,
as sunxi does't support older kernels anymore.
Fixes FS#755.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/target/linux/sunxi/Makefile b/target/linux/sunxi/Makefile
index b0bc1bab398af55b77909deccd8f059e17d96e67..3c2f14b8418e1d296a239027f6fdee9b5ba8f9b2 100644
--- a/target/linux/sunxi/Makefile
+++ b/target/linux/sunxi/Makefile
@@ -27,7 +27,7 @@ KERNELNAME:=zImage dtbs
include $(INCLUDE_DIR)/target.mk
-DEFAULT_PACKAGES += uboot-envtools kmod-eeprom-sunxi kmod-wdt-sunxi
+DEFAULT_PACKAGES += uboot-envtools
DEFAULT_PACKAGES += mkf2fs e2fsprogs
$(eval $(call BuildTarget))
diff --git a/target/linux/sunxi/config-4.4 b/target/linux/sunxi/config-4.4
index 2253afa124ad6c3d6b9d6798dc29f68437455341..a978e9d15b8c358f69669d3afdbf4a14bba83d31 100644
--- a/target/linux/sunxi/config-4.4
+++ b/target/linux/sunxi/config-4.4
@@ -356,7 +356,7 @@ CONFIG_NO_HZ_COMMON=y
CONFIG_NO_HZ_IDLE=y
CONFIG_NR_CPUS=8
CONFIG_NVMEM=y
-# CONFIG_NVMEM_SUNXI_SID is not set
+CONFIG_NVMEM_SUNXI_SID=y
CONFIG_OF=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_EARLY_FLATTREE=y
diff --git a/target/linux/sunxi/modules.mk b/target/linux/sunxi/modules.mk
index 6f4991798decb4a65f615d3a7282270960a7555a..99b82a3b5f17348049458ced5823f7c90f784269 100644
--- a/target/linux/sunxi/modules.mk
+++ b/target/linux/sunxi/modules.mk
@@ -25,7 +25,7 @@ $(eval $(call KernelPackage,rtc-sunxi))
define KernelPackage/sunxi-ir
SUBMENU:=$(OTHER_MENU)
TITLE:=Sunxi SoC built-in IR support (A20)
- DEPENDS:=@TARGET_sunxi @!LINUX_4_4 +kmod-input-core
+ DEPENDS:=@TARGET_sunxi +kmod-input-core
$(call AddDepends/rtc)
KCONFIG:= \
CONFIG_MEDIA_SUPPORT=y \
@@ -42,22 +42,6 @@ endef
$(eval $(call KernelPackage,sunxi-ir))
-define KernelPackage/eeprom-sunxi
- SUBMENU:=$(OTHER_MENU)
- TITLE:=AllWinner Security ID fuse support
- DEPENDS:=@TARGET_sunxi @!LINUX_4_4
- KCONFIG:= \
- CONFIG_EEPROM_SUNXI_SID
- FILES:=$(LINUX_DIR)/drivers/misc/eeprom/sunxi_sid.ko
- AUTOLOAD:=$(call AutoLoad,50,sunxi_sid)
-endef
-
-define KernelPackage/eeprom-sunxi/description
- Support for the AllWinner Security ID fuse support
-endef
-
-$(eval $(call KernelPackage,eeprom-sunxi))
-
define KernelPackage/ata-sunxi
TITLE:=AllWinner sunXi AHCI SATA support
SUBMENU:=$(BLOCK_MENU)
@@ -76,7 +60,7 @@ $(eval $(call KernelPackage,ata-sunxi))
define KernelPackage/sun4i-emac
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=AllWinner EMAC Ethernet support
- DEPENDS:=@TARGET_sunxi +LINUX_4_4:kmod-of-mdio +LINUX_4_4:kmod-libphy
+ DEPENDS:=@TARGET_sunxi +kmod-of-mdio +kmod-libphy
KCONFIG:=CONFIG_SUN4I_EMAC
FILES:=$(LINUX_DIR)/drivers/net/ethernet/allwinner/sun4i-emac.ko
AUTOLOAD:=$(call AutoProbe,sun4i-emac)
@@ -85,35 +69,11 @@ endef
$(eval $(call KernelPackage,sun4i-emac))
-define KernelPackage/wdt-sunxi
- SUBMENU:=$(OTHER_MENU)
- TITLE:=AllWinner sunXi Watchdog timer
- DEPENDS:=@TARGET_sunxi
- KCONFIG:=CONFIG_SUNXI_WATCHDOG
- FILES:=$(LINUX_DIR)/drivers/$(WATCHDOG_DIR)/sunxi_wdt.ko
- AUTOLOAD:=$(call AutoLoad,51,sunxi_wdt)
-endef
-
-define KernelPackage/wdt-sunxi/description
- Kernel module for AllWinner sunXi watchdog timer.
-endef
-
-$(eval $(call KernelPackage,wdt-sunxi))
-
-
define KernelPackage/sound-soc-sunxi
TITLE:=AllWinner built-in SoC sound support
- KCONFIG:= \
- CONFIG_SND_SUNXI_SOC_CODEC \
- CONFIG_SND_SUN4I_CODEC
-ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),lt,4.4.0)),1)
- FILES+=$(LINUX_DIR)/sound/soc/sunxi/sunxi-codec.ko
- AUTOLOAD:=$(call AutoLoad,65,sunxi-codec)
-endif
-ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,4.4.0)),1)
+ KCONFIG:=CONFIG_SND_SUN4I_CODEC
FILES:=$(LINUX_DIR)/sound/soc/sunxi/sun4i-codec.ko
AUTOLOAD:=$(call AutoLoad,65,sun4i-codec)
-endif
DEPENDS:=@TARGET_sunxi +kmod-sound-soc-core
$(call AddDepends/sound)
endef
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 3 May 2017 08:27:40 +0200
Subject: procd: clean up trailing whitespace in nand.sh
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/package/system/procd/files/nand.sh b/package/system/procd/files/nand.sh
index ebaaf2aa16009cc1431dbb79ba9f689c8b636069..8a164ee08537014936a8608f5a60fe0e27dcabd6 100644
--- a/package/system/procd/files/nand.sh
+++ b/package/system/procd/files/nand.sh
@@ -194,7 +194,7 @@ nand_upgrade_prepare_ubi() {
nand_do_upgrade_success() {
local conf_tar="/tmp/sysupgrade.tgz"
-
+
sync
[ -f "$conf_tar" ] && nand_restore_config "$conf_tar"
echo "sysupgrade successful"
@@ -231,7 +231,7 @@ nand_upgrade_ubifs() {
local rootfs_length=`(cat $1 | wc -c) 2> /dev/null`
nand_upgrade_prepare_ubi "$rootfs_length" "ubifs" "0" "0"
-
+
local ubidev="$( nand_find_ubi "$CI_UBIPART" )"
local root_ubivol="$(nand_find_volume $ubidev rootfs)"
ubiupdatevol /dev/$root_ubivol -s $rootfs_length $1
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 3 May 2017 08:28:05 +0200
Subject: procd: prepare NAND sysupgrade for making upgraded dynamically linked
Use install_bin to copy upgraded with all dependencies. The old name
/tmp/upgraded is temporarily retained as a symlink to avoid breaking
things.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/package/system/procd/files/nand.sh b/package/system/procd/files/nand.sh
index 8a164ee08537014936a8608f5a60fe0e27dcabd6..6bd2005344c081df20e5a330a69e49e37225c39f 100644
--- a/package/system/procd/files/nand.sh
+++ b/package/system/procd/files/nand.sh
@@ -333,7 +333,7 @@ nand_upgrade_stage1() {
[ "$SAVE_CONFIG" != 1 -a -f "$CONF_TAR" ] &&
rm $CONF_TAR
- ubus call system nandupgrade "{\"path\": \"$path\" }"
+ ubus call system nandupgrade "{\"prefix\": \"$RAM_ROOT\", \"path\": \"$path\" }"
exit 0
}
}
@@ -370,6 +370,7 @@ nand_do_platform_check() {
# $(1): file to be used for upgrade
nand_do_upgrade() {
echo -n $1 > /tmp/sysupgrade-nand-path
- cp /sbin/upgraded /tmp/
+ install_bin /sbin/upgraded
+ ln -s "$RAM_ROOT"/sbin/upgraded /tmp/upgraded
nand_upgrade_stage1
}
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Mon, 29 May 2017 23:15:22 +0200
Subject: procd: update to latest git HEAD
992b796 rcS: add missing fcntl.h include
63789e5 init: add support for sysupgrades triggered from preinit
5b1fb35 Remove code that has become unnecessary after sysupgrade changes
5918b6d upgraded: add support for passing a "command" argument to stage2
056d8dd upgraded: link dynamically, chroot during exec
7c6cf55 system: always support staged sysupgrade
d42b21e procd/rcS: Use /dev/null as stdin
e0098d4 service/instance: add an auto start option
1247db1 procd: Log initscript output prefixed with script name
8d720b2 procd: Don't use syslog before its initialization
2555474 procd: Add missing \n in debug message
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile
index 43ea23aab00918a2b664e9a5da7767f90cd568db..805583143fa865d9ffb38355f10ad300e222400e 100644
--- a/package/system/procd/Makefile
+++ b/package/system/procd/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(LEDE_GIT)/project/procd.git
-PKG_SOURCE_DATE:=2017-03-05
-PKG_SOURCE_VERSION:=8f218f5626a3cb3900dbe9801ee8ace236b0e4a5
-PKG_MIRROR_HASH:=8ac8691888b64726453bd726fe0c98fc906540bbd2ae666dae6bea592b0b4e4d
+PKG_SOURCE_DATE:=2017-05-29
+PKG_SOURCE_VERSION:=992b796204caf5b0290ea4a1246b43b353b6c1d7
+PKG_MIRROR_HASH:=effecf66ef6a7396dd26d54a5d232b4a895d9fe7aaca83063aaffc7b39a051d5
CMAKE_INSTALL:=1
PKG_LICENSE:=GPL-2.0