From 8097aa0b3291bb41409d386000f866573533e849 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 22 May 2024 14:14:23 -0700 Subject: [PATCH 1/7] tools/lz4: remove patches meson is used to build it since 291b137. No need to patch Makefiles. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/15524 Signed-off-by: Christian Marangi --- ...01-add-make-ENABLE_DOCS-configurable.patch | 60 ---------------- ...makefile-install-links-from-same-dir.patch | 71 ------------------- 2 files changed, 131 deletions(-) delete mode 100644 tools/lz4/patches/001-add-make-ENABLE_DOCS-configurable.patch delete mode 100644 tools/lz4/patches/002-makefile-install-links-from-same-dir.patch diff --git a/tools/lz4/patches/001-add-make-ENABLE_DOCS-configurable.patch b/tools/lz4/patches/001-add-make-ENABLE_DOCS-configurable.patch deleted file mode 100644 index 5d6dca33f3..0000000000 --- a/tools/lz4/patches/001-add-make-ENABLE_DOCS-configurable.patch +++ /dev/null @@ -1,60 +0,0 @@ -+++ a/programs/Makefile 2022-08-15 15:45:31.000000000 -0700 ---- b/programs/Makefile 2022-11-28 16:34:21.315593784 -0800 -@@ -66,6 +66,7 @@ - MD2ROFF = ronn - MD2ROFF_FLAGS = --roff --warnings --manual="User Commands" --organization="lz4 $(LZ4_VERSION)" - -+ENABLE_DOCS ?= 1 - - default: lz4-release - -@@ -120,6 +121,7 @@ - lz4c32 : $(SRCFILES) - $(CC) $(FLAGS) $^ -o $@$(EXT) - -+ifeq ($(ENABLE_DOCS),1) - lz4.1: lz4.1.md $(LIBVER_SRC) - cat $< | $(MD2ROFF) $(MD2ROFF_FLAGS) | $(SED) -n '/^\.\\\".*/!p' > $@ - -@@ -130,6 +132,7 @@ - - preview-man: clean-man man - man ./lz4.1 -+endif - - clean: - ifeq ($(WINBASED),yes) -@@ -172,16 +175,19 @@ - - install: lz4 - @echo Installing binaries in $(DESTDIR)$(bindir) -- $(INSTALL_DIR) $(DESTDIR)$(bindir)/ $(DESTDIR)$(man1dir)/ -+ $(INSTALL_DIR) $(DESTDIR)$(bindir)/ - $(INSTALL_PROGRAM) lz4$(EXT) $(DESTDIR)$(bindir)/lz4$(EXT) - $(LN_SF) lz4$(EXT) $(DESTDIR)$(bindir)/lz4c$(EXT) - $(LN_SF) lz4$(EXT) $(DESTDIR)$(bindir)/lz4cat$(EXT) - $(LN_SF) lz4$(EXT) $(DESTDIR)$(bindir)/unlz4$(EXT) -+ifeq ($(ENABLE_DOCS),1) - @echo Installing man pages in $(DESTDIR)$(man1dir) -+ $(INSTALL_DIR) $(DESTDIR)$(man1dir)/ - $(INSTALL_DATA) lz4.1 $(DESTDIR)$(man1dir)/lz4.1 - $(LN_SF) lz4.1 $(DESTDIR)$(man1dir)/lz4c.1 - $(LN_SF) lz4.1 $(DESTDIR)$(man1dir)/lz4cat.1 - $(LN_SF) lz4.1 $(DESTDIR)$(man1dir)/unlz4.1 -+endif - @echo lz4 installation completed - - uninstall: -@@ -189,10 +195,12 @@ - $(RM) $(DESTDIR)$(bindir)/unlz4$(EXT) - $(RM) $(DESTDIR)$(bindir)/lz4$(EXT) - $(RM) $(DESTDIR)$(bindir)/lz4c$(EXT) -+ifeq ($(ENABLE_DOCS),1) - $(RM) $(DESTDIR)$(man1dir)/lz4.1 - $(RM) $(DESTDIR)$(man1dir)/lz4c.1 - $(RM) $(DESTDIR)$(man1dir)/lz4cat.1 - $(RM) $(DESTDIR)$(man1dir)/unlz4.1 -+endif - @echo lz4 programs successfully uninstalled - - endif diff --git a/tools/lz4/patches/002-makefile-install-links-from-same-dir.patch b/tools/lz4/patches/002-makefile-install-links-from-same-dir.patch deleted file mode 100644 index 159dc67f1a..0000000000 --- a/tools/lz4/patches/002-makefile-install-links-from-same-dir.patch +++ /dev/null @@ -1,71 +0,0 @@ -diff -ur a/lib/Makefile b/lib/Makefile ---- a/lib/Makefile 2022-12-04 23:49:06.336839263 -0800 -+++ b/lib/Makefile 2022-12-05 00:00:59.172307488 -0800 -@@ -195,8 +195,8 @@ - $(INSTALL_PROGRAM) dll/$(LIBLZ4_EXP) $(DESTDIR)$(libdir) - else - $(INSTALL_PROGRAM) liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(libdir) -- $(LN_SF) liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(libdir)/liblz4.$(SHARED_EXT_MAJOR) -- $(LN_SF) liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(libdir)/liblz4.$(SHARED_EXT) -+ (cd $(DESTDIR)$(libdir) && $(LN_SF) liblz4.$(SHARED_EXT_VER) liblz4.$(SHARED_EXT_MAJOR)) -+ (cd $(DESTDIR)$(libdir) && $(LN_SF) liblz4.$(SHARED_EXT_MAJOR) liblz4.$(SHARED_EXT)) - endif - endif - @echo Installing headers in $(DESTDIR)$(includedir) -diff -ur a/Makefile b/Makefile ---- a/Makefile 2022-12-04 23:49:06.336839263 -0800 -+++ b/Makefile 2022-12-04 23:42:09.693836654 -0800 -@@ -77,12 +77,12 @@ - - .PHONY: clean - clean: -- $(MAKE) -C $(LZ4DIR) $@ > $(VOID) -- $(MAKE) -C $(PRGDIR) $@ > $(VOID) -- $(MAKE) -C $(TESTDIR) $@ > $(VOID) -- $(MAKE) -C $(EXDIR) $@ > $(VOID) -- $(MAKE) -C $(FUZZDIR) $@ > $(VOID) -- $(MAKE) -C contrib/gen_manual $@ > $(VOID) -+ $(MAKE) -C $(LZ4DIR) $@ -+ $(MAKE) -C $(PRGDIR) $@ -+ $(MAKE) -C $(TESTDIR) $@ -+ $(MAKE) -C $(EXDIR) $@ -+ $(MAKE) -C $(FUZZDIR) $@ -+ $(MAKE) -C contrib/gen_manual $@ - $(RM) lz4$(EXT) - $(RM) -r $(CMAKE_BUILD_DIR) - @echo Cleaning completed -diff -ur a/programs/Makefile b/programs/Makefile ---- a/programs/Makefile 2022-12-04 23:49:06.336839263 -0800 -+++ b/programs/Makefile 2022-12-04 23:42:30.849582910 -0800 -@@ -138,7 +138,7 @@ - ifeq ($(WINBASED),yes) - $(RM) *.rc - endif -- $(MAKE) -C $(LZ4DIR) $@ > $(VOID) -+ $(MAKE) -C $(LZ4DIR) $@ - $(RM) core *.o *.test tmp* \ - lz4$(EXT) lz4c$(EXT) lz4c32$(EXT) lz4-wlib$(EXT) \ - unlz4$(EXT) lz4cat$(EXT) -@@ -177,16 +177,16 @@ - @echo Installing binaries in $(DESTDIR)$(bindir) - $(INSTALL_DIR) $(DESTDIR)$(bindir)/ - $(INSTALL_PROGRAM) lz4$(EXT) $(DESTDIR)$(bindir)/lz4$(EXT) -- $(LN_SF) lz4$(EXT) $(DESTDIR)$(bindir)/lz4c$(EXT) -- $(LN_SF) lz4$(EXT) $(DESTDIR)$(bindir)/lz4cat$(EXT) -- $(LN_SF) lz4$(EXT) $(DESTDIR)$(bindir)/unlz4$(EXT) -+ (cd $(DESTDIR)$(bindir) && $(LN_SF) lz4$(EXT) lz4c$(EXT)) -+ (cd $(DESTDIR)$(bindir) && $(LN_SF) lz4$(EXT) lz4cat$(EXT)) -+ (cd $(DESTDIR)$(bindir) && $(LN_SF) lz4$(EXT) unlz4$(EXT)) - ifeq ($(ENABLE_DOCS),1) - @echo Installing man pages in $(DESTDIR)$(man1dir) - $(INSTALL_DIR) $(DESTDIR)$(man1dir)/ - $(INSTALL_DATA) lz4.1 $(DESTDIR)$(man1dir)/lz4.1 -- $(LN_SF) lz4.1 $(DESTDIR)$(man1dir)/lz4c.1 -- $(LN_SF) lz4.1 $(DESTDIR)$(man1dir)/lz4cat.1 -- $(LN_SF) lz4.1 $(DESTDIR)$(man1dir)/unlz4.1 -+ (cd $(DESTDIR)$(man1dir) && $(LN_SF) lz4.1 lz4c.1) -+ (cd $(DESTDIR)$(man1dir) && $(LN_SF) lz4.1 lz4cat.1) -+ (cd $(DESTDIR)$(man1dir) && $(LN_SF) lz4.1 unlz4.1) - endif - @echo lz4 installation completed - From 337b0c80cbbb2c76e80f9f970b03decedcd4c827 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 18 May 2024 12:14:20 -0700 Subject: [PATCH 2/7] tools: refresh all patches Refresh all tools patches now that tools/refresh correctly works. CI now checks for them and actively complain if tools have unrefreshed patches. Signed-off-by: Rosen Penev [ reword commit message ] Link: https://github.com/openwrt/openwrt/pull/15524 Signed-off-by: Christian Marangi --- tools/elftosb/patches/001-libm.patch | 6 ++-- .../elftosb/patches/002-fix-header-path.patch | 5 ++- .../001-add-cmake-ENABLE-configurables.patch | 14 ++++---- tools/lzma/patches/001-large_files.patch | 8 ++--- tools/lzma/patches/002-lzmp.patch | 36 +++++++------------ tools/lzma/patches/003-compile_fixes.patch | 14 ++++---- ...1-add-cmake-ENABLE_DOCS-configurable.patch | 8 ++--- tools/patch/patches/050-CVE-2019-13636.patch | 15 +++----- tools/patch/patches/060-CVE-2019-13638.patch | 9 ++--- 9 files changed, 44 insertions(+), 71 deletions(-) diff --git a/tools/elftosb/patches/001-libm.patch b/tools/elftosb/patches/001-libm.patch index 02705d24bb..6b49ac1af2 100644 --- a/tools/elftosb/patches/001-libm.patch +++ b/tools/elftosb/patches/001-libm.patch @@ -1,6 +1,6 @@ ---- elftosb-10.12.01/makefile.rules 2012-03-15 11:01:44.979020178 -0400 -+++ elftosb-10.12.01/makefile.rules 2012-03-15 11:01:16.332761989 -0400 -@@ -101,7 +101,7 @@ +--- a/makefile.rules ++++ b/makefile.rules +@@ -101,7 +101,7 @@ OBJ_FILES_KEYGEN = \ keygen.o diff --git a/tools/elftosb/patches/002-fix-header-path.patch b/tools/elftosb/patches/002-fix-header-path.patch index 5e3b5091b9..5099b29644 100644 --- a/tools/elftosb/patches/002-fix-header-path.patch +++ b/tools/elftosb/patches/002-fix-header-path.patch @@ -5,9 +5,8 @@ others once multiarch becomes more common. This patch makes the types a relative path, and allows the system to use whatever include paths it feels are correct. -diff -Naurp elftosb-10.12.01-orig/common/stdafx.h elftosb-10.12.01/common/stdafx.h ---- elftosb-10.12.01-orig/common/stdafx.h 2012-07-12 13:30:10.990249396 -0400 -+++ elftosb-10.12.01/common/stdafx.h 2012-07-12 13:30:06.858249391 -0400 +--- a/common/stdafx.h ++++ b/common/stdafx.h @@ -27,7 +27,7 @@ // For Linux systems only, types.h only defines the signed // integer types. This is not professional code. diff --git a/tools/liblzo/patches/001-add-cmake-ENABLE-configurables.patch b/tools/liblzo/patches/001-add-cmake-ENABLE-configurables.patch index 9ab27fc924..e0ba410167 100644 --- a/tools/liblzo/patches/001-add-cmake-ENABLE-configurables.patch +++ b/tools/liblzo/patches/001-add-cmake-ENABLE-configurables.patch @@ -1,6 +1,6 @@ ---- a/CMakeLists.txt 2022-11-28 06:34:39.171209779 -0800 -+++ b/CMakeLists.txt 2022-11-28 06:33:13.368239757 -0800 -@@ -51,8 +51,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -51,8 +51,11 @@ endif() project(lzo VERSION 2.10 LANGUAGES C) # configuration options @@ -14,7 +14,7 @@ if(NOT ENABLE_STATIC AND NOT ENABLE_SHARED) set(ENABLE_STATIC ON) endif() -@@ -127,14 +130,20 @@ +@@ -127,14 +130,20 @@ macro(lzo_add_executable t) endif() endmacro() # main test driver @@ -35,7 +35,7 @@ # some boring internal test programs if(0) lzo_add_executable(align tests/align.c) -@@ -144,7 +153,7 @@ +@@ -144,7 +153,7 @@ if(0) endif() # miniLZO @@ -44,7 +44,7 @@ add_executable(testmini minilzo/testmini.c minilzo/minilzo.c) target_include_directories(testmini PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include/lzo") # needed for "lzoconf.h" endif() -@@ -263,8 +272,10 @@ +@@ -263,8 +272,10 @@ add_test(NAME lzotest-03 COMMAND lzotest if(DEFINED CMAKE_INSTALL_FULL_LIBDIR) @@ -57,7 +57,7 @@ set(f include/lzo/lzo1.h include/lzo/lzo1a.h include/lzo/lzo1b.h include/lzo/lzo1c.h include/lzo/lzo1f.h include/lzo/lzo1x.h -@@ -285,7 +296,7 @@ +@@ -285,7 +296,7 @@ if(ENABLE_SHARED) ) endif() diff --git a/tools/lzma/patches/001-large_files.patch b/tools/lzma/patches/001-large_files.patch index b95fe9e90f..65603f4976 100644 --- a/tools/lzma/patches/001-large_files.patch +++ b/tools/lzma/patches/001-large_files.patch @@ -1,8 +1,6 @@ -Index: lzma-4.65/CPP/7zip/Compress/LZMA_Alone/makefile.gcc -=================================================================== ---- lzma-4.65.orig/CPP/7zip/Compress/LZMA_Alone/makefile.gcc 2009-05-15 23:33:51.000000000 +0200 -+++ lzma-4.65/CPP/7zip/Compress/LZMA_Alone/makefile.gcc 2009-06-01 22:00:54.000000000 +0200 -@@ -3,7 +3,7 @@ +--- a/CPP/7zip/Compress/LZMA_Alone/makefile.gcc ++++ b/CPP/7zip/Compress/LZMA_Alone/makefile.gcc +@@ -3,7 +3,7 @@ CXX = g++ -O2 -Wall CXX_C = gcc -O2 -Wall LIB = -lm RM = rm -f diff --git a/tools/lzma/patches/002-lzmp.patch b/tools/lzma/patches/002-lzmp.patch index 72d881cdb2..f1d45f45ff 100644 --- a/tools/lzma/patches/002-lzmp.patch +++ b/tools/lzma/patches/002-lzmp.patch @@ -1,7 +1,5 @@ -Index: lzma-4.65/CPP/7zip/Compress/LZMA_Alone/lzmp.cpp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ lzma-4.65/CPP/7zip/Compress/LZMA_Alone/lzmp.cpp 2009-06-01 22:01:10.000000000 +0200 +--- /dev/null ++++ b/CPP/7zip/Compress/LZMA_Alone/lzmp.cpp @@ -0,0 +1,895 @@ +/* + * LZMA command line tool similar to gzip to encode and decode LZMA files. @@ -898,10 +896,8 @@ Index: lzma-4.65/CPP/7zip/Compress/LZMA_Alone/lzmp.cpp + return STATUS_OK; +} + -Index: lzma-4.65/CPP/7zip/Compress/LZMA_Alone/Exception.h -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ lzma-4.65/CPP/7zip/Compress/LZMA_Alone/Exception.h 2009-06-01 22:01:10.000000000 +0200 +--- /dev/null ++++ b/CPP/7zip/Compress/LZMA_Alone/Exception.h @@ -0,0 +1,45 @@ +/* A couple of exceptions for lzmp. + * @@ -948,10 +944,8 @@ Index: lzma-4.65/CPP/7zip/Compress/LZMA_Alone/Exception.h + +#endif + -Index: lzma-4.65/CPP/7zip/Compress/LZMA_Alone/makefile.gcc -=================================================================== ---- lzma-4.65.orig/CPP/7zip/Compress/LZMA_Alone/makefile.gcc 2009-06-01 22:00:54.000000000 +0200 -+++ lzma-4.65/CPP/7zip/Compress/LZMA_Alone/makefile.gcc 2009-06-01 22:06:13.000000000 +0200 +--- a/CPP/7zip/Compress/LZMA_Alone/makefile.gcc ++++ b/CPP/7zip/Compress/LZMA_Alone/makefile.gcc @@ -1,9 +1,10 @@ -PROG = lzma +PROG = lzma_alone @@ -965,7 +959,7 @@ Index: lzma-4.65/CPP/7zip/Compress/LZMA_Alone/makefile.gcc ifdef SystemDrive IS_MINGW = 1 -@@ -45,12 +46,35 @@ +@@ -45,12 +46,35 @@ OBJS = \ Lzma86Dec.o \ Lzma86Enc.o \ @@ -1002,17 +996,15 @@ Index: lzma-4.65/CPP/7zip/Compress/LZMA_Alone/makefile.gcc LzmaAlone.o: LzmaAlone.cpp $(CXX) $(CFLAGS) LzmaAlone.cpp -@@ -131,5 +153,5 @@ +@@ -131,5 +155,5 @@ Lzma86Enc.o: ../../../../C/LzmaUtil/Lzma $(CXX_C) $(CFLAGS) ../../../../C/LzmaUtil/Lzma86Enc.c clean: - -$(RM) $(PROG) $(OBJS) + -$(RM) $(PROG) $(PROG2) $(OBJS) -Index: lzma-4.65/CPP/7zip/Compress/LZMA_Alone/lzma_version.h -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ lzma-4.65/CPP/7zip/Compress/LZMA_Alone/lzma_version.h 2009-06-01 22:01:10.000000000 +0200 +--- /dev/null ++++ b/CPP/7zip/Compress/LZMA_Alone/lzma_version.h @@ -0,0 +1,31 @@ +#ifndef LZMA_VERSION_H +#define LZMA_VERSION_H @@ -1045,11 +1037,9 @@ Index: lzma-4.65/CPP/7zip/Compress/LZMA_Alone/lzma_version.h + "named COPYING.\n"; + +#endif /* ifndef LZMA_VERSION_H */ -Index: lzma-4.65/CPP/Common/C_FileIO.h -=================================================================== ---- lzma-4.65.orig/CPP/Common/C_FileIO.h 2009-05-15 23:33:51.000000000 +0200 -+++ lzma-4.65/CPP/Common/C_FileIO.h 2009-06-01 22:06:56.000000000 +0200 -@@ -24,6 +24,7 @@ +--- a/CPP/Common/C_FileIO.h ++++ b/CPP/Common/C_FileIO.h +@@ -24,6 +24,7 @@ public: bool Close(); bool GetLength(UInt64 &length) const; off_t Seek(off_t distanceToMove, int moveMethod) const; diff --git a/tools/lzma/patches/003-compile_fixes.patch b/tools/lzma/patches/003-compile_fixes.patch index 49ae66b9c4..06f7a54aef 100644 --- a/tools/lzma/patches/003-compile_fixes.patch +++ b/tools/lzma/patches/003-compile_fixes.patch @@ -1,7 +1,6 @@ -diff -urN lzma-4.65/CPP/7zip/Common/FileStreams.h lzma-4.65.new/CPP/7zip/Common/FileStreams.h ---- lzma-4.65/CPP/7zip/Common/FileStreams.h 2009-05-15 23:33:51.000000000 +0200 -+++ lzma-4.65.new/CPP/7zip/Common/FileStreams.h 2009-06-01 22:30:01.000000000 +0200 -@@ -72,6 +72,7 @@ +--- a/CPP/7zip/Common/FileStreams.h ++++ b/CPP/7zip/Common/FileStreams.h +@@ -72,6 +72,7 @@ class COutFileStream: public IOutStream, public CMyUnknownImp { @@ -9,10 +8,9 @@ diff -urN lzma-4.65/CPP/7zip/Common/FileStreams.h lzma-4.65.new/CPP/7zip/Common/ #ifdef USE_WIN_FILE NWindows::NFile::NIO::COutFile File; #else -diff -urN lzma-4.65/CPP/Common/MyWindows.h lzma-4.65.new/CPP/Common/MyWindows.h ---- lzma-4.65/CPP/Common/MyWindows.h 2009-05-15 23:33:51.000000000 +0200 -+++ lzma-4.65.new/CPP/Common/MyWindows.h 2009-06-01 22:29:26.000000000 +0200 -@@ -101,8 +101,11 @@ +--- a/CPP/Common/MyWindows.h ++++ b/CPP/Common/MyWindows.h +@@ -101,8 +101,11 @@ typedef LONG SCODE; #ifdef __cplusplus diff --git a/tools/lzop/patches/001-add-cmake-ENABLE_DOCS-configurable.patch b/tools/lzop/patches/001-add-cmake-ENABLE_DOCS-configurable.patch index 01ebd33a39..27af782c1c 100644 --- a/tools/lzop/patches/001-add-cmake-ENABLE_DOCS-configurable.patch +++ b/tools/lzop/patches/001-add-cmake-ENABLE_DOCS-configurable.patch @@ -1,6 +1,6 @@ ---- a/CMakeLists.txt 2017-08-10 04:19:45.000000000 -0700 -+++ b/CMakeLists.txt 2022-11-28 17:21:03.453548350 -0800 -@@ -50,6 +50,9 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -50,6 +50,9 @@ endif() project(lzop VERSION 1.04 LANGUAGES C) @@ -10,7 +10,7 @@ # install directories if(NOT CMAKE_INSTALL_PREFIX) message(FATAL_ERROR "ERROR: CMAKE_INSTALL_PREFIX is not defined.") -@@ -186,9 +189,11 @@ +@@ -186,9 +189,11 @@ if(DEFINED CMAKE_INSTALL_FULL_LIBDIR) install(TARGETS lzop DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}") diff --git a/tools/patch/patches/050-CVE-2019-13636.patch b/tools/patch/patches/050-CVE-2019-13636.patch index e62c3d4175..d819838bba 100644 --- a/tools/patch/patches/050-CVE-2019-13636.patch +++ b/tools/patch/patches/050-CVE-2019-13636.patch @@ -14,8 +14,6 @@ with O_CREAT | O_EXCL to avoid following symlinks in that case as well. src/util.c | 14 +++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) -diff --git a/src/inp.c b/src/inp.c -index 32d0919..22d7473 100644 --- a/src/inp.c +++ b/src/inp.c @@ -238,8 +238,13 @@ plan_a (char const *filename) @@ -52,11 +50,9 @@ index 32d0919..22d7473 100644 || ! (ifp = fdopen (ifd, binary_transput ? "rb" : "r"))) pfatal ("Can't open file %s", quotearg (filename)); if (TMPINNAME_needs_removal) -diff --git a/src/util.c b/src/util.c -index 1cc08ba..fb38307 100644 --- a/src/util.c +++ b/src/util.c -@@ -388,7 +388,7 @@ create_backup (char const *to, const struct stat *to_st, bool leave_original) +@@ -388,7 +388,7 @@ create_backup (char const *to, const str try_makedirs_errno = ENOENT; safe_unlink (bakname); @@ -65,7 +61,7 @@ index 1cc08ba..fb38307 100644 { if (errno != try_makedirs_errno) pfatal ("Can't create file %s", quotearg (bakname)); -@@ -579,10 +579,13 @@ create_file (char const *file, int open_flags, mode_t mode, +@@ -579,10 +579,13 @@ create_file (char const *file, int open_ static void copy_to_fd (const char *from, int tofd) { @@ -80,7 +76,7 @@ index 1cc08ba..fb38307 100644 pfatal ("Can't reopen file %s", quotearg (from)); while ((i = read (fromfd, buf, bufsize)) != 0) { -@@ -625,6 +628,8 @@ copy_file (char const *from, char const *to, struct stat *tost, +@@ -625,6 +628,8 @@ copy_file (char const *from, char const else { assert (S_ISREG (mode)); @@ -89,7 +85,7 @@ index 1cc08ba..fb38307 100644 tofd = create_file (to, O_WRONLY | O_BINARY | to_flags, mode, to_dir_known_to_exist); copy_to_fd (from, tofd); -@@ -640,9 +645,12 @@ copy_file (char const *from, char const *to, struct stat *tost, +@@ -640,9 +645,12 @@ copy_file (char const *from, char const void append_to_file (char const *from, char const *to) { @@ -103,6 +99,3 @@ index 1cc08ba..fb38307 100644 pfatal ("Can't reopen file %s", quotearg (to)); copy_to_fd (from, tofd); if (close (tofd) != 0) --- -cgit v1.0-41-gc330 - diff --git a/tools/patch/patches/060-CVE-2019-13638.patch b/tools/patch/patches/060-CVE-2019-13638.patch index 38caff628a..590cf186e7 100644 --- a/tools/patch/patches/060-CVE-2019-13638.patch +++ b/tools/patch/patches/060-CVE-2019-13638.patch @@ -9,11 +9,9 @@ command to avoid quoting vulnerabilities. src/pch.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -diff --git a/src/pch.c b/src/pch.c -index 4fd5a05..16e001a 100644 --- a/src/pch.c +++ b/src/pch.c -@@ -2459,9 +2459,6 @@ do_ed_script (char const *inname, char const *outname, +@@ -2459,9 +2459,6 @@ do_ed_script (char const *inname, char c *outname_needs_removal = true; copy_file (inname, outname, 0, exclusive, instat.st_mode, true); } @@ -23,7 +21,7 @@ index 4fd5a05..16e001a 100644 fflush (stdout); pid = fork(); -@@ -2470,7 +2467,8 @@ do_ed_script (char const *inname, char const *outname, +@@ -2470,7 +2467,8 @@ do_ed_script (char const *inname, char c else if (pid == 0) { dup2 (tmpfd, 0); @@ -33,6 +31,3 @@ index 4fd5a05..16e001a 100644 _exit (2); } else --- -cgit v1.0-41-gc330 - From e83a5618d423b6588fa443b93693c5b93a144ee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Mon, 22 Apr 2024 23:13:11 +0200 Subject: [PATCH 3/7] mediatek: include "kmod-mt7915e" package per device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mt7915e driver supports MT7915 & MT7916 devices and MT7981 & MT7986 on-SoC wireless controllers. Devices based on MT7988 and possibly other next chipsets are quite unlikely to need it (MT7988 was designed to be used with MT7996). Move kmod-mt7915e to DEVICE_PACKAGES of relevant devices. Signed-off-by: Rafał Miłecki --- target/linux/mediatek/filogic/target.mk | 2 +- target/linux/mediatek/image/filogic.mk | 106 ++++++++++++------------ 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/target/linux/mediatek/filogic/target.mk b/target/linux/mediatek/filogic/target.mk index c87552f196..d1637e06af 100644 --- a/target/linux/mediatek/filogic/target.mk +++ b/target/linux/mediatek/filogic/target.mk @@ -2,7 +2,7 @@ ARCH:=aarch64 SUBTARGET:=filogic BOARDNAME:=Filogic 8x0 (MT798x) CPU_TYPE:=cortex-a53 -DEFAULT_PACKAGES += fitblk kmod-phy-aquantia kmod-crypto-hw-safexcel kmod-mt7915e wpad-basic-mbedtls uboot-envtools +DEFAULT_PACKAGES += fitblk kmod-phy-aquantia kmod-crypto-hw-safexcel wpad-basic-mbedtls uboot-envtools KERNELNAME:=Image dtbs define Target/Description diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index e85d67f2ae..35baccf95e 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -110,7 +110,7 @@ define Device/acelink_ew-7886cax DEVICE_MODEL := EW-7886CAX DEVICE_DTS := mt7986a-acelink-ew-7886cax DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k PAGESIZE := 2048 @@ -128,7 +128,7 @@ define Device/acer_predator-w6 DEVICE_DTS := mt7986a-acer-predator-w6 DEVICE_DTS_DIR := ../dts DEVICE_DTS_LOADADDR := 0x47000000 - DEVICE_PACKAGES := kmod-usb3 kmod-mt7986-firmware kmod-mt7916-firmware mt7986-wo-firmware e2fsprogs f2fsck mkf2fs + DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7916-firmware kmod-mt7986-firmware mt7986-wo-firmware e2fsprogs f2fsck mkf2fs IMAGES := sysupgrade.bin KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb KERNEL_INITRAMFS := kernel-bin | lzma | \ @@ -141,7 +141,7 @@ define Device/adtran_smartrg DEVICE_VENDOR := Adtran DEVICE_DTS_DIR := ../dts DEVICE_PACKAGES := e2fsprogs f2fsck mkf2fs kmod-hwmon-pwmfan \ - kmod-mt7986-firmware mt7986-wo-firmware + kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata endef @@ -163,7 +163,7 @@ define Device/smartrg_sdg-8622 $(call Device/adtran_smartrg) DEVICE_MODEL := SDG-8622 DEVICE_DTS := mt7986a-smartrg-SDG-8622 - DEVICE_PACKAGES += kmod-mt7915-firmware + DEVICE_PACKAGES += kmod-mt7915e kmod-mt7915-firmware endef TARGET_DEVICES += smartrg_sdg-8622 @@ -171,7 +171,7 @@ define Device/smartrg_sdg-8632 $(call Device/adtran_smartrg) DEVICE_MODEL := SDG-8632 DEVICE_DTS := mt7986a-smartrg-SDG-8632 - DEVICE_PACKAGES += kmod-mt7915-firmware + DEVICE_PACKAGES += kmod-mt7915e kmod-mt7915-firmware endef TARGET_DEVICES += smartrg_sdg-8632 @@ -180,7 +180,7 @@ define Device/asus_rt-ax59u DEVICE_MODEL := RT-AX59U DEVICE_DTS := mt7986a-asus-rt-ax59u DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware + DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata endef TARGET_DEVICES += asus_rt-ax59u @@ -191,7 +191,7 @@ define Device/asus_tuf-ax4200 DEVICE_DTS := mt7986a-asus-tuf-ax4200 DEVICE_DTS_DIR := ../dts DEVICE_DTS_LOADADDR := 0x47000000 - DEVICE_PACKAGES := kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware + DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware IMAGES := sysupgrade.bin KERNEL := kernel-bin | lzma | \ fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb @@ -207,7 +207,7 @@ define Device/asus_tuf-ax6000 DEVICE_DTS := mt7986a-asus-tuf-ax6000 DEVICE_DTS_DIR := ../dts DEVICE_DTS_LOADADDR := 0x47000000 - DEVICE_PACKAGES := kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware + DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware IMAGES := sysupgrade.bin KERNEL := kernel-bin | lzma | \ fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb @@ -227,7 +227,7 @@ define Device/bananapi_bpi-r3 mt7986a-bananapi-bpi-r3-respeaker-2mics DEVICE_DTS_DIR := $(DTS_DIR)/ DEVICE_DTS_LOADADDR := 0x43f00000 - DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-i2c-gpio kmod-mt7986-firmware kmod-sfp kmod-usb3 \ + DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-i2c-gpio kmod-mt7915e kmod-mt7986-firmware kmod-sfp kmod-usb3 \ e2fsprogs f2fsck mkf2fs mt7986-wo-firmware IMAGES := sysupgrade.itb KERNEL_LOADADDR := 0x44000000 @@ -280,7 +280,7 @@ define Device/bananapi_bpi-r3-mini DEVICE_DTS_CONFIG := config-mt7986a-bananapi-bpi-r3-mini DEVICE_DTS_DIR := ../dts DEVICE_DTS_LOADADDR := 0x43f00000 - DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-mt7986-firmware kmod-phy-airoha-en8811h \ + DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-mt7915e kmod-mt7986-firmware kmod-phy-airoha-en8811h \ kmod-usb3 e2fsprogs f2fsck mkf2fs mt7986-wo-firmware KERNEL_LOADADDR := 0x44000000 KERNEL := kernel-bin | gzip @@ -382,7 +382,7 @@ define Device/cetron_ct3003 DEVICE_DTS := mt7981b-cetron-ct3003 DEVICE_DTS_DIR := ../dts SUPPORTED_DEVICES += mediatek,mt7981-spim-snand-rfb - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k PAGESIZE := 2048 @@ -401,7 +401,7 @@ define Device/cmcc_rax3000m DEVICE_DTS_DIR := ../dts DEVICE_DTC_FLAGS := --pad 4096 DEVICE_DTS_LOADADDR := 0x43f00000 - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 \ + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 \ e2fsprogs f2fsck mkf2fs KERNEL_LOADADDR := 0x44000000 KERNEL := kernel-bin | gzip @@ -433,7 +433,7 @@ define Device/comfast_cf-e393ax DEVICE_DTS_DIR := ../dts DEVICE_DTC_FLAGS := --pad 4096 DEVICE_DTS_LOADADDR := 0x43f00000 - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware KERNEL_LOADADDR := 0x44000000 KERNEL = kernel-bin | lzma | \ fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb @@ -462,7 +462,7 @@ define Device/confiabits_mt7981 IMAGE_SIZE := 65536k KERNEL_IN_UBI := 1 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata - DEVICE_PACKAGES := kmod-usb3 kmod-mt7981-firmware mt7981-wo-firmware + DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware endef TARGET_DEVICES += confiabits_mt7981 @@ -484,7 +484,7 @@ define Device/cudy_m3000-v1 fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware endef TARGET_DEVICES += cudy_m3000-v1 @@ -503,7 +503,7 @@ define Device/cudy_re3000-v1 KERNEL_INITRAMFS := kernel-bin | lzma | \ fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | pad-rootfs | check-size | append-metadata - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware endef TARGET_DEVICES += cudy_re3000-v1 @@ -520,7 +520,7 @@ define Device/cudy_tr3000-v1 IMAGE_SIZE := 65536k KERNEL_IN_UBI := 1 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata - DEVICE_PACKAGES := kmod-usb3 kmod-mt7981-firmware mt7981-wo-firmware + DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware endef TARGET_DEVICES += cudy_tr3000-v1 @@ -539,7 +539,7 @@ define Device/cudy_wr3000-v1 KERNEL_INITRAMFS := kernel-bin | lzma | \ fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | pad-rootfs | check-size | append-metadata - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware endef TARGET_DEVICES += cudy_wr3000-v1 @@ -549,7 +549,7 @@ define Device/dlink_aquila-pro-ai-m30-a1 DEVICE_VARIANT := A1 DEVICE_DTS := mt7981b-dlink-aquila-pro-ai-m30-a1 DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-leds-gca230718 kmod-mt7981-firmware mt7981-wo-firmware + DEVICE_PACKAGES := kmod-leds-gca230718 kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware KERNEL_IN_UBI := 1 IMAGES += recovery.bin IMAGE_SIZE := 51200k @@ -572,7 +572,7 @@ define Device/edgecore_eap111 IMAGES := sysupgrade.bin factory.bin IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE) IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware endef TARGET_DEVICES += edgecore_eap111 @@ -582,7 +582,7 @@ define Device/glinet_gl-mt2500 DEVICE_DTS := mt7981b-glinet-gl-mt2500 DEVICE_DTS_DIR := ../dts DEVICE_DTS_LOADADDR := 0x47000000 - DEVICE_PACKAGES := -kmod-mt7915e -wpad-basic-mbedtls e2fsprogs f2fsck mkf2fs kmod-usb3 + DEVICE_PACKAGES := -wpad-basic-mbedtls e2fsprogs f2fsck mkf2fs kmod-usb3 SUPPORTED_DEVICES += glinet,mt2500-emmc IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata @@ -595,7 +595,7 @@ define Device/glinet_gl-mt3000 DEVICE_DTS := mt7981b-glinet-gl-mt3000 DEVICE_DTS_DIR := ../dts SUPPORTED_DEVICES += glinet,mt3000-snand - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-hwmon-pwmfan kmod-usb3 + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-hwmon-pwmfan kmod-usb3 UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k PAGESIZE := 2048 @@ -610,7 +610,7 @@ define Device/glinet_gl-mt6000 DEVICE_MODEL := GL-MT6000 DEVICE_DTS := mt7986a-glinet-gl-mt6000 DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := e2fsprogs f2fsck mkf2fs kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware + DEVICE_PACKAGES := e2fsprogs f2fsck mkf2fs kmod-usb3 kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware IMAGES += factory.bin IMAGE/factory.bin := append-kernel | pad-to 32M | append-rootfs IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata @@ -623,7 +623,7 @@ TARGET_DEVICES += glinet_gl-mt6000 define Device/glinet_gl-x3000-xe3000-common DEVICE_VENDOR := GL.iNet DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware mkf2fs \ + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware mkf2fs \ kmod-fs-f2fs kmod-hwmon-pwmfan kmod-usb3 kmod-usb-serial-option \ kmod-usb-storage kmod-usb-net-qmi-wwan uqmi IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata @@ -663,7 +663,7 @@ define Device/h3c_magic-nx30-pro fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k IMAGE/sysupgrade.itb := append-kernel | \ fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware ARTIFACTS := preloader.bin bl31-uboot.fip ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3 ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot h3c_magic-nx30-pro @@ -687,7 +687,7 @@ define Device/jcg_q30-pro fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k IMAGE/sysupgrade.itb := append-kernel | \ fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware ARTIFACTS := preloader.bin bl31-uboot.fip ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3 ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot jcg_q30-pro @@ -701,7 +701,7 @@ define Device/jdcloud_re-cp-03 DEVICE_DTS_DIR := ../dts DEVICE_DTC_FLAGS := --pad 4096 DEVICE_DTS_LOADADDR := 0x43f00000 - DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware \ + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware \ e2fsprogs f2fsck mkf2fs KERNEL_LOADADDR := 0x44000000 KERNEL := kernel-bin | gzip @@ -731,7 +731,7 @@ define Device/mediatek_mt7981-rfb DEVICE_DTS_DIR := $(DTS_DIR)/ DEVICE_DTC_FLAGS := --pad 4096 DEVICE_DTS_LOADADDR := 0x43f00000 - DEVICE_PACKAGES := kmod-mt7981-firmware kmod-usb3 e2fsprogs f2fsck mkf2fs mt7981-wo-firmware + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware kmod-usb3 e2fsprogs f2fsck mkf2fs mt7981-wo-firmware KERNEL_LOADADDR := 0x44000000 KERNEL := kernel-bin | gzip KERNEL_INITRAMFS := kernel-bin | lzma | \ @@ -780,7 +780,7 @@ define Device/mediatek_mt7986a-rfb-nand DEVICE_MODEL := MT7986 rfba AP (NAND) DEVICE_DTS := mt7986a-rfb-spim-nand DEVICE_DTS_DIR := $(DTS_DIR)/ - DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware SUPPORTED_DEVICES := mediatek,mt7986a-rfb-snand UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k @@ -802,7 +802,7 @@ define Device/mediatek_mt7986b-rfb DEVICE_MODEL := MTK7986 rfbb AP DEVICE_DTS := mt7986b-rfb DEVICE_DTS_DIR := $(DTS_DIR)/ - DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware SUPPORTED_DEVICES := mediatek,mt7986b-rfb UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k @@ -883,7 +883,7 @@ define Device/mercusys_mr90x-v1 DEVICE_MODEL := MR90X v1 DEVICE_DTS := mt7986b-mercusys-mr90x-v1 DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k PAGESIZE := 2048 @@ -909,7 +909,7 @@ define Device/netcore_n60 fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k IMAGE/sysupgrade.itb := append-kernel | \ fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata - DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware ARTIFACTS := preloader.bin bl31-uboot.fip ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr3 ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot netcore_n60 @@ -923,7 +923,7 @@ define Device/netgear_wax220 DEVICE_DTS_DIR := ../dts NETGEAR_ENC_MODEL := WAX220 NETGEAR_ENC_REGION := US - DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware KERNEL_INITRAMFS_SUFFIX := -recovery.itb IMAGE_SIZE := 32768k IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata @@ -939,7 +939,7 @@ define Device/openembed_som7981 DEVICE_MODEL := SOM7981 DEVICE_DTS := mt7981b-openembed-som7981 DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k PAGESIZE := 2048 @@ -962,7 +962,7 @@ define Device/openwrt_one DEVICE_DTS_DIR := ../dts DEVICE_DTC_FLAGS := --pad 4096 DEVICE_DTS_LOADADDR := 0x43f00000 - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-rtc-pcf8563 kmod-usb3 kmod-nvme kmod-phy-airoha-en8811h + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-rtc-pcf8563 kmod-usb3 kmod-nvme kmod-phy-airoha-en8811h KERNEL_LOADADDR := 0x44000000 KERNEL := kernel-bin | gzip KERNEL_INITRAMFS := kernel-bin | lzma | \ @@ -1016,7 +1016,7 @@ define Device/qihoo_360t7 fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k IMAGE/sysupgrade.itb := append-kernel | \ fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware ARTIFACTS := preloader.bin bl31-uboot.fip ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3 ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot qihoo_360t7 @@ -1028,7 +1028,7 @@ define Device/routerich_ax3000 DEVICE_MODEL := AX3000 DEVICE_DTS := mt7981b-routerich-ax3000 DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata SUPPORTED_DEVICES += mediatek,mt7981-spim-snand-rfb endef @@ -1049,7 +1049,7 @@ define Device/tplink_tl-xdr-common fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k IMAGE/sysupgrade.itb := append-kernel | \ fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-with-rootfs | append-metadata - DEVICE_PACKAGES := fitblk kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware + DEVICE_PACKAGES := fitblk kmod-usb3 kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware ARTIFACTS := preloader.bin bl31-uboot.fip ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr3 endef @@ -1083,7 +1083,7 @@ define Device/ubnt_unifi-6-plus DEVICE_MODEL := UniFi 6 Plus DEVICE_DTS := mt7981a-ubnt-unifi-6-plus DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware e2fsprogs f2fsck mkf2fs fdisk partx-utils + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware e2fsprogs f2fsck mkf2fs fdisk partx-utils IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata endef TARGET_DEVICES += ubnt_unifi-6-plus @@ -1092,7 +1092,7 @@ define Device/unielec_u7981-01 DEVICE_VENDOR := Unielec DEVICE_MODEL := U7981-01 DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 e2fsprogs f2fsck mkf2fs fdisk partx-utils + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 e2fsprogs f2fsck mkf2fs fdisk partx-utils IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata endef @@ -1118,7 +1118,7 @@ define Device/xiaomi_mi-router-ax3000t UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k PAGESIZE := 2048 - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) ARTIFACTS := initramfs-factory.ubi ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-kernel.bin | ubinize-kernel @@ -1135,7 +1135,7 @@ define Device/xiaomi_mi-router-ax3000t-ubootmod UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k PAGESIZE := 2048 - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware KERNEL_IN_UBI := 1 UBOOTENV_IN_UBI := 1 IMAGES := sysupgrade.itb @@ -1163,7 +1163,7 @@ define Device/xiaomi_mi-router-wr30u-stock UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k PAGESIZE := 2048 - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) ARTIFACTS := initramfs-factory.ubi ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-kernel.bin | ubinize-kernel @@ -1180,7 +1180,7 @@ define Device/xiaomi_mi-router-wr30u-ubootmod UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k PAGESIZE := 2048 - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware KERNEL_IN_UBI := 1 UBOOTENV_IN_UBI := 1 IMAGES := sysupgrade.itb @@ -1205,7 +1205,7 @@ define Device/xiaomi_redmi-router-ax6000-stock DEVICE_MODEL := Redmi Router AX6000 (stock layout) DEVICE_DTS := mt7986a-xiaomi-redmi-router-ax6000-stock DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-leds-ws2812b kmod-mt7986-firmware mt7986-wo-firmware + DEVICE_PACKAGES := kmod-leds-ws2812b kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k PAGESIZE := 2048 @@ -1222,7 +1222,7 @@ define Device/xiaomi_redmi-router-ax6000-ubootmod DEVICE_MODEL := Redmi Router AX6000 (OpenWrt U-Boot layout) DEVICE_DTS := mt7986a-xiaomi-redmi-router-ax6000-ubootmod DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-leds-ws2812b kmod-mt7986-firmware mt7986-wo-firmware + DEVICE_PACKAGES := kmod-leds-ws2812b kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware KERNEL_INITRAMFS_SUFFIX := -recovery.itb IMAGES := sysupgrade.itb UBINIZE_OPTS := -E 5 @@ -1259,7 +1259,7 @@ define Device/yuncore_ax835 KERNEL_INITRAMFS := kernel-bin | lzma | \ fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | pad-rootfs | check-size | append-metadata - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware endef TARGET_DEVICES += yuncore_ax835 @@ -1269,7 +1269,7 @@ define Device/zbtlink_zbt-z8102ax DEVICE_MODEL := ZBT-Z8102AX DEVICE_DTS := mt7981b-zbtlink-zbt-z8102ax DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 kmod-usb-net-qmi-wwan kmod-usb-serial-option + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 kmod-usb-net-qmi-wwan kmod-usb-serial-option KERNEL_IN_UBI := 1 UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k @@ -1286,7 +1286,7 @@ define Device/zbtlink_zbt-z8103ax DEVICE_MODEL := ZBT-Z8103AX DEVICE_DTS := mt7981b-zbtlink-zbt-z8103ax DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware KERNEL_IN_UBI := 1 UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k @@ -1304,7 +1304,7 @@ define Device/zyxel_ex5601-t0-stock DEVICE_VARIANT := (stock layout) DEVICE_DTS := mt7986a-zyxel-ex5601-t0-stock DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware kmod-usb3 + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware kmod-usb3 SUPPORTED_DEVICES := mediatek,mt7986a-rfb-snand UBINIZE_OPTS := -E 5 BLOCKSIZE := 256k @@ -1327,7 +1327,7 @@ define Device/zyxel_ex5601-t0-ubootmod DEVICE_VARIANT := (OpenWrt U-Boot layout) DEVICE_DTS := mt7986a-zyxel-ex5601-t0-ubootmod DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware kmod-usb3 + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware kmod-usb3 KERNEL_INITRAMFS_SUFFIX := -recovery.itb IMAGES := sysupgrade.itb UBINIZE_OPTS := -E 5 @@ -1355,7 +1355,7 @@ define Device/zyxel_ex5700-telenor DEVICE_MODEL := EX5700 (Telenor) DEVICE_DTS := mt7986a-zyxel-ex5700-telenor DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-mt7916-firmware kmod-ubootenv-nvram kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware + DEVICE_PACKAGES := kmod-ubootenv-nvram kmod-usb3 kmod-mt7915e kmod-mt7916-firmware kmod-mt7986-firmware mt7986-wo-firmware UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k PAGESIZE := 2048 @@ -1369,7 +1369,7 @@ define Device/zyxel_nwa50ax-pro DEVICE_MODEL := NWA50AX Pro DEVICE_DTS := mt7981b-zyxel-nwa50ax-pro DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware zyxel-bootconfig + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware zyxel-bootconfig DEVICE_DTS_LOADADDR := 0x44000000 UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k From 2a2f53415ed8ed79778edb8135bdbb5e819e587b Mon Sep 17 00:00:00 2001 From: Lea Teuberth Date: Tue, 2 Apr 2024 11:30:32 +0200 Subject: [PATCH 4/7] ramips: add support for TP-Link Archer MR200v5 Specifications: CPU: MT7628AN 580MHz RAM: 64MB DDR2 FLASH: 8MB EN25QH64 NOR SPI WIFI: 2.4GHz 2x2 MT7628 b/g/n internal WIFI: 5GHz 1x1 MT7610E ac/n PCI LTE: Qualcomm MDM9207 ETH: 4xLAN 100base-T integrated SWITCH: RT3050-ESW Port 0,1,2,3: LAN, Port 6: CPU LEDS: LAN, WAN, Power, 3x signal strength, WiFi BTNS: Reset, WiFi toggle UART: Near ETH ports, Vcc-GND-RX-TX, 115200, 8N1 Installation: 1. Update using recovery mode - set your IP to 192.168.0.225, subnet mask: 255.255.255.0 - start tftp server, rename tftp-recovery.bin to tp_recovery.bin and place it into the server's directory - while holdig the "reset" button, power on the device - keep holding "reset" until the file is being transferred Notes: This board has only one MAC address programmed in the "romfile" partition: - MAC for phy0 (2.4GHz) at romfile 0xf100 (0) - MAC for phy1 (5GHz) at romfile 0xf100 (-1) - stock firmware re-uses phy0 MAC for ethernet - stock firmware uses romfile 0xf100 (1) for WWAN; not used since QMI interface is raw IP Signed-off-by: Lea Teuberth --- .../dts/mt7628an_tplink_archer-mr200-v5.dts | 192 ++++++++++++++++++ target/linux/ramips/image/mt76x8.mk | 15 ++ .../mt76x8/base-files/etc/board.d/01_leds | 4 + .../mt76x8/base-files/etc/board.d/02_network | 5 + 4 files changed, 216 insertions(+) create mode 100644 target/linux/ramips/dts/mt7628an_tplink_archer-mr200-v5.dts diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-mr200-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-mr200-v5.dts new file mode 100644 index 0000000000..177cd4db8a --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-mr200-v5.dts @@ -0,0 +1,192 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7628an.dtsi" + +#include +#include +#include + +/ { + compatible = "tplink,archer-mr200-v5", "mediatek,mt7628an-soc"; + model = "TP-Link Archer MR200 v5"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = ðernet; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + lan { + function = LED_FUNCTION_LAN; + color = ; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + }; + + wan { + function = LED_FUNCTION_WAN; + color = ; + gpios = <&gpio 40 GPIO_ACTIVE_LOW>; + }; + + led_power: power { + function = LED_FUNCTION_POWER; + color = ; + gpios = <&gpio 39 GPIO_ACTIVE_LOW>; + }; + + signal1 { + label = "white:signal1"; + gpios = <&gpio 41 GPIO_ACTIVE_LOW>; + }; + + signal2 { + label = "white:signal2"; + gpios = <&gpio 42 GPIO_ACTIVE_LOW>; + }; + + signal3 { + label = "white:signal3"; + gpios = <&gpio 43 GPIO_ACTIVE_LOW>; + }; + + wlan { + function = LED_FUNCTION_WLAN; + color = ; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 38 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + rfkill { + label = "rfkill"; + gpios = <&gpio 46 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <104000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x20000>; + read-only; + }; + + partition@20000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x20000 0x7b0000>; + }; + + partition@7d0000 { + label = "config"; + reg = <0x7d0000 0x10000>; + read-only; + }; + + partition@7e0000 { + label = "romfile"; + reg = <0x7e0000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_romfile_f100: macaddr@f100 { + compatible = "mac-base"; + reg = <0xf100 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@7f0000 { + label = "radio"; + reg = <0x7f0000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "p0led_an", "p1led_an", "p2led_an", "p3led_an", "p4led_an", "uart1", "wdt"; + function = "gpio"; + }; +}; + +&wmac { + nvmem-cells = <&eeprom_radio_0>, <&macaddr_romfile_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; + status = "okay"; +}; + +&esw { + mediatek,portdisable = <0x30>; +}; + +ðernet { + nvmem-cells = <&macaddr_romfile_f100 0>; + nvmem-cell-names = "mac-address"; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + mt76@0,0 { + reg = <0x0000 0 0 0 0>; + ieee80211-freq-limit = <5000000 6000000>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_romfile_f100 (-1)>; + nvmem-cell-names = "eeprom", "mac-address"; + }; +}; diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index fc81266da9..37c5a034c4 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -606,6 +606,21 @@ define Device/tplink_archer-c50-v6 endef TARGET_DEVICES += tplink_archer-c50-v6 +define Device/tplink_archer-mr200-v5 + $(Device/tplink-v2) + IMAGE_SIZE := 7872k + DEVICE_MODEL := Archer MR200 + DEVICE_VARIANT := v5 + TPLINK_FLASHLAYOUT := 8MLmtk + TPLINK_HWID := 0x20000005 + TPLINK_HWREV := 0x5 + TPLINK_HWREVADD := 0x5 + DEVICE_PACKAGES := kmod-mt76x0e uqmi kmod-usb2 kmod-usb-serial-option + IMAGES := sysupgrade.bin tftp-recovery.bin + IMAGE/tftp-recovery.bin := pad-extra 128k | $$(IMAGE/factory.bin) +endef +TARGET_DEVICES += tplink_archer-mr200-v5 + define Device/tplink_re200-v2 $(Device/tplink-safeloader) IMAGE_SIZE := 7808k diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds index da3ef154c0..324b57124f 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds @@ -83,6 +83,10 @@ tplink,archer-c50-v6) ucidef_set_led_wlan "wlan2g" "wlan2g" "green:wlan2g" "phy0tpt" ucidef_set_led_wlan "wlan5g" "wlan5g" "green:wlan5g" "phy1tpt" ;; +tplink,archer-mr200-v5) + ucidef_set_led_netdev "lan" "lan" "white:lan" "eth0" + ucidef_set_led_netdev "wan" "wan" "white:wan" "wwan0" + ;; tplink,re200-v2|\ tplink,re200-v3|\ tplink,re200-v4|\ diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index fd8c086a85..9fee26e122 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -153,6 +153,11 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0" ;; + tplink,archer-mr200-v5) + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "3:lan" "6t@eth0" + ucidef_set_interface "wan" device "/dev/cdc-wdm0" protocol "qmi" + ;; tplink,tl-mr3020-v3) ucidef_add_switch "switch0" \ "0:lan" "6@eth0" From 6febb93cfd5ceb4c68ee5c870f5bc762b5248adb Mon Sep 17 00:00:00 2001 From: Didier 'OdyX' Raboud Date: Wed, 15 May 2024 09:49:05 +0200 Subject: [PATCH 5/7] usbmode: add Huawei E5785 This 4G/LTE modem is a WiFi hotspot, and also works as cdc_ether modem when plugged over USB. It needs usb-modeswitching. With HuaweiNewMode, it will modeswitch from 3426:1f01 (mass-storage) to 3426:14db (cdc_ether). Signed-off-by: Didier 'OdyX' Raboud Link: https://github.com/openwrt/openwrt/pull/15497 Signed-off-by: Robert Marko --- package/utils/usbmode/data/3426-1f01 | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 package/utils/usbmode/data/3426-1f01 diff --git a/package/utils/usbmode/data/3426-1f01 b/package/utils/usbmode/data/3426-1f01 new file mode 100644 index 0000000000..cd5b7e7055 --- /dev/null +++ b/package/utils/usbmode/data/3426-1f01 @@ -0,0 +1,4 @@ +# Huawei E5785 +TargetVendor=0x3426 +TargetProduct=0x14db +HuaweiNewMode=1 From 3e024022c3370e94b7002ddd183ac9a622ab89d2 Mon Sep 17 00:00:00 2001 From: Rany Hany Date: Mon, 13 May 2024 16:34:22 +0300 Subject: [PATCH 6/7] linux-atm: fix build with GCC 14 Basic changes to make linux-atm build without any issues with GCC 14. Besides some errors caused by -Wpointer-sign, there was also an issue with socklen_t not being used for getsockopt() and accept() sometimes. I also updated the Debian patch to include the latest changes from version "1:2.5.1-5.1" in Debian Sid. This allowed me to drop "600-fix-format-errors.patch" and "700-include_sockios.patch". Signed-off-by: Rany Hany --- package/network/utils/linux-atm/Makefile | 2 +- ...an_16.patch => 000-debian_2.5.1-5.1.patch} | 133 ++++++++++++------ .../510-remove-LINUX_NETDEVICE-hack.patch | 4 +- .../patches/600-fix-format-errors.patch | 11 -- ...l-include.patch => 600-musl-include.patch} | 0 .../patches/700-fix-gcc14-build.patch | 82 +++++++++++ .../patches/800-include_sockios.patch | 21 --- 7 files changed, 176 insertions(+), 77 deletions(-) rename package/network/utils/linux-atm/patches/{000-debian_16.patch => 000-debian_2.5.1-5.1.patch} (87%) delete mode 100644 package/network/utils/linux-atm/patches/600-fix-format-errors.patch rename package/network/utils/linux-atm/patches/{700-musl-include.patch => 600-musl-include.patch} (100%) create mode 100644 package/network/utils/linux-atm/patches/700-fix-gcc14-build.patch delete mode 100644 package/network/utils/linux-atm/patches/800-include_sockios.patch diff --git a/package/network/utils/linux-atm/Makefile b/package/network/utils/linux-atm/Makefile index 43f4b6556b..c48309da9c 100644 --- a/package/network/utils/linux-atm/Makefile +++ b/package/network/utils/linux-atm/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=linux-atm PKG_VERSION:=2.5.2 -PKG_RELEASE:=7 +PKG_RELEASE:=8 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SF/$(PKG_NAME) diff --git a/package/network/utils/linux-atm/patches/000-debian_16.patch b/package/network/utils/linux-atm/patches/000-debian_2.5.1-5.1.patch similarity index 87% rename from package/network/utils/linux-atm/patches/000-debian_16.patch rename to package/network/utils/linux-atm/patches/000-debian_2.5.1-5.1.patch index 4abaac07e8..27bf6b1ad1 100644 --- a/package/network/utils/linux-atm/patches/000-debian_16.patch +++ b/package/network/utils/linux-atm/patches/000-debian_2.5.1-5.1.patch @@ -1,3 +1,45 @@ +--- a/src/mpoad/mpcd.8 ++++ b/src/mpoad/mpcd.8 +@@ -28,7 +28,7 @@ mpcd \- ATM MPOA (Multi\-Protocol Over A + .B ]] + .SH DESCRIPTION + MPOA client +-.SM(MPC) is responsible for creating and receiving ++.SM (MPC) is responsible for creating and receiving + internetwork layer shortcuts. Using these shortcuts MPCs forward + unicast internetwork layer packets effectively over ATM without need + for routing protocols. +@@ -43,7 +43,7 @@ accepts shortcuts and packets arriving o + shortcuts is done with the help of + .SM MPOA + server +-.SM(MPS). ++.SM (MPS). + .PP + Just as the Linux + .SM LAN +--- a/src/led/zeppelin.8 ++++ b/src/led/zeppelin.8 +@@ -99,7 +99,7 @@ Ring and ATM parts of the ELAN, so using + recommended. Token Ring support has received less testing than its + Ethernet counterpart. + .SH FILES +-.IP \fI/var/run/lec[interface number].pid\fP ++.IP \fI/var/run/lec[interface\ number].pid\fP + The file containing the process id of zeppelin. + .SH BUGS + John Bonham died 1980 and Led Zeppelin broke. +--- a/src/sigd/atmsigd.conf.4 ++++ b/src/sigd/atmsigd.conf.4 +@@ -125,7 +125,7 @@ a comment. The `#' character cannot be e + .P + If an option is specified in \fBatmsigd.conf\fP and on the command + line, the command line has priority. +-.COMPATIBILITY ++.SH COMPATIBILITY + Certain options used by past versions of \fBatmsigd\fP but no longer documented + on the man page are still recognized and supported, but they also yield a + warning message. Future versions of \fBatmsigd\fP will not recognize those --- a/src/arpd/io.c +++ b/src/arpd/io.c @@ -277,7 +277,8 @@ static void accept_new(void) @@ -226,45 +268,52 @@ if (trans) { /* set send socket buffer if we are transmitting */ ---- a/src/mpoad/mpcd.8 -+++ b/src/mpoad/mpcd.8 -@@ -28,7 +28,7 @@ mpcd \- ATM MPOA (Multi\-Protocol Over A - .B ]] - .SH DESCRIPTION - MPOA client --.SM(MPC) is responsible for creating and receiving -+.SM (MPC) is responsible for creating and receiving - internetwork layer shortcuts. Using these shortcuts MPCs forward - unicast internetwork layer packets effectively over ATM without need - for routing protocols. -@@ -43,7 +43,7 @@ accepts shortcuts and packets arriving o - shortcuts is done with the help of - .SM MPOA - server --.SM(MPS). -+.SM (MPS). - .PP - Just as the Linux - .SM LAN ---- a/src/led/zeppelin.8 -+++ b/src/led/zeppelin.8 -@@ -99,7 +99,7 @@ Ring and ATM parts of the ELAN, so using - recommended. Token Ring support has received less testing than its - Ethernet counterpart. - .SH FILES --.IP \fI/var/run/lec[interface number].pid\fP -+.IP \fI/var/run/lec[interface\ number].pid\fP - The file containing the process id of zeppelin. - .SH BUGS - John Bonham died 1980 and Led Zeppelin broke. ---- a/src/sigd/atmsigd.conf.4 -+++ b/src/sigd/atmsigd.conf.4 -@@ -125,7 +125,7 @@ a comment. The `#' character cannot be e - .P - If an option is specified in \fBatmsigd.conf\fP and on the command - line, the command line has priority. --.COMPATIBILITY -+.SH COMPATIBILITY - Certain options used by past versions of \fBatmsigd\fP but no longer documented - on the man page are still recognized and supported, but they also yield a - warning message. Future versions of \fBatmsigd\fP will not recognize those +@@ -663,7 +664,7 @@ int no_check = 0; + exit(0); + + usage: +- fprintf(stderr, Usage); ++ fprintf(stderr, "%s", Usage); + exit(1); + } + +--- a/src/arpd/arp.c ++++ b/src/arpd/arp.c +@@ -17,6 +17,7 @@ + #include /* for ntohs, etc. */ + #define _LINUX_NETDEVICE_H /* very crude hack for glibc2 */ + #include ++#include + #include + #include + #include +--- a/src/arpd/itf.c ++++ b/src/arpd/itf.c +@@ -14,6 +14,7 @@ + #include + #define _LINUX_NETDEVICE_H /* glibc2 */ + #include ++#include + #include + + #include "atmd.h" +--- a/src/maint/atmdump.c ++++ b/src/maint/atmdump.c +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + #include /* for htonl and ntohl */ + #include + +--- a/src/maint/saaldump.c ++++ b/src/maint/saaldump.c +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + #include + + #include "pdu.h" diff --git a/package/network/utils/linux-atm/patches/510-remove-LINUX_NETDEVICE-hack.patch b/package/network/utils/linux-atm/patches/510-remove-LINUX_NETDEVICE-hack.patch index d76ec1eaf4..c16df18aa9 100644 --- a/package/network/utils/linux-atm/patches/510-remove-LINUX_NETDEVICE-hack.patch +++ b/package/network/utils/linux-atm/patches/510-remove-LINUX_NETDEVICE-hack.patch @@ -28,8 +28,8 @@ in Linux 4.20. #include -#define _LINUX_NETDEVICE_H /* glibc2 */ #include + #include #include - --- a/src/arpd/io.c +++ b/src/arpd/io.c @@ -21,7 +21,6 @@ @@ -48,5 +48,5 @@ in Linux 4.20. #include /* for ntohs, etc. */ -#define _LINUX_NETDEVICE_H /* very crude hack for glibc2 */ #include + #include #include - #include diff --git a/package/network/utils/linux-atm/patches/600-fix-format-errors.patch b/package/network/utils/linux-atm/patches/600-fix-format-errors.patch deleted file mode 100644 index ef484f2fa3..0000000000 --- a/package/network/utils/linux-atm/patches/600-fix-format-errors.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/test/ttcp.c -+++ b/src/test/ttcp.c -@@ -664,7 +664,7 @@ int no_check = 0; - exit(0); - - usage: -- fprintf(stderr, Usage); -+ fprintf(stderr, "%s", Usage); - exit(1); - } - diff --git a/package/network/utils/linux-atm/patches/700-musl-include.patch b/package/network/utils/linux-atm/patches/600-musl-include.patch similarity index 100% rename from package/network/utils/linux-atm/patches/700-musl-include.patch rename to package/network/utils/linux-atm/patches/600-musl-include.patch diff --git a/package/network/utils/linux-atm/patches/700-fix-gcc14-build.patch b/package/network/utils/linux-atm/patches/700-fix-gcc14-build.patch new file mode 100644 index 0000000000..a19dc6c767 --- /dev/null +++ b/package/network/utils/linux-atm/patches/700-fix-gcc14-build.patch @@ -0,0 +1,82 @@ +--- a/src/arpd/io.c ++++ b/src/arpd/io.c +@@ -615,7 +615,7 @@ int ip_itf_info(int number,uint32_t *ip, + int get_local(int fd,struct sockaddr_atmsvc *addr) + { + int result; +- size_t length; ++ socklen_t length; + + length = sizeof(struct sockaddr_atmsvc); + result = getsockname(fd,(struct sockaddr *) addr,&length); +--- a/src/led/conn.c ++++ b/src/led/conn.c +@@ -405,7 +405,7 @@ Conn_t *accept_conn(Conn_t *conn) + { + Conn_t *new; + struct sockaddr_atmsvc addr; +- size_t len; ++ socklen_t len; + int fd; + char buff[MAX_ATM_ADDR_LEN+1]; + +@@ -538,7 +538,7 @@ static int handle_accept(Conn_t *conn) + */ + static int handle_data(Conn_t *conn) + { +- char buff[MAX_CTRL_FRAME]; ++ unsigned char buff[MAX_CTRL_FRAME]; + int retval; + + retval = recv_frame(conn, buff, sizeof(buff)); +--- a/src/led/frames.c ++++ b/src/led/frames.c +@@ -312,7 +312,7 @@ static void handle_ready_ind(Conn_t *con + * dependant handler functions. + * Returns < 0 for serious error + */ +-int handle_frame(Conn_t *conn, char *buff, int size) ++int handle_frame(Conn_t *conn, unsigned char *buff, int size) + { + struct ctrl_frame *frame; + +--- a/src/led/frames.h ++++ b/src/led/frames.h +@@ -13,7 +13,7 @@ int validate_frame(unsigned char *buff, + void send_ready_ind(Conn_t *conn); + void send_register_req(void); + +-int handle_frame(Conn_t *conn, char *buff, int size); ++int handle_frame(Conn_t *conn, unsigned char *buff, int size); + uint32_t send_flush_req(Conn_t *conn); + + void parse_tlvs(uint16_t opcode, unsigned char *tlvp, int numtlvs, int sizeoftlvs); +--- a/src/led/join.c ++++ b/src/led/join.c +@@ -43,7 +43,7 @@ static int read_join_rsp(char *buff, int + static int parse_join_rsp(unsigned char *buff, int size); + + static int get_bus_addr(struct sockaddr_atmsvc *addr); +-static int read_bus_arp(Conn_t *conn, struct sockaddr_atmsvc *addr, char *buff, int buffsize); ++static int read_bus_arp(Conn_t *conn, struct sockaddr_atmsvc *addr, unsigned char *buff, int buffsize); + + /* + * 5.1, Initial state +@@ -693,7 +693,7 @@ static int get_bus_addr(struct sockaddr_ + fd_set rfds; + struct timeval tv; + int n = 0, retval, timeout; +- char buff[MAX_CTRL_FRAME]; ++ unsigned char buff[MAX_CTRL_FRAME]; + + timeout = 4; /* wait response for 4 seconds */ + lec_params.c7c_current_timeout = 1; +@@ -740,7 +740,7 @@ static int get_bus_addr(struct sockaddr_ + * Tries to read BUS ATM address in *addr + * returns < 0 for error, 0 for not found > 0 for success + */ +-static int read_bus_arp(Conn_t *conn, struct sockaddr_atmsvc *addr, char *buff, int buffsize) ++static int read_bus_arp(Conn_t *conn, struct sockaddr_atmsvc *addr, unsigned char *buff, int buffsize) + { + int frame_size; + struct ctrl_frame *frame; diff --git a/package/network/utils/linux-atm/patches/800-include_sockios.patch b/package/network/utils/linux-atm/patches/800-include_sockios.patch deleted file mode 100644 index edb385ca10..0000000000 --- a/package/network/utils/linux-atm/patches/800-include_sockios.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/src/maint/saaldump.c 2020-03-29 22:58:01.089711789 +0200 -+++ b/src/maint/saaldump.c 2020-03-29 22:59:17.564639387 +0200 -@@ -6,6 +6,7 @@ - #include - #endif - -+#include - #include - #include - #include ---- a/src/maint/atmdump.c 2020-03-29 22:58:18.573694469 +0200 -+++ b/src/maint/atmdump.c 2020-03-29 22:58:49.956729365 +0200 -@@ -6,6 +6,7 @@ - #include - #endif - -+#include - #include - #include - #include - From febcfadc804d5877cb5e51483c51d2da6d04768c Mon Sep 17 00:00:00 2001 From: Andrey Bondar Date: Fri, 10 May 2024 16:22:14 +0300 Subject: [PATCH 7/7] ath79: add support for 8Devices Carambola3 board Carambola3 is a WiFi module based on Qualcomm/Atheros QCA4531 http://wiki.8devices.com/carambola3 Specification: - 650/600/216 MHz (CPU/DDR/AHB) - 128 MB of RAM (DDR2) - 32 MB of FLASH - 2T2R 2.4 GHz - 2x 10/100 Mbps Ethernet - 1x USB 2.0 Host socket - UART for serial console - 12x GPIO Flash instructions: Upgrading from ar71xx target: - Upload image into the board: scp openwrt-ath79-generic-8dev_carambola3-squashfs-sysupgrade.bin \ root@192.168.1.1/tmp/ - Run sysupgrade sysupgrade -F /tmp/openwrt-ath79-generic-8dev_carambola3-squashfs-sysupgrade.bin Upgrading from u-boot: - Set up tftp server with openwrt-ath79-generic-8dev_carambola3-initramfs-kernel.bin - Go to u-boot (reboot and press ESC when prompted) - Set TFTP server IP setenv serverip 192.168.1.254 - Set device ip from the same subnet setenv ipaddr 192.168.1.1 - Copy new firmware to board tftpboot 0x82000000 initramfs.bin - Boot OpenWRT bootm 0x82000000 - Upload image openwrt-ath79-generic-8dev_carambola3-squashfs-sysupgrade.bin into the board - Run sysupgrade. Signed-off-by: Andrey Bondar Link: https://github.com/openwrt/openwrt/pull/15514 Signed-off-by: Robert Marko --- .../ath79/dts/qca9531_8dev_carambola3.dts | 133 ++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 4 + .../etc/hotplug.d/firmware/10-ath9k-eeprom | 1 + target/linux/ath79/image/generic.mk | 10 ++ 4 files changed, 148 insertions(+) create mode 100644 target/linux/ath79/dts/qca9531_8dev_carambola3.dts diff --git a/target/linux/ath79/dts/qca9531_8dev_carambola3.dts b/target/linux/ath79/dts/qca9531_8dev_carambola3.dts new file mode 100644 index 0000000000..c019f2c3d1 --- /dev/null +++ b/target/linux/ath79/dts/qca9531_8dev_carambola3.dts @@ -0,0 +1,133 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca953x.dtsi" + +#include +#include +#include + +/ { + compatible = "8dev,carambola3", "qca,qca9531"; + model = "8devices Carambola3"; + + aliases { + label-mac-device = &wmac; + }; + + leds { + compatible = "gpio-leds"; + + lan { + label = "green:lan"; + function = LED_FUNCTION_LAN; + color = ; + gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; + }; + + wan { + label = "green:wan"; + function = LED_FUNCTION_WAN; + color = ; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&usb0 { + status = "okay"; + + dr_mode = "host"; +}; + +&usb_phy { + status = "okay"; +}; + +&wdt { + status = "okay"; +}; + +&spi { + status = "okay"; + + /* Winbond W25Q256 SPI flash */ + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <45000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x040000>; + }; + + art: partition@80000 { + label = "art"; + reg = <0x080000 0x040000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; + }; + + partition@c0000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x0c0000 0xf40000>; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy0>; + + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; + + gmac-config { + device = <&gmac>; + + switch-phy-addr-swap = <1>; + switch-phy-swap = <1>; + }; +}; + +ð1 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index 18fe436dbc..98d1b0a7ba 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -10,6 +10,10 @@ case "$board" in ucidef_set_led_netdev "lan" "LAN" "orange:eth0" "eth0" ucidef_set_led_switch "wan" "WAN" "orange:eth1" "switch0" "0x04" ;; +8dev,carambola3) + ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0" "link" + ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1" "link" + ;; alcatel,hh40v) ucidef_set_led_netdev "lan_data" "LAN Data" "green:lan" "eth1" "tx rx" ucidef_set_led_netdev "lan_link" "LAN Link" "orange:lan" "eth1" "link" diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index e5f4870e6f..1caba6aa7c 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -9,6 +9,7 @@ board=$(board_name) case "$FIRMWARE" in "ath9k-eeprom-ahb-18100000.wmac.bin") case $board in + 8dev,carambola3|\ 8dev,lima) caldata_extract "art" 0x1000 0x800 ;; diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 90270a7a4e..ca72c8c6d8 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -204,6 +204,16 @@ define Device/8dev_carambola2 endef TARGET_DEVICES += 8dev_carambola2 +define Device/8dev_carambola3 + SOC := qca9531 + DEVICE_VENDOR := 8devices + DEVICE_MODEL := Carambola3 + DEVICE_PACKAGES := kmod-usb2 + IMAGE_SIZE := 32768k + SUPPORTED_DEVICES += carambola3 +endef +TARGET_DEVICES += 8dev_carambola3 + define Device/8dev_lima SOC := qca9531 DEVICE_VENDOR := 8devices