Re: [PATCH 2/2] toolchain/musl: remove several GNU headers

2020-08-28 Thread Felix Fietkau
On 2020-08-29 05:28, Rosen Penev wrote:
> Remove GLOB_ONLYDIR patch. Only fstools relies on it. fstools can be fixed
> separately.
> 
> Remove woresize.h file. It seems to be for an old version of GCC.
> 
> Remove features.h and glibc-types files. Same as above.
> 
> Remove sys/cdefs.h. This is a deprecated header. Patches to fix packages
> that use it have already been patched.
> 
> Tested with all packages in the base tree. They all compile.
Did you verify all packages in the feeds as well? When I added some of
these headers years ago, it was because some packages there were still
relying on them.

- Felix

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


[PATCH 1/2] toolchain/musl: update to 1.2.1

2020-08-28 Thread Rosen Penev
This release introduces 64-bit time_t, which is needed to avoid the
year 2038 problem.

Remove upstream patches.

Rebased features.h file based on latest musl.

Signed-off-by: Rosen Penev 
---
 v4: remove sys/cdefs.h as well.
 v3: rebase and split commit between version update and header
 removal.
 v2: removed more glibc headers.
 toolchain/musl/common.mk  |  4 +-
 toolchain/musl/include/features.h | 10 ++-
 .../patches/200-add_libssp_nonshared.patch|  8 +-
 toolchain/musl/patches/300-relative.patch |  2 +-
 ...ist-unlink-in-pthread_exit-after-all.patch | 51 ---
 ...hreads_minus_1-as-relaxed-atomic-for.patch | 69 --
 ...own-size-of-some-libc-struct-members.patch | 25 --
 ...pping-for-processes-that-return-to-s.patch | 90 ---
 8 files changed, 16 insertions(+), 243 deletions(-)
 delete mode 100644 
toolchain/musl/patches/500-0001-reorder-thread-list-unlink-in-pthread_exit-after-all.patch
 delete mode 100644 
toolchain/musl/patches/500-0002-don-t-use-libc.threads_minus_1-as-relaxed-atomic-for.patch
 delete mode 100644 
toolchain/musl/patches/500-0003-cut-down-size-of-some-libc-struct-members.patch
 delete mode 100644 
toolchain/musl/patches/500-0004-restore-lock-skipping-for-processes-that-return-to-s.patch

diff --git a/toolchain/musl/common.mk b/toolchain/musl/common.mk
index 6a59577108..44d2ed5603 100644
--- a/toolchain/musl/common.mk
+++ b/toolchain/musl/common.mk
@@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/target.mk
 
 PKG_NAME:=musl
-PKG_VERSION:=1.1.24
+PKG_VERSION:=1.2.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://musl.libc.org/releases/
-PKG_HASH:=1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+PKG_HASH:=68af6e18539f646f9c41a3a2bb25be4a5cfa5a8f65f0bb647fd2bbfdf877e84b
 
 LIBC_SO_VERSION:=$(PKG_VERSION)
 PATCH_DIR:=$(PATH_PREFIX)/patches
diff --git a/toolchain/musl/include/features.h 
b/toolchain/musl/include/features.h
index edb8cc72d4..e801e2299a 100644
--- a/toolchain/musl/include/features.h
+++ b/toolchain/musl/include/features.h
@@ -1,10 +1,14 @@
 #ifndef _FEATURES_H
 #define _FEATURES_H
 
-#ifdef _ALL_SOURCE
+#if defined(_ALL_SOURCE) && !defined(_GNU_SOURCE)
 #define _GNU_SOURCE 1
 #endif
 
+#if defined(_DEFAULT_SOURCE) && !defined(_BSD_SOURCE)
+#define _BSD_SOURCE 1
+#endif
+
 #if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) \
  && !defined(_XOPEN_SOURCE) && !defined(_GNU_SOURCE) \
  && !defined(_BSD_SOURCE) && !defined(__STRICT_ANSI__)
@@ -20,6 +24,8 @@
 
 #if __STDC_VERSION__ >= 199901L || defined(__cplusplus)
 #define __inline inline
+#elif !defined(__GNUC__)
+#define __inline
 #endif
 
 #if __STDC_VERSION__ >= 201112L
@@ -29,6 +35,8 @@
 #define _Noreturn
 #endif
 
+#define __REDIR(x,y) __typeof__(x) x __asm__(#y)
+
 /* Convenience macros to test the versions of glibc and gcc.
Use them like this:
#if __GNUC_PREREQ (2,8)
diff --git a/toolchain/musl/patches/200-add_libssp_nonshared.patch 
b/toolchain/musl/patches/200-add_libssp_nonshared.patch
index 05bd2fe54a..26a9bfebea 100644
--- a/toolchain/musl/patches/200-add_libssp_nonshared.patch
+++ b/toolchain/musl/patches/200-add_libssp_nonshared.patch
@@ -7,7 +7,7 @@ Signed-off-by: Steven Barth 
 
 --- a/Makefile
 +++ b/Makefile
-@@ -66,7 +66,7 @@ CRT_LIBS = $(addprefix lib/,$(notdir $(C
+@@ -67,7 +67,7 @@ CRT_LIBS = $(addprefix lib/,$(notdir $(C
  STATIC_LIBS = lib/libc.a
  SHARED_LIBS = lib/libc.so
  TOOL_LIBS = lib/musl-gcc.specs
@@ -16,7 +16,7 @@ Signed-off-by: Steven Barth 
  ALL_TOOLS = obj/musl-gcc
  
  WRAPCC_GCC = gcc
-@@ -86,7 +86,7 @@ else
+@@ -88,7 +88,7 @@ else
  
  all: $(ALL_LIBS) $(ALL_TOOLS)
  
@@ -25,7 +25,7 @@ Signed-off-by: Steven Barth 
  
  $(ALL_LIBS) $(ALL_TOOLS) $(ALL_OBJS) $(ALL_OBJS:%.o=%.lo) $(GENH) 
$(GENH_INT): | $(OBJ_DIRS)
  
-@@ -113,6 +113,8 @@ obj/crt/rcrt1.o: $(srcdir)/ldso/dlstart.
+@@ -115,6 +115,8 @@ obj/crt/rcrt1.o: $(srcdir)/ldso/dlstart.
  
  obj/crt/Scrt1.o obj/crt/rcrt1.o: CFLAGS_ALL += -fPIC
  
@@ -34,7 +34,7 @@ Signed-off-by: Steven Barth 
  OPTIMIZE_SRCS = $(wildcard $(OPTIMIZE_GLOBS:%=$(srcdir)/src/%))
  $(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.o) 
$(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.lo): CFLAGS += -O3
  
-@@ -165,6 +167,11 @@ lib/libc.a: $(AOBJS)
+@@ -167,6 +169,11 @@ lib/libc.a: $(AOBJS)
$(AR) rc $@ $(AOBJS)
$(RANLIB) $@
  
diff --git a/toolchain/musl/patches/300-relative.patch 
b/toolchain/musl/patches/300-relative.patch
index e34e60a09d..7e1eb7d6bc 100644
--- a/toolchain/musl/patches/300-relative.patch
+++ b/toolchain/musl/patches/300-relative.patch
@@ -1,6 +1,6 @@
 --- a/Makefile
 +++ b/Makefile
-@@ -215,7 +215,7 @@ $(DESTDIR)$(includedir)/%: $(srcdir)/inc
+@@ -217,7 +217,7 @@ $(DESTDIR)$(includedir)/%: $(srcdir)/inc
$(INSTALL) -D -m 644 $< $@
  
  $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so
diff --git 

[PATCH 2/2] toolchain/musl: remove several GNU headers

2020-08-28 Thread Rosen Penev
Remove GLOB_ONLYDIR patch. Only fstools relies on it. fstools can be fixed
separately.

Remove woresize.h file. It seems to be for an old version of GCC.

Remove features.h and glibc-types files. Same as above.

Remove sys/cdefs.h. This is a deprecated header. Patches to fix packages
that use it have already been patched.

Tested with all packages in the base tree. They all compile.

Signed-off-by: Rosen Penev 
---
 v4: remove sys/cdefs.h as well.
 v3: rebase and split commit between version update and header
 removal.
 v2: removed more glibc headers.
 toolchain/musl/include/bits/wordsize.h|   1 -
 toolchain/musl/include/features.h |  56 ---
 toolchain/musl/include/sgidefs.h  |  73 
 toolchain/musl/include/sys/cdefs.h| 378 --
 toolchain/musl/include/sys/glibc-types.h  |  35 --
 .../musl/patches/100-add_glob_onlydir.patch   |  11 -
 6 files changed, 554 deletions(-)
 delete mode 100644 toolchain/musl/include/bits/wordsize.h
 delete mode 100644 toolchain/musl/include/features.h
 delete mode 100644 toolchain/musl/include/sgidefs.h
 delete mode 100644 toolchain/musl/include/sys/cdefs.h
 delete mode 100644 toolchain/musl/include/sys/glibc-types.h
 delete mode 100644 toolchain/musl/patches/100-add_glob_onlydir.patch

diff --git a/toolchain/musl/include/bits/wordsize.h 
b/toolchain/musl/include/bits/wordsize.h
deleted file mode 100644
index 2d4cbe8317..00
--- a/toolchain/musl/include/bits/wordsize.h
+++ /dev/null
@@ -1 +0,0 @@
-#include 
diff --git a/toolchain/musl/include/features.h 
b/toolchain/musl/include/features.h
deleted file mode 100644
index e801e2299a..00
--- a/toolchain/musl/include/features.h
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef _FEATURES_H
-#define _FEATURES_H
-
-#if defined(_ALL_SOURCE) && !defined(_GNU_SOURCE)
-#define _GNU_SOURCE 1
-#endif
-
-#if defined(_DEFAULT_SOURCE) && !defined(_BSD_SOURCE)
-#define _BSD_SOURCE 1
-#endif
-
-#if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) \
- && !defined(_XOPEN_SOURCE) && !defined(_GNU_SOURCE) \
- && !defined(_BSD_SOURCE) && !defined(__STRICT_ANSI__)
-#define _BSD_SOURCE 1
-#define _XOPEN_SOURCE 700
-#endif
-
-#if __STDC_VERSION__ >= 199901L
-#define __restrict restrict
-#elif !defined(__GNUC__)
-#define __restrict
-#endif
-
-#if __STDC_VERSION__ >= 199901L || defined(__cplusplus)
-#define __inline inline
-#elif !defined(__GNUC__)
-#define __inline
-#endif
-
-#if __STDC_VERSION__ >= 201112L
-#elif defined(__GNUC__)
-#define _Noreturn __attribute__((__noreturn__))
-#else
-#define _Noreturn
-#endif
-
-#define __REDIR(x,y) __typeof__(x) x __asm__(#y)
-
-/* Convenience macros to test the versions of glibc and gcc.
-   Use them like this:
-   #if __GNUC_PREREQ (2,8)
-   ... code requiring gcc 2.8 or later ...
-   #endif
-   Note - they won't work for gcc1 or glibc1, since the _MINOR macros
-   were not defined then.  */
-#if defined __GNUC__ && defined __GNUC_MINOR__
-# define __GNUC_PREREQ(maj, min) \
-   ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
-#else
-# define __GNUC_PREREQ(maj, min) 0
-#endif
-
-#include 
-
-#endif
diff --git a/toolchain/musl/include/sgidefs.h b/toolchain/musl/include/sgidefs.h
deleted file mode 100644
index 74509fdbd0..00
--- a/toolchain/musl/include/sgidefs.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Copyright (C) 1996, 1997, 1998, 2003, 2004 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ralf Baechle .
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library 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
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#ifndef _SGIDEFS_H
-#define _SGIDEFS_H 1
-
-/*
- * A crude hack to stop 
- */
-#undef __ASM_SGIDEFS_H
-#define __ASM_SGIDEFS_H
-
-/*
- * And remove any damage it might have already done
- */
-#undef _MIPS_ISA_MIPS1
-#undef _MIPS_ISA_MIPS2
-#undef _MIPS_ISA_MIPS3
-#undef _MIPS_ISA_MIPS4
-#undef _MIPS_ISA_MIPS5
-#undef _MIPS_ISA_MIPS32
-#undef _MIPS_ISA_MIPS64
-
-#undef _MIPS_SIM_ABI32
-#undef _MIPS_SIM_NABI32
-#undef _MIPS_SIM_ABI64
-
-/*
- * Definitions for the ISA level
- */
-#define _MIPS_ISA_MIPS1 1
-#define _MIPS_ISA_MIPS2 2
-#define _MIPS_ISA_MIPS3 3
-#define _MIPS_ISA_MIPS4 4
-#define _MIPS_ISA_MIPS5 5
-#define _MIPS_ISA_MIPS32 6
-#define _MIPS_ISA_MIPS64 7
-
-/*
- * Subprogram calling convention
- */
-#ifndef 

Re: [PATCH] ugps: fix 64-bit time_t

2020-08-28 Thread Rosen Penev
On Tue, Jul 21, 2020 at 3:50 PM Rosen Penev  wrote:
>
> The abs function takes a 32-bit int, which can cause truncation. Fixes
> compilation error:
>
> error: absolute value function 'abs' given an argu>
> if ((sec < 0) || (abs(cur.tv_sec - tv.tv_sec) > MAX_TIME_OFFSET)) {
Ping. This is still not applied.
>
> Signed-off-by: Rosen Penev 
> ---
>  nmea.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/nmea.c b/nmea.c
> index 8df7792..1204c20 100644
> --- a/nmea.c
> +++ b/nmea.c
> @@ -107,7 +107,7 @@ nmea_rmc_cb(void)
>
> gettimeofday(, NULL);
>
> -   if ((sec < 0) || (abs(cur.tv_sec - sec) > 
> MAX_TIME_OFFSET)) {
> +   if ((sec < 0) || (llabs(cur.tv_sec - sec) > 
> MAX_TIME_OFFSET)) {
> struct timeval tv = { 0 };
> tv.tv_sec = sec;
> if (++nmea_bad_time > MAX_BAD_TIME) {
> --
> 2.26.2
>

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


[PATCHv3 1/2] libcxxabi: add

2020-08-28 Thread Rosen Penev
This will be used for libcxx.

libcxxabi is needed as libsupc++ is not good enough for libcxx. It uses
GCC specific stuff which causes failed compilation for some packages.
There are also runtime issues, most notably with cxxopts where the
program just crashes.

Reference: https://github.com/gerbera/gerbera/issues/795

Added patch to fix ARM compilation.

Signed-off-by: Rosen Penev 
---
 v3: Add ARM patch to fix compilation at least under mvebu.
 v2: Added extra description.
 package/libs/libcxxabi/Makefile  | 71 
 package/libs/libcxxabi/patches/010-arm.patch | 27 
 2 files changed, 98 insertions(+)
 create mode 100644 package/libs/libcxxabi/Makefile
 create mode 100644 package/libs/libcxxabi/patches/010-arm.patch

diff --git a/package/libs/libcxxabi/Makefile b/package/libs/libcxxabi/Makefile
new file mode 100644
index 00..90547561b2
--- /dev/null
+++ b/package/libs/libcxxabi/Makefile
@@ -0,0 +1,71 @@
+
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libcxxabi
+PKG_VERSION:=10.0.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).src.tar.xz
+PKG_SOURCE_URL:=https://github.com/llvm/llvm-project/releases/download/llvmorg-$(PKG_VERSION)
+PKG_HASH:=e71bac75a88c9dde455ad3f2a2b449bf745eafd41d2d8432253b2964e0ca14e1
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION).src
+
+PKG_MAINTAINER:=Rosen Penev 
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE.txt
+
+PKG_BUILD_PARALLEL:=1
+CMAKE_BINARY_SUBDIR:=build
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/libcxxabi
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=LLVM lib++abi
+  URL:=https://libcxxabi.llvm.org/
+  DEPENDS:=+libpthread
+  BUILDONLY:=1
+endef
+
+define Package/libcxxabi/description
+  libc++abi is a new implementation of low level support for a standard C++ 
library.
+endef
+
+CMAKE_OPTIONS += \
+   -DLIBCXXABI_ENABLE_EXCEPTIONS=ON \
+   -DLIBCXXABI_ENABLE_PEDANTIC=OFF \
+   -DLIBCXXABI_ENABLE_PIC=ON \
+   -DLIBCXXABI_ENABLE_WERROR=OFF \
+   -DLIBCXXABI_USE_LLVM_UNWINDER=OFF \
+   -DLIBCXXABI_USE_COMPILER_RT=OFF \
+   -DLIBCXXABI_ENABLE_THREADS=ON \
+   -DLIBCXXABI_HAS_PTHREAD_API=ON \
+   -DLIBCXXABI_INCLUDE_TESTS=OFF \
+   -DLIBCXXABI_LIBDIR_SUFFIX="" \
+   -DLIBCXXABI_INSTALL_LIBRARY=ON \
+   -DLIBCXXABI_ENABLE_SHARED=OFF \
+   -DLIBCXXABI_LIBCXX_SRC_DIR=$(BUILD_DIR)/libcxx-$(PKG_VERSION).src \
+   
-DLIBCXXABI_LIBCXX_INCLUDES=$(BUILD_DIR)/libcxx-$(PKG_VERSION).src/include
+
+TARGET_CXXFLAGS += -flto
+TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
+
+define Build/Prepare
+   $(MAKE) -C $(TOPDIR)/package/libs/libcxx prepare
+   $(call Build/Prepare/Default)
+endef
+
+define Build/InstallDev
+   $(call Build/InstallDev/cmake,$(1))
+   $(INSTALL_DIR) $(1)/usr/include/
+   $(INSTALL_DATA) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include/
+endef
+
+$(eval $(call BuildPackage,libcxxabi))
diff --git a/package/libs/libcxxabi/patches/010-arm.patch 
b/package/libs/libcxxabi/patches/010-arm.patch
new file mode 100644
index 00..c4f6907c97
--- /dev/null
+++ b/package/libs/libcxxabi/patches/010-arm.patch
@@ -0,0 +1,27 @@
+--- a/src/cxa_exception.h
 b/src/cxa_exception.h
+@@ -27,6 +27,13 @@ _LIBCXXABI_HIDDEN uint64_t __getExceptionClass  (const 
_Unwind_Exception*);
+ _LIBCXXABI_HIDDEN void __setExceptionClass  (  _Unwind_Exception*, 
uint64_t);
+ _LIBCXXABI_HIDDEN bool __isOurExceptionClass(const _Unwind_Exception*);
+ 
++#if defined(__arm__) && defined(__GNUC__)
++// missing values from _Unwind_Reason_Code enum
++#define _URC_FATAL_PHASE2_ERROR ((_Unwind_Reason_Code)2)
++#define _URC_FATAL_PHASE1_ERROR ((_Unwind_Reason_Code)3)
++#define _URC_NORMAL_STOP ((_Unwind_Reason_Code)4)
++#endif
++
+ struct _LIBCXXABI_HIDDEN __cxa_exception {
+ #if defined(__LP64__) || defined(_WIN64) || defined(_LIBCXXABI_ARM_EHABI)
+ // Now _Unwind_Exception is marked with __attribute__((aligned)),
+--- a/src/cxa_personality.cpp
 b/src/cxa_personality.cpp
+@@ -1108,7 +1108,7 @@ __gxx_personality_v0(_Unwind_State state,
+ 
+ // Check the undocumented force unwinding behavior
+ bool is_force_unwinding = state & _US_FORCE_UNWIND;
+-state &= ~_US_FORCE_UNWIND;
++state = (_Unwind_State)(state & ~_US_FORCE_UNWIND);
+ 
+ scan_results results;
+ switch (state) {
-- 
2.26.2


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


[PATCHv3 2/2] libcxx: update to 10.0.0

2020-08-28 Thread Rosen Penev
Switched to upstream tarballs.

Switched to libcxxabi as using libsupc++ is quite wonky.

Fixed description.

Removed patches. The fixes are cosmetic.

Added ssp patch. This one is needed for i386 and powerpc under musl.

Compile tested every C++ package in the tree with the exception of
several boost packages. There's something broken with boost.

Ran tested with gerbera.

Signed-off-by: Rosen Penev 
---
 package/libs/libcxx/Makefile| 18 +--
 package/libs/libcxx/files/g++-libcxx|  4 +--
 package/libs/libcxx/patches/010-cxx17.patch | 14 -
 package/libs/libcxx/patches/010-ssp.patch   | 13 
 package/libs/libcxx/patches/020-fixes.patch | 35 -
 5 files changed, 24 insertions(+), 60 deletions(-)
 delete mode 100644 package/libs/libcxx/patches/010-cxx17.patch
 create mode 100644 package/libs/libcxx/patches/010-ssp.patch
 delete mode 100644 package/libs/libcxx/patches/020-fixes.patch

diff --git a/package/libs/libcxx/Makefile b/package/libs/libcxx/Makefile
index 8343cbb427..3809bea651 100644
--- a/package/libs/libcxx/Makefile
+++ b/package/libs/libcxx/Makefile
@@ -7,19 +7,20 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libcxx
-PKG_VERSION:=9.0.1
-PKG_RELEASE:=4
+PKG_VERSION:=10.0.0
+PKG_RELEASE:=1
 
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://git.llvm.org/git/libcxx
-PKG_SOURCE_VERSION:=2076f539f410805ef88692b9c0ce0a0b882a7680
-PKG_MIRROR_HASH:=d527880a18dec9109575c76717cf5288fb91c11381b9d261cae2e5bebcbdab2e
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).src.tar.xz
+PKG_SOURCE_URL:=https://github.com/llvm/llvm-project/releases/download/llvmorg-$(PKG_VERSION)
+PKG_HASH:=270f8a3f176f1981b0f6ab8aa556720988872ec2b48ed3b605d0ced8d09156c7
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION).src
 
 PKG_MAINTAINER:=Rosen Penev 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=LICENSE.txt
 
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_DEPENDS:=libcxxabi
 CMAKE_BINARY_SUBDIR:=build
 
 include $(INCLUDE_DIR)/package.mk
@@ -34,12 +35,11 @@ define Package/libcxx
 endef
 
 define Package/libcxx/description
-  LLVM C++ library targeting C++11 and above
+  libc++ is an implementation of the C++ standard library, targeting C++11, 
C++14 and above.
 endef
 
 CMAKE_OPTIONS += \
-   -DLIBCXX_CXX_ABI="libsupc++" \
-   
-DLIBCXX_CXX_ABI_INCLUDE_PATHS="$(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/include/c++/$(CONFIG_GCC_VERSION);$(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/include/c++/$(CONFIG_GCC_VERSION)/$(REAL_GNU_TARGET_NAME)"
 \
+   -DLIBCXX_CXX_ABI="libcxxabi" \
-DLIBCXX_ENABLE_ASSERTIONS=OFF \
-DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF \
-DLIBCXX_INCLUDE_BENCHMARKS=OFF \
diff --git a/package/libs/libcxx/files/g++-libcxx 
b/package/libs/libcxx/files/g++-libcxx
index 81ca46eb0e..88b3e7da01 100755
--- a/package/libs/libcxx/files/g++-libcxx
+++ b/package/libs/libcxx/files/g++-libcxx
@@ -13,7 +13,7 @@ do
-static) [ "$WRAPPER_LIBS" != "-lc -lgcc_s -lssp_nonshared -lgcc_eh" ] 
&& WRAPPER_LIBS="-lc -lgcc_s -lssp_nonshared -lgcc_eh" ;;
esac
 done
-[ "$WRAPPER_INCLIB" = "Y" ] && WRAPPER_OPTIONS="-nodefaultlibs $WRAPPER_LIBDIR 
-lc++ -lsupc++ $WRAPPER_LIBS"
+[ "$WRAPPER_INCLIB" = "Y" ] && WRAPPER_OPTIONS="-nodefaultlibs $WRAPPER_LIBDIR 
-lc++ -lc++abi $WRAPPER_LIBS"
 
-exec CXX -fno-builtin -nostdinc++ -DGCC_HASCLASSVISIBILITY 
"$WRAPPER_INCLUDEDIR" "$@" $WRAPPER_OPTIONS
+exec CXX -nostdinc++ -DGCC_HASCLASSVISIBILITY "$WRAPPER_INCLUDEDIR" "$@" 
$WRAPPER_OPTIONS
 
diff --git a/package/libs/libcxx/patches/010-cxx17.patch 
b/package/libs/libcxx/patches/010-cxx17.patch
deleted file mode 100644
index dceec9d4f3..00
--- a/package/libs/libcxx/patches/010-cxx17.patch
+++ /dev/null
@@ -1,14 +0,0 @@
 a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -524,9 +524,9 @@ remove_flags(-Wno-pedantic -pedantic-err
- if (LIBCXX_HAS_MUSL_LIBC OR LIBCXX_TARGETING_CLANG_CL)
-   # musl's pthread implementations uses volatile types in their structs which 
is
-   # not a constexpr in C++11 but is in C++14, so we use C++14 with musl.
--  set(LIBCXX_STANDARD_VER c++14 CACHE STRING "internal option to change build 
dialect")
-+  set(LIBCXX_STANDARD_VER c++2a CACHE STRING "internal option to change build 
dialect")
- else()
--  set(LIBCXX_STANDARD_VER c++11 CACHE STRING "internal option to change build 
dialect")
-+  set(LIBCXX_STANDARD_VER c++2a CACHE STRING "internal option to change build 
dialect")
- endif()
- add_compile_flags_if_supported(-std=${LIBCXX_STANDARD_VER})
- add_compile_flags_if_supported("/std:${LIBCXX_STANDARD_VER}")
diff --git a/package/libs/libcxx/patches/010-ssp.patch 
b/package/libs/libcxx/patches/010-ssp.patch
new file mode 100644
index 00..c9dc90c7f2
--- /dev/null
+++ b/package/libs/libcxx/patches/010-ssp.patch
@@ -0,0 +1,13 @@
+--- a/CMakeLists.txt
 b/CMakeLists.txt
+@@ -760,6 +760,10 @@ function(cxx_link_system_libraries target)
+ target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++  if (LIBCXX_HAS_MUSL_LIBC)
++

[PATCH 18.06] mac80211: Backport fixes for Kr00k vulnerabilities

2020-08-28 Thread Hauke Mehrtens
This backports some fixes from kernel 5.6 and 4.14.175.

Signed-off-by: Hauke Mehrtens 
---
 ...ation-unauthorized-before-key-remova.patch | 42 +++
 ...ort-authorization-in-the-ieee80211_t.patch | 54 +++
 ...-fix-authentication-with-iwlwifi-mvm.patch | 34 
 3 files changed, 130 insertions(+)
 create mode 100644 
package/kernel/mac80211/patches/480-mac80211-mark-station-unauthorized-before-key-remova.patch
 create mode 100644 
package/kernel/mac80211/patches/481-mac80211-Check-port-authorization-in-the-ieee80211_t.patch
 create mode 100644 
package/kernel/mac80211/patches/482-mac80211-fix-authentication-with-iwlwifi-mvm.patch

diff --git 
a/package/kernel/mac80211/patches/480-mac80211-mark-station-unauthorized-before-key-remova.patch
 
b/package/kernel/mac80211/patches/480-mac80211-mark-station-unauthorized-before-key-remova.patch
new file mode 100644
index 00..012b6cae15
--- /dev/null
+++ 
b/package/kernel/mac80211/patches/480-mac80211-mark-station-unauthorized-before-key-remova.patch
@@ -0,0 +1,42 @@
+From 1ec47ff0525c4a530dc7783cb28044179334a4cc Mon Sep 17 00:00:00 2001
+From: Johannes Berg 
+Date: Thu, 26 Mar 2020 15:51:35 +0100
+Subject: [PATCH] mac80211: mark station unauthorized before key removal
+
+commit b16798f5b907733966fd1a558fca823b3c67e4a1 upstream.
+
+If a station is still marked as authorized, mark it as no longer
+so before removing its keys. This allows frames transmitted to it
+to be rejected, providing additional protection against leaking
+plain text data during the disconnection flow.
+
+Cc: sta...@vger.kernel.org
+Link: 
https://lore.kernel.org/r/20200326155133.ccb4fb0bb356.If48f0f0504efdcf16b8921f48c6d3bb2cb763c99@changeid
+Signed-off-by: Johannes Berg 
+Signed-off-by: Greg Kroah-Hartman 
+---
+ net/mac80211/sta_info.c | 6 ++
+ 1 file changed, 6 insertions(+)
+
+--- a/net/mac80211/sta_info.c
 b/net/mac80211/sta_info.c
+@@ -3,6 +3,7 @@
+  * Copyright 2006-2007Jiri Benc 
+  * Copyright 2013-2014  Intel Mobile Communications GmbH
+  * Copyright (C) 2015 - 2017 Intel Deutschland GmbH
++ * Copyright (C) 2018-2020 Intel Corporation
+  *
+  * This program is free software; you can redistribute it and/or modify
+  * it under the terms of the GNU General Public License version 2 as
+@@ -976,6 +977,11 @@ static void __sta_info_destroy_part2(str
+   might_sleep();
+   lockdep_assert_held(>sta_mtx);
+ 
++  while (sta->sta_state == IEEE80211_STA_AUTHORIZED) {
++  ret = sta_info_move_state(sta, IEEE80211_STA_ASSOC);
++  WARN_ON_ONCE(ret);
++  }
++
+   /* now keys can no longer be reached */
+   ieee80211_free_sta_keys(local, sta);
+ 
diff --git 
a/package/kernel/mac80211/patches/481-mac80211-Check-port-authorization-in-the-ieee80211_t.patch
 
b/package/kernel/mac80211/patches/481-mac80211-Check-port-authorization-in-the-ieee80211_t.patch
new file mode 100644
index 00..1867e809be
--- /dev/null
+++ 
b/package/kernel/mac80211/patches/481-mac80211-Check-port-authorization-in-the-ieee80211_t.patch
@@ -0,0 +1,54 @@
+From 07dc42ff9b9c38eae221b36acda7134ab8670af8 Mon Sep 17 00:00:00 2001
+From: Jouni Malinen 
+Date: Thu, 26 Mar 2020 15:51:34 +0100
+Subject: [PATCH] mac80211: Check port authorization in the
+ ieee80211_tx_dequeue() case
+
+commit ce2e1ca703071723ca2dd94d492a5ab6d15050da upstream.
+
+mac80211 used to check port authorization in the Data frame enqueue case
+when going through start_xmit(). However, that authorization status may
+change while the frame is waiting in a queue. Add a similar check in the
+dequeue case to avoid sending previously accepted frames after
+authorization change. This provides additional protection against
+potential leaking of frames after a station has been disconnected and
+the keys for it are being removed.
+
+Cc: sta...@vger.kernel.org
+Signed-off-by: Jouni Malinen 
+Link: 
https://lore.kernel.org/r/20200326155133.ced84317ea29.I34d4c47cd8cc8a4042b38a76f16a601fbcbfd9b3@changeid
+Signed-off-by: Johannes Berg 
+Signed-off-by: Greg Kroah-Hartman 
+---
+ net/mac80211/tx.c | 19 ++-
+ 1 file changed, 18 insertions(+), 1 deletion(-)
+
+--- a/net/mac80211/tx.c
 b/net/mac80211/tx.c
+@@ -3496,8 +3496,25 @@ begin:
+   tx.sdata = vif_to_sdata(info->control.vif);
+   tx.hdrlen = ieee80211_padded_hdrlen(hw, hdr->frame_control);
+ 
+-  if (txq->sta)
++  if (txq->sta) {
+   tx.sta = container_of(txq->sta, struct sta_info, sta);
++  /*
++   * Drop unicast frames to unauthorised stations unless they are
++   * EAPOL frames from the local station.
++   */
++  if (unlikely(!ieee80211_vif_is_mesh(>vif) &&
++   tx.sdata->vif.type != NL80211_IFTYPE_OCB &&
++   !is_multicast_ether_addr(hdr->addr1) &&
++   !test_sta_flag(tx.sta, WLAN_STA_AUTHORIZED) &&
++   

Re: Upcoming 19.07.4 and 18.07.9 stable releases

2020-08-28 Thread Hauke Mehrtens
On 7/30/20 8:57 PM, Baptiste Jonglez wrote:
> Hi,
> 
> New point releases for 19.07 and 18.06 are starting to be overdue, and I
> would like to help 19.07.4 and 18.06.9 get released somewhere around
> mid-August.
> 
> The main motivation are fixes for a libubox regression and for the musl
> synchronisation bug, as well as a LuCI regression (see "release goals"
> below).  But there are many other fixes, mostly device-related, that also
> motivate these new point releases.  If you have more fixes to backport,
> please consider doing so soon, especially for 18.06.9 which will likely be
> the last release for 18.06.
> 
> 
> The following links can be useful to track changes for 19.07:
> 
> - release goals for 19.07.4 (mostly high-level): 
> https://openwrt.org/docs/guide-developer/releases/goals/19.07.4
> 
> - current release notes for 19.07.4: 
> https://openwrt.org/releases/19.07/notes-19.07.4
> 
> - pending patches on patchwork for 19.07: 
> https://patchwork.ozlabs.org/project/openwrt/list/?q=19.07
> 
> - pending patches on github for 19.07: 
> https://github.com/openwrt/openwrt/pulls?q=is%3Apr+is%3Aopen+label%3Arelease%2F19.07
> 
> - open bug reports for 19.07: 
> https://bugs.openwrt.org/index.php?do=tasklist=2%5B0%5D=open%5B%5D=10=severity=desc
> 
> 
> And for 18.06 (overall, things are obviously more quiet):
> 
> - current release notes for 18.06.9: 
> https://openwrt.org/releases/18.06/notes-18.06.9
> 
> - pending patches on patchwork for 18.06: 
> https://patchwork.ozlabs.org/project/openwrt/list/?q=18.06
> 
> - pending patches on github for 18.06: 
> https://github.com/openwrt/openwrt/pulls?q=is%3Apr+is%3Aopen+label%3Arelease%2F18.06
> 
> - open bug reports for 18.06: 
> https://bugs.openwrt.org/index.php?do=tasklist=2%5B0%5D=open%5B%5D=8=severity=desc
> 
> 
> While everything is mostly ready, the actual release will need somebody
> with the rights to "push the button": 
> https://openwrt.org/docs/guide-developer/releases/making-service-release
> 
> Regards,
> Baptiste

Hi,

I would like to do a 19.07.4 and a 18.06.9 release on Sunday or
beginning of next week.

Is there something missing in the current branches which should get into
this release?

Hauke

Hauke



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


RE: [PATCH 1/2] ipq40xx: add support for Luma WRTQ-329ACN

2020-08-28 Thread Adrian Schmutzler
Hi,

> + DEVICE_VENDOR := Luma
> + DEVICE_MODEL := Home (WRTQ-329ACN)

If you use WRTQ-329ACN as the primary name for OpenWrt here (as in device 
definition, compatible), I'd also put it first here and have the "Home" in 
brackets.
Apart from that, I'd make DEVICE_VENDOR/DEVICE_MODEL consistent with the DTS, 
so add the "Home" in brackets there, too.
 
> + SOC := qcom-ipq4018
> + DEVICE_DTS := qcom-ipq4018-wrtq-329acn

DEVICE_DTS can be dropped, it should be calculated from SOC and device name.

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 1/2] ipq40xx: add support for Luma WRTQ-329ACN

2020-08-28 Thread Tomasz Maciej Nowak
Luma WRTQ-329ACN, also known as Luma Home WiFi, is a dual-band wireless
access point.

Specification
SoC: Qualcomm Atheros IPQ4018
RAM: 256 MB DDR3
Flash: 2 MB SPI NOR
   128 MB SPI NAND
WIFI: 2.4 GHz 2T2R integrated
  5 GHz 2T2R integrated
Ethernet: 2x 10/100/1000 Mbps QCA8075
USB: 1x 2.0
Bluetooth: 1x 4.0 CSR8510 A10, connected to USB bus
LEDS: 16x multicolor LEDs ring, controlled by MSP430G2403 MCU
Buttons: 1x GPIO controlled
EEPROM: 16 Kbit, compatible with AT24C16
UART: row of 4 holes marked on PCB as J19, starting count from the side
  of J19 marking on PCB
  1. GND, 2. RX, 3. TX, 4. 3.3V
  baud: 115200, parity: none, flow control: none

The device supports OTA or USB flash drive updates, unfotunately they
are signed. Until the signing key is known, the UART access is mandatory
for installation. The difficult part is disassembling the casing, there
are a lot of latches holding it together.

Teardown
Prepare three thin, but sturdy, prying tools. Place the device with back
of it facing upwards. Start with the wall having a small notch. Insert
first tool, until You'll feel resistance and keep it there. Repeat the
procedure for neighbouring walls. With applying a pressure, one edge of
the back cover should pop up. Now carefully slide one of the tools to
free the rest of the latches.
There's no need to solder pins to the UART holes, You can use hook clips,
but wiring them outside the casing, will ease debuging and recovery if
problems occur.

Installation
1. Prepare TFTP server with OpenWrt initramfs image.
2. Connect to UART port (don't connect the voltage pin).
3. Connect to LAN port.
4. Power on the device, carefully observe the console output and when
   asked quickly enter the failsafe mode.
5. Invoke 'mount_root'.
6. After the overlayfs is mounted run:
 fw_setenv bootdelay 3
   This will allow to access U-Boot shell.
7. Reboot the device and when prompted to stop autoboot, hit any key.
8. Adjust "ipaddr" and "serverip" addresses in U-Boot environment, use
   'setenv' to do that, then run following commands:
 tftpboot 0x8400 
 bootm 0x8400
   and wait till OpenWrt boots.
9. In OpenWrt command line run following commands:
 fw_setenv openwrt "setenv mtdids nand1=spi_nand; setenv mtdparts 
mtdparts=spi_nand:-(ubi); ubi part ubi; ubi read 0x8400 kernel1; bootm 
0x8400"
 fw_setenv bootcmd "run openwrt"
10. Transfer OpenWrt sysupgrade image to /tmp directory and flash it
with:
  sysupgrade -v -n /tmp/
11. After flashing, the access point will reboot to OpenWrt, then it's
ready for configuration.

Reverting to OEM firmware
1. Execute installation guide steps: 1, 2, 3, 7, 8.
2. In OpenWrt command line run following commands:
 ubirmvol /dev/ubi0 -N rootfs_data
 ubirmvol /dev/ubi0 -N ubi_rootfs1
 ubirmvol /dev/ubi0 -N kernel1
 ubimkvol /dev/ubi0 -S 264 -N rootfs_data
 ubimkvol /dev/ubi0 -S 34 -N kernel1
 ubimkvol /dev/ubi0 -S 320 -N ubi_rootfs1
 fw_setenv bootcmd bootipq
3. Reboot.

Known issues
The LEDs ring doesn't have any dedicated driver or application to control
it, the only available option atm is to manipulate it with 'i2cset'
command. The default action after applying power to device is spinning
blue light. This light will stay active at all time. To disable it
install 'i2c-tools' with opkg and run:
 i2cset -y 2 0x48 3 1 0 0 i
The light will stay off until next cold boot.

Additional information
After completing 5. step from installation guide, one can disable asking
for root password on OEM firmware by running:
 sed -e 's/root:x:/root::/' -i /etc/passwd
This could be useful to ivestigate OEM firmware and communication with
producer cloud servers or simply making a backup of both flash chips.
The root password seems to be constant across all sold devices.
This is output of 'led_ctl' from OEM firmware to illustrate
possibilities of LEDs ring:

Usage: led_ctl [status | upgrade | force_upgrade | version]
   led_ctl solidCOLOR 
   led_ctl single   COLOR INDEX 
   led_ctl spinning COLOR 
   led_ctl fill COLOR 
 ( default is 5 )
   led_ctl flashing COLOR   
  (default is  34)  ( default is 34 )
   led_ctl pulsing  COLOR
COLOR: red, green, blue, yellow, purple, cyan, white

Signed-off-by: Tomasz Maciej Nowak 
---
 package/boot/uboot-envtools/files/ipq40xx |   1 +
 .../ipq40xx/base-files/etc/board.d/02_network |   3 +-
 .../etc/hotplug.d/firmware/11-ath10k-caldata  |   2 +
 .../base-files/lib/upgrade/platform.sh|   6 +
 .../arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts | 277 ++
 target/linux/ipq40xx/image/Makefile   |  13 +
 .../901-arm-boot-add-dts-files.patch  |   3 +-
 7 files changed, 303 insertions(+), 2 deletions(-)
 create mode 100644 
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts

diff --git a/package/boot/uboot-envtools/files/ipq40xx 

[PATCH 2/2] ipq-wifi: add BDF for Luma WRTQ-329ACN

2020-08-28 Thread Tomasz Maciej Nowak
These are extracted from OEM firmware.

Signed-off-by: Tomasz Maciej Nowak 
---
 package/firmware/ipq-wifi/Makefile  |   2 ++
 .../ipq-wifi/board-luma_wrtq-329acn.qca4019 | Bin 0 -> 24324 bytes
 .../arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts   |   4 
 target/linux/ipq40xx/image/Makefile |   2 +-
 4 files changed, 7 insertions(+), 1 deletion(-)
 create mode 100644 package/firmware/ipq-wifi/board-luma_wrtq-329acn.qca4019

diff --git a/package/firmware/ipq-wifi/Makefile 
b/package/firmware/ipq-wifi/Makefile
index ee7b1946011f..7cbfc71a7b0b 100644
--- a/package/firmware/ipq-wifi/Makefile
+++ b/package/firmware/ipq-wifi/Makefile
@@ -37,6 +37,7 @@ ALLWIFIBOARDS:= \
ezviz_cs-w3-wd1200g-eup \
glinet_gl-s1300 \
linksys_ea8300 \
+   luma_wrtq-329acn \
mobipromo_cm520-79f \
qxwlan_e2600ac
 
@@ -111,6 +112,7 @@ $(eval $(call 
generate-ipq-wifi-package,engenius_emr3500,EnGenius EMR3500))
 $(eval $(call generate-ipq-wifi-package,ezviz_cs-w3-wd1200g-eup,EZVIZ 
CS-W3-WD1200G EUP))
 $(eval $(call generate-ipq-wifi-package,glinet_gl-s1300,GL.iNet GL-S1300))
 $(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300))
+$(eval $(call generate-ipq-wifi-package,luma_wrtq-329acn,Luma WRTQ-329ACN))
 $(eval $(call generate-ipq-wifi-package,mobipromo_cm520-79f,MobiPromo 
CM520-79F))
 $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac,Qxwlan E2600AC))
 
diff --git a/package/firmware/ipq-wifi/board-luma_wrtq-329acn.qca4019 
b/package/firmware/ipq-wifi/board-luma_wrtq-329acn.qca4019
new file mode 100644
index 
..4e52602713380f7e2f0468d1dc6ddc48dea3f874
GIT binary patch
literal 24324
zcmeHPZBP?Q8g7s;6_rT>LK23MfDn%a2pmL+5(2UTMnDevh@J#yVBXN(
zZ};@u@7vFGl9}m;>`qA*CFd!lqcTN`?Bv{3pw(~d1F!?8(qlE-OUg?lO0{ay
zfpWD@q%PYYWvP``l~k7z)#$j0+LCH@$>={5qJrGK-J%%Dw=0vO!Gq)R
zB02wbaRF;iFkRql@
zaUqFHYgo3dKHSCwE>GX@)lPZ>KSO!{*!=ZP(}#TEY={>nM2wU^QzqGrc-#Sx=gjhCH
zVjaP&!O_-MjXGVG^lG%HrJ+ofnZE7OP|umxYW42)xJScKt5N5s|N1SIJLAGI@Oo(U
zRBMHLmrDL>xaV|3xe7~{J-S77Q>CX%p~1P`EclnG3`uvwSTd3c&~BW8D0+Cb)n!p3!4A@4?Vf6YfL-HPiH1P9;j;0sM@l}FZJdPb(gaB
zS9P57`=hnJktc$5%;M#R5*;mtfV=0~^&2)JOyA7`oWLOJ6Mv>8K4WKuva%}S1rY!)
zF0QVwE=0a~+M$CP*uw$~RcpPkGJXN80a;9n>|I9R|B=JWI2yuj2Iiq
zZ?CP*%fr&7VEuXz57L!X7%JfNgJ6Z_`R}*y-uXg}Y$F;2y**vs-2Q9n>H=)plcOwM
zt{Z{ZBXD@#iMA0U5uP|x!Y2epQ8s*)tj(-XdJC4gZd!;r~*}p70(q&2AUzxz~rbLQKAx5
zB9=UtAPH!KI01`7qYx=N9fYahwmKb?Og0@Atxz~21!H{#fcbs5@zQXS0waHo)c?Vch)pAJB5Cv%zU%h)@;3B7TUHFu1V=R
z*mL%2lxURZL4aNw^8jPjyed($LV&2+#=72+#=72+#l>248+9`O8ZoKX{rqO
zLVyg&+~fcOe|;=$0w5X)5Xhr~#2Y^3^H50!+ZFD@mkLke-(Vt2OY(6;fM=6CZx9}T
z_3|h1z)#bxD&_Dfw?`UVC^Zjar2_^0oGc;WbgS^Id7UAZos
z-oUaCiZNQKolwgjD5hwkc0n!spO~bD+5vSO#Ca`NKDx_h8LX^8?b$QV%HMyet@G*)
ze0<_B^XV%Km6_SF-mwra$`x}l7D#=UieM-v#;{Zn`z{udp)#=yi(Rz)>lv?(Xnqnu
z1ZAX2(vU1hoFop}!BBM*ueoDT-*Z<=w~I#k>DcrHczB-PgBUSm3^W5S3y8
zd_75Y;3cJncMpJ@8`)x=3w|?~cMtgoNmN=W?;d*j{_Ii_N6m^(>it
z+}@T|xt+Mea%gech)HrJ)rK+eo3Ku_tWUuLw~0r{lE9M=NZau#yzQ9!X+oT$1
zp3S)@^pB+7hhl}q!|sPKX5C&`sUQ0Am^^E)#4%H}fjik^uD~-*5<}p`xT#Zrq$o`q
zI!QZDhoVpqDt!og(17rg+
zq>%Cm1Cuc<3`};LPvM76Ifm_%z2>ucrD=~|gnwh`)Kn`|r4ne+p|7M2t{TIH0Cqc%
z>kPS?xXJ704!qt_sFC3lh91pP<<4+_i-!u$UNR(8HxZJ_+=^G|Q;R|-`^^{dYQrAQ
z4*Xk#QB$i_hI1zFnJ!yG3L-+f+8qu(beX@z59oI&+0e8FSL+o@4*myIuSTm(mPVSt
z#rq8nngS`CFzD?TZUK{><|e#YpP@6_7GQCV000S}Vj}>J~h30X*+fc2^R)
zgfOHF=6bwPFHy24zcL@kRZv6B_wj2GOSu$%b$8;5sZNuk3?MzgIXEItc^WX}nt
zQKC_r2Z5EaH0GHa-MnfM7(d(i+nv!OZh*)2mdbtclHkCNUPn9AnuSN$rQT`Z4IDhb
zT`xGix#-Uw^{OP%7GHn$d)G8B?Xj{k+e{I=-hJk6%8r?)CE%9}#90sEhIt8?PR
zwrmFAQSb3eWr|o77Xyu$r;w@sPSBsYy`jzyC>ZO|c>_lhttps://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH 3/3] build: switch VERSION_REPO to HTTPS

2020-08-28 Thread Baptiste Jonglez
Thanks :)

Acked-by: Baptiste Jonglez 

On 27-08-20, Paul Spooren wrote:
> The variable VERSION_REPO is used by opkg to download package(list)s.
> Now that the default installation support encrypted HTTP opkg should
> make use of it.
> 
> Suggested-by: Petr Štetiar 
> Suggested-by: Baptiste Jonglez 
> Signed-off-by: Paul Spooren 
> ---
>  include/version.mk | 2 +-
>  package/base-files/image-config.in | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/version.mk b/include/version.mk
> index 7d3c1ad640..b7f42e13bb 100644
> --- a/include/version.mk
> +++ b/include/version.mk
> @@ -32,7 +32,7 @@ VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
>  VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION))
>  
>  VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
> -VERSION_REPO:=$(if 
> $(VERSION_REPO),$(VERSION_REPO),http://downloads.openwrt.org/snapshots)
> +VERSION_REPO:=$(if 
> $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/snapshots)
>  
>  VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
>  VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)
> diff --git a/package/base-files/image-config.in 
> b/package/base-files/image-config.in
> index 4bace77db0..bfa3055cc8 100644
> --- a/package/base-files/image-config.in
> +++ b/package/base-files/image-config.in
> @@ -183,7 +183,7 @@ if VERSIONOPT
>   config VERSION_REPO
>   string
>   prompt "Release repository"
> - default "http://downloads.openwrt.org/snapshots;
> + default "https://downloads.openwrt.org/snapshots;
>   help
>   This is the repository address embedded in the image, 
> it defaults
>   to the trunk snapshot repo; the url may contain the 
> following placeholders:


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


Re: [PATCH 1/3] build: add libustream and certs to default pkgs

2020-08-28 Thread Petr Štetiar
Karl Palsson  [2020-08-28 09:12:04]:

Hi,

> Doesn't the availability of ustream-*ssl also trigger uhttpd to
> generate self signed certs? 

no, the certs are generated via px5g-mbedtls, so this would need px5g-wolfssl
which is not available so far and needs to be done if we would like to ship
20.y with HTTPS by default.

-- ynezz

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


[PATCH v2 1/2] mvebu: backport linkstation-poweroff upstream driver

2020-08-28 Thread Daniel González Cabanelas
Backport the Linkstation poweroff driver from the kernel upstream (commit
a7f79f99541ef)

This driver is required by the Buffalo LinkStation LS421DE for a correct
power off operation. It also allows to use the WoL feature.

Signed-off-by: Daniel González Cabanelas 
---
changes in v2
   - module moved to the mvebu target

 target/linux/mvebu/modules.mk |  21 +++
 .../030-linkstation-poweroff.patch| 177 ++
 2 files changed, 198 insertions(+)
 create mode 100644 target/linux/mvebu/modules.mk
 create mode 100644 
target/linux/mvebu/patches-5.4/030-linkstation-poweroff.patch

diff --git a/target/linux/mvebu/modules.mk b/target/linux/mvebu/modules.mk
new file mode 100644
index 00..3a5e316788
--- /dev/null
+++ b/target/linux/mvebu/modules.mk
@@ -0,0 +1,21 @@
+define KernelPackage/linkstation-poweroff
+  SUBMENU:=$(OTHER_MENU)
+  DEPENDS:=@TARGET_mvebu
+  TITLE:=Buffalo LinkStation power off driver
+  KCONFIG:= \
+   CONFIG_POWER_RESET=y \
+   CONFIG_POWER_RESET_LINKSTATION \
+   CONFIG_POWER_RESET_QNAP=n
+
+  FILES:=$(LINUX_DIR)/drivers/power/reset/linkstation-poweroff.ko
+  AUTOLOAD:=$(call AutoLoad,31,linkstation-poweroff,1)
+endef
+
+define KernelPackage/linkstation-poweroff/description
+  This driver supports turning off some Buffalo LinkStations by
+  setting an output pin at the ethernet PHY to the correct state.
+  It also makes the device compatible with the WoL function.
+  Say Y here if you have a Buffalo LinkStation LS421D/E.
+endef
+
+$(eval $(call KernelPackage,linkstation-poweroff))
diff --git a/target/linux/mvebu/patches-5.4/030-linkstation-poweroff.patch 
b/target/linux/mvebu/patches-5.4/030-linkstation-poweroff.patch
new file mode 100644
index 00..e4dee5c09e
--- /dev/null
+++ b/target/linux/mvebu/patches-5.4/030-linkstation-poweroff.patch
@@ -0,0 +1,177 @@
+--- a/drivers/power/reset/Kconfig
 b/drivers/power/reset/Kconfig
+@@ -99,6 +99,17 @@
+   help
+ Reboot support for Hisilicon boards.
+ 
++config POWER_RESET_LINKSTATION
++  tristate "Buffalo LinkStation power-off driver"
++  depends on ARCH_MVEBU || COMPILE_TEST
++  depends on OF_MDIO && PHYLIB
++  help
++This driver supports turning off some Buffalo LinkStations by
++setting an output pin at the ethernet PHY to the correct state.
++It also makes the device compatible with the WoL function.
++
++Say Y here if you have a Buffalo LinkStation LS421D/E.
++
+ config POWER_RESET_MSM
+   bool "Qualcomm MSM power-off driver"
+   depends on ARCH_QCOM
+--- a/drivers/power/reset/Makefile
 b/drivers/power/reset/Makefile
+@@ -10,6 +10,7 @@
+ obj-$(CONFIG_POWER_RESET_GPIO) += gpio-poweroff.o
+ obj-$(CONFIG_POWER_RESET_GPIO_RESTART) += gpio-restart.o
+ obj-$(CONFIG_POWER_RESET_HISI) += hisi-reboot.o
++obj-${CONFIG_POWER_RESET_LINKSTATION} += linkstation-poweroff.o
+ obj-$(CONFIG_POWER_RESET_MSM) += msm-poweroff.o
+ obj-$(CONFIG_POWER_RESET_QCOM_PON) += qcom-pon.o
+ obj-$(CONFIG_POWER_RESET_OCELOT_RESET) += ocelot-reset.o
+--- a/dev/null
 b/drivers/power/reset/linkstation-poweroff.c
+@@ -0,0 +1,144 @@
++// SPDX-License-Identifier: GPL-2.0
++/*
++ * LinkStation power off restart driver
++ * Copyright (C) 2020 Daniel González Cabanelas 
++ */
++
++#include 
++#include 
++#include 
++#include 
++#include 
++#include 
++#include 
++
++/* Defines from the eth phy Marvell driver */
++#define MII_MARVELL_COPPER_PAGE   0
++#define MII_MARVELL_LED_PAGE  3
++#define MII_MARVELL_WOL_PAGE  17
++#define MII_MARVELL_PHY_PAGE  22
++
++#define MII_PHY_LED_CTRL  16
++#define MII_88E1318S_PHY_LED_TCR  18
++#define MII_88E1318S_PHY_WOL_CTRL 16
++#define MII_M1011_IEVENT  19
++
++#define MII_88E1318S_PHY_LED_TCR_INTn_ENABLE  BIT(7)
++#define MII_88E1318S_PHY_LED_TCR_FORCE_INTBIT(15)
++#define MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUSBIT(12)
++#define LED2_FORCE_ON (0x8 << 8)
++#define LEDMASK   GENMASK(11,8)
++
++static struct phy_device *phydev;
++
++static void mvphy_reg_intn(u16 data)
++{
++  int rc = 0, saved_page;
++
++  saved_page = phy_select_page(phydev, MII_MARVELL_LED_PAGE);
++  if (saved_page < 0)
++  goto err;
++
++  /* Force manual LED2 control to let INTn work */
++  __phy_modify(phydev, MII_PHY_LED_CTRL, LEDMASK, LED2_FORCE_ON);
++
++  /* Set the LED[2]/INTn pin to the required state */
++  __phy_modify(phydev, MII_88E1318S_PHY_LED_TCR,
++   MII_88E1318S_PHY_LED_TCR_FORCE_INT,
++   MII_88E1318S_PHY_LED_TCR_INTn_ENABLE | data);
++
++  if (!data) {
++  /* Clear interrupts to ensure INTn won't be holded in high 
state */
++  __phy_write(phydev, MII_MARVELL_PHY_PAGE, 
MII_MARVELL_COPPER_PAGE);
++  __phy_read(phydev, MII_M1011_IEVENT);
++
++   

[PATCH v2 2/2] mvebu: LS421DE: add linkstation poweroff driver

2020-08-28 Thread Daniel González Cabanelas
Compile the Linkstation poweroff module for the Buffalo LS421DE.
Without this driver the device remains forever halted if a power off
command is executed.

The driver will also allow to use the WoL feature, which wasn't availabe
in the stock firmware.

Signed-off-by: Daniel González Cabanelas 
---
Changes in v2:
- None

 .../arm/boot/dts/armada-370-buffalo-ls421de.dts | 13 -
 target/linux/mvebu/image/cortexa9.mk|  4 ++--
 2 files changed, 2 insertions(+), 15 deletions(-)

diff --git 
a/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts 
b/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts
index ea392f9e41..e0c0cb55a0 100644
--- a/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts
+++ b/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts
@@ -209,12 +209,6 @@
gpio = < 9 GPIO_ACTIVE_HIGH>;
};
};
-
-   /* FIXME: this driver needs to be aware of the LED2 eth phy use,
-  which must be set to off state before shutting down the machine */
-   restart_poweroff {
-   compatible = "restart-poweroff";
-   };
 };
 
  {
@@ -243,13 +237,6 @@
 
ethphy0: ethernet-phy@0 { /* Marvell 88E1518 */
reg = <0>;
-   /*
-* LED2 is used to inform, at restart time, if the power
-* switch was slided to the "off" position.
-* Page 0x3, Register 0x10, bits 8-11:
-* 0x800: LED2 off, power off the machine
-* 0x900: LED2 on, boot the machine
-*/
marvell,reg-init = <0x3 0x10 0x1 0x1991>, /* LED function */
   <0x3 0x11 0x1 0x4401>, /* LED polarity */
   <0x3 0x12 0x1 0x4905>; /* LED timer */
diff --git a/target/linux/mvebu/image/cortexa9.mk 
b/target/linux/mvebu/image/cortexa9.mk
index 7c2069ed2f..824f142a8b 100644
--- a/target/linux/mvebu/image/cortexa9.mk
+++ b/target/linux/mvebu/image/cortexa9.mk
@@ -24,8 +24,8 @@ define Device/buffalo_ls421de
   DEVICE_DTS := armada-370-buffalo-ls421de
   DEVICE_PACKAGES :=  \
 kmod-rtc-rs5c372a kmod-hwmon-gpiofan kmod-hwmon-drivetemp kmod-usb3 \
-kmod-md-raid0 kmod-md-raid1 kmod-md-mod kmod-fs-xfs mkf2fs e2fsprogs \
-partx-utils
+kmod-linkstation-poweroff kmod-md-raid0 kmod-md-raid1 kmod-md-mod \
+kmod-fs-xfs mkf2fs e2fsprogs partx-utils
 endef
 TARGET_DEVICES += buffalo_ls421de
 
-- 
2.28.0





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


Re: [PATCH 2/3] build: sort default packages and split by newlines

2020-08-28 Thread Karl Palsson

Paul Spooren  wrote:
> The line of default packages became very long and it is easier
> to read one package per line, therefore split it by newlines
> and sort it alphabetically.

If you're going to do that, why not use += as well, so you don't
have to worry about people getting the \ right, and adding
entries at the end doesn't break things?

DEFAULT_PACKAGES+=base-files
DEFAULT_PACKAGES+=busybox
DEFAULT_PACKAGES+=ca-bundle
.


Sincerely,
Karl Palsson


> 
> Signed-off-by: Paul Spooren 
> ---
>  include/target.mk | 35 ---
>  1 file changed, 32 insertions(+), 3 deletions(-)
> 
> diff --git a/include/target.mk b/include/target.mk
> index b0c563a0ef..03550c6ca6 100644
> --- a/include/target.mk
> +++ b/include/target.mk
> @@ -13,13 +13,42 @@ __target_inc=1
>  DEVICE_TYPE?=router
>  
>  # Default packages - the really basic set
> -DEFAULT_PACKAGES:=base-files busybox ca-bundle dropbear
> fstools libc libgcc logd libustream-wolfssl mtd netifd opkg uci
> uclient-fetch urandom-seed urngd +DEFAULT_PACKAGES:=\
> + base-files \
> + busybox \
> + ca-bundle \
> + dropbear \
> + fstools \
> + libc \
> + libgcc \
> + libustream-wolfssl \
> + logd \
> + mtd \
> + netifd \
> + opkg \
> + uci \
> + uclient-fetch \
> + urandom-seed \
> + urngd
>  # For the basic set
>  DEFAULT_PACKAGES.basic:=
>  # For nas targets
> -DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm
> +DEFAULT_PACKAGES.nas:=\
> + block-mount \
> + fdisk \
> + lsblk \
> + mdadm
>  # For router targets
> -DEFAULT_PACKAGES.router:=dnsmasq iptables ip6tables ppp
> ppp-mod-pppoe firewall odhcpd-ipv6only odhcp6c kmod-ipt-offload
> +DEFAULT_PACKAGES.router:=\
> + dnsmasq \
> + firewall \
> + ip6tables \
> + iptables \
> + kmod-ipt-offload \
> + odhcp6c \
> + odhcpd-ipv6only \
> + ppp \
> + ppp-mod-pppoe
>  
>  ifneq ($(DUMP),)
>all: dumpinfo
> -- 
> 2.25.1
> 
> 
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

OpenPGP-digital-signature.html
Description: OpenPGP Digital Signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH 1/3] build: add libustream and certs to default pkgs

2020-08-28 Thread Karl Palsson



Paul Spooren  wrote:
> To allow HTTPS usage on a router it requires both certificates
> (ca-bundle) and a fitting libustream library
> (libustream-wolfssl)
> 
> By adding both, uclient-fetch and wget can connect to encrypted
> HTTP.

Doesn't the availability of ustream-*ssl also trigger uhttpd to
generate self signed certs? That's still (IMO) a major step
backwards while browsers still obstinately treat them as
insecure.

That could be _separated_ of course

Sincerely,
Karl Palsson

OpenPGP-digital-signature.html
Description: OpenPGP Digital Signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel