Disabling br-lan

2020-08-14 Thread Shalla Thakur

Hi,

I see that with default configuration, openwrt always creates a bridge 
br-lan. I am running openwrt on virtualbox and am assigning only one 
interface to it. I don't want the bridge to be created by default. The 
interface should take IP configuration via dhcp.


Currently, after boot up, I do "uci set network.lan.type=''; uci set 
network.lan.proto='dhcp'". But I have to do it everytime I attach a vdi 
to the virtual machine.


Can I disable brige and all the zones completely during build time?

--
Regards
Shalla

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] options: fix parsing of boolean attributes

2020-08-14 Thread remi . nguyenvan
From: Remi NGUYEN VAN 

Boolean attributes were parsed the same way as string attributes,
so a value of { "bool_attr": "true" } would be parsed correctly, but
{ "bool_attr": true } (without quotes) was parsed as false.

Fixes FS#3284

Signed-off-by: Remi NGUYEN VAN 
---
 options.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/options.c b/options.c
index aed0cfb..6131786 100644
--- a/options.c
+++ b/options.c
@@ -1170,6 +1170,9 @@ fw3_parse_blob_options(void *s, const struct fw3_option 
*opts,
if (blobmsg_type(e) == 
BLOBMSG_TYPE_INT32) {
snprintf(buf, 
sizeof(buf), "%d", blobmsg_get_u32(e));
v = buf;
+   } else if (blobmsg_type(o) == 
BLOBMSG_TYPE_BOOL) {
+   snprintf(buf, 
sizeof(buf), "%d", blobmsg_get_bool(o));
+   v = buf;
} else {
v = 
blobmsg_get_string(e);
}
@@ -1189,6 +1192,9 @@ fw3_parse_blob_options(void *s, const struct fw3_option 
*opts,
if (blobmsg_type(o) == BLOBMSG_TYPE_INT32) {
snprintf(buf, sizeof(buf), "%d", 
blobmsg_get_u32(o));
v = buf;
+   } else if (blobmsg_type(o) == 
BLOBMSG_TYPE_BOOL) {
+   snprintf(buf, sizeof(buf), "%d", 
blobmsg_get_bool(o));
+   v = buf;
} else {
v = blobmsg_get_string(o);
}
-- 
2.28.0.220.ged08abb693-goog


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 2/3] uClibc-ng: refresh config and remove several legacy options

2020-08-14 Thread Rosen Penev
SUSV3_LEGACY_MACROS are completely unused since SUSV3_LEGACY is enabled

HAS_OBSOLETE_BSD_SIGNAL is completely deprecated functionality.

HAS_BSD_RES_CLOSE is completely deprecated functionality.

HAS_FTW is deprecated SUSV4 functionality. Saves ~4.5kb.

Signed-off-by: Rosen Penev 
---
 toolchain/uClibc/config/arc   |  2 --
 toolchain/uClibc/config/archs |  2 --
 toolchain/uClibc/config/arm   |  2 --
 toolchain/uClibc/config/armeb |  2 --
 toolchain/uClibc/config/common| 35 +++
 toolchain/uClibc/config/i386  | 13 --
 toolchain/uClibc/config/i686  | 13 --
 toolchain/uClibc/config/m68k  |  1 -
 toolchain/uClibc/config/mips  |  8 --
 toolchain/uClibc/config/mips64|  8 --
 toolchain/uClibc/config/mips64.32 |  8 --
 toolchain/uClibc/config/mips64.64 |  8 --
 toolchain/uClibc/config/mips64.n32|  8 --
 toolchain/uClibc/config/mips64el  |  8 --
 toolchain/uClibc/config/mips64el.32   |  8 --
 toolchain/uClibc/config/mips64el.64   |  8 --
 toolchain/uClibc/config/mips64el.n32  |  8 --
 toolchain/uClibc/config/mipsel|  8 --
 toolchain/uClibc/config/mipsel.cobalt |  8 --
 toolchain/uClibc/config/sparc |  2 --
 toolchain/uClibc/config/sparc.leon|  2 --
 toolchain/uClibc/config/x86_64|  1 -
 22 files changed, 4 insertions(+), 159 deletions(-)

diff --git a/toolchain/uClibc/config/arc b/toolchain/uClibc/config/arc
index de1ffc4415..f92328b7ed 100644
--- a/toolchain/uClibc/config/arc
+++ b/toolchain/uClibc/config/arc
@@ -3,8 +3,6 @@ ARCH_LITTLE_ENDIAN=y
 ARCH_WANTS_LITTLE_ENDIAN=y
 TARGET_ARCH="arc"
 TARGET_arc=y
-CONFIG_ARC_CPU_700=y
-# CONFIG_ARC_CPU_HS is not set
 CONFIG_ARC_PAGE_SIZE_8K=y
 # CONFIG_ARC_PAGE_SIZE_16K is not set
 # CONFIG_ARC_PAGE_SIZE_4K is not set
diff --git a/toolchain/uClibc/config/archs b/toolchain/uClibc/config/archs
index 961628ed8c..f92328b7ed 100644
--- a/toolchain/uClibc/config/archs
+++ b/toolchain/uClibc/config/archs
@@ -3,8 +3,6 @@ ARCH_LITTLE_ENDIAN=y
 ARCH_WANTS_LITTLE_ENDIAN=y
 TARGET_ARCH="arc"
 TARGET_arc=y
-# CONFIG_ARC_CPU_700 is not set
-CONFIG_ARC_CPU_HS=y
 CONFIG_ARC_PAGE_SIZE_8K=y
 # CONFIG_ARC_PAGE_SIZE_16K is not set
 # CONFIG_ARC_PAGE_SIZE_4K is not set
diff --git a/toolchain/uClibc/config/arm b/toolchain/uClibc/config/arm
index 41a60b1c38..9544f144d1 100644
--- a/toolchain/uClibc/config/arm
+++ b/toolchain/uClibc/config/arm
@@ -1,9 +1,7 @@
 ARCH_ANY_ENDIAN=y
 ARCH_LITTLE_ENDIAN=y
 ARCH_WANTS_LITTLE_ENDIAN=y
-# COMPILE_IN_THUMB_MODE is not set
 TARGET_ARCH="arm"
 TARGET_arm=y
-# USE_BX is not set
 CONFIG_ARM_EABI=y
 
diff --git a/toolchain/uClibc/config/armeb b/toolchain/uClibc/config/armeb
index 2e46dd67d9..e329c7e369 100644
--- a/toolchain/uClibc/config/armeb
+++ b/toolchain/uClibc/config/armeb
@@ -1,9 +1,7 @@
 ARCH_ANY_ENDIAN=y
 ARCH_BIG_ENDIAN=y
 ARCH_WANTS_BIG_ENDIAN=y
-# COMPILE_IN_THUMB_MODE is not set
 TARGET_ARCH="arm"
 TARGET_arm=y
-# USE_BX is not set
 CONFIG_ARM_EABI=y
 
diff --git a/toolchain/uClibc/config/common b/toolchain/uClibc/config/common
index b679c0a1ec..d88d5bf473 100644
--- a/toolchain/uClibc/config/common
+++ b/toolchain/uClibc/config/common
@@ -7,13 +7,11 @@ ARCH_USE_MMU=y
 # ARCH_WANTS_BIG_ENDIAN is not set
 # ARCH_WANTS_LITTLE_ENDIAN is not set
 ASSUME_DEVPTS=y
-# COMPAT_ATEXIT is not set
 CROSS_COMPILER_PREFIX=""
 DEVEL_PREFIX="/usr/"
 # DOASSERTS is not set
 # DODEBUG is not set
 # DODEBUG_PT is not set
-# DOMULTI is not set
 DOPIC=y
 DOSTRIP=y
 DO_C99_MATH=y
@@ -33,7 +31,6 @@ LDSO_CACHE_SUPPORT=y
 # LDSO_GNU_HASH_SUPPORT is not set
 LDSO_LD_LIBRARY_PATH=y
 LDSO_LDD_SUPPORT=y
-# LDSO_NO_CLEANUP is not set
 # LDSO_PRELINK_SUPPORT is not set
 # LDSO_PRELOAD_FILE_SUPPORT is not set
 LDSO_PRELOAD_ENV_SUPPORT=y
@@ -42,12 +39,9 @@ LDSO_SAFE_RUNPATH=y
 # LDSO_RUNPATH_OF_EXECUTABLE is not set
 # LDSO_SEARCH_INTERP_PATH is not set
 # LDSO_STANDALONE_SUPPORT is not set
-# LINUXTHREADS_NEW is not set
-# LINUXTHREADS_OLD is not set
 # UCLIBC_HAS_BACKTRACE is not set
 UCLIBC_HAS_THREADS_NATIVE=y
 # MALLOC is not set
-MALLOC_GLIBC_COMPAT=y
 # MALLOC_SIMPLE is not set
 MALLOC_STANDARD=y
 MULTILIB_DIR="lib"
@@ -63,12 +57,10 @@ TARGET_SUBARCH=""
 # TARGET_bfin is not set
 # TARGET_c6x is not set
 # TARGET_cris is not set
-# TARGET_e1 is not set
 # TARGET_frv is not set
 # TARGET_h8300 is not set
 # TARGET_hppa is not set
 # TARGET_i386 is not set
-# TARGET_i960 is not set
 # TARGET_ia64 is not set
 # TARGET_lm32 is not set
 # TARGET_m68k is not set
@@ -80,10 +72,7 @@ TARGET_SUBARCH=""
 # TARGET_or1k is not set
 # TARGET_powerpc is not set
 # TARGET_sh is not set
-# TARGET_sh64 is not set
 # TARGET_sparc is not set
-# TARGET_v850 is not set
-# TARGET_vax is not set
 # TARGET_x86_64 is not set
 # TARGET_xtensa is not set
 UCLIBC_BSD_SPECIFIC=y
@@ -96,10 +85,9 @@ UCLIBC_DYNAMIC_ATEXIT=y
 UCLIBC_EXTRA_CFLAGS=""
 UCLIBC_GRP_BUFFER_SIZE=256
 UCLIBC_HAS_ADVANCED_REAL

[PATCH 1/3] uClibc-ng: update package from 1.0.31 to 1.0.34

2020-08-14 Thread Rosen Penev
From: Donald Hoskins 

Update package from 1.0.31 to 1.0.34

Tested mips64/octeonplus/octeon3
Build against: OpenWrt SNAPSHOT r13871-546e140382 / LuCI Master 
git-20.186.79919-0c47989
Build Kernel: 5.4.51

Signed-off-by: Donald Hoskins 
---
 toolchain/uClibc/common.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/toolchain/uClibc/common.mk b/toolchain/uClibc/common.mk
index a79a838be4..bb093b1dc7 100644
--- a/toolchain/uClibc/common.mk
+++ b/toolchain/uClibc/common.mk
@@ -7,7 +7,7 @@
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/target.mk
 
-PKG_VERSION:=1.0.31
+PKG_VERSION:=1.0.34
 PKG_RELEASE:=1
 
 PKG_NAME:=uClibc-ng
@@ -17,7 +17,7 @@ CONFIG_DIR:=$(PATH_PREFIX)/config
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 LIBC_SO_VERSION:=$(PKG_VERSION)
 
-PKG_HASH:=2215d7377118434d1697fd575f10d7a6be3f29e460d6b0e1ee9f6f5306288060
+PKG_HASH:=e6776229eee8d3f5a1cd29fb4286630e3cb9e97dded4e8f4a3a9bb4fa8c0d5e3
 
 HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION)
 
-- 
2.26.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 3/3] toolchain: remove BROKEN from uClibc-ng

2020-08-14 Thread Rosen Penev
uClibc-ng works fine. Additionally, most packages have been fixed to
compile with uClibc-ng.

Signed-off-by: Rosen Penev 
---
 toolchain/Config.in | 1 -
 1 file changed, 1 deletion(-)

diff --git a/toolchain/Config.in b/toolchain/Config.in
index cb557d4ad3..b1f7b1e5d6 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -250,7 +250,6 @@ choice
config LIBC_USE_UCLIBC
select USE_UCLIBC
bool "Use uClibc"
-   depends on BROKEN || arc
 
config LIBC_USE_MUSL
select USE_MUSL
-- 
2.26.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[RFC PATCH] openvpn: update to 2.5 beta1

2020-08-14 Thread Magnus Kroken
New features:
* Per client tls-crypt keys
* ChaCha20-Poly1305 can be used to encrypt the data channel
* Routes are added/removed via Netlink instead of ifconfig/route
  (unless iproute2 support is enabled).
* VLAN support when using a TAP device

Significant changes:
* Server support can no longer be disabled.
* Crypto support can no longer be disabled, remove nossl variant.
* Blowfish (BF-CBC) is no longer implicitly the default cipher.
  OpenVPN peers prior to 2.4, or peers with data cipher negotiation
  disabled, will not be able to connect to a 2.5 peer unless
  option data_fallback_ciphers is set on the 2.5 peer and it contains a
  cipher supported by the client.

Signed-off-by: Magnus Kroken 
---
Compile-tested mbedtls and openssl variants on mips_24kc and
arm_cortex-a9. Runtime-tested mbedtls variant as server and openssl as
client.

Hopefully more people will test this and give feedback, I'd suggest
merging this later in the release cycle or at 2.5.0 release.

I propose disabling LZO compression support by default, due to:
* Compression is not recommended, as it may weaken the security of the
  connection
* For users who need compression, we build with LZ4 support by default
* LZO in OpenVPN pulls in liblzo at approx. 32 kB. LZO support also
  adds about 1 kB to the OpenVPN package itself. LZ4 support (using OpenVPN
  bundled LZ4) adds about 6 kB to the OpenVPN package in total.

This means OpenWrt users will not be able to connect to OpenVPN peers 
that require LZO compression, unless they build the package themselves.

I left the PROVIDES line as "openvpn openvpn-crypto". As the nossl variant 
will no longer exist and all OpenVPN packages will cover both cases 
I am not entirely sure how this should be handled.

 .../services/openvpn/Config-mbedtls.in|  6 +-
 .../network/services/openvpn/Config-nossl.in  | 50 --
 .../services/openvpn/Config-openssl.in|  6 +-
 package/network/services/openvpn/Makefile | 20 +-
 .../services/openvpn/files/openvpn.config | 67 ---
 .../services/openvpn/files/openvpn.options| 14 +++-
 .../001-reproducible-remove_DATE.patch|  6 +-
 ...bedtls-disable-runtime-version-check.patch |  2 +-
 ...l-dont-use-deprecated-ssleay-symbols.patch | 58 
 ...enssl-add-missing-include-statements.patch | 65 --
 .../210-build_always_use_internal_lz4.patch   |  2 +-
 .../openvpn/patches/220-disable_des.patch | 21 ++
 12 files changed, 72 insertions(+), 245 deletions(-)
 delete mode 100644 package/network/services/openvpn/Config-nossl.in
 delete mode 100644 
package/network/services/openvpn/patches/110-openssl-dont-use-deprecated-ssleay-symbols.patch
 delete mode 100644 
package/network/services/openvpn/patches/111-openssl-add-missing-include-statements.patch

diff --git a/package/network/services/openvpn/Config-mbedtls.in 
b/package/network/services/openvpn/Config-mbedtls.in
index beac492022..3cf233b8f7 100644
--- a/package/network/services/openvpn/Config-mbedtls.in
+++ b/package/network/services/openvpn/Config-mbedtls.in
@@ -2,16 +2,12 @@ if PACKAGE_openvpn-mbedtls
 
 config OPENVPN_mbedtls_ENABLE_LZO
bool "Enable LZO compression support"
-   default y
+   default n
 
 config OPENVPN_mbedtls_ENABLE_LZ4
bool "Enable LZ4 compression support"
default y
 
-config OPENVPN_mbedtls_ENABLE_SERVER
-   bool "Enable server support (otherwise only client mode is support)"
-   default y
-
 #config OPENVPN_mbedtls_ENABLE_EUREPHIA
 #  bool "Enable support for the eurephia plug-in"
 #  default n
diff --git a/package/network/services/openvpn/Config-nossl.in 
b/package/network/services/openvpn/Config-nossl.in
deleted file mode 100644
index 79140ad5d1..00
--- a/package/network/services/openvpn/Config-nossl.in
+++ /dev/null
@@ -1,50 +0,0 @@
-if PACKAGE_openvpn-nossl
-
-config OPENVPN_nossl_ENABLE_LZO
-   bool "Enable LZO compression support"
-   default y
-
-config OPENVPN_nossl_ENABLE_LZ4
-   bool "Enable LZ4 compression support"
-   default y
-
-config OPENVPN_nossl_ENABLE_SERVER
-   bool "Enable server support (otherwise only client mode is support)"
-   default y
-
-config OPENVPN_nossl_ENABLE_MANAGEMENT
-   bool "Enable management server support"
-   default n
-
-config OPENVPN_nossl_ENABLE_FRAGMENT
-   bool "Enable internal fragmentation support (--fragment)"
-   default y
-
-config OPENVPN_nossl_ENABLE_MULTIHOME
-   bool "Enable multi-homed UDP server support (--multihome)"
-   default y
-
-config OPENVPN_nossl_ENABLE_PORT_SHARE
-   bool "Enable TCP server port-share support (--port-share)"
-   default y
-
-config OPENVPN_nossl_ENABLE_DEF_AUTH
-   bool "Enable deferred authentication"
-   default y
-
-config OPENVPN_nossl_ENABLE_PF
-   bool "Enable internal packet filter"
-   default y
-
-config OPENVPN_nossl_ENABLE_IPROUTE2
-   bool "Enable support for iproute2"
-   

[PATCH v2 1/4] build: Fix Shellcheck for get_source_date_epoch.sh

2020-08-14 Thread Paul Spooren
If a `cd` to `TOPDIR` fails the script should quit.

Also unify `try_mtime` function by storing it in a variable.

Signed-off-by: Paul Spooren 
---
 scripts/get_source_date_epoch.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/get_source_date_epoch.sh b/scripts/get_source_date_epoch.sh
index 84ba445454..bd3384a761 100755
--- a/scripts/get_source_date_epoch.sh
+++ b/scripts/get_source_date_epoch.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 export LANG=C
 export LC_ALL=C
-[ -n "$TOPDIR" ] && cd $TOPDIR
+[ -n "$TOPDIR" ] && (cd "$TOPDIR" || exit 1)
 
 try_version() {
[ -f version.date ] || return 1
@@ -22,7 +22,7 @@ try_hg() {
 }
 
 try_mtime() {
-   perl -e 'print((stat $ARGV[0])[9])' "$0"
+   SOURCE_DATE_EPOCH=$(perl -e 'print((stat $ARGV[0])[9])' "$0")
[ -n "$SOURCE_DATE_EPOCH" ]
 }
 
-- 
2.25.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 4/4] build: store SourceDateEpoch in manifest

2020-08-14 Thread Paul Spooren
The usage of granular `SOURCE_DATE_EPOCH` for packages is an
incrementing integer which could be useful for downstream tooling,
therefore add it to the packages manifest.

Signed-off-by: Paul Spooren 
---
 include/package-ipkg.mk | 1 +
 package/Makefile| 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk
index 6cdc6fa312..b4356848d6 100644
--- a/include/package-ipkg.mk
+++ b/include/package-ipkg.mk
@@ -185,6 +185,7 @@ $$(call addfield,Depends,$$(Package/$(1)/DEPENDS)
 )$$(call addfield,LicenseFiles,$(LICENSE_FILES)
 )$$(call addfield,Section,$(SECTION)
 )$$(call addfield,Require-User,$(USERID)
+)$$(call addfield,SourceDateEpoch,$(shell 
$(TOPDIR)/scripts/get_source_date_epoch.sh $(SOURCE))
 )$(if $(PKG_CPE_ID),CPE-ID: $(PKG_CPE_ID)
 )$(if $(filter hold,$(PKG_FLAGS)),Status: unknown hold not-installed
 )$(if $(filter essential,$(PKG_FLAGS)),Essential: yes
diff --git a/package/Makefile b/package/Makefile
index 58c1ba2bbf..f5373ee65d 100644
--- a/package/Makefile
+++ b/package/Makefile
@@ -84,7 +84,7 @@ $(curdir)/index: FORCE
mkdir -p $$d; \
cd $$d || continue; \
$(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages.manifest; \
-   grep -vE '^(Maintainer|LicenseFiles|Source|SourceName|Require)' 
Packages.manifest > Packages; \
+   grep -vE 
'^(Maintainer|LicenseFiles|Source|SourceName|Require|SourceDateEpoch)' 
Packages.manifest > Packages; \
case "$$(((64 + $$(stat -L -c%s Packages)) % 128))" in 110|111) 
\
$(call ERROR_MESSAGE,WARNING: Applying padding in 
$$d/Packages to workaround usign SHA-512 bug!); \
{ echo ""; echo ""; } >> Packages;; \
-- 
2.25.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 3/4] build: store granular timestamps in packages

2020-08-14 Thread Paul Spooren
With the new `SOURCE` argument of `get_source_date_epoch` it is possible
to set package timestamps based on actual package changes rather thane
$TOPDIR changes.

This commit adds a new variable PKG_SOURCE_DATE_EPOCH which is used by
the `ipkg` build script. As a fallback the existing SOURCE_DATE_EPOCH is
used or as last resort the current time.

The redundant checks for `.git/` and `.svn/` are removed.

Signed-off-by: Paul Spooren 
---
 include/package-ipkg.mk |  1 +
 scripts/ipkg-build  | 12 +++-
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk
index 622cbf3223..6cdc6fa312 100644
--- a/include/package-ipkg.mk
+++ b/include/package-ipkg.mk
@@ -196,6 +196,7 @@ $(_endef)
 $$(IPKG_$(1)) : export CONTROL=$$(Package/$(1)/CONTROL)
 $$(IPKG_$(1)) : export DESCRIPTION=$$(Package/$(1)/description)
 $$(IPKG_$(1)) : export PATH=$$(TARGET_PATH_PKG)
+$$(IPKG_$(1)) : export PKG_SOURCE_DATE_EPOCH=$(shell 
$(TOPDIR)/scripts/get_source_date_epoch.sh $(SOURCE))
 $(PKG_INFO_DIR)/$(1).provides $$(IPKG_$(1)): $(STAMP_BUILT) 
$(INCLUDE_DIR)/package-ipkg.mk
@rm -rf $$(IDIR_$(1)); \
$$(call remove_ipkg_files,$(1),$$(call 
opkg_package_files,$(call gen_ipkg_wildcard,$(1
diff --git a/scripts/ipkg-build b/scripts/ipkg-build
index 6e027bc546..979be0d253 100755
--- a/scripts/ipkg-build
+++ b/scripts/ipkg-build
@@ -16,16 +16,10 @@ TAR="${TAR:-$(command -v tar)}"
 GZIP="$(command -v gzip)"
 
 # try to use fixed source epoch
-if [ -n "$SOURCE_DATE_EPOCH" ]; then
+if [ -n "$PKG_SOURCE_DATE_EPOCH" ]; then
+   TIMESTAMP=$(date --date="@$PKG_SOURCE_DATE_EPOCH")
+elif [ -n "$SOURCE_DATE_EPOCH" ]; then
TIMESTAMP=$(date --date="@$SOURCE_DATE_EPOCH")
-
-# look up date of last commit
-elif [ -d "$TOPDIR/.git" ]; then
-   GIT="$(command -v git)"
-   TIMESTAMP=$(cd $TOPDIR; $GIT log -1 -s --format=%ci)
-elif [ -d "$TOPDIR/.svn" ]; then
-   SVN="$(command -v svn)"
-   TIMESTAMP=$($SVN info "$TOPDIR" | sed -n "s/^Last Changed Date: 
\(.*\)/\1/p")
 else
TIMESTAMP=$(date)
 fi
-- 
2.25.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 2/4] build: get_source_date_epoch allow external repos

2020-08-14 Thread Paul Spooren
The SOURCE_DATE_EPOCH variable is used to make builds reproducible even
if rebuild at different times. Instead of using the current timestamp,
the time of the last source change is used.

Created packages are `touch`ed with a specific timestamp so resulting
packages have the same checksums.

The `get_source_date_epoch.sh` script tries multiple ways (file, git,
hg) to determine the correct timestamp.

Until now the script would only consider the $TOPDIR instead of package
specific changes. Resulting in packages with same versions but different
timestamps, as $TOPDIR (openwrt.git) received changes not affecting
package versions. This results in warning/erros in `opkg` as the package
versions stay the same but checksums changed.

This commit adds an optional argument to get the `SOURCE_DATE_EPOCH` of
a specific path (e.g. package SOURCE) rather than the $TOPDIR. As a
consequence this allows granular but still reproducible timestamps.

As packages might be distributed over multiple repositories the check
for `.git/` becomes unfeasible. Instead tell `git` and `hg` to change
their working directories and automatically traverse the repo folder.

Signed-off-by: Paul Spooren 
---
 scripts/get_source_date_epoch.sh | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/get_source_date_epoch.sh b/scripts/get_source_date_epoch.sh
index bd3384a761..fa80a4691e 100755
--- a/scripts/get_source_date_epoch.sh
+++ b/scripts/get_source_date_epoch.sh
@@ -3,21 +3,21 @@ export LANG=C
 export LC_ALL=C
 [ -n "$TOPDIR" ] && (cd "$TOPDIR" || exit 1)
 
+SOURCE="${1:-.}"
+
 try_version() {
-   [ -f version.date ] || return 1
-   SOURCE_DATE_EPOCH="$(cat version.date)"
+   [ -f "$SOURCE/version.date" ] || return 1
+   SOURCE_DATE_EPOCH=$(cat "$SOURCE/version.date")
[ -n "$SOURCE_DATE_EPOCH" ]
 }
 
 try_git() {
-   [ -e .git ] || return 1
-   SOURCE_DATE_EPOCH="$(git log -1 --format=format:%ct)"
+   SOURCE_DATE_EPOCH=$(git -C "$SOURCE" log -1 --format=format:%ct 
"$SOURCE" 2>/dev/null)
[ -n "$SOURCE_DATE_EPOCH" ]
 }
 
 try_hg() {
-   [ -d .hg ] || return 1
-   SOURCE_DATE_EPOCH="$(hg log --template '{date}' -l 1 | cut -d. -f1)"
+   SOURCE_DATE_EPOCH=$(hg --cwd "$SOURCE" log --template '{date}' -l 1 
"$SOURCE" 2>/dev/null | cut -d. -f1)
[ -n "$SOURCE_DATE_EPOCH" ]
 }
 
-- 
2.25.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 0/4] Granular timestamps in packages

2020-08-14 Thread Paul Spooren
v2: Fix Shellcheck patch which would exit if TOPDIR isn't definied.
Instead it should just exit if TOPDIR is defined but the `cd`
fails.

Based on Jo's IRC statement below[1] I reworked the get_source_date_epoch
script to create reproducible builds even if the SDK is updated.

 aparcar: I investigated that pacakge reproducibility issue a
little bit
 the problem is twofold
 1) ipkg-bild uses SOURCE_DATE_EPOCH which - in the
case of SDK - is hardcoded to the SDK build time

This should fix part 1. HG is untested and I'd prefer to just remove it
from the script, it doesn't seem to be used anywhere anyway.

 2) depending on toolchain version etc. building
the same package sources might generate different binaries (this
seems to be the lesser problem atm)

Part 2 will be tackled in some later patches.

[1]: 
http://logs.nslu2-linux.org/livelogs/openwrt-devel/openwrt-devel.20200807.txt

Paul Spooren (4):
  build: Fix Shellcheck for get_source_date_epoch.sh
  build: get_source_date_epoch allow external repos
  build: store granular timestamps in packages
  build: store SourceDateEpoch in manifest

 include/package-ipkg.mk  |  2 ++
 package/Makefile |  2 +-
 scripts/get_source_date_epoch.sh | 16 
 scripts/ipkg-build   | 12 +++-
 4 files changed, 14 insertions(+), 18 deletions(-)

-- 
2.25.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


RE: [RFC PATCH v2 0/1] Introduce UCI support for configuring DSA VLAN filter rules

2020-08-14 Thread Adrian Schmutzler
> config dsa_vlan
>   option vlan 1
>   option ports 'lan1 lan2 lan3 lan4'

Just got aware that this will make the names/labels of the ports part of the 
config (not just their internal numbers, as before), i.e. we cannot change them 
afterwards.

Maybe we should think again about whether those can be standardized to some 
extent 

Best

Adrian 


openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


RE: [PATCH] ipset: update to version 7.6

2020-08-14 Thread Adrian Schmutzler
> -Original Message-
> From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org]
> On Behalf Of Josef Schlehofer
> Sent: Freitag, 14. August 2020 21:19
> To: openwrt-devel@lists.openwrt.org
> Subject: [PATCH] ipset: update to version 7.6
> 
> Changelog:
> https://ipset.netfilter.org/changelog.html

Not that terribly important, but I'd prefer to just paste the few relevant 
lines here (the link could stay in addition).

Best

Adrian

> 
> Signed-off-by: Josef Schlehofer 
> ---
>  package/network/utils/ipset/Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/package/network/utils/ipset/Makefile
> b/package/network/utils/ipset/Makefile
> index 0bab21a12f..2d0c561198 100644
> --- a/package/network/utils/ipset/Makefile
> +++ b/package/network/utils/ipset/Makefile
> @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk  include
> $(INCLUDE_DIR)/kernel.mk
> 
>  PKG_NAME:=ipset
> -PKG_VERSION:=7.4
> +PKG_VERSION:=7.6
>  PKG_RELEASE:=1
> 
>  PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
>  PKG_SOURCE_URL:=http://ipset.netfilter.org
> -
> PKG_HASH:=4a974176e57fe4b7e2984abb231c4a18af2291bdc41536ef64e4b8e
> c4d4a1884
> +PKG_HASH:=0e7d44caa9c153d96a9b5f12644fbe35a632537a5a7f653792b72e
> 53d9d5c
> +2db
> 
>  PKG_MAINTAINER:=Jo-Philipp Wich 
>  PKG_LICENSE:=GPL-2.0
> --
> 2.25.1
> 
> 
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel


openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] ipset: update to version 7.6

2020-08-14 Thread Josef Schlehofer
Changelog:
https://ipset.netfilter.org/changelog.html

Signed-off-by: Josef Schlehofer 
---
 package/network/utils/ipset/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/network/utils/ipset/Makefile 
b/package/network/utils/ipset/Makefile
index 0bab21a12f..2d0c561198 100644
--- a/package/network/utils/ipset/Makefile
+++ b/package/network/utils/ipset/Makefile
@@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=ipset
-PKG_VERSION:=7.4
+PKG_VERSION:=7.6
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://ipset.netfilter.org
-PKG_HASH:=4a974176e57fe4b7e2984abb231c4a18af2291bdc41536ef64e4b8ec4d4a1884
+PKG_HASH:=0e7d44caa9c153d96a9b5f12644fbe35a632537a5a7f653792b72e53d9d5c2db
 
 PKG_MAINTAINER:=Jo-Philipp Wich 
 PKG_LICENSE:=GPL-2.0
-- 
2.25.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


RE: [PATCH] ath79: add support for ALLNET ALL-WAP02860AC

2020-08-14 Thread Adrian Schmutzler
> -Original Message-
> From: Tomasz Maciej Nowak [mailto:tome...@o2.pl]
> Sent: Freitag, 14. August 2020 18:55
> To: Adrian Schmutzler ; openwrt-
> de...@lists.openwrt.org
> Subject: Re: [PATCH] ath79: add support for ALLNET ALL-WAP02860AC
> 
> Hi,
> W dniu 14.08.2020 o 18:30, Adrian Schmutzler pisze:
> > Hi,
> >
> >> +&wmac {
> >> +  status = "okay";
> >> +
> >> +  mtd-cal-data = <&art 0x1000>;
> >> +  mtd-mac-address = <&art 0x0>;
> >> +  mtd-mac-address-increment = <1>;
> >
> > Caldata does not contain valid addresses? (same for 0x5000)
> 
> Nope.
> 
> >
> > Are the calculated addresses chosen in accordance with OEM firmware?
> 
> Yes.
> 
> Should I move the caldata extraction and MAC address setting to userspace?

I think it's fine how it's done now (if you checked it's actually working for 
the caldata).

I will have a closer look later and then apply it if nothing new comes up 
(probably I will add a sentence that MAC addresses are following OEM firmware 
to the commit message).

Best

Adrian

> 
> >
> > Rest seems fine on a quick look.
> >
> > Best
> >
> > Adrian
> >
> 
> Regards
> 
> --
> TMN


openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] ath79: add support for ALLNET ALL-WAP02860AC

2020-08-14 Thread Tomasz Maciej Nowak
Hi,
W dniu 14.08.2020 o 18:30, Adrian Schmutzler pisze:
> Hi,
> 
>> +&wmac {
>> +status = "okay";
>> +
>> +mtd-cal-data = <&art 0x1000>;
>> +mtd-mac-address = <&art 0x0>;
>> +mtd-mac-address-increment = <1>;
> 
> Caldata does not contain valid addresses? (same for 0x5000)

Nope.

> 
> Are the calculated addresses chosen in accordance with OEM firmware?

Yes.

Should I move the caldata extraction and MAC address setting to userspace?

> 
> Rest seems fine on a quick look.
> 
> Best
> 
> Adrian 
> 

Regards

-- 
TMN

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: Upcoming 19.07.4 and 18.07.9 stable releases

2020-08-14 Thread Baptiste Jonglez
Hi,

On 07-08-20, Adrian Schmutzler wrote:
> > Hi, 
> > There is also a new mbedtls version which fixes some security bugs, we 
> > should also update this: 
> > https://github.com/ARMmbed/mbedtls/releases/tag/mbedtls-2.16.7 

I have added it to 
https://openwrt.org/docs/guide-developer/releases/goals/19.07.4

18.06 is also using 2.16.6 currently.

> FYI:
> This PR is marked as 19.07 and also is related to mac80211, but I cannot 
> really judge its content:
> https://github.com/openwrt/openwrt/pull/3182

Also FYI, I noticed that ath10k-firmware-*-ct is currently using version
"lede.013" in 19.07, while master has version "lede.019".

Should it be updated because it fixes things, or is there too much potential 
for regression?

Thanks,
Baptiste


signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: Changing Inittab

2020-08-14 Thread Shalla Thakur

On 14/08/20 6:20 pm, Alberto Bursi wrote:



On 14/08/20 14:46, Shalla Thakur wrote:

On 14/08/20 6:08 pm, Alberto Bursi wrote:



On 14/08/20 05:54, Shalla Thakur wrote:

Hi,

I am trying to change inittab to launch a different binary than 
/usr/libexec/login.sh. I changed 
package/base-files/files/etc/inittab for that. But it seems during 
build these changes get overridden. What is the correct way to 
achieve this?


Thanks


You can override that by creating a "files" folder in the main build 
folder, all files in that will overwrite files in the rootfs.
If you want to overwrite the inittab you can create your own inittab 
file in

/files/etc/inittab


You mean the base directory where package, feeds, and other 
directories reside or build_dir in the base directory?




Sorry, I meant the base directory.

-Alberto


Thanks Alberto!

--
Regards
Shalla

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


RE: [PATCH] ath79: add support for ALLNET ALL-WAP02860AC

2020-08-14 Thread Adrian Schmutzler
Hi,

> +&wmac {
> + status = "okay";
> +
> + mtd-cal-data = <&art 0x1000>;
> + mtd-mac-address = <&art 0x0>;
> + mtd-mac-address-increment = <1>;

Caldata does not contain valid addresses? (same for 0x5000)

Are the calculated addresses chosen in accordance with OEM firmware?

Rest seems fine on a quick look.

Best

Adrian 


openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] ath79: add support for ALLNET ALL-WAP02860AC

2020-08-14 Thread Tomasz Maciej Nowak
ALLNET ALL-WAP02860AC is a dual-band wireless access point.

Specification
SoC: Qualcomm Atheros QCA9558
RAM: 128 MB DDR2
Flash: 16 MB SPI NOR
WIFI: 2.4 GHz 3T3R integrated
  5 GHz 3T3R QCA9880 Mini PCIe card
Ethernet: 1x 10/100/1000 Mbps AR8035-A, PoE capable (802.3at)
LEDS: 5x, which four are GPIO controlled
Buttons: 1x GPIO controlled
UART: 4 pin header near Mini PCIe card, starting count from white
  triangle on PCB
  1. VCC 3.3V, 2. GND, 3. TX, 4. RX
  baud: 115200, parity: none, flow control: none

Because of:
a) constrained environment (SNMP) when connecting through Telnet
   or SSH,
b) hard-coded kernel and rootfs sizes,
c) checksum verification of kerenel and rootfs images in bootloder,

creating factory image accepted by OEM web interface is difficult,
therefore, to install OpenWrt on this device UART connection is needed.
The teardown is simple, unscrew four screws to disassemble the casing,
plus two screws to separate mainboard from the casing.
Before flashing, be sure to have a copy of factory firmware, in case You
wish to revert to original firmware.

Installation
1. Prepare TFTP server with OpenWrt initramfs-kernel image.
2. Connect to LAN port.
3. Connect to UART port.
4. Power on the device and when prompted to stop autoboot, hit any key.
5. Alter U-Boot environment with following commands:
setenv failsafe_boot bootm 0x9f0a
saveenv
6. Adjust "ipaddr" and "serverip" addresses in U-Boot environment, use
   'setenv' to do that, then run following commands:
tftpboot 0x8100 
bootm 0x8100
7. Wait about 1 minute for OpenWrt to boot.
8. Transfer OpenWrt sysupgrade image to /tmp directory and flash it
   with:
sysupgrade -n /tmp/
9. After flashing, the access point will reboot to OpenWrt. Wait few
   minutes, until the Power LED stops blinking, then it's ready for
   configuration.

Signed-off-by: Tomasz Maciej Nowak 
---
 package/boot/uboot-envtools/files/ath79   |   1 +
 .../dts/qca9558_allnet_all-wap02860ac.dts | 155 ++
 .../generic/base-files/etc/board.d/02_network |   1 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata  |   9 +-
 target/linux/ath79/image/generic.mk   |   9 +
 5 files changed, 171 insertions(+), 4 deletions(-)
 create mode 100644 target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts

diff --git a/package/boot/uboot-envtools/files/ath79 
b/package/boot/uboot-envtools/files/ath79
index b00e3fa12766..c0873c6e0d7f 100644
--- a/package/boot/uboot-envtools/files/ath79
+++ b/package/boot/uboot-envtools/files/ath79
@@ -14,6 +14,7 @@ board=$(board_name)
 
 case "$board" in
 alfa-network,ap121f|\
+allnet,all-wap02860ac|\
 arduino,yun|\
 buffalo,bhr-4grv2|\
 devolo,magic-2-wifi|\
diff --git a/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts 
b/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts
new file mode 100644
index ..f78a06d432c2
--- /dev/null
+++ b/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts
@@ -0,0 +1,155 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include 
+#include 
+
+#include "qca955x.dtsi"
+
+/ {
+   model = "ALLNET ALL-WAP02860AC";
+   compatible = "allnet,all-wap02860ac", "qca,qca9558";
+
+   aliases {
+   label-mac-device = ð0;
+   led-boot = &led_power;
+   led-failsafe = &led_power;
+   led-running = &led_power;
+   led-upgrade = &led_power;
+   };
+
+   keys {
+   compatible = "gpio-keys";
+
+   reset {
+   label = "reset";
+   linux,code = ;
+   gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+   };
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   led_power: power {
+   label = "all-wap02860ac:amber:power";
+   gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
+   default-state = "on";
+   };
+
+   wlan2g {
+   label = "all-wap02860ac:blue:wlan2g";
+   gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+   linux,default-trigger = "phy1tpt";
+   };
+
+   wlan5g {
+   label = "all-wap02860ac:green:wlan5g";
+   gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
+   linux,default-trigger = "phy0tpt";
+   };
+
+   wps {
+   label = "all-wap02860ac:blue:wps";
+   gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
+   };
+   };
+};
+
+ð0 {
+   status = "okay";
+
+   mtd-mac-address = <&art 0x0>;
+   pll-data = <0x8e00 0x8101 0x80001313>;
+   phy-handle = <&phy5>;
+   phy-mode = "rgmii-rxid";
+};
+
+&mdio0 {
+   status = "okay";
+
+   phy5: ethernet-phy@5 {
+   reg = <5>;
+   eee-broken-100tx;
+   eee-broken-1000t;
+   

Re: [bcm53xx] Pin Controller in Northstar

2020-08-14 Thread Vivek Unune
Hi Rafał,

Has there been any update on this?

Thanks in advance!

Vivek

On Mon, May 4, 2020 at 8:44 AM Vivek Unune  wrote:
>
> On Mon, May 4, 2020 at 8:11 AM Rafał Miłecki  wrote:
> >
> > Hi Vivek & sorry for late reply.
> >
> > It took me few hours to evaluate current DMU / CRU / pinctrl situation.
> >
> > On 03.05.2020 22:15, Vivek Unune wrote:
> > > On Sun, Apr 5, 2020 at 10:48 AM Vivek Unune  
> > > wrote:
> > >>
> > >> On Tue, Mar 31, 2020 at 5:51 PM Vivek Unune  
> > >> wrote:
> > >>>
> > >>> Hi All / Rafał,
> > >>>
> > >>> I'm about to update device tree for Linksys Panamera router (aka
> > >>> EA9500) so that it uses pin controller defined in BCM5301X.dtsi [1].
> > >>> However, the mainline kernel's Northstar pinctrl driver code
> > >>> (ns-pinctrl.cs [2]) is out of sync with the device tree. As you see,
> > >>> the driver looks for syscon node which is absent in the device tree.
> > >>>
> > >>> Was there a patch submitted to update the device tree along with the
> > >>> driver? I could only find the patch wrt the driver [3]
> > >>>
> > >>> If the device tree was indeed updated, which git repository should I
> > >>> use to prepare and test my patch?
> >
> > That mismatch is caused by a failed cleanup action for DMU / CRU. I
> > decided to refactor those bindings, some changes were accepted and some
> > were rejected as Rob found some issues in my submitted work.
> >
> > It results in a slightly messy situation that needs sorting out properly
> > with all nodes considered. I'll write e-mail to devicetree@ shortly.
> >
> >
> > >>> Thanks,
> > >>>
> > >>> Vivek
> > >>>
> > >>> [1] 
> > >>> https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/bcm5301x.dtsi
> > >>> [2] 
> > >>> https://github.com/torvalds/linux/blob/master/drivers/pinctrl/bcm/pinctrl-ns.c
> > >>> [3] https://patchwork.kernel.org/patch/10735933/
> > >>
> > >> Adding Rafał
> > >>
> > >> So I've managed to compile and have the pincontrol working in OpenWrt.
> > >> However, in order to submit my patch upstream I will need correct tree
> > >> to create my patch.
> > >>
> > >> Rafał - can you point me in the right direction?
> > >>
> > >> Thanks,
> > >>
> > >> Vivek
> > >
> > > Bump & change subject.
> >
> > For DTS changes you should branch devicetree/next of:
> > https://github.com/Broadcom/stblinux.git
>
> Excellent! Thanks!

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


RE: ath25 and rb532 fail after mac80211 changes

2020-08-14 Thread Adrian Schmutzler
> -Original Message-
> From: Felix Fietkau [mailto:n...@nbd.name]
> Sent: Freitag, 14. August 2020 16:34
> To: Adrian Schmutzler ; openwrt-
> de...@lists.openwrt.org
> Subject: Re: ath25 and rb532 fail after mac80211 changes
> 
> On 2020-08-14 11:16, Adrian Schmutzler wrote:
> > Hi,
> >
> > after "mac80211: merge performance improvement patches" [1], build fails
> on a few 4.14 targets, namely ath25, rb532 (and ar71xx):
> >
> >
> >
> > So, we have to decide whether
> > 1. we fix this
> > 2. we leave the buildbots broken
> > 3. we remove those 4.14 targets in master (ath25, rb532)
> >
> > Personally, I prefer option 3, as it's only a matter of time when we drop
> those targets anyway.
> I'm going to push backports for 4.14 soon. I'm testing them at the moment.
> Sorry about the build breakage.

Okay, thanks. I actually don't think this is an urgent issue, I just wanted to 
know whether it is addressed at all.

So, if it's not convenient for you now, nothing bad will happen IMO if this 
stays broken for another week.

Best

Adrian

> 
> - Felix


openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: ath25 and rb532 fail after mac80211 changes

2020-08-14 Thread Felix Fietkau
On 2020-08-14 11:16, Adrian Schmutzler wrote:
> Hi,
> 
> after "mac80211: merge performance improvement patches" [1], build fails on a 
> few 4.14 targets, namely ath25, rb532 (and ar71xx):
> 
> 
> 
> So, we have to decide whether
> 1. we fix this
> 2. we leave the buildbots broken
> 3. we remove those 4.14 targets in master (ath25, rb532)
> 
> Personally, I prefer option 3, as it's only a matter of time when we drop 
> those targets anyway.
I'm going to push backports for 4.14 soon. I'm testing them at the
moment. Sorry about the build breakage.

- Felix

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] ath79: ar724x: make sure builtin-switch is enabled in DT

2020-08-14 Thread Adrian Schmutzler
On ar7240/ar7241 the mdioX node with the builtin-switch is enabled
in the DTSI files, but the parent ethX node is left disabled. It
only gets enabled per device or device family, and has not been
enabled at all yet for the TP-Link WA devices with ar7240, making
the switch unavailable there.

This patch makes sure ð0/ð1 nodes are enabled together with
the &mdio0/&mdio1 nodes containing the builtin-switch.
For ar7240_tplink_tl-wa.dtsi, ð0 is properly hidden again via
  compatible = "syscon", "simple-mfd";

This partially fixes FS#2887, however it seems dmesg still does
not show cable (dis)connect in dmesg for ar7240 TP-Link WA
devices.

Signed-off-by: Adrian Schmutzler 
---
 target/linux/ath79/dts/ar7240.dtsi| 2 ++
 target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts   | 2 --
 target/linux/ath79/dts/ar7240_dlink_dir-615-e4.dts| 4 
 target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts  | 2 --
 target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi  | 2 --
 target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi   | 4 
 target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi   | 2 --
 target/linux/ath79/dts/ar7241.dtsi| 2 ++
 target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts  | 3 +--
 target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi| 3 +--
 target/linux/ath79/dts/ar7241_tplink.dtsi | 2 --
 target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts | 2 --
 target/linux/ath79/dts/ar7241_ubnt_unifi.dts  | 2 --
 13 files changed, 10 insertions(+), 22 deletions(-)

diff --git a/target/linux/ath79/dts/ar7240.dtsi 
b/target/linux/ath79/dts/ar7240.dtsi
index 5382a710f9..730c509d7b 100644
--- a/target/linux/ath79/dts/ar7240.dtsi
+++ b/target/linux/ath79/dts/ar7240.dtsi
@@ -59,6 +59,8 @@
 };
 
 ð0 {
+   status = "okay";
+
compatible = "qca,ar7240-eth", "syscon";
 
pll-data = <0x0011 0x1099 0x00991099>;
diff --git a/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts 
b/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts
index a2d3a99430..cd61bdb45f 100644
--- a/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts
+++ b/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts
@@ -156,8 +156,6 @@
 };
 
 ð0 {
-   status = "okay";
-
mtd-mac-address = <&art 0x120c>;
 };
 
diff --git a/target/linux/ath79/dts/ar7240_dlink_dir-615-e4.dts 
b/target/linux/ath79/dts/ar7240_dlink_dir-615-e4.dts
index 537a99b8db..22a1aeb0dc 100644
--- a/target/linux/ath79/dts/ar7240_dlink_dir-615-e4.dts
+++ b/target/linux/ath79/dts/ar7240_dlink_dir-615-e4.dts
@@ -139,10 +139,6 @@
};
 };
 
-ð0 {
-   status = "okay";
-};
-
 ð1 {
status = "okay";
 };
diff --git a/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts 
b/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts
index c231f4721c..8ae2a128ee 100644
--- a/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts
+++ b/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts
@@ -174,8 +174,6 @@
 };
 
 ð0 {
-   status = "okay";
-
mtd-mac-address = <&art 0x0>;
 };
 
diff --git a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi 
b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi
index a7e6b49c1f..e270dfa5c2 100644
--- a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi
+++ b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi
@@ -106,8 +106,6 @@
 };
 
 ð0 {
-   status = "okay";
-
mtd-mac-address = <&art 0x0>;
 };
 
diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi 
b/target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi
index ac5a4d5ee9..7f671ee4bf 100644
--- a/target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi
+++ b/target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi
@@ -9,6 +9,10 @@
};
 };
 
+ð0 {
+   compatible = "syscon", "simple-mfd";
+}
+
 ð1 {
mtd-mac-address = <&uboot 0x1fc00>;
 };
diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi 
b/target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi
index 7621b1d53c..5ceada8375 100644
--- a/target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi
+++ b/target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi
@@ -30,8 +30,6 @@
 };
 
 ð0 {
-   status = "okay";
-
mtd-mac-address = <&uboot 0x1fc00>;
mtd-mac-address-increment = <(-1)>;
 };
diff --git a/target/linux/ath79/dts/ar7241.dtsi 
b/target/linux/ath79/dts/ar7241.dtsi
index 59fcd05f5e..4044cdee0e 100644
--- a/target/linux/ath79/dts/ar7241.dtsi
+++ b/target/linux/ath79/dts/ar7241.dtsi
@@ -77,6 +77,8 @@
 };
 
 ð1 {
+   status = "okay";
+
compatible = "qca,ar7241-eth", "syscon";
 
pll-data = <0x0011 0x1099 0x00991099>;
diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts 
b/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts
index 4d080c82f8..b4765d1a14 100644
--- a/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts
+++ b/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts
@@ -183,9 +183,8 @@
 };
 
 ð1 {
-   status = "okay";
-
compatible = "qca,ar7241-eth", "syscon", "simple-mfd";
+

Re: Changing Inittab

2020-08-14 Thread Alberto Bursi




On 14/08/20 14:46, Shalla Thakur wrote:

On 14/08/20 6:08 pm, Alberto Bursi wrote:



On 14/08/20 05:54, Shalla Thakur wrote:

Hi,

I am trying to change inittab to launch a different binary than 
/usr/libexec/login.sh. I changed package/base-files/files/etc/inittab 
for that. But it seems during build these changes get overridden. 
What is the correct way to achieve this?


Thanks


You can override that by creating a "files" folder in the main build 
folder, all files in that will overwrite files in the rootfs.
If you want to overwrite the inittab you can create your own inittab 
file in

/files/etc/inittab


You mean the base directory where package, feeds, and other directories 
reside or build_dir in the base directory?




Sorry, I meant the base directory.

-Alberto

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: Changing Inittab

2020-08-14 Thread Shalla Thakur

On 14/08/20 6:08 pm, Alberto Bursi wrote:



On 14/08/20 05:54, Shalla Thakur wrote:

Hi,

I am trying to change inittab to launch a different binary than 
/usr/libexec/login.sh. I changed package/base-files/files/etc/inittab 
for that. But it seems during build these changes get overridden. What 
is the correct way to achieve this?


Thanks


You can override that by creating a "files" folder in the main build 
folder, all files in that will overwrite files in the rootfs.
If you want to overwrite the inittab you can create your own inittab 
file in

/files/etc/inittab


You mean the base directory where package, feeds, and other directories 
reside or build_dir in the base directory?


--
Regards
Shalla

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: Changing Inittab

2020-08-14 Thread Alberto Bursi




On 14/08/20 05:54, Shalla Thakur wrote:

Hi,

I am trying to change inittab to launch a different binary than 
/usr/libexec/login.sh. I changed package/base-files/files/etc/inittab 
for that. But it seems during build these changes get overridden. What 
is the correct way to achieve this?


Thanks


You can override that by creating a "files" folder in the main build 
folder, all files in that will overwrite files in the rootfs.

If you want to overwrite the inittab you can create your own inittab file in
/files/etc/inittab

see here on the wiki documentation about this:
https://openwrt.org/docs/guide-developer/build-system/use-buildsystem#custom_files

-Alberto

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


kmod-usb-bcma is not available

2020-08-14 Thread Nerijus Baliūnas

Hello,

I am using openwrt-19.07 branch, CONFIG_TARGET_brcm47xx, device is Option 
Globesurfer III.
I have an older openwrt image from 2015 with kernel 3.3.8, where 3g modem is 
seen by lsusb:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 04cc:1520 ST-Ericsson USB 2.0 Hub (Avocent KVM)
Bus 001 Device 003: ID 0af0:7601 Option Globetrotter MO40x 3G Modem (GTM 382)

With openwrt-19.07 branch lsusb does not see it:
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 04cc:1520 ST-Ericsson USB 2.0 Hub (Avocent KVM)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I suspect it is because older image has bcma-hcd.ko kernel module. I tried to 
include

kmod-usb-bcma in openwrt-19.07, but when compiling I get:
WARNING: kmod-usb-bcma is not available in the kernel config - generating 
empty package.

Why is it so? In package/kernel/linux/modules/usb.mk:
define KernelPackage/usb-ohci
  TITLE:=Support for OHCI controllers
  DEPENDS:= \
+TARGET_bcm53xx:kmod-usb-bcma \
+TARGET_brcm47xx:kmod-usb-bcma \
+TARGET_brcm47xx:kmod-usb-ssb

My .config is https://paste.centos.org/view/6456fe38 (I added 
CONFIG_DEFAULT_kmod-bcma=y to it too).


Thanks,
Nerijus

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v5] zram-swap: explicitly use mkswap/swapon/swapoff from /sbin

2020-08-14 Thread Rui Salvaterra
The required BusyBox applets are enabled by default, so we can rely on them
being present in the system. This way, we make sure there are no conflicts with
less featured variants of these same applets which might also be present in the
system.

Fixes: 0bd7dfa3ed60 ("zram-swap: enable swap discard")

v5: addressed Adrian Schmutzler's comments

Signed-off-by: Rui Salvaterra 
---
 package/system/zram-swap/Makefile|  4 ++--
 package/system/zram-swap/files/zram.init | 18 +-
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/package/system/zram-swap/Makefile 
b/package/system/zram-swap/Makefile
index 5c132c9062..9a18dd3417 100644
--- a/package/system/zram-swap/Makefile
+++ b/package/system/zram-swap/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zram-swap
-PKG_RELEASE:=6
+PKG_RELEASE:=7
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
@@ -17,7 +17,7 @@ include $(INCLUDE_DIR)/package.mk
 define Package/zram-swap
   SECTION:=utils
   CATEGORY:=Base system
-  DEPENDS:=+kmod-zram 
+!(BUSYBOX_CONFIG_MKSWAP&&BUSYBOX_CONFIG_SWAPON&&BUSYBOX_CONFIG_SWAPOFF):swap-utils
+  DEPENDS:=+kmod-zram +@BUSYBOX_CONFIG_MKSWAP +@BUSYBOX_CONFIG_SWAPON 
+@BUSYBOX_CONFIG_FEATURE_SWAPON_DISCARD +@BUSYBOX_CONFIG_FEATURE_SWAPON_PRI 
+@BUSYBOX_CONFIG_SWAPOFF
   TITLE:=ZRAM swap scripts
   PKGARCH:=all
 endef
diff --git a/package/system/zram-swap/files/zram.init 
b/package/system/zram-swap/files/zram.init
index 42c084855a..f31a87438c 100755
--- a/package/system/zram-swap/files/zram.init
+++ b/package/system/zram-swap/files/zram.init
@@ -35,18 +35,18 @@ zram_applicable()
return 1
}
 
-   command -v mkswap >/dev/null || {
-   logger -s -t zram_applicable -p daemon.err "[ERROR] 'mkswap' 
not installed"
+   [ -x /sbin/mkswap ] || {
+   logger -s -t zram_applicable -p daemon.err "[ERROR] 'BusyBox 
mkswap' not installed"
return 1
}
 
-   command -v swapon >/dev/null || {
-   logger -s -t zram_applicable -p daemon.err "[ERROR] 'swapon' 
not installed"
+   [ -x /sbin/swapon ] || {
+   logger -s -t zram_applicable -p daemon.err "[ERROR] 'BusyBox 
swapon' not installed"
return 1
}
 
-   command -v swapoff >/dev/null || {
-   logger -s -t zram_applicable -p daemon.err "[ERROR] 'swapoff' 
not installed"
+   [ -x /sbin/swapoff ] || {
+   logger -s -t zram_applicable -p daemon.err "[ERROR] 'BusyBox 
swapoff' not installed"
return 1
}
 }
@@ -181,8 +181,8 @@ start()
zram_comp_algo "$zram_dev"
zram_comp_streams "$zram_dev"
echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename 
"$zram_dev" )/disksize"
-   mkswap "$zram_dev"
-   swapon -d $zram_priority "$zram_dev"
+   /sbin/mkswap "$zram_dev"
+   /sbin/swapon -d $zram_priority "$zram_dev"
 }
 
 stop()
@@ -191,7 +191,7 @@ stop()
 
for zram_dev in $( grep zram /proc/swaps |awk '{print $1}' ); do {
logger -s -t zram_stop -p daemon.debug "deactivate swap 
$zram_dev"
-   swapoff "$zram_dev" && zram_reset "$zram_dev" "claiming memory 
back"
+   /sbin/swapoff "$zram_dev" && zram_reset "$zram_dev" "claiming 
memory back"
local dev_index="$( echo $zram_dev | grep -o "[0-9]*$" )"
if [ $dev_index -ne 0 ]; then
logger -s -t zram_stop -p daemon.debug "removing zram 
$zram_dev"
-- 
2.28.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] zram-swap: explicitly use mkswap/swapon/swapoff from /sbin

2020-08-14 Thread Rui Salvaterra
The required BusyBox applets are enabled by default, so we can rely on them
being present in the system. This way, we make sure there are no conflicts with
less featured variants of these same applets which might also be present in the
system.

Fixes: 0bd7dfa3ed60 ("zram-swap: enable swap discard")

v5: addressed Adrian Schmutzler's comments

Signed-off-by: Rui Salvaterra 
---
 package/system/zram-swap/Makefile|  4 ++--
 package/system/zram-swap/files/zram.init | 18 +-
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/package/system/zram-swap/Makefile 
b/package/system/zram-swap/Makefile
index 5c132c9062..9a18dd3417 100644
--- a/package/system/zram-swap/Makefile
+++ b/package/system/zram-swap/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zram-swap
-PKG_RELEASE:=6
+PKG_RELEASE:=7
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
@@ -17,7 +17,7 @@ include $(INCLUDE_DIR)/package.mk
 define Package/zram-swap
   SECTION:=utils
   CATEGORY:=Base system
-  DEPENDS:=+kmod-zram 
+!(BUSYBOX_CONFIG_MKSWAP&&BUSYBOX_CONFIG_SWAPON&&BUSYBOX_CONFIG_SWAPOFF):swap-utils
+  DEPENDS:=+kmod-zram +@BUSYBOX_CONFIG_MKSWAP +@BUSYBOX_CONFIG_SWAPON 
+@BUSYBOX_CONFIG_FEATURE_SWAPON_DISCARD +@BUSYBOX_CONFIG_FEATURE_SWAPON_PRI 
+@BUSYBOX_CONFIG_SWAPOFF
   TITLE:=ZRAM swap scripts
   PKGARCH:=all
 endef
diff --git a/package/system/zram-swap/files/zram.init 
b/package/system/zram-swap/files/zram.init
index 42c084855a..f31a87438c 100755
--- a/package/system/zram-swap/files/zram.init
+++ b/package/system/zram-swap/files/zram.init
@@ -35,18 +35,18 @@ zram_applicable()
return 1
}
 
-   command -v mkswap >/dev/null || {
-   logger -s -t zram_applicable -p daemon.err "[ERROR] 'mkswap' 
not installed"
+   [ -x /sbin/mkswap ] || {
+   logger -s -t zram_applicable -p daemon.err "[ERROR] 'BusyBox 
mkswap' not installed"
return 1
}
 
-   command -v swapon >/dev/null || {
-   logger -s -t zram_applicable -p daemon.err "[ERROR] 'swapon' 
not installed"
+   [ -x /sbin/swapon ] || {
+   logger -s -t zram_applicable -p daemon.err "[ERROR] 'BusyBox 
swapon' not installed"
return 1
}
 
-   command -v swapoff >/dev/null || {
-   logger -s -t zram_applicable -p daemon.err "[ERROR] 'swapoff' 
not installed"
+   [ -x /sbin/swapoff ] || {
+   logger -s -t zram_applicable -p daemon.err "[ERROR] 'BusyBox 
swapoff' not installed"
return 1
}
 }
@@ -181,8 +181,8 @@ start()
zram_comp_algo "$zram_dev"
zram_comp_streams "$zram_dev"
echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename 
"$zram_dev" )/disksize"
-   mkswap "$zram_dev"
-   swapon -d $zram_priority "$zram_dev"
+   /sbin/mkswap "$zram_dev"
+   /sbin/swapon -d $zram_priority "$zram_dev"
 }
 
 stop()
@@ -191,7 +191,7 @@ stop()
 
for zram_dev in $( grep zram /proc/swaps |awk '{print $1}' ); do {
logger -s -t zram_stop -p daemon.debug "deactivate swap 
$zram_dev"
-   swapoff "$zram_dev" && zram_reset "$zram_dev" "claiming memory 
back"
+   /sbin/swapoff "$zram_dev" && zram_reset "$zram_dev" "claiming 
memory back"
local dev_index="$( echo $zram_dev | grep -o "[0-9]*$" )"
if [ $dev_index -ne 0 ]; then
logger -s -t zram_stop -p daemon.debug "removing zram 
$zram_dev"
-- 
2.28.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] kernel: fix mtd partition erase

2020-08-14 Thread Tomasz Maciej Nowak
Hi John.
W dniu 05.08.2020 o 23:13, John Thomson pisze:
> This bug applied where mtd partition end address,
> or erase start address, was not cleanly divisible by parent mtd erasesize.
> 
> This error would cause the bits following the end of the partition
> to the next erasesize block boundary to be erased,
> and this partition-overflow data to be written to the partition erase
> address (missing additional partition offset address)
> of the mtd (top) parent device.
> 
> Signed-off-by: John Thomson 

Yay!
The description in this patch matches the symptoms I described Year ago in this 
bug report:
https://bugs.openwrt.org/index.php?do=details&task_id=2428
and this patch fixes it, Thank You very much.

Tested-by: Tomasz Maciej Nowak 
Fixes: FS#2428

> 
> --
> 
> 4.19 also requires this fix
> 
> A little discussion here:
> https://github.com/openwrt/openwrt/pull/3103#issuecomment-667610510
> 
> mtdpart.c should be made to work with 4K erase sectors, where available
> Considering this here:
> https://github.com/openwrt/openwrt/pull/3271
> ---
>  .../411-mtd-partial_eraseblock_write.patch  | 13 ++---
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git 
> a/target/linux/generic/pending-5.4/411-mtd-partial_eraseblock_write.patch 
> b/target/linux/generic/pending-5.4/411-mtd-partial_eraseblock_write.patch
> index b46c3f5ed4..c48a144d3d 100644
> --- a/target/linux/generic/pending-5.4/411-mtd-partial_eraseblock_write.patch
> +++ b/target/linux/generic/pending-5.4/411-mtd-partial_eraseblock_write.patch
> @@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau 
>   /* Our partition linked list */
>   static LIST_HEAD(mtd_partitions);
>   static DEFINE_MUTEX(mtd_partitions_mutex);
> -@@ -206,6 +208,53 @@ static int part_erase(struct mtd_info *m
> +@@ -206,11 +208,77 @@ static int part_erase(struct mtd_info *m
>   {
>   struct mtd_part *part = mtd_to_part(mtd);
>   int ret;
> @@ -73,10 +73,9 @@ Signed-off-by: Felix Fietkau 
>   
>   instr->addr += part->offset;
>   ret = part->parent->_erase(part->parent, instr);
> -@@ -213,6 +262,24 @@ static int part_erase(struct mtd_info *m
> + if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN)
>   instr->fail_addr -= part->offset;
> - instr->addr -= part->offset;
> - 
> ++
>  +if (mtd->flags & MTD_ERASE_PARTIAL) {
>  +if (partial_start) {
>  +part->parent->_write(part->parent,
> @@ -95,10 +94,10 @@ Signed-off-by: Felix Fietkau 
>  +kfree(erase_buf);
>  +}
>  +
> - return ret;
> - }
> + instr->addr -= part->offset;
>   
> -@@ -525,19 +592,22 @@ static struct mtd_part *allocate_partiti
> + return ret;
> +@@ -525,19 +593,22 @@ static struct mtd_part *allocate_partiti
>   remainder = do_div(tmp, wr_alignment);
>   if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) {
>   /* Doesn't start on a boundary of major erase size */
> 


-- 
TMN

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] ramips: remove legacy ethernet driver components for mt7621

2020-08-14 Thread Adrian Schmutzler
The mt7621 subtarget has been switched to DSA quite a while ago and
seems to run sufficiently fine. Build with older kernels than 5.4 has
been disabled directly during the kernel bump.

Therefore, since they are not used anymore, let's remove the
mt7621-specific parts of "our" ethernet driver, so we don't have
to maintain them and it's obvious they are not used.

This also drops offloading as this was specifically implemented to
depend on mt7621.

Signed-off-by: Adrian Schmutzler 
---
 .../files/drivers/net/ethernet/ralink/Kconfig |  16 +-
 .../drivers/net/ethernet/ralink/Makefile  |   4 -
 .../drivers/net/ethernet/ralink/gsw_mt7621.c  | 275 -
 .../drivers/net/ethernet/ralink/mtk_debugfs.c | 115 
 .../drivers/net/ethernet/ralink/mtk_eth_soc.c |  42 +-
 .../drivers/net/ethernet/ralink/mtk_offload.c | 540 --
 .../drivers/net/ethernet/ralink/mtk_offload.h | 260 -
 .../drivers/net/ethernet/ralink/soc_mt7621.c  | 187 --
 8 files changed, 6 insertions(+), 1433 deletions(-)
 delete mode 100644 
target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7621.c
 delete mode 100644 
target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_debugfs.c
 delete mode 100644 
target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_offload.c
 delete mode 100644 
target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_offload.h
 delete mode 100644 
target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7621.c

diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/Kconfig 
b/target/linux/ramips/files/drivers/net/ethernet/ralink/Kconfig
index 51cace5333..26e5e6d73e 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/Kconfig
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/Kconfig
@@ -27,23 +27,15 @@ config NET_RALINK_MT7620
bool "MT7620"
depends on MIPS && SOC_MT7620
 
-config NET_RALINK_MT7621
-   bool "MT7621"
-   depends on MIPS && SOC_MT7621
-
 endchoice
 
-config NET_RALINK_OFFLOAD
-   def_bool NET_RALINK_SOC
-   depends on NET_RALINK_MT7621
-
 config NET_RALINK_HW_QOS
def_bool NET_RALINK_SOC
depends on NET_RALINK_MT7623
 
 config NET_RALINK_MDIO
def_bool NET_RALINK_SOC
-   depends on (NET_RALINK_RT2880 || NET_RALINK_RT3883 || NET_RALINK_MT7620 
|| NET_RALINK_MT7621)
+   depends on (NET_RALINK_RT2880 || NET_RALINK_RT3883 || NET_RALINK_MT7620)
select PHYLIB
 
 config NET_RALINK_MDIO_RT2880
@@ -53,7 +45,7 @@ config NET_RALINK_MDIO_RT2880
 
 config NET_RALINK_MDIO_MT7620
def_bool NET_RALINK_SOC
-   depends on (NET_RALINK_MT7620 || NET_RALINK_MT7621)
+   depends on NET_RALINK_MT7620
select NET_RALINK_MDIO
 
 config NET_RALINK_ESW_RT3050
@@ -63,8 +55,4 @@ config NET_RALINK_ESW_RT3050
 config NET_RALINK_GSW_MT7620
def_tristate NET_RALINK_SOC
depends on NET_RALINK_MT7620
-
-config NET_RALINK_GSW_MT7621
-   def_tristate NET_RALINK_SOC
-   depends on NET_RALINK_MT7621
 endif
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/Makefile 
b/target/linux/ramips/files/drivers/net/ethernet/ralink/Makefile
index eba21643b2..79d2dbfef9 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/Makefile
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/Makefile
@@ -8,15 +8,11 @@ ralink-eth-$(CONFIG_NET_RALINK_MDIO)  += mdio.o
 ralink-eth-$(CONFIG_NET_RALINK_MDIO_RT2880)+= mdio_rt2880.o
 ralink-eth-$(CONFIG_NET_RALINK_MDIO_MT7620)+= mdio_mt7620.o
 
-ralink-eth-$(CONFIG_NET_RALINK_OFFLOAD)+= mtk_offload.o mtk_debugfs.o
-
 ralink-eth-$(CONFIG_NET_RALINK_RT2880) += soc_rt2880.o
 ralink-eth-$(CONFIG_NET_RALINK_RT3050) += soc_rt3050.o
 ralink-eth-$(CONFIG_NET_RALINK_RT3883) += soc_rt3883.o
 ralink-eth-$(CONFIG_NET_RALINK_MT7620) += soc_mt7620.o
-ralink-eth-$(CONFIG_NET_RALINK_MT7621) += soc_mt7621.o
 
 obj-$(CONFIG_NET_RALINK_ESW_RT3050)+= esw_rt3050.o
 obj-$(CONFIG_NET_RALINK_GSW_MT7620)+= gsw_mt7620.o mt7530.o
-obj-$(CONFIG_NET_RALINK_GSW_MT7621)+= gsw_mt7621.o mt7530.o
 obj-$(CONFIG_NET_RALINK_SOC)   += ralink-eth.o
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7621.c 
b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7621.c
deleted file mode 100644
index 232bcd8cf4..00
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7621.c
+++ /dev/null
@@ -1,275 +0,0 @@
-/*   This program is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; version 2 of the License
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   Copyright (C) 2009-2015 John Cris

RE: MT7621 Flow Control

2020-08-14 Thread Adrian Schmutzler
> -Original Message-
> From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org]
> On Behalf Of Jaap Buurman
> Sent: Freitag, 7. August 2020 09:55
> To: John Crispin 
> Cc: OpenWrt Development List ; Andre
> Valentin 
> Subject: Re: MT7621 Flow Control
> 
> On Thu, Aug 6, 2020 at 2:35 PM John Crispin  wrote:
> >
> >
> > On 06.08.20 14:31, Andre Valentin wrote:
> > > Hi Jaap,
> > >
> > >
> > > Am 06.08.20 um 13:43 schrieb Jaap Buurman:
> > >> Dear all,
> > >>
> > >> I have noticed the flow control work for mt7621 in the following
> > >> Openwrt patch:
> > >>
> https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=c8f8e5981
> > >> 6eca49d776562d2d302bf990a87faf0
> > >>
> > >> However, the problem that the patch is supposed to fix is still
> > >> occurring, even in combination with other experimental patches
> > >> submitted. These experiences can be read about here:
> > >> https://forum.openwrt.org/t/mtk-soc-eth-watchdog-timeout-after-
> r115
> > >> 73/5/
> > >>
> > >> However, on this mailing list a user by the name of Kristian claims
> > >> that disabling flow control helps fix this problem, as can be read
> > >> here:
> > >> https://lists.openwrt.org/pipermail/openwrt-devel/2017-
> November/009
> > >> 882.html
> > >>
> > >>  From what I understood, he was running many mt7621 devices
> > >> commercially, with many of them experiencing the issue, which were
> > >> all fixed with his own flow control patch. My question is why the
> > >> decision was made to only disable flow control on port 5 in the
> > >> above mentioned Openwrt patch? AFAIK, Kristian's own patch disables
> > >> flow control on all of the ports and he claims the issue is fixed
> > >> for him. Perhaps the current patch should be extended to disable flow
> control on all ports?
> > >> What are people's thoughts on this?
> > > I'm facing the same issue now after upgrading to 5.4 kernel more often
> than before.
> > > Every second reboot reboot with 5.4 fails with this timeout error.
> > >
> > >> Yours sincerely,
> > >>
> > >> Jaap
> > > André
> > >
> > >
> > from previous discussions with MTK and looking at the SDK code, the
> > flow control should always be disabled.
> >
> >  John
> >
> 
> Dear all,
> 
> I had a look at the actual patch to see if it would be possible for me to 
> extend
> it to disable flow control on all ports. However, I am unsure if the patch in 
> its
> current form even does anything, even for port 5. Here is the diff of the
> commit in question:
> https://git.openwrt.org/?p=openwrt/openwrt.git;a=blobdiff;f=target/linux/
> ramips/files-
> 4.14/drivers/net/ethernet/mediatek/gsw_mt7621.c;h=232bcd8cf4ea5edbd3
> 4d815032ce72b1f1f85661;hp=89be23900738095a8180532d5dd7e585f01bb7c4;
> hb=c8f8e59816eca49d776562d2d302bf990a87faf0;hpb=3e11ddaf2ede4f105b
> c9ac91229623526371a7a2
> 
> In the old code, the IF statement was used to check silicon revision.
> As this code only runs on mt7621 devices, this apparently always evaluates to
> TRUE, which means the ELSE statement is never run.
> Therefore, the IF condition is removed. However, let's see what was in the
> original IF block:
> 
> /* (GE1, Force 1000M/FD, FC ON, MAX_RX_LENGTH 1536) */
> mtk_switch_w32(gsw, 0x2305e30b, GSW_REG_MAC_P0_MCR);
> mt7530_mdio_w32(gsw, 0x3600, 0x5e30b);
> 
> As we can see, some values are written to the switch's registers. The
> included comment states "FC ON" implying that flow control is enabled, as
> expected (since this was the old code).
> 
> Now if we look at the new code, we see this:
> 
> /* (GE1, Force 1000M/FD, FC OFF, MAX_RX_LENGTH 1536) */
> mtk_switch_w32(gsw, 0x2305e30b, GSW_REG_MAC_P0_MCR);
> mt7530_mdio_w32(gsw, 0x3600, 0x5e30b);
> 
> Here the included comment states "FC OFF" implying that flow control is
> disabled. HOWEVER, if we look at the values written and the location where
> they are written to, they are identical in the old and new code. Hence this
> commit doesn't seem to actually change anything.
> Am I reading this correct, or am I missing something?
> 
> Jaap

In addition to what Stijn just wrote, please be aware that these files are not 
used at all for kernel 5.4, as we use DSA there.
There appear to be no CONFIG_NET_RALINK options set in mt7621 at all.
So, whatever you do to these files, it won't matter.

I wonder whether it wouldn't be better to remove these parts from "our" driver 
entirely, so this becomes obvious (as we do not support 4.14 on mt7621 in 
master anyway).

Best

Adrian

> 
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel


openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: MT7621 Flow Control

2020-08-14 Thread Stijn Segers

Hi,

Op donderdag 13 augustus 2020 om 1u46 schreef Andre Valentin 
:

Hello,

it seems that I had another problem when upgrading from 4.14 to 5.4.


5.4 uses DSA on MT7621.

In 4.14 network config I had no switch definition and it worked out 
of the box.

But with 5.4 I need a switch config in network config like that:
config interface 'lan'
option type 'bridge'
option ifname 'eth0.1'


DSA would be:

   option ifname 'lan1 lan2 lan3 lan4'

It does not use any 'ethX' definitions anymore. Looks like you did a 
messy upgrade and kept configs. With all the DSA related breakages on 
MT7621 (and the few other migrated platforms) popping up here and 
there, I'd wager by now most people keeping an eye on master would know 
*not* to keep settings when migrating.


With newer builds Adrian also implemented an explicit warning about DSA 
and config incompatibility. So did you ignore those as well?


Stijn


option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
option metric '10'

config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'

config switch_vlan
option device 'switch0'
option vlan '1'
option ports '0 1 2 3 6t'

Sorry for the noise.

I could now check one of the bricked devices and found no hint for 
the FC issue.


Kind regards,

André


Am 06.08.20 um 14:31 schrieb Andre Valentin:

 Hi Jaap,


 Am 06.08.20 um 13:43 schrieb Jaap Buurman:

 Dear all,

 I have noticed the flow control work for mt7621 in the following
 Openwrt patch: 
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=c8f8e59816eca49d776562d2d302bf990a87faf0


 However, the problem that the patch is supposed to fix is still
 occurring, even in combination with other experimental patches
 submitted. These experiences can be read about here:
 
https://forum.openwrt.org/t/mtk-soc-eth-watchdog-timeout-after-r11573/5/


 However, on this mailing list a user by the name of Kristian claims
 that disabling flow control helps fix this problem, as can be read
 here: 
https://lists.openwrt.org/pipermail/openwrt-devel/2017-November/009882.html


 From what I understood, he was running many mt7621 devices
 commercially, with many of them experiencing the issue, which were 
all
 fixed with his own flow control patch. My question is why the 
decision
 was made to only disable flow control on port 5 in the above 
mentioned

 Openwrt patch? AFAIK, Kristian's own patch disables flow control on
 all of the ports and he claims the issue is fixed for him. Perhaps 
the
 current patch should be extended to disable flow control on all 
ports?

 What are people's thoughts on this?


 I'm facing the same issue now after upgrading to 5.4 kernel more 
often than before.

 Every second reboot reboot with 5.4 fails with this timeout error.



 Yours sincerely,

 Jaap


 André


 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/mailman/listinfo/openwrt-devel




--
Mit freundlichen Grüßen
André Valentin

Systemadministration - Projektkoordination


--
MarcanT AG, Herforder Straße 163a, D - 33609 Bielefeld
Fon: +49 (521) 95945-0 | Fax: +49 (521) 95945-18
URL: http://www.marcant.net  | 
http://www.global-m2m.com 


Internet * Netzwerk * Mobile Daten

Vorstand:
Thorsten Hojas (Vorsitzender)
Marc-Henrik Delker
Dr. Anja-Christina Padberg
Handelsregister: AG Bielefeld, HRB 42260 USt-ID Nr.: DE 190203238



___
Ausserhalb unserer Geschäftszeiten (Montag bis Freitag von 8:30 Uhr 
bis

17:30 Uhr, ausgenommen gesetzliche Feiertage in NRW) stehen wir Ihnen
gemäß Ihrer jeweiligen Service-Level-Agreements unter der Ihnen
mitgeteilten Telefonnummer für Störungen und Notfälle zur 
Verfügung.
Sie können natürlich auch gerne jederzeit unter supp...@marcant.net 
ein

Ticket eröffnen, welches am nächsten Arbeitstag bearbeitet wird.




___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel




___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


ath25 and rb532 fail after mac80211 changes

2020-08-14 Thread Adrian Schmutzler
Hi,

after "mac80211: merge performance improvement patches" [1], build fails on a 
few 4.14 targets, namely ath25, rb532 (and ar71xx):

/builder/shared-workdir/build/build_dir/target-mips_mips32_musl/linux-ath25/backports-5.8-1/net/mac80211/rx.c:4803:3:
 error: implicit declaration of function 'netif_receive_skb_list'; did 
you mean 'netif_receive_skb'? [-Werror=implicit-function-declaration]
   netif_receive_skb_list(&list);
   ^~
   netif_receive_skb
/builder/shared-workdir/build/build_dir/target-mips_mips32_musl/linux-ath25/backports-5.8-1/net/mac80211/rx.c:4808:3:
 error: implicit declaration of function 'skb_list_del_init'; did you 
mean 'hlist_del_init'? [-Werror=implicit-function-declaration]
   skb_list_del_init(skb);
   ^
   hlist_del_init

scripts/Makefile.build:326: recipe for target 
'/builder/shared-workdir/build/build_dir/target-mips_mips32_musl/linux-ath25/backports-5.8-1/net/mac80211/rx.o'
 failed
make[8]: *** 
[/builder/shared-workdir/build/build_dir/target-mips_mips32_musl/linux-ath25/backports-5.8-1/net/mac80211/rx.o]
 Error 1
scripts/Makefile.build:585: recipe for target 
'/builder/shared-workdir/build/build_dir/target-mips_mips32_musl/linux-ath25/backports-5.8-1/net/mac80211'
 failed
make[7]: *** 
[/builder/shared-workdir/build/build_dir/target-mips_mips32_musl/linux-ath25/backports-5.8-1/net/mac80211]
 Error 2


So, we have to decide whether
1. we fix this
2. we leave the buildbots broken
3. we remove those 4.14 targets in master (ath25, rb532)

Personally, I prefer option 3, as it's only a matter of time when we drop those 
targets anyway.

Best

Adrian

[1] 
https://github.com/openwrt/openwrt/commit/3d731fc9030655e18d86f81ca8aed3341ab2bc1e


openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: buildbots/config.guess: error message written into command

2020-08-14 Thread Petr Štetiar
Adrian Schmutzler  [2020-08-12 13:28:21]:

Hi,

> However, I don't see what's the problem with it, it should put the error 
> message into stderr ...

that sed command comes from 
https://git.openwrt.org/?p=buildbot.git;a=blob;f=phase1/master.cfg#l1028
and that config.guess issue is from 
https://git.openwrt.org/?p=buildbot.git;a=blob;f=phase1/master.cfg#l1011
as the build step captures stderr, workaround could be following (untested):

diff --git a/phase1/master.cfg b/phase1/master.cfg
index 3ba7a1606e89..1e68e2e8b862 100644
--- a/phase1/master.cfg
+++ b/phase1/master.cfg
@@ -1012,7 +1012,8 @@ for target in targets:
property = "stageroot",
description = "Finding the rootfs staging 
directory",
command=["make", "--no-print-directory", 
"val.STAGING_DIR_ROOT"],
-   env = { 'TOPDIR': 
Interpolate("%(kw:cwd)s/build", cwd=GetCwd) }
+   env = { 'TOPDIR': 
Interpolate("%(kw:cwd)s/build", cwd=GetCwd) },
+   want_stderr = False
))
 
factory.addStep(ShellCommand(

> If somebody has a clue, I'd be happy if this could be fixed, as sed-ing on
> some "random" paths is not really desirable ...

The origin of those occasional config.guess issues is probably from no disk
space on the build host:

 [pid 29908] 05:15:29 mkdir("/tmp/cg0Qcc67", 0700) = -1 ENOSPC (No space left 
on device)

Those buildslaves are running in Docker containers, so the / from host is / in
the container, so if / on host is full, then / (and /tmp) in container is full
as well.  Builds itself happen in /builder directory which is 25GB tmpfs, so
without space issues.

I'm now trying to find out, what is sometimes making / on host full (there is
usually about 67GB free on /) and fix this annoying and recurring issue for
good.

-- ynezz

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel