Skip to content
Snippets Groups Projects
Unverified Commit 78b2775e authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

Use LEDE as base for Gluon

parent 04818c17
No related branches found
No related tags found
No related merge requests found
Showing
with 276 additions and 26418 deletions
#!/bin/sh /etc/rc.common
USE_PROCD=1
PROG=/usr/sbin/dropbear
NAME=dropbear
start_service() {
[ -x /etc/init.d/dropbear ] || return 0
. /etc/init.d/dropbear
[ -s /etc/dropbear/dropbear_rsa_host_key ] || keygen
. /lib/functions.sh
. /lib/functions/network.sh
procd_open_instance
procd_set_param command "$PROG" -F -f
procd_set_param respawn
procd_close_instance
}
#!/bin/sh /etc/rc.common
START=50
USE_PROCD=1
PROG=/usr/sbin/telnetd
start_service() {
procd_open_instance
procd_set_param command "$PROG" -F -l /lib/gluon/setup-mode/ash-login
procd_close_instance
}
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-site
PKG_VERSION:=$(if $(GLUON_SITE_CODE),$(GLUON_SITE_CODE),1)
PKG_RELEASE:=$(GLUON_RELEASE)
GLUON_SITEDIR = '$(call qstrip,$(CONFIG_GLUON_SITEDIR))'
GLUON_SITE_VERSION = $(shell ( cd $(GLUON_SITEDIR) && git --git-dir=.git describe --always --dirty=+ ) 2>/dev/null || echo unknown)
PKG_VERSION:=$(if $(DUMP),x,$(GLUON_SITE_VERSION))
PKG_CONFIG_DEPENDS := CONFIG_GLUON_RELEASE CONFIG_GLUON_SITEDIR
PKG_FILE_DEPENDS := $(GLUON_SITEDIR)/site.conf $(GLUON_SITEDIR)/i18n/
PKG_BUILD_DEPENDS := luci-base/host lua-cjson/host
......@@ -20,6 +24,18 @@ define Package/gluon-site
TITLE:=Site-specific files of Gluon
endef
define Package/gluon-site/config
config GLUON_RELEASE
string "Gluon release number"
depends on PACKAGE_gluon-site
default ""
config GLUON_SITEDIR
string "Gluon site configuration directory"
depends on PACKAGE_gluon-site
default ""
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
......@@ -28,14 +44,15 @@ define Build/Configure
endef
define Build/Compile
lua -e 'print(require("cjson").encode(assert(dofile("../../scripts/site_config.lua"))))' > $(PKG_BUILD_DIR)/site.json
GLUON_SITEDIR='$(call qstrip,$(CONFIG_GLUON_SITEDIR))' lua -e 'print(require("cjson").encode(assert(dofile("../../scripts/site_config.lua"))))' > $(PKG_BUILD_DIR)/site.json
$(call GluonBuildI18N,gluon-site,$(GLUON_SITEDIR)/i18n)
endef
define Package/gluon-site/install
$(INSTALL_DIR) $(1)/lib/gluon
$(INSTALL_DATA) $(PKG_BUILD_DIR)/site.json $(1)/lib/gluon/
echo "$(GLUON_RELEASE)" > $(1)/lib/gluon/release
echo '$(GLUON_SITE_VERSION)' > $(1)/lib/gluon/site-version
echo '$(call qstrip,$(CONFIG_GLUON_RELEASE))' > $(1)/lib/gluon/release
$(call GluonInstallI18N,gluon-site,$(1))
endef
......
......@@ -5,8 +5,13 @@ include $(INCLUDE_DIR)/package.mk
# Annoyingly, make's shell function replaces all newlines with spaces, so we have to do some escaping work. Yuck.
define GluonCheckSite
[ -z "$$GLUONDIR" ] || sed -e 's/-@/\n/g' -e 's/+@/@/g' <<'END__GLUON__CHECK__SITE' | "$$GLUONDIR"/scripts/check_site.sh
$(shell cat $(1) | sed -ne '1h; 1!H; $$ {g; s/@/+@/g; s/\n/-@/g; p}')
[ -z "$$IPKG_INSTROOT" ] || sed -e 's/-@/\n/g' -e 's/+@/@/g' <<'END__GLUON__CHECK__SITE' | "${TOPDIR}/staging_dir/hostpkg/bin/lua" -e 'dofile()'
local f = assert(io.open(os.getenv('IPKG_INSTROOT') .. '/lib/gluon/site.json'))
local site_json = f:read('*a')
f:close()
site = require('cjson').decode(site_json)
$(shell cat '$(TOPDIR)/../scripts/check_site_lib.lua' '$(1)' | sed -ne '1h; 1!H; $$ {g; s/@/+@/g; s/\n/-@/g; p}')
END__GLUON__CHECK__SITE
endef
......@@ -41,9 +46,7 @@ define GluonSrcDiet
rm -rf $(2)
$(CP) $(1) $(2)
$(FIND) $(2) -type f | while read src; do \
if $(STAGING_DIR_HOST)/bin/lua $(STAGING_DIR_HOST)/bin/LuaSrcDiet \
--noopt-binequiv -o "$$$$src.o" "$$$$src"; \
then \
if LuaSrcDiet --noopt-binequiv -o "$$$$src.o" "$$$$src"; then \
chmod $$$$(stat -c%a "$$$$src") "$$$$src.o"; \
mv "$$$$src.o" "$$$$src"; \
fi; \
......
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 5f572e9d7475e807ea56713ee2069dc98f5c1f6b..80c1b05937410cb9fce20e7b759577480cf390e7 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 5cfbdeba5138c4362f82b7ae86b910a1f41f082a..fee7c6ce8fca6160a7055a8ccb9c0ebd0759032b 100644
--- a/include/host-build.mk
+++ b/include/host-build.mk
@@ -115,7 +115,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
......@@ -6,27 +6,38 @@ This conflicts with our reset button usage.
diff --git a/package/base-files/files/etc/rc.button/reset b/package/base-files/files/etc/rc.button/reset
deleted file mode 100755
index 3e241460efbb08abaa775c1a7843b5fa3e237d44..0000000000000000000000000000000000000000
index 4265767437e8eda3c758fe7f7941d7f608c95782..0000000000000000000000000000000000000000
--- a/package/base-files/files/etc/rc.button/reset
+++ /dev/null
@@ -1,20 +0,0 @@
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-[ "${ACTION}" = "released" ] || exit 0
-
-. /lib/functions.sh
-
-logger "$BUTTON pressed for $SEEN seconds"
-OVERLAY="$( grep ' /overlay ' /proc/mounts )"
-
-case "$ACTION" in
-pressed)
- [ -z "$OVERLAY" ] && return 0
-
- return 5
-;;
-timeout)
- . /etc/diag.sh
- set_state failsafe
-;;
-released)
- if [ "$SEEN" -lt 1 ]
- then
- echo "REBOOT" > /dev/console
- sync
- reboot
-elif [ "$SEEN" -gt 5 ]
- elif [ "$SEEN" -gt 5 -a -n "$OVERLAY" ]
- then
- echo "FACTORY RESET" > /dev/console
- jffs2reset -y && reboot &
- fi
-;;
-esac
-
-return 0
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: Sat, 26 Jul 2014 06:10:23 +0200
Subject: tools/Makefile: fix host tools build dependencies
diff --git a/tools/Makefile b/tools/Makefile
index d2fe2ffddf4b7207a937ca75efe1c2728e8067aa..c6cded8eccd81c422f99e7ee50754c4bc66decc7 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -95,10 +95,16 @@ define PrepareStaging
endef
# preparatory work
+ifneq ($(ARCH),)
+staging_prepared = $(STAGING_DIR)/.prepared
+
$(STAGING_DIR)/.prepared: $(TMP_DIR)/.build
$(call PrepareStaging,$(STAGING_DIR))
mkdir -p $(BUILD_DIR)/stamp
touch $@
+else
+staging_prepared :=
+endif
$(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
$(call PrepareStaging,$(STAGING_DIR_HOST))
@@ -110,8 +116,8 @@ $(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
endif
-$(curdir)//prepare = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared
-$(curdir)//compile = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared
+$(curdir)//prepare = $(staging_prepared) $(STAGING_DIR_HOST)/.prepared
+$(curdir)//compile = $(staging_prepared) $(STAGING_DIR_HOST)/.prepared
# prerequisites for the individual targets
$(curdir)/ := .config prereq
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Tue, 17 Jan 2017 22:08:21 +0100
Subject: odhcp6c: backport from LEDE 0d49f9f4b4da9d1960f82e68ae797290e4b9c434
diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile
index 3705705f6540dc841c7041e81f6d208a41a1f08a..a8e45588a52859daf14c68c665a53690b9d09be2 100644
--- a/package/network/ipv6/odhcp6c/Makefile
+++ b/package/network/ipv6/odhcp6c/Makefile
@@ -8,15 +8,16 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=odhcp6c
-PKG_VERSION:=2016-02-08
+PKG_VERSION:=2017-01-07
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_URL:=https://github.com/openwrt/odhcp6c.git
+PKG_SOURCE_URL:=git://git.lede-project.org/project/odhcp6c.git
PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=dc186d6d2b0dd4ad23ca5fc69c00e81f796ff6d9
-PKG_MAINTAINER:=Steven Barth <steven@midlink.org>
+PKG_SOURCE_VERSION:=d420f49396c627ce1072b83170889baf0720bc8b
+PKG_MIRROR_HASH:=a7c599b5600b6cca9aec221dd32fc7754e0e942b0192bd902f1e789f53345127
+PKG_MAINTAINER:=Hans Dedecker <dedeckeh@gmail.com>
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
@@ -30,7 +31,7 @@ define Package/odhcp6c
SECTION:=net
CATEGORY:=Network
TITLE:=Embedded DHCPv6-client for OpenWrt
- DEPENDS:=+kmod-ipv6
+ DEPENDS:=@IPV6 +libubox
endef
define Package/odhcp6c/config
diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script
index 677d35f4f92e82d6a7fe9ca01a35e071097baca8..1bb5e771b6dc80c1f5bceef88508d92cc69b1d3a 100755
--- a/package/network/ipv6/odhcp6c/files/dhcpv6.script
+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script
@@ -77,6 +77,11 @@ setup_interface () {
-z "$RA_DNS" -a "$FAKE_ROUTES" = 1 ]; then
RA_ROUTES="::/0,$SERVER,$valid,4096"
fi
+
+ # RFC 7278
+ if [ "$mask" -eq 64 -a -z "$PREFIXES" -a -n "$EXTENDPREFIX" ]; then
+ proto_add_ipv6_prefix "$addr/$mask,$preferred,$valid"
+ fi
done
for entry in $RA_ROUTES; do
@@ -180,7 +185,7 @@ setup_interface () {
# Apply IPv6 / ND configuration
HOPLIMIT=$(cat /proc/sys/net/ipv6/conf/$device/hop_limit)
[ -n "$RA_HOPLIMIT" -a -n "$HOPLIMIT" ] && [ "$RA_HOPLIMIT" -gt "$HOPLIMIT" ] && echo "$RA_HOPLIMIT" > /proc/sys/net/ipv6/conf/$device/hop_limit
- [ -n "$RA_MTU" ] && [ "$RA_MTU" -gt 0 ] && echo "$RA_MTU" > /proc/sys/net/ipv6/conf/$device/mtu
+ [ -n "$RA_MTU" ] && [ "$RA_MTU" -ge 1280 ] && echo "$RA_MTU" > /proc/sys/net/ipv6/conf/$device/mtu 2>/dev/null
[ -n "$RA_REACHABLE" ] && [ "$RA_REACHABLE" -gt 0 ] && echo "$RA_REACHABLE" > /proc/sys/net/ipv6/neigh/$device/base_reachable_time_ms
[ -n "$RA_RETRANSMIT" ] && [ "$RA_RETRANSMIT" -gt 0 ] && echo "$RA_RETRANSMIT" > /proc/sys/net/ipv6/neigh/$device/retrans_time_ms
@@ -209,6 +214,6 @@ case "$2" in
esac
# user rules
-[ -f /etc/odhcp6c.user ] && . /etc/odhcp6c.user
+[ -f /etc/odhcp6c.user ] && . /etc/odhcp6c.user "@"
exit 0
diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.sh b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
index 4a453fdc4d94d9298067a986b0e4c6054b6c0a60..9e3f6697335a55cf4be1751fec907a4ac93f09ec 100755
--- a/package/network/ipv6/odhcp6c/files/dhcpv6.sh
+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
@@ -13,6 +13,7 @@ proto_dhcpv6_init_config() {
proto_config_add_string 'reqopts:list(uinteger)'
proto_config_add_string 'noslaaconly:bool'
proto_config_add_string 'forceprefix:bool'
+ proto_config_add_string 'extendprefix:bool'
proto_config_add_string 'norelease:bool'
proto_config_add_string 'ip6prefix:ip6addr'
proto_config_add_string iface_dslite
@@ -29,14 +30,15 @@ proto_dhcpv6_init_config() {
proto_config_add_int "soltimeout"
proto_config_add_boolean fakeroutes
proto_config_add_boolean sourcefilter
+ proto_config_add_boolean keep_ra_dnslifetime
}
proto_dhcpv6_setup() {
local config="$1"
local iface="$2"
- local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter
- json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter
+ local reqaddress reqprefix clientid reqopts noslaaconly forceprefix extendprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter keep_ra_dnslifetime
+ json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix extendprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter keep_ra_dnslifetime
# Configure
@@ -60,6 +62,8 @@ proto_dhcpv6_setup() {
[ -n "$userclass" ] && append opts "-u$userclass"
+ [ "$keep_ra_dnslifetime" = "1" ] && append opts "-L"
+
for opt in $reqopts; do
append opts "-r$opt"
done
@@ -78,6 +82,7 @@ proto_dhcpv6_setup() {
[ -n "$zone" ] && proto_export "ZONE=$zone"
[ "$fakeroutes" != "0" ] && proto_export "FAKE_ROUTES=1"
[ "$sourcefilter" = "0" ] && proto_export "NOSOURCEFILTER=1"
+ [ "$extendprefix" = "1" ] && proto_export "EXTENDPREFIX=1"
proto_export "INTERFACE=$config"
proto_run_command "$config" odhcp6c \
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Fri, 5 Dec 2014 18:57:16 +0100
Subject: busybox: enable telnet only when root password is really empty, not when it is locked
diff --git a/package/utils/busybox/files/telnet b/package/utils/busybox/files/telnet
index a1d1cdf9b18d69895e7a08a8b1318f1ff591ea07..f95be90490597f6251d8c3e1247b522dfd9e72c0 100755
--- a/package/utils/busybox/files/telnet
+++ b/package/utils/busybox/files/telnet
@@ -11,7 +11,7 @@ has_root_pwd() {
pwd="${pwd#*root:}"
pwd="${pwd%%:*}"
- test -n "${pwd#[\!x]}"
+ test -n "${pwd}"
}
get_root_home() {
@@ -28,7 +28,7 @@ has_ssh_pubkey() {
start_service() {
if ( ! has_ssh_pubkey && \
- ! has_root_pwd /etc/passwd && ! has_root_pwd /etc/shadow ) || \
+ ( ! has_root_pwd /etc/passwd || ! has_root_pwd /etc/shadow ) ) || \
( ! /etc/init.d/dropbear enabled 2> /dev/null && ! /etc/init.d/sshd enabled 2> /dev/null );
then
procd_open_instance
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Tue, 19 Jul 2016 17:48:53 +0200
Subject: ar71xx: define wmac reset function for QCA955x
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Backport of LEDE a176168a85477caa44eef7e979567d1d52868fde
diff --git a/target/linux/ar71xx/patches-3.18/640-MIPS-ath79-add-QCA955x-wmac-reset.patch b/target/linux/ar71xx/patches-3.18/640-MIPS-ath79-add-QCA955x-wmac-reset.patch
new file mode 100644
index 0000000000000000000000000000000000000000..4ac5acd618748fc9ad0f091d110d2503cdc39d53
--- /dev/null
+++ b/target/linux/ar71xx/patches-3.18/640-MIPS-ath79-add-QCA955x-wmac-reset.patch
@@ -0,0 +1,71 @@
+--- a/arch/mips/ath79/common.h
++++ b/arch/mips/ath79/common.h
+@@ -19,6 +19,8 @@
+ #define ATH79_MEM_SIZE_MIN (2 * 1024 * 1024)
+ #define ATH79_MEM_SIZE_MAX (128 * 1024 * 1024)
+
++extern void __iomem *ath79_ddr_base;
++
+ void ath79_clocks_init(void);
+ unsigned long ath79_get_sys_clk_rate(const char *id);
+
+--- a/arch/mips/ath79/dev-wmac.c
++++ b/arch/mips/ath79/dev-wmac.c
+@@ -149,6 +149,27 @@ static void ar934x_wmac_setup(void)
+ ath79_wmac_data.is_clk_25mhz = true;
+ }
+
++static int ar955x_wmac_reset(void)
++{
++ int i;
++
++ /* Try to wait for WMAC DDR activity to stop */
++ for (i = 0; i < 10; i++) {
++ if (!(__raw_readl(ath79_ddr_base + QCA955X_DDR_CTL_CONFIG) &
++ QCA955X_DDR_CTL_CONFIG_ACT_WMAC))
++ break;
++
++ udelay(10);
++ }
++
++ ath79_device_reset_set(QCA955X_RESET_RTC);
++ udelay(10);
++ ath79_device_reset_clear(QCA955X_RESET_RTC);
++ udelay(10);
++
++ return 0;
++}
++
+ static void qca955x_wmac_setup(void)
+ {
+ u32 t;
+@@ -165,6 +186,8 @@ static void qca955x_wmac_setup(void)
+ ath79_wmac_data.is_clk_25mhz = false;
+ else
+ ath79_wmac_data.is_clk_25mhz = true;
++
++ ath79_wmac_data.external_reset = ar955x_wmac_reset;
+ }
+
+ static bool __init
+--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
++++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
+@@ -32,7 +32,7 @@
+ #define AR71XX_SPI_SIZE 0x01000000
+
+ #define AR71XX_DDR_CTRL_BASE (AR71XX_APB_BASE + 0x00000000)
+-#define AR71XX_DDR_CTRL_SIZE 0x100
++#define AR71XX_DDR_CTRL_SIZE 0x200
+ #define AR71XX_UART_BASE (AR71XX_APB_BASE + 0x00020000)
+ #define AR71XX_UART_SIZE 0x100
+ #define AR71XX_USB_CTRL_BASE (AR71XX_APB_BASE + 0x00030000)
+@@ -173,6 +173,9 @@
+ #define AR934X_DDR_REG_FLUSH_PCIE 0xa8
+ #define AR934X_DDR_REG_FLUSH_WMAC 0xac
+
++#define QCA955X_DDR_CTL_CONFIG 0x108
++#define QCA955X_DDR_CTL_CONFIG_ACT_WMAC BIT(23)
++
+ /*
+ * PLL block
+ */
This diff is collapsed.
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 20 May 2015 23:15:20 +0200
Subject: iwinfo: update NanoStation (Loco) txpower offsets
diff --git a/package/network/utils/iwinfo/patches/001-update_nanostation_offsets.patch b/package/network/utils/iwinfo/patches/001-update_nanostation_offsets.patch
new file mode 100644
index 0000000000000000000000000000000000000000..1e13570fc2b585a8e33275116370f5438c899633
--- /dev/null
+++ b/package/network/utils/iwinfo/patches/001-update_nanostation_offsets.patch
@@ -0,0 +1,14 @@
+--- a/hardware.txt
++++ b/hardware.txt
+@@ -42,8 +42,9 @@
+ 0x168c 0x0027 0x0777 0x4082 7 0 "Ubiquiti" "SR71"
+ 0x168c 0x0029 0x0777 0x4005 7 0 "Ubiquiti" "SR71-15"
+ 0x168c 0x002a 0x0777 0xe302 12 0 "Ubiquiti" "PicoStation M2" /* ToDo: confirm offset */
+-0x168c 0x002a 0x0777 0xe012 12 0 "Ubiquiti" "NanoStation M2" /* ToDo: confirm offset */
+-0x168c 0x002a 0x0777 0xe005 5 0 "Ubiquiti" "NanoStation M5" /* ToDo: confirm offset */
++0x168c 0x002a 0x0777 0xe012 11 0 "Ubiquiti" "NanoStation M2"
++0x168c 0x002e 0x0777 0xe0a2 8 0 "Ubiquiti" "NanoStation Loco M2"
++0x168c 0x002a 0x0777 0xe005 16 0 "Ubiquiti" "NanoStation M5"
+ 0x168c 0x002a 0x0777 0xe202 12 0 "Ubiquiti" "Bullet M2"
+ 0x168c 0x002a 0x0777 0xe805 5 0 "Ubiquiti" "Bullet M5"
+ 0x168c 0x002a 0x0777 0xe345 0 0 "Ubiquiti" "WispStation M5" /* ToDo: confirm offset */
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Mon, 2 Nov 2015 02:02:02 +0100
Subject: ipv6: fix crash on ICMPv6 redirects with prohibited/blackholed source
There are other error values besides ip6_null_entry that can be returned by
ip6_route_redirect(): fib6_rule_action() can also result in
ip6_blk_hole_entry and ip6_prohibit_entry if such ip rules are installed.
Only checking for ip6_null_entry in rt6_do_redirect() causes ip6_ins_rt()
to be called with rt->rt6i_table == NULL in these cases, making the kernel
crash.
diff --git a/target/linux/generic/patches-3.18/672-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch b/target/linux/generic/patches-3.18/672-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch
new file mode 100644
index 0000000000000000000000000000000000000000..6e4b3da3ad820e789f57df71b33ccfc5eaead01e
--- /dev/null
+++ b/target/linux/generic/patches-3.18/672-ipv6-fix-crash-on-ICMPv6-redirects-with-prohibited-blackholed-source.patch
@@ -0,0 +1,39 @@
+From 7426eb388ade0f1ad800c408d7efa227d4f41408 Mon Sep 17 00:00:00 2001
+Message-Id: <7426eb388ade0f1ad800c408d7efa227d4f41408.1446425986.git.mschiffer@universe-factory.net>
+From: Matthias Schiffer <mschiffer@universe-factory.net>
+Date: Mon, 2 Nov 2015 01:05:15 +0100
+Subject: [PATCH] ipv6: fix crash on ICMPv6 redirects with
+ prohibited/blackholed source
+
+There are other error values besides ip6_null_entry that can be returned by
+ip6_route_redirect(): fib6_rule_action() can also result in
+ip6_blk_hole_entry and ip6_prohibit_entry if such ip rules are installed.
+
+Only checking for ip6_null_entry in rt6_do_redirect() causes ip6_ins_rt()
+to be called with rt->rt6i_table == NULL in these cases, making the kernel
+crash.
+
+Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
+---
+ net/ipv6/route.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/net/ipv6/route.c
++++ b/net/ipv6/route.c
+@@ -1766,7 +1766,6 @@ static int ip6_route_del(struct fib6_con
+
+ static void rt6_do_redirect(struct dst_entry *dst, struct sock *sk, struct sk_buff *skb)
+ {
+- struct net *net = dev_net(skb->dev);
+ struct netevent_redirect netevent;
+ struct rt6_info *rt, *nrt = NULL;
+ struct ndisc_options ndopts;
+@@ -1827,7 +1826,7 @@ static void rt6_do_redirect(struct dst_e
+ }
+
+ rt = (struct rt6_info *) dst;
+- if (rt == net->ipv6.ip6_null_entry) {
++ if (rt->rt6i_flags & RTF_REJECT) {
+ net_dbg_ratelimited("rt6_redirect: source isn't a valid nexthop for redirect target\n");
+ return;
+ }
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Tue, 29 Dec 2015 22:48:52 +0100
Subject: lua: fix installation of headers for host build
diff --git a/package/utils/lua/Makefile b/package/utils/lua/Makefile
index 72d56316b45dc484888d219aebd98e651edbe415..c37d99b485d58d955b86a033ea776adb54cfa414 100644
--- a/package/utils/lua/Makefile
+++ b/package/utils/lua/Makefile
@@ -140,6 +140,7 @@ define Host/Install
$(MAKE) -C $(HOST_BUILD_DIR) \
INSTALL_TOP="$(STAGING_DIR_HOST)" \
install
+ $(CP) $(HOST_BUILD_DIR)/src/lnum_config.h $(STAGING_DIR_HOST)/include/
endef
define Build/InstallDev
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Mon, 4 Jan 2016 10:22:52 +0100
Subject: kernel: fs, seq_file: fallback to vmalloc instead of oom kill processes
diff --git a/target/linux/generic/patches-3.18/089-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-.patch b/target/linux/generic/patches-3.18/089-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-.patch
new file mode 100644
index 0000000000000000000000000000000000000000..cad56f4275287b73dd5e769ea34daee064ee8d69
--- /dev/null
+++ b/target/linux/generic/patches-3.18/089-fs-seq_file-fallback-to-vmalloc-instead-of-oom-kill-.patch
@@ -0,0 +1,53 @@
+From 5cec38ac866bfb8775638e71a86e4d8cac30caae Mon Sep 17 00:00:00 2001
+Message-Id: <5cec38ac866bfb8775638e71a86e4d8cac30caae.1451899087.git.mschiffer@universe-factory.net>
+From: David Rientjes <rientjes@google.com>
+Date: Fri, 12 Dec 2014 16:56:16 -0800
+Subject: [PATCH] fs, seq_file: fallback to vmalloc instead of oom kill
+ processes
+
+Since commit 058504edd026 ("fs/seq_file: fallback to vmalloc allocation"),
+seq_buf_alloc() falls back to vmalloc() when the kmalloc() for contiguous
+memory fails. This was done to address order-4 slab allocations for
+reading /proc/stat on large machines and noticed because
+PAGE_ALLOC_COSTLY_ORDER < 4, so there is no infinite loop in the page
+allocator when allocating new slab for such high-order allocations.
+
+Contiguous memory isn't necessary for caller of seq_buf_alloc(), however.
+Other GFP_KERNEL high-order allocations that are <=
+PAGE_ALLOC_COSTLY_ORDER will simply loop forever in the page allocator and
+oom kill processes as a result.
+
+We don't want to kill processes so that we can allocate contiguous memory
+in situations when contiguous memory isn't necessary.
+
+This patch does the kmalloc() allocation with __GFP_NORETRY for high-order
+allocations. This still utilizes memory compaction and direct reclaim in
+the allocation path, the only difference is that it will fail immediately
+instead of oom kill processes when out of memory.
+
+[akpm@linux-foundation.org: add comment]
+Signed-off-by: David Rientjes <rientjes@google.com>
+Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
+Cc: Christoph Hellwig <hch@infradead.org>
+Cc: Al Viro <viro@zeniv.linux.org.uk>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+---
+ fs/seq_file.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/fs/seq_file.c
++++ b/fs/seq_file.c
+@@ -36,7 +36,11 @@ static void *seq_buf_alloc(unsigned long
+ {
+ void *buf;
+
+- buf = kmalloc(size, GFP_KERNEL | __GFP_NOWARN);
++ /*
++ * __GFP_NORETRY to avoid oom-killings with high-order allocations -
++ * it's better to fall back to vmalloc() than to kill things.
++ */
++ buf = kmalloc(size, GFP_KERNEL | __GFP_NORETRY | __GFP_NOWARN);
+ if (!buf && size > PAGE_SIZE)
+ buf = vmalloc(size);
+ return buf;
From: Neal Oakey <neal.oakey@bingo-ev.de>
Date: Sun, 14 Feb 2016 20:58:20 +0100
Subject: fix UBNT XM model detection
Signed-off-by: Neal Oakey <neal.oakey@bingo-ev.de>
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index a9dca58847fe1fb62a69c5845fda3206407c6727..0aa1c865cbdeb0624147d4117d289a640d20a5ef 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -64,6 +64,40 @@ wndr3700_board_detect() {
AR71XX_MODEL="$machine"
}
+ubnt_get_mtd_part_magic() {
+ ar71xx_get_mtd_offset_size_format EEPROM 4118 2 %02x
+}
+
+ubnt_xm_board_detect() {
+ local model
+ local magic
+
+ magic="$(ubnt_get_mtd_part_magic)"
+ case ${magic:0:3} in
+ "e00"|\
+ "e01"|\
+ "e80")
+ model="Ubiquiti NanoStation M"
+ ;;
+ "e0a")
+ model="Ubiquiti NanoStation loco M"
+ ;;
+ "e1b"|\
+ "e1d")
+ model="Ubiquiti Rocket M"
+ ;;
+ "e20"|\
+ "e2d")
+ model="Ubiquiti Bullet M"
+ ;;
+ "e30")
+ model="Ubiquiti PicoStation M"
+ ;;
+ esac
+
+ [ ! -z "$model" ] && AR71XX_MODEL="${model}${magic:3:1}"
+}
+
cybertan_get_hw_magic() {
local part
@@ -478,12 +512,14 @@ ar71xx_board_detect() {
;;
*"Bullet M")
name="bullet-m"
+ ubnt_xm_board_detect
;;
*"Loco M XW")
name="loco-m-xw"
;;
*"Nanostation M")
name="nanostation-m"
+ ubnt_xm_board_detect
;;
*"Nanostation M XW")
name="nanostation-m-xw"
@@ -685,6 +721,7 @@ ar71xx_board_detect() {
;;
*"Rocket M")
name="rocket-m"
+ ubnt_xm_board_detect
;;
*"Rocket M XW")
name="rocket-m-xw"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment