diff --git a/config/Config-build.in b/config/Config-build.in index a54df11566..0aaf6b31c3 100644 --- a/config/Config-build.in +++ b/config/Config-build.in @@ -5,6 +5,20 @@ # See /LICENSE for more information. # +config EXPERIMENTAL + bool "Enable experimental features by default" + default n + help + Set this option to build with latest bleeding edge features + which may or may not work as expected. + If you would like to help the development of OpenWrt, you are + encouraged to set this option and provide feedback (both + positive and negative). But do so only if you know how to + recover your device in case of flashing potentially non-working + firmware. + + If you plan to use this build in production, say NO! + menu "Global build settings" config JSON_OVERVIEW_IMAGE_INFO @@ -51,7 +65,7 @@ menu "Global build settings" config TESTING_KERNEL bool "Use the testing kernel version" depends on HAS_TESTING_KERNEL - default n + default EXPERIMENTAL help If the target supports a newer kernel version than the default, you can use this config option to enable it @@ -215,10 +229,6 @@ menu "Global build settings" config USE_UCLIBCXX bool "uClibc++" - config USE_LIBCXX - bool "libc++" - depends on !USE_UCLIBC - config USE_LIBSTDCXX bool "libstdc++" endchoice diff --git a/include/depends.mk b/include/depends.mk index 3df51adae3..ace7139000 100644 --- a/include/depends.mk +++ b/include/depends.mk @@ -13,7 +13,7 @@ DEP_FINDPARAMS := -x "*/.svn*" -x ".*" -x "*:*" -x "*\!*" -x "* *" -x "*\\\#*" -x "*/.*_check" -x "*/.*.swp" -x "*/.pkgdir*" -find_md5=find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) | mkhash md5 +find_md5=find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) -printf "%p%T@\n" | sort | mkhash md5 define rdep .PRECIOUS: $(2) diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk index db93a53d71..863c180e48 100644 --- a/include/kernel-defaults.mk +++ b/include/kernel-defaults.mk @@ -24,7 +24,7 @@ Kernel/Patch:=$(Kernel/Patch/Default) ifneq (,$(findstring .xz,$(LINUX_SOURCE))) LINUX_CAT:=xzcat else - LINUX_CAT:=zcat + LINUX_CAT:=gzip -dc endif ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"") diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 11df16e9f5..2633ef5107 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -6,9 +6,9 @@ ifdef CONFIG_TESTING_KERNEL KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER) endif -LINUX_VERSION-5.4 = .81 +LINUX_VERSION-5.4 = .82 -LINUX_KERNEL_HASH-5.4.81 = 9470bde475726996202d845a5fc3bc8bd3bb546bbc6816fb663fa73df25d8427 +LINUX_KERNEL_HASH-5.4.82 = fb4458e4ea38b6c5df4ee8cee0d9b0420b5aed07e273787b045c0db48709ddaf remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/include/prereq-build.mk b/include/prereq-build.mk index e7314b253b..5045fabdfb 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -170,6 +170,9 @@ $(eval $(call SetupHostCommand,git,Please install Git (git-core) >= 1.7.12.2, \ $(eval $(call SetupHostCommand,file,Please install the 'file' package, \ file --version 2>&1 | grep file)) +$(eval $(call SetupHostCommand,rsync,Please install 'rsync', \ + rsync --version $(1)/usr/lib/opkg/status.new mv $(1)/usr/lib/opkg/status.new $(1)/usr/lib/opkg/status - -find $(1)/usr/lib/opkg -empty | $(XARGS) rm -rf + -find $(1)/usr/lib/opkg -empty -delete endef endif @@ -88,15 +88,13 @@ define prepare_rootfs done || true \ ) $(if $(SOURCE_DATE_EPOCH),sed -i "s/Installed-Time: .*/Installed-Time: $(SOURCE_DATE_EPOCH)/" $(1)/usr/lib/opkg/status) - @-find $(1) -name CVS | $(XARGS) rm -rf - @-find $(1) -name .svn | $(XARGS) rm -rf - @-find $(1) -name .git | $(XARGS) rm -rf - @-find $(1) -name '.#*' | $(XARGS) rm -f - rm -rf $(1)/tmp/* - rm -f $(1)/usr/lib/opkg/lists/* - rm -f $(1)/usr/lib/opkg/info/*.postinst* - rm -f $(1)/var/lock/*.lock - rm -rf $(1)/boot + @-find $(1) -name CVS -o -name .svn -o -name .git -o -name '.#*' | $(XARGS) rm -rf + rm -rf \ + $(1)/boot \ + $(1)/tmp/* \ + $(1)/usr/lib/opkg/info/*.postinst* \ + $(1)/usr/lib/opkg/lists/* \ + $(1)/var/lock/*.lock $(call clean_ipkg,$(1)) $(call mklibs,$(1)) $(if $(SOURCE_DATE_EPOCH),find $(1)/ -mindepth 1 -execdir touch -hcd "@$(SOURCE_DATE_EPOCH)" "{}" +) diff --git a/include/uclibc++.mk b/include/uclibc++.mk index 27533279c9..a1a61f26d4 100644 --- a/include/uclibc++.mk +++ b/include/uclibc++.mk @@ -4,8 +4,8 @@ ifndef DUMP endif endif -PKG_PREPARED_DEPENDS += CONFIG_USE_UCLIBCXX CONFIG_USE_LIBCXX -CXX_DEPENDS = +USE_UCLIBCXX:uclibcxx +USE_LIBCXX:libcxx +USE_LIBSTDCXX:libstdcpp +PKG_PREPARED_DEPENDS += CONFIG_USE_UCLIBCXX +CXX_DEPENDS = +USE_UCLIBCXX:uclibcxx +USE_LIBSTDCXX:libstdcpp ifneq ($(CONFIG_USE_UCLIBCXX),) ifneq ($(CONFIG_CCACHE),) @@ -14,11 +14,3 @@ ifneq ($(CONFIG_USE_UCLIBCXX),) TARGET_CXX=g++-uc endif endif - -ifneq ($(CONFIG_USE_LIBCXX),) - ifneq ($(CONFIG_CCACHE),) - TARGET_CXX_NOCACHE=g++-libcxx - else - TARGET_CXX=g++-libcxx - endif -endif diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 0c612b73ca..fbcb694592 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=base-files -PKG_RELEASE:=239 +PKG_RELEASE:=240 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ diff --git a/package/base-files/files/lib/functions/caldata.sh b/package/base-files/files/lib/functions/caldata.sh index e22c7d27e6..2177cf8415 100644 --- a/package/base-files/files/lib/functions/caldata.sh +++ b/package/base-files/files/lib/functions/caldata.sh @@ -3,6 +3,16 @@ . /lib/functions.sh . /lib/functions/system.sh +caldata_dd() { + local source=$1 + local target=$2 + local count=$(($3)) + local offset=$(($4)) + + dd if=$source of=$target iflag=skip_bytes,fullblock bs=$count skip=$offset count=1 2>/dev/null + return $? +} + caldata_die() { echo "caldata: " "$*" exit 1 @@ -17,7 +27,7 @@ caldata_extract() { mtd=$(find_mtd_chardev $part) [ -n "$mtd" ] || caldata_die "no mtd device found for partition $part" - dd if=$mtd of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \ + caldata_dd $mtd /lib/firmware/$FIRMWARE $count $offset || \ caldata_die "failed to extract calibration data from $mtd" } @@ -34,7 +44,7 @@ caldata_extract_ubi() { ubi=$(nand_find_volume $ubidev $part) [ -n "$ubi" ] || caldata_die "no UBI volume found for $part" - dd if=/dev/$ubi of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \ + caldata_dd /dev/$ubi /lib/firmware/$FIRMWARE $count $offset || \ caldata_die "failed to extract calibration data from $ubi" } @@ -64,8 +74,7 @@ caldata_from_file() { [ -n "$target" ] || target=/lib/firmware/$FIRMWARE - # dd doesn't handle partial reads from special files: use cat - cat $source | dd of=$target iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \ + caldata_dd $source $target $count $offset || \ caldata_die "failed to extract calibration data from $source" } @@ -73,16 +82,20 @@ caldata_sysfsload_from_file() { local source=$1 local offset=$(($2)) local count=$(($3)) + local target_dir="/sys/$DEVPATH" + local target="$target_dir/data" - # dd doesn't handle partial reads from special files: use cat - # test extract to /dev/null first - cat $source | dd of=/dev/null iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \ + [ -d "$target_dir" ] || \ + caldata_die "no sysfs dir to write: $target" + + echo 1 > "$target_dir/loading" + caldata_dd $source $target $count $offset + if [ $? != 0 ]; then + echo 1 > "$target_dir/loading" caldata_die "failed to extract calibration data from $source" - - # can't fail now - echo 1 > /sys/$DEVPATH/loading - cat $source | dd of=/sys/$DEVPATH/data iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null - echo 0 > /sys/$DEVPATH/loading + else + echo 0 > "$target_dir/loading" + fi } caldata_valid() { diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index 398f37de12..590e38d883 100644 --- a/package/boot/uboot-envtools/Makefile +++ b/package/boot/uboot-envtools/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uboot-envtools PKG_DISTNAME:=u-boot PKG_VERSION:=2020.04 -PKG_RELEASE:=8 +PKG_RELEASE:=9 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index a2753eed7a..4319832e11 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -29,7 +29,7 @@ buffalo,wsr-1166dhp|\ buffalo,wsr-600dhp|\ mediatek,linkit-smart-7688|\ samknows,whitebox-v8|\ -xiaomi,mir3g-v2|\ +xiaomi,mi-router-3g-v2|\ xiaomi,mi-router-4a-gigabit|\ xiaomi,mi-router-4c|\ xiaomi,miwifi-nano|\ @@ -45,9 +45,9 @@ ravpower,rp-wd03) linksys,ea7300-v1|\ linksys,ea7300-v2|\ linksys,ea7500-v2|\ +xiaomi,mi-router-3g|\ +xiaomi,mi-router-3-pro|\ xiaomi,mi-router-ac2100|\ -xiaomi,mir3p|\ -xiaomi,mir3g|\ xiaomi,redmi-router-ac2100) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" ;; diff --git a/package/kernel/linux/modules/lib.mk b/package/kernel/linux/modules/lib.mk index 43d3ca5538..9a341932bd 100644 --- a/package/kernel/linux/modules/lib.mk +++ b/package/kernel/linux/modules/lib.mk @@ -124,16 +124,18 @@ $(eval $(call KernelPackage,lib-lzo)) define KernelPackage/lib-zstd SUBMENU:=$(LIB_MENU) TITLE:=ZSTD support + DEPENDS:=+kmod-crypto-acompress KCONFIG:= \ + CONFIG_CRYPTO_ZSTD \ CONFIG_ZSTD_COMPRESS \ CONFIG_ZSTD_DECOMPRESS \ CONFIG_XXHASH - HIDDEN:=1 FILES:= \ + $(LINUX_DIR)/crypto/zstd.ko \ $(LINUX_DIR)/lib/xxhash.ko \ $(LINUX_DIR)/lib/zstd/zstd_compress.ko \ $(LINUX_DIR)/lib/zstd/zstd_decompress.ko - AUTOLOAD:=$(call AutoProbe,xxhash zstd_compress zstd_decompress) + AUTOLOAD:=$(call AutoProbe,xxhash zstd zstd_compress zstd_decompress) endef define KernelPackage/lib-zstd/description diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk index 2564e5c1e6..878877a201 100644 --- a/package/kernel/linux/modules/usb.mk +++ b/package/kernel/linux/modules/usb.mk @@ -1105,7 +1105,7 @@ endef define KernelPackage/usb-net-aqc111 - TITLE:=Kernel module for Aquantia AQtion USB to 5/2.5GbE Controllers + TITLE:=Support for USB-to-Ethernet Aquantia AQtion 5/2.5GbE DEPENDS:=+kmod-libphy KCONFIG:=CONFIG_USB_NET_AQC111 FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/aqc111.ko @@ -1114,8 +1114,7 @@ define KernelPackage/usb-net-aqc111 endef define KernelPackage/usb-net-aqc111/description - Kernel module for Aquantia AQtion USB Ethernet adapters - based on AQC111U/AQC112 chips. + Support for USB-to-Ethernet Aquantia AQtion 5/2.5GbE endef $(eval $(call KernelPackage,usb-net-aqc111)) diff --git a/package/libs/libcxx/Makefile b/package/libs/libcxx/Makefile deleted file mode 100644 index 3809bea651..0000000000 --- a/package/libs/libcxx/Makefile +++ /dev/null @@ -1,66 +0,0 @@ - -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=libcxx -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:=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 -include $(INCLUDE_DIR)/cmake.mk - -define Package/libcxx - SECTION:=libs - CATEGORY:=Libraries - TITLE:=LLVM libstdc++ - URL:=https://libcxx.llvm.org/ - DEPENDS:=+libatomic +libpthread -endef - -define Package/libcxx/description - libc++ is an implementation of the C++ standard library, targeting C++11, C++14 and above. -endef - -CMAKE_OPTIONS += \ - -DLIBCXX_CXX_ABI="libcxxabi" \ - -DLIBCXX_ENABLE_ASSERTIONS=OFF \ - -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF \ - -DLIBCXX_INCLUDE_BENCHMARKS=OFF \ - -DLIBCXX_INCLUDE_DOCS=OFF \ - -DLIBCXX_INCLUDE_TESTS=OFF \ - -DLIBCXX_LIBDIR_SUFFIX="" \ - -DLIBCXX_STANDALONE_BUILD=ON \ - -DLIBCXX_HAS_MUSL_LIBC=$(if $(CONFIG_USE_MUSL),ON,OFF) - -TARGET_CXXFLAGS += -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -Wno-attributes -flto -TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed - -define Build/InstallDev - $(call Build/InstallDev/cmake,$(1)) - $(CP) files/g++-libcxx $(TOOLCHAIN_DIR)/bin/ - $(SED) 's,CXX,$(TARGET_CXX),g' $(TOOLCHAIN_DIR)/bin/g++-libcxx -endef - -define Package/libcxx/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libc++.so.* $(1)/usr/lib/ -endef - -$(eval $(call BuildPackage,libcxx)) diff --git a/package/libs/libcxx/files/g++-libcxx b/package/libs/libcxx/files/g++-libcxx deleted file mode 100755 index 88b3e7da01..0000000000 --- a/package/libs/libcxx/files/g++-libcxx +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -WRAPPER_INCLUDEDIR="-I$STAGING_DIR/usr/include/c++/v1" -WRAPPER_LIBDIR="-L$STAGING_DIR/usr/lib" -WRAPPER_LIBS="-lc -lgcc_s -lssp_nonshared" - -WRAPPER_OPTIONS="" -WRAPPER_INCLIB="Y" -for arg -do - case "$arg" in - -c|-E|-S) WRAPPER_INCLIB="N" ;; - -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++ -lc++abi $WRAPPER_LIBS" - -exec CXX -nostdinc++ -DGCC_HASCLASSVISIBILITY "$WRAPPER_INCLUDEDIR" "$@" $WRAPPER_OPTIONS - diff --git a/package/libs/libcxx/patches/010-ssp.patch b/package/libs/libcxx/patches/010-ssp.patch deleted file mode 100644 index f83c7b9b56..0000000000 --- a/package/libs/libcxx/patches/010-ssp.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -760,6 +760,10 @@ function(cxx_link_system_libraries targe - target_link_libraries(${target} PRIVATE atomic) - endif() - -+ if (LIBCXX_HAS_MUSL_LIBC) -+ target_link_libraries(${target} PRIVATE ssp_nonshared) -+ endif() -+ - if (MINGW) - target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}") - endif() diff --git a/package/libs/libcxxabi/Makefile b/package/libs/libcxxabi/Makefile deleted file mode 100644 index 90547561b2..0000000000 --- a/package/libs/libcxxabi/Makefile +++ /dev/null @@ -1,71 +0,0 @@ - -# -# 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 deleted file mode 100644 index b14609dc62..0000000000 --- a/package/libs/libcxxabi/patches/010-arm.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/src/cxa_exception.h -+++ b/src/cxa_exception.h -@@ -27,6 +27,13 @@ _LIBCXXABI_HIDDEN uint64_t __getExceptio - _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) { diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile index 9d41ed7c7a..d9c239a50d 100644 --- a/package/libs/libubox/Makefile +++ b/package/libs/libubox/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/libubox.git -PKG_MIRROR_HASH:=cf963b19f5a25da85b2d8888514cbcc33c3f641c4478c9c25312b8bf83fe9e6b -PKG_SOURCE_DATE:=2020-08-06 -PKG_SOURCE_VERSION:=9e52171d70def760a6949676800d0b73f85ee22d +PKG_MIRROR_HASH:=97dc4eba01cf2c5d6a6d0db3747e0cdc0d95cb87e51b3115272e7d3e69a8b255 +PKG_SOURCE_DATE:=2020-12-12 +PKG_SOURCE_VERSION:=357877693ca363b12e6e7e14d345639b2440cd07 CMAKE_INSTALL:=1 PKG_LICENSE:=ISC @@ -27,7 +27,7 @@ define Package/libubox SECTION:=libs CATEGORY:=Libraries TITLE:=Basic utility library - ABI_VERSION:=20191228 + ABI_VERSION:=20201212 DEPENDS:= endef diff --git a/package/libs/lzo/Makefile b/package/libs/lzo/Makefile deleted file mode 100644 index 09885e8d9b..0000000000 --- a/package/libs/lzo/Makefile +++ /dev/null @@ -1,61 +0,0 @@ -# -# Copyright (C) 2006-2016 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=lzo -PKG_VERSION:=2.10 -PKG_RELEASE:=4 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://www.oberhumer.com/opensource/lzo/download/ -PKG_HASH:=c0f892943208266f9b6543b3ae308fab6284c5c90e627931446fb49b4221a072 - -PKG_LICENSE:=GPL-2.0-or-later -PKG_LICENSE_FILES:=COPYING - -PKG_BUILD_PARALLEL:=1 -CMAKE_BINARY_SUBDIR:=openwrt-build - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/cmake.mk - -define Package/liblzo - SECTION:=libs - CATEGORY:=Libraries - TITLE:=A real-time data compression library - URL:=http://www.oberhumer.com/opensource/lzo/ - ABI_VERSION:=2 -endef - -define Package/liblzo/description - LZO is a data compression library which is suitable for data de-/compression - in real-time. This means it favours speed over compression ratio. -endef - -CMAKE_OPTIONS += \ - -DENABLE_SHARED=ON \ - -DENABLE_STATIC=ON \ - \ - -DBUILD_TESTING=OFF \ - -DCMAKE_SKIP_INSTALL_RPATH=ON - -define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig - $(CP) $(PKG_INSTALL_DIR)/usr/include/lzo $(1)/usr/include/ - $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzo2.{a,so*} $(1)/usr/lib/ - $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lzo2.pc $(1)/usr/lib/pkgconfig - $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/lzo2.pc - $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/lzo2.pc -endef - -define Package/liblzo/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzo2.so.* $(1)/usr/lib/ -endef - -$(eval $(call BuildPackage,liblzo)) diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 4082ae7aa7..2722f08a5c 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -334,6 +334,7 @@ define Build/Configure --prefix=/usr \ --libdir=lib \ --openssldir=/etc/ssl \ + --cross-compile-prefix="$(TARGET_CROSS)" \ $(TARGET_CPPFLAGS) \ $(TARGET_LDFLAGS) \ $(OPENSSL_OPTIONS) && \ @@ -346,14 +347,12 @@ TARGET_LDFLAGS += -Wl,--gc-sections define Build/Compile +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE="$(TARGET_CROSS)" \ CC="$(TARGET_CC)" \ SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) \ OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \ $(OPENSSL_MAKEFLAGS) \ all $(MAKE) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE="$(TARGET_CROSS)" \ CC="$(TARGET_CC)" \ DESTDIR="$(PKG_INSTALL_DIR)" \ $(OPENSSL_MAKEFLAGS) \ diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index dc8ca2b262..6758f7dd08 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wolfssl PKG_VERSION:=4.5.0-stable -PKG_RELEASE:=2 +PKG_RELEASE:=5 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION) @@ -61,9 +61,12 @@ TARGET_LDFLAGS += -flto # --enable-stunnel needed for OpenSSL API compatibility bits CONFIGURE_ARGS += \ + --enable-lighty \ + --enable-opensslall \ --enable-opensslextra \ --enable-sni \ --enable-stunnel \ + --disable-crypttests \ --disable-examples \ --disable-jobserver \ --$(if $(CONFIG_IPV6),enable,disable)-ipv6 \ diff --git a/package/libs/wolfssl/patches/200-fix-checkhostname-matching.patch b/package/libs/wolfssl/patches/200-fix-checkhostname-matching.patch new file mode 100644 index 0000000000..aaf14e46d9 --- /dev/null +++ b/package/libs/wolfssl/patches/200-fix-checkhostname-matching.patch @@ -0,0 +1,123 @@ +From ea5c290d605b2af7b10d6e5ce69aa3534f52385f Mon Sep 17 00:00:00 2001 +From: Eric Blankenhorn +Date: Fri, 17 Jul 2020 08:37:02 -0500 +Subject: [PATCH] Fix CheckHostName matching + +--- + src/internal.c | 18 ++++++++++++------ + src/ssl.c | 5 +++++ + tests/api.c | 30 ++++++++++++++++++++++++++++++ + 3 files changed, 47 insertions(+), 6 deletions(-) + +diff --git a/src/internal.c b/src/internal.c +index dc57df0242..cda815d875 100644 +--- a/src/internal.c ++++ b/src/internal.c +@@ -9346,7 +9346,7 @@ int CheckForAltNames(DecodedCert* dCert, const char* domain, int* checkCN) + altName = dCert->altNames; + + if (checkCN != NULL) { +- *checkCN = altName == NULL; ++ *checkCN = (altName == NULL) ? 1 : 0; + } + + while (altName) { +@@ -9415,23 +9415,29 @@ int CheckForAltNames(DecodedCert* dCert, const char* domain, int* checkCN) + int CheckHostName(DecodedCert* dCert, const char *domainName, size_t domainNameLen) + { + int checkCN; ++ int ret = DOMAIN_NAME_MISMATCH; + + /* Assume name is NUL terminated. */ + (void)domainNameLen; + + if (CheckForAltNames(dCert, domainName, &checkCN) != 1) { +- WOLFSSL_MSG("DomainName match on alt names failed too"); +- return DOMAIN_NAME_MISMATCH; ++ WOLFSSL_MSG("DomainName match on alt names failed"); + } ++ else { ++ ret = 0; ++ } ++ + if (checkCN == 1) { + if (MatchDomainName(dCert->subjectCN, dCert->subjectCNLen, +- domainName) == 0) { ++ domainName) == 1) { ++ ret = 0; ++ } ++ else { + WOLFSSL_MSG("DomainName match on common name failed"); +- return DOMAIN_NAME_MISMATCH; + } + } + +- return 0; ++ return ret; + } + + int CheckIPAddr(DecodedCert* dCert, const char* ipasc) +diff --git a/src/ssl.c b/src/ssl.c +index 11bc08a3cb..59ad9bae60 100644 +--- a/src/ssl.c ++++ b/src/ssl.c +@@ -43661,6 +43661,11 @@ int wolfSSL_X509_check_host(WOLFSSL_X509 *x, const char *chk, size_t chklen, + (void)flags; + (void)peername; + ++ if ((x == NULL) || (chk == NULL)) { ++ WOLFSSL_MSG("Invalid parameter"); ++ return WOLFSSL_FAILURE; ++ } ++ + if (flags == WOLFSSL_NO_WILDCARDS) { + WOLFSSL_MSG("X509_CHECK_FLAG_NO_WILDCARDS not yet implemented"); + return WOLFSSL_FAILURE; +diff --git a/tests/api.c b/tests/api.c +index 774a332968..db888952d4 100644 +--- a/tests/api.c ++++ b/tests/api.c +@@ -23875,6 +23875,35 @@ static void test_wolfSSL_X509_issuer_name_hash(void) + #endif + } + ++static void test_wolfSSL_X509_check_host(void) ++{ ++#if defined(OPENSSL_EXTRA) && !defined(NO_CERTS) && !defined(NO_FILESYSTEM) \ ++ && !defined(NO_SHA) && !defined(NO_RSA) ++ ++ X509* x509; ++ const char altName[] = "example.com"; ++ ++ printf(testingFmt, "wolfSSL_X509_check_host()"); ++ ++ AssertNotNull(x509 = wolfSSL_X509_load_certificate_file(cliCertFile, ++ SSL_FILETYPE_PEM)); ++ ++ AssertIntEQ(X509_check_host(x509, altName, XSTRLEN(altName), 0, NULL), ++ WOLFSSL_SUCCESS); ++ ++ AssertIntEQ(X509_check_host(x509, NULL, 0, 0, NULL), ++ WOLFSSL_FAILURE); ++ ++ X509_free(x509); ++ ++ AssertIntEQ(X509_check_host(NULL, altName, XSTRLEN(altName), 0, NULL), ++ WOLFSSL_FAILURE); ++ ++ printf(resultFmt, passed); ++ ++#endif ++} ++ + static void test_wolfSSL_DES(void) + { + #if defined(OPENSSL_EXTRA) && !defined(NO_DES3) +@@ -36407,6 +36436,7 @@ void ApiTest(void) + test_wolfSSL_X509_INFO(); + test_wolfSSL_X509_subject_name_hash(); + test_wolfSSL_X509_issuer_name_hash(); ++ test_wolfSSL_X509_check_host(); + test_wolfSSL_DES(); + test_wolfSSL_certs(); + test_wolfSSL_ASN1_TIME_print(); diff --git a/package/network/config/xfrm/Makefile b/package/network/config/xfrm/Makefile index 1b3b99adb0..bcee89f82c 100644 --- a/package/network/config/xfrm/Makefile +++ b/package/network/config/xfrm/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xfrm -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/config/xfrm/files/xfrm.sh b/package/network/config/xfrm/files/xfrm.sh index 1bd1958726..ca7c3380e6 100755 --- a/package/network/config/xfrm/files/xfrm.sh +++ b/package/network/config/xfrm/files/xfrm.sh @@ -11,8 +11,8 @@ proto_xfrm_setup() { local cfg="$1" local mode="xfrm" - local tunlink ifid mtu zone - json_get_vars tunlink ifid mtu zone + local tunlink ifid mtu zone multicast + json_get_vars tunlink ifid mtu zone multicast [ -z "$tunlink" ] && { proto_notify_error "$cfg" NO_TUNLINK @@ -36,6 +36,8 @@ proto_xfrm_setup() { json_add_string link "$tunlink" + json_add_boolean multicast "${multicast:-1}" + json_add_object 'data' [ -n "$ifid" ] && json_add_int ifid "$ifid" json_close_object @@ -61,6 +63,7 @@ proto_xfrm_init_config() { proto_config_add_string "tunlink" proto_config_add_string "zone" proto_config_add_int "ifid" + proto_config_add_boolean "multicast" } diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile index 15800b678b..b1528ee2d1 100644 --- a/package/network/ipv6/odhcp6c/Makefile +++ b/package/network/ipv6/odhcp6c/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=16 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git -PKG_SOURCE_DATE:=2020-03-28 -PKG_SOURCE_VERSION:=f575351cbb3defc0bf52680c9082912a6c264374 -PKG_MIRROR_HASH:=3a0df503be81d25da44a83ae36d5fbeaabae1b7c99f6eb8ffe6f62311e254d06 +PKG_SOURCE_DATE:=2020-12-08 +PKG_SOURCE_VERSION:=0ffa3a31f7146d320214f431291c1196070a010f +PKG_MIRROR_HASH:=16eab81663ad7bd7f650c62019b65ded21f08e797874041787543e2e8ed665e8 PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 diff --git a/package/network/services/dropbear/Config.in b/package/network/services/dropbear/Config.in index 6aa5a7e4e1..15000eff53 100644 --- a/package/network/services/dropbear/Config.in +++ b/package/network/services/dropbear/Config.in @@ -99,4 +99,14 @@ config DROPBEAR_SCP bool "Build dropbear with scp" default y +config DROPBEAR_ASKPASS + bool "Enable askpass helper support" + default n + depends on DROPBEAR_DBCLIENT + help + This enables support for ssh-askpass helper in dropbear client + in order to authenticate on remote hosts. + + Increases binary size by about 0.1 kB (MIPS). + endmenu diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile index 8520426382..8bbb26f829 100644 --- a/package/network/services/dropbear/Makefile +++ b/package/network/services/dropbear/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dropbear PKG_VERSION:=2020.81 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ @@ -32,7 +32,7 @@ PKG_CONFIG_DEPENDS:= \ CONFIG_DROPBEAR_CURVE25519 CONFIG_DROPBEAR_ZLIB \ CONFIG_DROPBEAR_ED25519 CONFIG_DROPBEAR_CHACHA20POLY1305 \ CONFIG_DROPBEAR_UTMP CONFIG_DROPBEAR_PUTUTLINE \ - CONFIG_DROPBEAR_DBCLIENT CONFIG_DROPBEAR_SCP + CONFIG_DROPBEAR_DBCLIENT CONFIG_DROPBEAR_SCP CONFIG_DROPBEAR_ASKPASS include $(INCLUDE_DIR)/package.mk @@ -96,47 +96,77 @@ CONFIGURE_ARGS += \ $(if $(CONFIG_DROPBEAR_ZLIB),,--disable-zlib) \ --enable-bundled-libtom +############################################################################## +# +# option|value - add option to localoptions.h +# !!option|value - replace option in sysoptions.h +# +############################################################################## + +# remove protocol idented software version number: +# - LOCAL_IDENT +# disable legacy/unsafe methods and unused functionality: +# - INETD_MODE +# - DROPBEAR_CLI_NETCAT +# - DROPBEAR_DSS +# - DO_MOTD +DB_OPT_COMMON = \ + DEFAULT_PATH|"$(TARGET_INIT_PATH)" \ + !!LOCAL_IDENT|"SSH-2.0-dropbear" \ + INETD_MODE|0 \ + DROPBEAR_CLI_NETCAT|0 \ + DROPBEAR_DSS|0 \ + DO_MOTD|0 \ + + +############################################################################## +# +# option|config|enabled|disabled = add option to localoptions.h +# !!option|config|enabled|disabled = replace option in sysoptions.h +# +# option := (config) ? enabled : disabled +# +############################################################################## + +DB_OPT_CONFIG = \ + DROPBEAR_CURVE25519|CONFIG_DROPBEAR_CURVE25519|1|0 \ + DROPBEAR_ED25519|CONFIG_DROPBEAR_ED25519|1|0 \ + DROPBEAR_CHACHA20POLY1305|CONFIG_DROPBEAR_CHACHA20POLY1305|1|0 \ + DROPBEAR_ECDSA|CONFIG_DROPBEAR_ECC|1|0 \ + DROPBEAR_ECDH|CONFIG_DROPBEAR_ECC|1|0 \ + !!DROPBEAR_ECC_384|CONFIG_DROPBEAR_ECC_FULL|1|0 \ + !!DROPBEAR_ECC_521|CONFIG_DROPBEAR_ECC_FULL|1|0 \ + DROPBEAR_CLI_ASKPASS_HELPER|CONFIG_DROPBEAR_ASKPASS|1|0 \ + + TARGET_CFLAGS += -DARGTYPE=3 -ffunction-sections -fdata-sections -flto TARGET_LDFLAGS += -Wl,--gc-sections -flto=jobserver +db_opt_add =echo '\#define $(1) $(2)' >> $(PKG_BUILD_DIR)/localoptions.h +db_opt_replace =$(ESED) 's,^(\#define $(1)) .*$$$$,\1 $(2),g' $(PKG_BUILD_DIR)/sysoptions.h + +define Build/Configure/dropbear_headers + $(strip $(foreach s,$(DB_OPT_COMMON), \ + $(if $(filter !!%,$(word 1,$(subst |, ,$(s)))), \ + $(call db_opt_replace,$(patsubst !!%,%,$(word 1,$(subst |, ,$(s)))),$(word 2,$(subst |, ,$(s)))), \ + $(call db_opt_add,$(word 1,$(subst |, ,$(s))),$(word 2,$(subst |, ,$(s)))) \ + ) ; \ + )) + + $(strip $(foreach s,$(DB_OPT_CONFIG), \ + $(if $(filter !!%,$(word 1,$(subst |, ,$(s)))), \ + $(call db_opt_replace,$(patsubst !!%,%,$(word 1,$(subst |, ,$(s)))),$(if $($(word 2,$(subst |, ,$(s)))),$(word 3,$(subst |, ,$(s))),$(word 4,$(subst |, ,$(s))))), \ + $(call db_opt_add,$(word 1,$(subst |, ,$(s))),$(if $($(word 2,$(subst |, ,$(s)))),$(word 3,$(subst |, ,$(s))),$(word 4,$(subst |, ,$(s))))) \ + ) ; \ + )) +endef + define Build/Configure : > $(PKG_BUILD_DIR)/localoptions.h $(Build/Configure/Default) - echo '#define DEFAULT_PATH "$(TARGET_INIT_PATH)"' >> \ - $(PKG_BUILD_DIR)/localoptions.h - - echo '#define DROPBEAR_CURVE25519 $(if $(CONFIG_DROPBEAR_CURVE25519),1,0)' >> \ - $(PKG_BUILD_DIR)/localoptions.h - - for OPTION in DROPBEAR_ECDSA DROPBEAR_ECDH; do \ - echo "#define $$$$OPTION $(if $(CONFIG_DROPBEAR_ECC),1,0)" >> \ - $(PKG_BUILD_DIR)/localoptions.h; \ - done - - echo '#define DROPBEAR_ED25519 $(if $(CONFIG_DROPBEAR_ED25519),1,0)' >> \ - $(PKG_BUILD_DIR)/localoptions.h - - echo '#define DROPBEAR_CHACHA20POLY1305 $(if $(CONFIG_DROPBEAR_CHACHA20POLY1305),1,0)' >> \ - $(PKG_BUILD_DIR)/localoptions.h - - # remove protocol idented software version number - $(ESED) 's,^(#define LOCAL_IDENT) .*$$$$,\1 "SSH-2.0-dropbear",g' \ - $(PKG_BUILD_DIR)/sysoptions.h - - # disable legacy/unsafe methods and unused functionality - for OPTION in INETD_MODE DROPBEAR_CLI_NETCAT \ - DROPBEAR_DSS DROPBEAR_USE_PASSWORD_ENV DO_MOTD ; do \ - echo "#define $$$$OPTION 0" >> \ - $(PKG_BUILD_DIR)/localoptions.h; \ - done - - # enable nistp384 and nistp521 only if full ECC support was requested - for OPTION in DROPBEAR_ECC_384 DROPBEAR_ECC_521; do \ - $(ESED) 's,^(#define '$$$$OPTION') .*$$$$,\1 $(if $(CONFIG_DROPBEAR_ECC_FULL),1,0),g' \ - $(PKG_BUILD_DIR)/sysoptions.h; \ - done + $(Build/Configure/dropbear_headers) # Enforce rebuild of svr-chansession.c rm -f $(PKG_BUILD_DIR)/svr-chansession.o diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 1e20b56200..61b2a548ef 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=17 +PKG_RELEASE:=18 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 178d9b490a..681c47216a 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -124,7 +124,7 @@ hostapd_prepare_device_config() { set_default country_ie 1 set_default spectrum_mgmt_required 0 set_default doth 1 - set_default legacy_rates 1 + set_default legacy_rates 0 set_default airtime_mode 0 set_default cell_density 0 diff --git a/package/network/services/lldpd/patches/002-fix-AX_LIB_READLINE-macro-conflict.patch b/package/network/services/lldpd/patches/002-fix-AX_LIB_READLINE-macro-conflict.patch new file mode 100644 index 0000000000..9cdf66f2e7 --- /dev/null +++ b/package/network/services/lldpd/patches/002-fix-AX_LIB_READLINE-macro-conflict.patch @@ -0,0 +1,61 @@ +From 23509dc05b24a28fb46022800e0e271ae0118de2 Mon Sep 17 00:00:00 2001 +From: Jo-Philipp Wich +Date: Wed, 9 Dec 2020 12:04:04 +0100 +Subject: [PATCH] build: prevent conflict with official AX_LIB_READLINE macro + +On systems where the official AX_LIB_READLINE (ax_lib_readline.m4) is +present in a globally shared autoconf include directory, auto(re)conf +will prefer including that offical version over the local variant due +to the offical macro having a higher serial number. + +As a consequence, @READLINE_LIBS@ will not be substituted in *.in files, +eventually failing the compilation with errors similar to: + + gcc: error: READLINE_LIBS@: No such file or directory + +Avoid this problem by renaming the incompatible local macro to +AX_LIB_READLINE_LLDPD which is sufficient to prevent any clashes. + +We encountered this problem on OpenWrt which uses GNU autoconf-archive +to provide commonly used M4 macros through a global include directory, +which happens to ship AX_LIB_READLINE as well. + +Signed-off-by: Jo-Philipp Wich +--- + configure.ac | 2 +- + m4/ax_lib_readline.m4 | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +--- a/configure.ac ++++ b/configure.ac +@@ -273,7 +273,7 @@ AC_ARG_WITH([readline], + [], + [with_readline=auto]) + if test x"$with_readline" != x"no"; then +- AX_LIB_READLINE ++ AX_LIB_READLINE_LLDPD + if test x"$with_readline" != x"check" -a x"$with_readline" != x"auto"; then + if test x"$ax_cv_lib_readline" = x"no"; then + AC_MSG_FAILURE([*** no readline support found]) +--- a/m4/ax_lib_readline.m4 ++++ b/m4/ax_lib_readline.m4 +@@ -4,7 +4,7 @@ + # + # SYNOPSIS + # +-# AX_LIB_READLINE ++# AX_LIB_READLINE_LLDPD + # + # DESCRIPTION + # +@@ -66,8 +66,8 @@ + + #serial 6 + +-AU_ALIAS([VL_LIB_READLINE], [AX_LIB_READLINE]) +-AC_DEFUN([AX_LIB_READLINE], [ ++AU_ALIAS([VL_LIB_READLINE], [AX_LIB_READLINE_LLDPD]) ++AC_DEFUN([AX_LIB_READLINE_LLDPD], [ + AC_CACHE_CHECK([for a readline compatible library], + ax_cv_lib_readline, [ + _save_LIBS="$LIBS" diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index 9a4cd19bef..1ab68ec33b 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git -PKG_SOURCE_DATE:=2020-11-15 -PKG_SOURCE_VERSION:=fb55e80394c51d7502bb278f57520dec15a11355 -PKG_MIRROR_HASH:=631d15fd7c93529fa33433380c4811dbacca9665864e5836c6daca0c7165f25a +PKG_SOURCE_DATE:=2020-12-13 +PKG_SOURCE_VERSION:=2cf6232fd170a24b801d71d497947d7aabd12015 +PKG_MIRROR_HASH:=097a6b186bc85cc8ff95a611e23ab50a6d8025988f19e0d48520e12a1020274d PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 diff --git a/package/network/services/openvpn-easy-rsa/Makefile b/package/network/services/openvpn-easy-rsa/Makefile deleted file mode 100644 index 0cf73950a6..0000000000 --- a/package/network/services/openvpn-easy-rsa/Makefile +++ /dev/null @@ -1,69 +0,0 @@ -# -# Copyright (C) 2010-2013 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=openvpn-easy-rsa - -PKG_VERSION:=3.0.4 -PKG_RELEASE:=1 -PKG_SOURCE_URL:=https://github.com/OpenVPN/easy-rsa/releases/download/v$(PKG_VERSION)/ -PKG_SOURCE:=EasyRSA-$(PKG_VERSION).tgz -PKG_HASH:=472167f976c6cb7c860cec6150a5616e163ae20365c81f179811d6ee0779ec5a -PKG_LICENSE:=GPL-2.0 -PKG_BUILD_DIR:=$(BUILD_DIR)/EasyRSA-$(PKG_VERSION) -PKGARCH:=all - -include $(INCLUDE_DIR)/package.mk - -define Package/openvpn-easy-rsa - TITLE:=CLI utility to build and manage a PKI CA. - SECTION:=net - CATEGORY:=Network - URL:=http://openvpn.net - SUBMENU:=VPN - DEPENDS:=+openssl-util -endef - -define Package/openvpn-easy-rsa/conffiles -/etc/easy-rsa/vars -/etc/easy-rsa/openssl-1.0.cnf -/etc/easy-rsa/openssl-easyrsa.cnf -endef - -define Build/Configure - -endef - -define Build/Compile - -endef - -define Package/openvpn-easy-rsa/install - $(INSTALL_DIR) $(1)/usr/bin - - $(INSTALL_BIN) $(PKG_BUILD_DIR)/easyrsa $(1)/usr/bin/ - $(INSTALL_DIR) $(1)/etc/easy-rsa - $(INSTALL_DATA) $(PKG_BUILD_DIR)/openssl-easyrsa.cnf $(1)/etc/easy-rsa/openssl-1.0.cnf - $(LN) /etc/easy-rsa/openssl-1.0.cnf $(1)/etc/easy-rsa/openssl-easyrsa.cnf - $(INSTALL_DATA) $(PKG_BUILD_DIR)/vars.example $(1)/etc/easy-rsa/vars - - $(INSTALL_DIR) $(1)/etc/easy-rsa/pki - chmod 700 $(1)/etc/easy-rsa/pki - $(INSTALL_DIR) $(1)/etc/easy-rsa/pki/private - chmod 700 $(1)/etc/easy-rsa/pki/private - $(INSTALL_DIR) $(1)/etc/easy-rsa/pki/reqs - chmod 700 $(1)/etc/easy-rsa/pki/reqs - - $(INSTALL_DIR) $(1)/etc/easy-rsa/x509-types - $(INSTALL_DATA) $(PKG_BUILD_DIR)/x509-types/* $(1)/etc/easy-rsa/x509-types/ - - $(INSTALL_DIR) $(1)/lib/upgrade/keep.d - $(INSTALL_DATA) files/openvpn-easy-rsa.upgrade $(1)/lib/upgrade/keep.d/$(PKG_NAME) -endef - -$(eval $(call BuildPackage,openvpn-easy-rsa)) diff --git a/package/network/services/openvpn-easy-rsa/files/openvpn-easy-rsa.upgrade b/package/network/services/openvpn-easy-rsa/files/openvpn-easy-rsa.upgrade deleted file mode 100644 index 8110b81a46..0000000000 --- a/package/network/services/openvpn-easy-rsa/files/openvpn-easy-rsa.upgrade +++ /dev/null @@ -1 +0,0 @@ -/etc/easy-rsa/pki/ diff --git a/package/network/services/openvpn-easy-rsa/patches/101-static_EASYRSA.patch b/package/network/services/openvpn-easy-rsa/patches/101-static_EASYRSA.patch deleted file mode 100644 index b81366c60b..0000000000 --- a/package/network/services/openvpn-easy-rsa/patches/101-static_EASYRSA.patch +++ /dev/null @@ -1,22 +0,0 @@ -Index: EasyRSA-3.0.4/easyrsa -=================================================================== ---- EasyRSA-3.0.4.orig/easyrsa -+++ EasyRSA-3.0.4/easyrsa -@@ -1033,7 +1033,7 @@ vars_setup() { - vars= - - # set up program path -- prog_vars="${0%/*}/vars" -+ prog_vars="/etc/easy-rsa/vars" - # set up PKI path - pki_vars="${EASYRSA_PKI:-$PWD/pki}/vars" - -@@ -1060,7 +1060,7 @@ Note: using Easy-RSA configuration from: - fi - - # Set defaults, preferring existing env-vars if present -- set_var EASYRSA "${0%/*}" -+ set_var EASYRSA "/etc/easy-rsa" - set_var EASYRSA_OPENSSL openssl - set_var EASYRSA_PKI "$PWD/pki" - set_var EASYRSA_DN cn_only diff --git a/package/network/services/openvpn/Config-mbedtls.in b/package/network/services/openvpn/Config-mbedtls.in deleted file mode 100644 index beac492022..0000000000 --- a/package/network/services/openvpn/Config-mbedtls.in +++ /dev/null @@ -1,58 +0,0 @@ -if PACKAGE_openvpn-mbedtls - -config OPENVPN_mbedtls_ENABLE_LZO - bool "Enable LZO compression support" - default y - -config OPENVPN_mbedtls_ENABLE_LZ4 - bool "Enable LZ4 compression support" - default y - -config OPENVPN_mbedtls_ENABLE_SERVER - bool "Enable server support (otherwise only client mode is support)" - default y - -#config OPENVPN_mbedtls_ENABLE_EUREPHIA -# bool "Enable support for the eurephia plug-in" -# default n - -config OPENVPN_mbedtls_ENABLE_MANAGEMENT - bool "Enable management server support" - default n - -#config OPENVPN_mbedtls_ENABLE_PKCS11 -# bool "Enable pkcs11 support" -# default n - -config OPENVPN_mbedtls_ENABLE_FRAGMENT - bool "Enable internal fragmentation support (--fragment)" - default y - -config OPENVPN_mbedtls_ENABLE_MULTIHOME - bool "Enable multi-homed UDP server support (--multihome)" - default y - -config OPENVPN_mbedtls_ENABLE_PORT_SHARE - bool "Enable TCP server port-share support (--port-share)" - default y - -config OPENVPN_mbedtls_ENABLE_DEF_AUTH - bool "Enable deferred authentication" - default y - -config OPENVPN_mbedtls_ENABLE_PF - bool "Enable internal packet filter" - default y - -config OPENVPN_mbedtls_ENABLE_IPROUTE2 - bool "Enable support for iproute2" - default n - -config OPENVPN_mbedtls_ENABLE_SMALL - bool "Enable size optimization" - default y - help - enable smaller executable size (disable OCC, usage - message, and verb 4 parm list) - -endif diff --git a/package/network/services/openvpn/Config-nossl.in b/package/network/services/openvpn/Config-nossl.in deleted file mode 100644 index 79140ad5d1..0000000000 --- a/package/network/services/openvpn/Config-nossl.in +++ /dev/null @@ -1,50 +0,0 @@ -if PACKAGE_openvpn-nossl - -config OPENVPN_nossl_ENABLE_LZO - bool "Enable LZO compression support" - default y - -config OPENVPN_nossl_ENABLE_LZ4 - bool "Enable LZ4 compression support" - default y - -config OPENVPN_nossl_ENABLE_SERVER - bool "Enable server support (otherwise only client mode is support)" - default y - -config OPENVPN_nossl_ENABLE_MANAGEMENT - bool "Enable management server support" - default n - -config OPENVPN_nossl_ENABLE_FRAGMENT - bool "Enable internal fragmentation support (--fragment)" - default y - -config OPENVPN_nossl_ENABLE_MULTIHOME - bool "Enable multi-homed UDP server support (--multihome)" - default y - -config OPENVPN_nossl_ENABLE_PORT_SHARE - bool "Enable TCP server port-share support (--port-share)" - default y - -config OPENVPN_nossl_ENABLE_DEF_AUTH - bool "Enable deferred authentication" - default y - -config OPENVPN_nossl_ENABLE_PF - bool "Enable internal packet filter" - default y - -config OPENVPN_nossl_ENABLE_IPROUTE2 - bool "Enable support for iproute2" - default n - -config OPENVPN_nossl_ENABLE_SMALL - bool "Enable size optimization" - default y - help - enable smaller executable size (disable OCC, usage - message, and verb 4 parm list) - -endif diff --git a/package/network/services/openvpn/Config-openssl.in b/package/network/services/openvpn/Config-openssl.in deleted file mode 100644 index f2b618eff1..0000000000 --- a/package/network/services/openvpn/Config-openssl.in +++ /dev/null @@ -1,62 +0,0 @@ -if PACKAGE_openvpn-openssl - -config OPENVPN_openssl_ENABLE_LZO - bool "Enable LZO compression support" - default y - -config OPENVPN_openssl_ENABLE_LZ4 - bool "Enable LZ4 compression support" - default y - -config OPENVPN_openssl_ENABLE_X509_ALT_USERNAME - bool "Enable the --x509-username-field feature" - default n - -config OPENVPN_openssl_ENABLE_SERVER - bool "Enable server support (otherwise only client mode is support)" - default y - -#config OPENVPN_openssl_ENABLE_EUREPHIA -# bool "Enable support for the eurephia plug-in" -# default n - -config OPENVPN_openssl_ENABLE_MANAGEMENT - bool "Enable management server support" - default n - -#config OPENVPN_openssl_ENABLE_PKCS11 -# bool "Enable pkcs11 support" -# default n - -config OPENVPN_openssl_ENABLE_FRAGMENT - bool "Enable internal fragmentation support (--fragment)" - default y - -config OPENVPN_openssl_ENABLE_MULTIHOME - bool "Enable multi-homed UDP server support (--multihome)" - default y - -config OPENVPN_openssl_ENABLE_PORT_SHARE - bool "Enable TCP server port-share support (--port-share)" - default y - -config OPENVPN_openssl_ENABLE_DEF_AUTH - bool "Enable deferred authentication" - default y - -config OPENVPN_openssl_ENABLE_PF - bool "Enable internal packet filter" - default y - -config OPENVPN_openssl_ENABLE_IPROUTE2 - bool "Enable support for iproute2" - default n - -config OPENVPN_openssl_ENABLE_SMALL - bool "Enable size optimization" - default y - help - enable smaller executable size (disable OCC, usage - message, and verb 4 parm list) - -endif diff --git a/package/network/services/openvpn/Makefile b/package/network/services/openvpn/Makefile deleted file mode 100644 index 40570fbdb6..0000000000 --- a/package/network/services/openvpn/Makefile +++ /dev/null @@ -1,158 +0,0 @@ -# -# Copyright (C) 2010-2015 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=openvpn - -PKG_VERSION:=2.4.9 -PKG_RELEASE:=5 - -PKG_SOURCE_URL:=\ - https://build.openvpn.net/downloads/releases/ \ - https://swupdate.openvpn.net/community/releases/ -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_HASH:=641f3add8694b2ccc39fd4fd92554e4f089ad16a8db6d2b473ec284839a5ebe2 - -PKG_MAINTAINER:=Felix Fietkau - -PKG_INSTALL:=1 -PKG_FIXUP:=autoreconf -PKG_BUILD_PARALLEL:=1 -PKG_LICENSE:=GPL-2.0 -PKG_CPE_ID:=cpe:/a:openvpn:openvpn - -include $(INCLUDE_DIR)/package.mk - -define Package/openvpn/Default - TITLE:=Open source VPN solution using $(2) - SECTION:=net - CATEGORY:=Network - URL:=http://openvpn.net - SUBMENU:=VPN - MENU:=1 - DEPENDS:=+kmod-tun +OPENVPN_$(1)_ENABLE_LZO:liblzo +OPENVPN_$(1)_ENABLE_IPROUTE2:ip $(3) - VARIANT:=$(1) -ifeq ($(1),nossl) - PROVIDES:=openvpn -else - PROVIDES:=openvpn openvpn-crypto -endif -endef - -Package/openvpn-openssl=$(call Package/openvpn/Default,openssl,OpenSSL,+PACKAGE_openvpn-openssl:libopenssl) -Package/openvpn-mbedtls=$(call Package/openvpn/Default,mbedtls,mbedTLS,+PACKAGE_openvpn-mbedtls:libmbedtls) -Package/openvpn-nossl=$(call Package/openvpn/Default,nossl,plaintext (no SSL)) - -define Package/openvpn/config/Default - source "$(SOURCE)/Config-$(1).in" -endef - -Package/openvpn-openssl/config=$(call Package/openvpn/config/Default,openssl) -Package/openvpn-mbedtls/config=$(call Package/openvpn/config/Default,mbedtls) -Package/openvpn-nossl/config=$(call Package/openvpn/config/Default,nossl) - -ifeq ($(BUILD_VARIANT),mbedtls) -CONFIG_OPENVPN_MBEDTLS:=y -endif -ifeq ($(BUILD_VARIANT),openssl) -CONFIG_OPENVPN_OPENSSL:=y -endif -ifeq ($(BUILD_VARIANT),nossl) -CONFIG_OPENVPN_NOSSL:=y -endif - -CONFIGURE_VARS += \ - IFCONFIG=/sbin/ifconfig \ - ROUTE=/sbin/route \ - IPROUTE=/sbin/ip \ - NETSTAT=/sbin/netstat - -TARGET_CFLAGS += -ffunction-sections -fdata-sections -TARGET_LDFLAGS += -Wl,--gc-sections - -define Build/Configure - $(call Build/Configure/Default, \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_SMALL),--enable-small) \ - --disable-selinux \ - --disable-systemd \ - --disable-plugins \ - --disable-debug \ - --disable-pkcs11 \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_LZO),--enable,--disable)-lzo \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_LZ4),--enable,--disable)-lz4 \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_X509_ALT_USERNAME),--enable,--disable)-x509-alt-username \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_SERVER),--enable,--disable)-server \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_MANAGEMENT),--enable,--disable)-management \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_FRAGMENT),--enable,--disable)-fragment \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_MULTIHOME),--enable,--disable)-multihome \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_IPROUTE2),--enable,--disable)-iproute2 \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_DEF_AUTH),--enable,--disable)-def-auth \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_PF),--enable,--disable)-pf \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_PORT_SHARE),--enable,--disable)-port-share \ - $(if $(CONFIG_OPENVPN_NOSSL),--disable-crypto,--enable-crypto) \ - $(if $(CONFIG_OPENVPN_OPENSSL),--with-crypto-library=openssl) \ - $(if $(CONFIG_OPENVPN_MBEDTLS),--with-crypto-library=mbedtls) \ - ) -endef - -define Package/openvpn-$(BUILD_VARIANT)/conffiles -/etc/config/openvpn -/etc/openvpn.user -endef - -define Package/openvpn-$(BUILD_VARIANT)/install - $(INSTALL_DIR) \ - $(1)/usr/sbin \ - $(1)/usr/share/openvpn \ - $(1)/etc/init.d \ - $(1)/etc/config \ - $(1)/etc/openvpn \ - $(1)/lib/functions \ - $(1)/lib/upgrade/keep.d \ - $(1)/usr/libexec \ - $(1)/etc/hotplug.d/openvpn - - $(INSTALL_BIN) \ - $(PKG_INSTALL_DIR)/usr/sbin/openvpn \ - $(1)/usr/sbin/ - - $(INSTALL_BIN) \ - files/openvpn.init \ - $(1)/etc/init.d/openvpn - - $(INSTALL_BIN) \ - files/usr/libexec/openvpn-hotplug \ - $(1)/usr/libexec/openvpn-hotplug - - $(INSTALL_DATA) \ - files/lib/functions/openvpn.sh \ - $(1)/lib/functions/openvpn.sh - - $(INSTALL_DATA) \ - files/etc/hotplug.d/openvpn/01-user \ - $(1)/etc/hotplug.d/openvpn/01-user - - $(INSTALL_DATA) \ - files/etc/openvpn.user \ - $(1)/etc/openvpn.user - - $(INSTALL_DATA) \ - files/openvpn.options \ - $(1)/usr/share/openvpn/openvpn.options - - $(INSTALL_CONF) files/openvpn.config \ - $(1)/etc/config/openvpn - - $(INSTALL_DATA) \ - files/openvpn.upgrade \ - $(1)/lib/upgrade/keep.d/openvpn -endef - -$(eval $(call BuildPackage,openvpn-openssl)) -$(eval $(call BuildPackage,openvpn-mbedtls)) -$(eval $(call BuildPackage,openvpn-nossl)) diff --git a/package/network/services/openvpn/files/etc/hotplug.d/openvpn/01-user b/package/network/services/openvpn/files/etc/hotplug.d/openvpn/01-user deleted file mode 100644 index f93823e5c5..0000000000 --- a/package/network/services/openvpn/files/etc/hotplug.d/openvpn/01-user +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -. /lib/functions/openvpn.sh - -[ -e "/etc/openvpn.user" ] && { - env -i ACTION="$ACTION" INSTANCE="$INSTANCE" \ - /bin/sh \ - /etc/openvpn.user \ - $* -} - -# Wrap user defined scripts on up/down events -case "$ACTION" in - up|down) - if get_openvpn_option "$config" command "$ACTION"; then - shift - exec /bin/sh -c "$command $*" - fi - ;; -esac - -exit 0 diff --git a/package/network/services/openvpn/files/etc/openvpn.user b/package/network/services/openvpn/files/etc/openvpn.user deleted file mode 100644 index a77566556a..0000000000 --- a/package/network/services/openvpn/files/etc/openvpn.user +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# -# This file is interpreted as shell script. -# Put your custom openvpn action here, they will -# be executed with each opevnp event. -# -# $ACTION -# down action is generated after the TUN/TAP device is closed -# up action is generated after the TUN/TAP device is opened -# $INSTANCE Name of the openvpn instance which went up or down - diff --git a/package/network/services/openvpn/files/lib/functions/openvpn.sh b/package/network/services/openvpn/files/lib/functions/openvpn.sh deleted file mode 100644 index 83fb1bb453..0000000000 --- a/package/network/services/openvpn/files/lib/functions/openvpn.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -get_openvpn_option() { - local config="$1" - local variable="$2" - local option="$3" - - local value="$(sed -rne 's/^[ \t]*'"$option"'[ \t]+(([^ \t\\]|\\.)+)[ \t]*$/\1/p' "$config" | tail -n1 | sed -re 's/\\(.)/\1/g')" - [ -n "$value" ] || value="$(sed -rne 's/^[ \t]*'"$option"'[ \t]+'"'([^']+)'"'[ \t]*$/\1/p' "$config" | tail -n1)" - [ -n "$value" ] || value="$(sed -rne 's/^[ \t]*'"$option"'[ \t]+"(([^"\\]|\\.)+)"[ \t]*$/\1/p' "$config" | tail -n1 | sed -re 's/\\(.)/\1/g')" - [ -n "$value" ] || return 1 - - export -n "$variable=$value" - return 0 -} - diff --git a/package/network/services/openvpn/files/openvpn.config b/package/network/services/openvpn/files/openvpn.config deleted file mode 100644 index 3de1881e35..0000000000 --- a/package/network/services/openvpn/files/openvpn.config +++ /dev/null @@ -1,474 +0,0 @@ -package openvpn - -################################################# -# Sample to include a custom config file. # -################################################# - -config openvpn custom_config - - # Set to 1 to enable this instance: - option enabled 0 - - # Include OpenVPN configuration - option config /etc/openvpn/my-vpn.conf - - -################################################# -# Sample OpenVPN 2.0 uci config for # -# multi-client server. # -################################################# - -config openvpn sample_server - - # Set to 1 to enable this instance: - option enabled 0 - - # Which local IP address should OpenVPN - # listen on? (optional) -# option local 0.0.0.0 - - # Which TCP/UDP port should OpenVPN listen on? - # If you want to run multiple OpenVPN instances - # on the same machine, use a different port - # number for each one. You will need to - # open up this port on your firewall. - option port 1194 - - # TCP or UDP server? -# option proto tcp - option proto udp - - # "dev tun" will create a routed IP tunnel, - # "dev tap" will create an ethernet tunnel. - # Use "dev tap0" if you are ethernet bridging - # and have precreated a tap0 virtual interface - # and bridged it with your ethernet interface. - # If you want to control access policies - # over the VPN, you must create firewall - # rules for the the TUN/TAP interface. - # On non-Windows systems, you can give - # an explicit unit number, such as tun0. - # On Windows, use "dev-node" for this. - # On most systems, the VPN will not function - # unless you partially or fully disable - # the firewall for the TUN/TAP interface. -# option dev tap - option dev tun - - # SSL/TLS root certificate (ca), certificate - # (cert), and private key (key). Each client - # and the server must have their own cert and - # key file. The server and all clients will - # use the same ca file. - # - # See the "easy-rsa" directory for a series - # of scripts for generating RSA certificates - # and private keys. Remember to use - # a unique Common Name for the server - # and each of the client certificates. - # - # Any X509 key management system can be used. - # OpenVPN can also use a PKCS #12 formatted key file - # (see "pkcs12" directive in man page). - option ca /etc/openvpn/ca.crt - option cert /etc/openvpn/server.crt - # This file should be kept secret: - option key /etc/openvpn/server.key - - # Diffie hellman parameters. - # Generate your own with: - # openssl dhparam -out dh2048.pem 2048 - # Substitute 2048 for 1024 if you are using - # 1024 bit keys. - option dh /etc/openvpn/dh2048.pem - - # Configure server mode and supply a VPN subnet - # for OpenVPN to draw client addresses from. - # The server will take 10.8.0.1 for itself, - # the rest will be made available to clients. - # Each client will be able to reach the server - # on 10.8.0.1. Comment this line out if you are - # ethernet bridging. See the man page for more info. - option server "10.8.0.0 255.255.255.0" - - # Maintain a record of client <-> virtual IP address - # associations in this file. If OpenVPN goes down or - # is restarted, reconnecting clients can be assigned - # the same virtual IP address from the pool that was - # previously assigned. - option ifconfig_pool_persist /tmp/ipp.txt - - # Configure server mode for ethernet bridging. - # You must first use your OS's bridging capability - # to bridge the TAP interface with the ethernet - # NIC interface. Then you must manually set the - # IP/netmask on the bridge interface, here we - # assume 10.8.0.4/255.255.255.0. Finally we - # must set aside an IP range in this subnet - # (start=10.8.0.50 end=10.8.0.100) to allocate - # to connecting clients. Leave this line commented - # out unless you are ethernet bridging. -# option server_bridge "10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100" - - # Push routes to the client to allow it - # to reach other private subnets behind - # the server. Remember that these - # private subnets will also need - # to know to route the OpenVPN client - # address pool (10.8.0.0/255.255.255.0) - # back to the OpenVPN server. -# list push "route 192.168.10.0 255.255.255.0" -# list push "route 192.168.20.0 255.255.255.0" - - # To assign specific IP addresses to specific - # clients or if a connecting client has a private - # subnet behind it that should also have VPN access, - # use the subdirectory "ccd" for client-specific - # configuration files (see man page for more info). - - # EXAMPLE: Suppose the client - # having the certificate common name "Thelonious" - # also has a small subnet behind his connecting - # machine, such as 192.168.40.128/255.255.255.248. - # First, uncomment out these lines: -# option client_config_dir /etc/openvpn/ccd -# list route "192.168.40.128 255.255.255.248" - # Then create a file ccd/Thelonious with this line: - # iroute 192.168.40.128 255.255.255.248 - # This will allow Thelonious' private subnet to - # access the VPN. This example will only work - # if you are routing, not bridging, i.e. you are - # using "dev tun" and "server" directives. - - # EXAMPLE: Suppose you want to give - # Thelonious a fixed VPN IP address of 10.9.0.1. - # First uncomment out these lines: -# option client_config_dir /etc/openvpn/ccd -# list route "10.9.0.0 255.255.255.252" -# list route "192.168.100.0 255.255.255.0" - # Then add this line to ccd/Thelonious: - # ifconfig-push "10.9.0.1 10.9.0.2" - - # Suppose that you want to enable different - # firewall access policies for different groups - # of clients. There are two methods: - # (1) Run multiple OpenVPN daemons, one for each - # group, and firewall the TUN/TAP interface - # for each group/daemon appropriately. - # (2) (Advanced) Create a script to dynamically - # modify the firewall in response to access - # from different clients. See man - # page for more info on learn-address script. -# option learn_address /etc/openvpn/script - - # If enabled, this directive will configure - # all clients to redirect their default - # network gateway through the VPN, causing - # all IP traffic such as web browsing and - # and DNS lookups to go through the VPN - # (The OpenVPN server machine may need to NAT - # the TUN/TAP interface to the internet in - # order for this to work properly). - # CAVEAT: May break client's network config if - # client's local DHCP server packets get routed - # through the tunnel. Solution: make sure - # client's local DHCP server is reachable via - # a more specific route than the default route - # of 0.0.0.0/0.0.0.0. -# list push "redirect-gateway" - - # Certain Windows-specific network settings - # can be pushed to clients, such as DNS - # or WINS server addresses. CAVEAT: - # http://openvpn.net/faq.html#dhcpcaveats -# list push "dhcp-option DNS 10.8.0.1" -# list push "dhcp-option WINS 10.8.0.1" - - # Uncomment this directive to allow different - # clients to be able to "see" each other. - # By default, clients will only see the server. - # To force clients to only see the server, you - # will also need to appropriately firewall the - # server's TUN/TAP interface. -# option client_to_client 1 - - # Uncomment this directive if multiple clients - # might connect with the same certificate/key - # files or common names. This is recommended - # only for testing purposes. For production use, - # each client should have its own certificate/key - # pair. - # - # IF YOU HAVE NOT GENERATED INDIVIDUAL - # CERTIFICATE/KEY PAIRS FOR EACH CLIENT, - # EACH HAVING ITS OWN UNIQUE "COMMON NAME", - # UNCOMMENT THIS LINE OUT. -# option duplicate_cn 1 - - # The keepalive directive causes ping-like - # messages to be sent back and forth over - # the link so that each side knows when - # the other side has gone down. - # Ping every 10 seconds, assume that remote - # peer is down if no ping received during - # a 120 second time period. - option keepalive "10 120" - - # For extra security beyond that provided - # by SSL/TLS, create an "HMAC firewall" - # to help block DoS attacks and UDP port flooding. - # - # Generate with: - # openvpn --genkey --secret ta.key - # - # The server and each client must have - # a copy of this key. - # The second parameter should be '0' - # on the server and '1' on the clients. - # This file is secret: -# option tls_auth "/etc/openvpn/ta.key 0" - - # For additional privacy, a shared secret key - # can be used for both authentication (as in tls_auth) - # and encryption of the TLS control channel. - # - # Generate a shared secret with: - # openvpn --genkey --secret ta.key - # - # The server and each client must have - # a copy of this key. - # - # tls_auth and tls_crypt should NOT - # be combined, as tls_crypt implies tls_auth. - # Use EITHER tls_crypt, tls_auth, or neither option. -# option tls_crypt "/etc/openvpn/ta.key" - - # Set the minimum required TLS protocol version - # for all connections. - # - # Require at least TLS 1.1 -# option tls_version_min "1.1" - # Require at least TLS 1.2 -# option tls_version_min "1.2" - # Require TLS 1.2, or the highest version supported - # on the system -# option tls_version_min "1.2 'or-highest'" - - # OpenVPN versions 2.4 and later will attempt to - # automatically negotiate the most secure cipher - # between the client and server, regardless of a - # configured "option cipher" (see below). - # Automatic negotiation is recommended. - # - # Uncomment this option to disable this behavior, - # and force all OpenVPN peers to use the configured - # cipher option instead (not recommended). -# option ncp_disable - - # Select a cryptographic cipher. - # This config item must be copied to - # the client config file as well. - # - # To see all supported ciphers, run: - # openvpn --show-ciphers - # - # Blowfish (default for backwards compatibility, - # but not recommended due to weaknesses): -# option cipher BF-CBC - # AES: -# option cipher AES-128-CBC - # Triple-DES: -# option cipher DES-EDE3-CBC - - # Enable compression on the VPN link. - # If you enable it here, you must also - # enable it in the client config file. - # - # Compression is not recommended, as compression and - # encryption in combination can weaken the security - # of the connection. - # - # LZ4 requires OpenVPN 2.4+ client and server -# option compress lz4 - # LZO is compatible with most OpenVPN versions - # (set "compress lzo" on 2.4+ clients, and "comp-lzo yes" on older clients) -# option compress lzo - - # The maximum number of concurrently connected - # clients we want to allow. -# option max_clients 100 - - # The persist options will try to avoid - # accessing certain resources on restart - # that may no longer be accessible because - # of the privilege downgrade. - option persist_key 1 - option persist_tun 1 - option user nobody - - # Output a short status file showing - # current connections, truncated - # and rewritten every minute. - option status /tmp/openvpn-status.log - - # By default, log messages will go to the syslog (or - # on Windows, if running as a service, they will go to - # the "\Program Files\OpenVPN\log" directory). - # Use log or log-append to override this default. - # "log" will truncate the log file on OpenVPN startup, - # while "log-append" will append to it. Use one - # or the other (but not both). -# option log /tmp/openvpn.log -# option log_append /tmp/openvpn.log - - # Set the appropriate level of log - # file verbosity. - # - # 0 is silent, except for fatal errors - # 4 is reasonable for general usage - # 5 and 6 can help to debug connection problems - # 9 is extremely verbose - option verb 3 - - # Silence repeating messages. At most 20 - # sequential messages of the same message - # category will be output to the log. -# option mute 20 - - -############################################## -# Sample client-side OpenVPN 2.0 uci config # -# for connecting to multi-client server. # -############################################## - -config openvpn sample_client - - # Set to 1 to enable this instance: - option enabled 0 - - # Specify that we are a client and that we - # will be pulling certain config file directives - # from the server. - option client 1 - - # Use the same setting as you are using on - # the server. - # On most systems, the VPN will not function - # unless you partially or fully disable - # the firewall for the TUN/TAP interface. -# option dev tap - option dev tun - - # Are we connecting to a TCP or - # UDP server? Use the same setting as - # on the server. -# option proto tcp - option proto udp - - # The hostname/IP and port of the server. - # You can have multiple remote entries - # to load balance between the servers. - list remote "my_server_1 1194" -# list remote "my_server_2 1194" - - # Choose a random host from the remote - # list for load_balancing. Otherwise - # try hosts in the order specified. -# option remote_random 1 - - # Keep trying indefinitely to resolve the - # host name of the OpenVPN server. Very useful - # on machines which are not permanently connected - # to the internet such as laptops. - option resolv_retry infinite - - # Most clients don't need to bind to - # a specific local port number. - option nobind 1 - - # Try to preserve some state across restarts. - option persist_key 1 - option persist_tun 1 - option user nobody - - # If you are connecting through an - # HTTP proxy to reach the actual OpenVPN - # server, put the proxy server/IP and - # port number here. See the man page - # if your proxy server requires - # authentication. - # retry on connection failures: -# option http_proxy_retry 1 - # specify http proxy address and port: -# option http_proxy "192.168.1.100 8080" - - # Wireless networks often produce a lot - # of duplicate packets. Set this flag - # to silence duplicate packet warnings. -# option mute_replay_warnings 1 - - # SSL/TLS parms. - # See the server config file for more - # description. It's best to use - # a separate .crt/.key file pair - # for each client. A single ca - # file can be used for all clients. - option ca /etc/openvpn/ca.crt - option cert /etc/openvpn/client.crt - option key /etc/openvpn/client.key - - # Verify server certificate by checking - # that the certicate has the key usage - # field set to "server". This is an - # important precaution to protect against - # a potential attack discussed here: - # http://openvpn.net/howto.html#mitm - # - # To use this feature, you will need to generate - # your server certificates with the nsCertType - # field set to "server". The build_key_server - # script in the easy_rsa folder will do this. -# option remote_cert_tls server - - # If a tls_auth key is used on the server - # then every client must also have the key. -# option tls_auth "/etc/openvpn/ta.key 1" - - # If a tls_crypt key is used on the server - # every client must also have the key. -# option tls_crypt "/etc/openvpn/ta.key" - - # Set the minimum required TLS protocol version - # for all connections. - # - # Require at least TLS 1.1 -# option tls_version_min "1.1" - # Require at least TLS 1.2 -# option tls_version_min "1.2" - # Require TLS 1.2, or the highest version supported - # on the system -# option tls_version_min "1.2 'or-highest'" - - # Select a cryptographic cipher. - # If the cipher option is used on the server - # then you must also specify it here. -# option cipher x - - # Enable compression on the VPN link. - # Don't enable this unless it is also - # enabled in the server config file. - # - # Compression is not recommended, as compression and - # encryption in combination can weaken the security - # of the connection. - # - # LZ4 requires OpenVPN 2.4+ on server and client -# option compress lz4 - # LZO is compatible with most OpenVPN versions -# option compress lzo - - # Set log file verbosity. - option verb 3 - - # Silence repeating messages -# option mute 20 diff --git a/package/network/services/openvpn/files/openvpn.init b/package/network/services/openvpn/files/openvpn.init deleted file mode 100644 index 487a2269e2..0000000000 --- a/package/network/services/openvpn/files/openvpn.init +++ /dev/null @@ -1,209 +0,0 @@ -#!/bin/sh /etc/rc.common -# Copyright (C) 2008-2013 OpenWrt.org -# Copyright (C) 2008 Jo-Philipp Wich -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. - -START=90 -STOP=10 - -USE_PROCD=1 -PROG=/usr/sbin/openvpn - -LIST_SEP=" -" - -UCI_STARTED= -UCI_DISABLED= - -append_param() { - local s="$1" - local v="$2" - case "$v" in - *_*_*_*) v=${v%%_*}-${v#*_}; v=${v%%_*}-${v#*_}; v=${v%%_*}-${v#*_} ;; - *_*_*) v=${v%%_*}-${v#*_}; v=${v%%_*}-${v#*_} ;; - *_*) v=${v%%_*}-${v#*_} ;; - esac - echo -n "$v" >> "/var/etc/openvpn-$s.conf" - return 0 -} - -append_bools() { - local p; local v; local s="$1"; shift - for p in $*; do - config_get_bool v "$s" "$p" - [ "$v" = 1 ] && append_param "$s" "$p" && echo >> "/var/etc/openvpn-$s.conf" - done -} - -append_params() { - local p; local v; local s="$1"; shift - for p in $*; do - config_get v "$s" "$p" - IFS="$LIST_SEP" - for v in $v; do - [ -n "$v" ] && [ "$p" != "push" ] && append_param "$s" "$p" && echo " $v" >> "/var/etc/openvpn-$s.conf" - [ -n "$v" ] && [ "$p" = "push" ] && append_param "$s" "$p" && echo " \"$v\"" >> "/var/etc/openvpn-$s.conf" - done - unset IFS - done -} - -append_list() { - local p; local v; local s="$1"; shift - - list_cb_append() { - v="${v}:$1" - } - - for p in $*; do - unset v - config_list_foreach "$s" "$p" list_cb_append - [ -n "$v" ] && append_param "$s" "$p" && echo " ${v:1}" >> "/var/etc/openvpn-$s.conf" - done -} - -section_enabled() { - config_get_bool enable "$1" 'enable' 0 - config_get_bool enabled "$1" 'enabled' 0 - [ $enable -gt 0 ] || [ $enabled -gt 0 ] -} - -openvpn_get_dev() { - local dev dev_type - local name="$1" - local conf="$2" - - # Do override only for configurations with config_file - config_get config_file "$name" config - [ -n "$config_file" ] || return - - # Check there is someething to override - config_get dev "$name" dev - config_get dev_type "$name" dev_type - [ -n "$dev" ] || return - - # If there is a no dev_type, try to guess it - if [ -z "$dev_type" ]; then - . /lib/functions/openvpn.sh - - local odev odev_type - get_openvpn_option "$conf" odev dev - get_openvpn_option "$conf" odev_type dev-type - [ -n "$odev_type" ] || odev_type="$odev" - - case "$odev_type" in - tun*) dev_type="tun" ;; - tap*) dev_type="tap" ;; - *) return;; - esac - fi - - # Return overrides - echo "--dev-type $dev_type --dev $dev" -} - -openvpn_add_instance() { - local name="$1" - local dir="$2" - local conf="$3" - local security="$4" - - procd_open_instance "$name" - procd_set_param command "$PROG" \ - --syslog "openvpn($name)" \ - --status "/var/run/openvpn.$name.status" \ - --cd "$dir" \ - --config "$conf" \ - --up "/usr/libexec/openvpn-hotplug up $name" \ - --down "/usr/libexec/openvpn-hotplug down $name" \ - --script-security "${security:-2}" \ - $(openvpn_get_dev "$name" "$conf") - procd_set_param file "$dir/$conf" - procd_set_param term_timeout 15 - procd_set_param respawn - procd_append_param respawn 3600 - procd_append_param respawn 5 - procd_append_param respawn -1 - procd_close_instance -} - -start_instance() { - local s="$1" - - config_get config "$s" config - config="${config:+$(readlink -f "$config")}" - - section_enabled "$s" || { - append UCI_DISABLED "$config" "$LIST_SEP" - return 1 - } - - local script_security - config_get script_security "$s" script_security - - [ ! -d "/var/run" ] && mkdir -p "/var/run" - - if [ ! -z "$config" ]; then - append UCI_STARTED "$config" "$LIST_SEP" - openvpn_add_instance "$s" "${config%/*}" "$config" "$script_security" - return - fi - - [ ! -d "/var/etc" ] && mkdir -p "/var/etc" - [ -f "/var/etc/openvpn-$s.conf" ] && rm "/var/etc/openvpn-$s.conf" - - append_bools "$s" $OPENVPN_BOOLS - append_params "$s" $OPENVPN_PARAMS - append_list "$s" $OPENVPN_LIST - - openvpn_add_instance "$s" "/var/etc" "openvpn-$s.conf" "$script_security" -} - -start_service() { - local instance="$1" - local instance_found=0 - - config_cb() { - local type="$1" - local name="$2" - if [ "$type" = "openvpn" ]; then - if [ -n "$instance" -a "$instance" = "$name" ]; then - instance_found=1 - fi - fi - } - - . /usr/share/openvpn/openvpn.options - config_load 'openvpn' - - if [ -n "$instance" ]; then - [ "$instance_found" -gt 0 ] || return - start_instance "$instance" - else - config_foreach start_instance 'openvpn' - - local path name - for path in /etc/openvpn/*.conf; do - if [ -f "$path" ]; then - name="${path##*/}"; name="${name%.conf}" - - # don't start configs again that are already started by uci - if echo "$UCI_STARTED" | grep -qxF "$path"; then - continue - - # don't start configs which are set to disabled in uci - elif echo "$UCI_DISABLED" | grep -qxF "$path"; then - logger -t openvpn "$name.conf is disabled in /etc/config/openvpn" - continue - fi - - openvpn_add_instance "$name" "${path%/*}" "$path" - fi - done - fi -} - -service_triggers() { - procd_add_reload_trigger openvpn -} diff --git a/package/network/services/openvpn/files/openvpn.options b/package/network/services/openvpn/files/openvpn.options deleted file mode 100644 index 5d7a387cd3..0000000000 --- a/package/network/services/openvpn/files/openvpn.options +++ /dev/null @@ -1,194 +0,0 @@ -OPENVPN_PARAMS=' -askpass -auth -auth_retry -auth_user_pass -auth_user_pass_verify -bcast_buffers -ca -capath -cd -cert -chroot -cipher -client_config_dir -client_connect -client_disconnect -comp_lzo -compress -connect_freq -connect_retry -connect_retry_max -connect_timeout -crl_verify -dev -dev_node -dev_type -dh -ecdh_curve -echo -engine -explicit_exit_notify -extra_certs -fragment -group -hand_window -hash_size -http_proxy -http_proxy_option -http_proxy_timeout -ifconfig -ifconfig_ipv6 -ifconfig_ipv6_pool -ifconfig_ipv6_push -ifconfig_pool -ifconfig_pool_persist -ifconfig_push -inactive -ipchange -iroute -iroute_ipv6 -keepalive -key -key_direction -key_method -keysize -learn_address -link_mtu -lladdr -local -log -log_append -lport -management -management_log_cache -max_clients -max_routes_per_client -mode -mssfix -mtu_disc -mute -nice -ns_cert_type -ping -ping_exit -ping_restart -pkcs12 -plugin -port -port_share -prng -proto -pull_filter -push -rcvbuf -redirect_gateway -remap_usr1 -remote -remote_cert_eku -remote_cert_ku -remote_cert_tls -reneg_bytes -reneg_pkts -reneg_sec -replay_persist -replay_window -resolv_retry -route -route_delay -route_gateway -route_ipv6 -route_metric -route_pre_down -route_up -rport -secret -server -server_bridge -server_ipv6 -setenv -shaper -sndbuf -socks_proxy -status -status_version -syslog -tcp_queue_limit -tls_auth -tls_crypt -tls_timeout -tls_verify -tls_version_min -tmp_dir -topology -tran_window -tun_mtu -tun_mtu_extra -txqueuelen -user -verb -verify_client_cert -verify_x509_name -x509_username_field -' - -OPENVPN_BOOLS=' -allow_recursive_routing -auth_nocache -auth_user_pass_optional -bind -ccd_exclusive -client -client_to_client -comp_noadapt -disable -disable_occ -down_pre -duplicate_cn -fast_io -float -http_proxy_retry -ifconfig_noexec -ifconfig_nowarn -management_forget_disconnect -management_hold -management_query_passwords -management_signal -mktun -mlock -mtu_test -multihome -mute_replay_warnings -ncp_disable -nobind -opt_verify -passtos -persist_key -persist_local_ip -persist_remote_ip -persist_tun -ping_timer_rem -pull -push_reset -remote_random -rmtun -route_noexec -route_nopull -single_session -socks_proxy_retry -suppress_timestamps -tcp_nodelay -test_crypto -tls_client -tls_exit -tls_server -up_delay -up_restart -username_as_common_name -' - -OPENVPN_LIST=' -ncp_ciphers -tls_cipher -tls_ciphersuites -' diff --git a/package/network/services/openvpn/files/openvpn.upgrade b/package/network/services/openvpn/files/openvpn.upgrade deleted file mode 100644 index 6ae49d22d0..0000000000 --- a/package/network/services/openvpn/files/openvpn.upgrade +++ /dev/null @@ -1 +0,0 @@ -/etc/openvpn/ diff --git a/package/network/services/openvpn/files/usr/libexec/openvpn-hotplug b/package/network/services/openvpn/files/usr/libexec/openvpn-hotplug deleted file mode 100644 index 9235fbacfe..0000000000 --- a/package/network/services/openvpn/files/usr/libexec/openvpn-hotplug +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -ACTION=$1 -shift -INSTANCE=$1 -shift - -export ACTION=$ACTION -export INSTANCE=$INSTANCE -exec /sbin/hotplug-call openvpn "$@" diff --git a/package/network/services/openvpn/patches/001-reproducible-remove_DATE.patch b/package/network/services/openvpn/patches/001-reproducible-remove_DATE.patch deleted file mode 100644 index 101fa12ba2..0000000000 --- a/package/network/services/openvpn/patches/001-reproducible-remove_DATE.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/src/openvpn/options.c -+++ b/src/openvpn/options.c -@@ -106,7 +106,6 @@ const char title_string[] = - #ifdef HAVE_AEAD_CIPHER_MODES - " [AEAD]" - #endif -- " built on " __DATE__ - ; - - #ifndef ENABLE_SMALL diff --git a/package/network/services/openvpn/patches/100-mbedtls-disable-runtime-version-check.patch b/package/network/services/openvpn/patches/100-mbedtls-disable-runtime-version-check.patch deleted file mode 100644 index cb16a906fe..0000000000 --- a/package/network/services/openvpn/patches/100-mbedtls-disable-runtime-version-check.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/openvpn/ssl_mbedtls.c -+++ b/src/openvpn/ssl_mbedtls.c -@@ -1415,7 +1415,7 @@ const char * - get_ssl_library_version(void) - { - static char mbedtls_version[30]; -- unsigned int pv = mbedtls_version_get_number(); -+ unsigned int pv = MBEDTLS_VERSION_NUMBER; - sprintf( mbedtls_version, "mbed TLS %d.%d.%d", - (pv>>24)&0xff, (pv>>16)&0xff, (pv>>8)&0xff ); - return mbedtls_version; diff --git a/package/network/services/openvpn/patches/110-openssl-dont-use-deprecated-ssleay-symbols.patch b/package/network/services/openvpn/patches/110-openssl-dont-use-deprecated-ssleay-symbols.patch deleted file mode 100644 index c7faf7c0c0..0000000000 --- a/package/network/services/openvpn/patches/110-openssl-dont-use-deprecated-ssleay-symbols.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 17a476fd5c8cc49f1d103a50199e87ede76b1b67 Mon Sep 17 00:00:00 2001 -From: Steffan Karger -Date: Sun, 26 Nov 2017 16:04:00 +0100 -Subject: [PATCH] openssl: don't use deprecated SSLEAY/SSLeay symbols - -Compiling our current master against OpenSSL 1.1 with --DOPENSSL_API_COMPAT=0x10100000L screams bloody murder. This patch fixes -the errors about the deprecated SSLEAY/SSLeay symbols and defines. - -Signed-off-by: Steffan Karger -Acked-by: Gert Doering -Message-Id: <20171126150401.28565-1-steffan@karger.me> -URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15934.html -Signed-off-by: Gert Doering ---- - configure.ac | 1 + - src/openvpn/openssl_compat.h | 8 ++++++++ - src/openvpn/ssl_openssl.c | 2 +- - 3 files changed, 10 insertions(+), 1 deletion(-) - ---- a/configure.ac -+++ b/configure.ac -@@ -904,6 +904,7 @@ if test "${enable_crypto}" = "yes" -a "$ - EVP_MD_CTX_free \ - EVP_MD_CTX_reset \ - EVP_CIPHER_CTX_reset \ -+ OpenSSL_version \ - SSL_CTX_get_default_passwd_cb \ - SSL_CTX_get_default_passwd_cb_userdata \ - SSL_CTX_set_security_level \ ---- a/src/openvpn/openssl_compat.h -+++ b/src/openvpn/openssl_compat.h -@@ -689,6 +689,14 @@ EC_GROUP_order_bits(const EC_GROUP *grou - #endif - - /* SSLeay symbols have been renamed in OpenSSL 1.1 */ -+#ifndef OPENSSL_VERSION -+#define OPENSSL_VERSION SSLEAY_VERSION -+#endif -+ -+#ifndef HAVE_OPENSSL_VERSION -+#define OpenSSL_version SSLeay_version -+#endif -+ - #if !defined(RSA_F_RSA_OSSL_PRIVATE_ENCRYPT) - #define RSA_F_RSA_OSSL_PRIVATE_ENCRYPT RSA_F_RSA_EAY_PRIVATE_ENCRYPT - #endif ---- a/src/openvpn/ssl_openssl.c -+++ b/src/openvpn/ssl_openssl.c -@@ -2008,7 +2008,7 @@ get_highest_preference_tls_cipher(char * - const char * - get_ssl_library_version(void) - { -- return SSLeay_version(SSLEAY_VERSION); -+ return OpenSSL_version(OPENSSL_VERSION); - } - - #endif /* defined(ENABLE_CRYPTO) && defined(ENABLE_CRYPTO_OPENSSL) */ diff --git a/package/network/services/openvpn/patches/111-openssl-add-missing-include-statements.patch b/package/network/services/openvpn/patches/111-openssl-add-missing-include-statements.patch deleted file mode 100644 index 6a62b16500..0000000000 --- a/package/network/services/openvpn/patches/111-openssl-add-missing-include-statements.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 1987498271abadf042d8bb3feee1fe0d877a9d55 Mon Sep 17 00:00:00 2001 -From: Steffan Karger -Date: Sun, 26 Nov 2017 16:49:12 +0100 -Subject: [PATCH] openssl: add missing #include statements - -Compiling our current master against OpenSSL 1.1 with --DOPENSSL_API_COMPAT=0x10100000L screams bloody murder. This patch fixes -the errors caused by missing includes. Previous openssl versions would -usually include 'the rest of the world', but they're fixing that. So we -should no longer rely on it. - -(And sneaking in alphabetic ordering of the includes while touching them.) - -Signed-off-by: Steffan Karger -Acked-by: Gert Doering -Message-Id: <20171126154912.13283-1-steffan@karger.me> -URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15936.html -Signed-off-by: Gert Doering ---- - src/openvpn/openssl_compat.h | 1 + - src/openvpn/ssl_openssl.c | 6 +++++- - src/openvpn/ssl_verify_openssl.c | 3 ++- - 3 files changed, 8 insertions(+), 2 deletions(-) - ---- a/src/openvpn/openssl_compat.h -+++ b/src/openvpn/openssl_compat.h -@@ -42,6 +42,7 @@ - - #include "buffer.h" - -+#include - #include - #include - ---- a/src/openvpn/ssl_openssl.c -+++ b/src/openvpn/ssl_openssl.c -@@ -52,10 +52,14 @@ - - #include "ssl_verify_openssl.h" - -+#include -+#include -+#include -+#include - #include - #include -+#include - #include --#include - #ifndef OPENSSL_NO_EC - #include - #endif ---- a/src/openvpn/ssl_verify_openssl.c -+++ b/src/openvpn/ssl_verify_openssl.c -@@ -44,8 +44,9 @@ - #include "ssl_verify_backend.h" - #include "openssl_compat.h" - --#include -+#include - #include -+#include - - int - verify_callback(int preverify_ok, X509_STORE_CTX *ctx) diff --git a/package/network/services/openvpn/patches/210-build_always_use_internal_lz4.patch b/package/network/services/openvpn/patches/210-build_always_use_internal_lz4.patch deleted file mode 100644 index 5cf5174a9d..0000000000 --- a/package/network/services/openvpn/patches/210-build_always_use_internal_lz4.patch +++ /dev/null @@ -1,74 +0,0 @@ ---- a/configure.ac -+++ b/configure.ac -@@ -1080,68 +1080,15 @@ dnl - AC_ARG_VAR([LZ4_CFLAGS], [C compiler flags for lz4]) - AC_ARG_VAR([LZ4_LIBS], [linker flags for lz4]) - if test "$enable_lz4" = "yes" && test "$enable_comp_stub" = "no"; then -- if test -z "${LZ4_CFLAGS}" -a -z "${LZ4_LIBS}"; then -- # if the user did not explicitly specify flags, try to autodetect -- PKG_CHECK_MODULES([LZ4], -- [liblz4 >= 1.7.1 liblz4 < 100], -- [have_lz4="yes"], -- [LZ4_LIBS="-llz4"] # If this fails, we will do another test next. -- # We also add set LZ4_LIBS otherwise the -- # linker will not know about the lz4 library -- ) -- fi - - saved_CFLAGS="${CFLAGS}" - saved_LIBS="${LIBS}" - CFLAGS="${CFLAGS} ${LZ4_CFLAGS}" - LIBS="${LIBS} ${LZ4_LIBS}" - -- # If pkgconfig check failed or LZ4_CFLAGS/LZ4_LIBS env vars -- # are used, check the version directly in the LZ4 include file -- if test "${have_lz4}" != "yes"; then -- AC_CHECK_HEADERS([lz4.h], -- [have_lz4h="yes"], -- []) -- -- if test "${have_lz4h}" = "yes" ; then -- AC_MSG_CHECKING([additionally if system LZ4 version >= 1.7.1]) -- AC_COMPILE_IFELSE( -- [AC_LANG_PROGRAM([[ --#include -- ]], -- [[ --/* Version encoding: MMNNPP (Major miNor Patch) - see lz4.h for details */ --#if LZ4_VERSION_NUMBER < 10701L --#error LZ4 is too old --#endif -- ]] -- )], -- [ -- AC_MSG_RESULT([ok]) -- have_lz4="yes" -- ], -- [AC_MSG_RESULT([system LZ4 library is too old])] -- ) -- fi -- fi -- -- # Double check we have a few needed functions -- if test "${have_lz4}" = "yes" ; then -- AC_CHECK_LIB([lz4], -- [LZ4_compress_default], -- [], -- [have_lz4="no"]) -- AC_CHECK_LIB([lz4], -- [LZ4_decompress_safe], -- [], -- [have_lz4="no"]) -- fi -- -- if test "${have_lz4}" != "yes" ; then -- AC_MSG_RESULT([ usable LZ4 library or header not found, using version in src/compat/compat-lz4.*]) -- AC_DEFINE([NEED_COMPAT_LZ4], [1], [use copy of LZ4 source in compat/]) -- LZ4_LIBS="" -- fi -+ AC_MSG_RESULT([ usable LZ4 library or header not found, using version in src/compat/compat-lz4.*]) -+ AC_DEFINE([NEED_COMPAT_LZ4], [1], [use copy of LZ4 source in compat/]) -+ LZ4_LIBS="" - OPTIONAL_LZ4_CFLAGS="${LZ4_CFLAGS}" - OPTIONAL_LZ4_LIBS="${LZ4_LIBS}" - AC_DEFINE(ENABLE_LZ4, [1], [Enable LZ4 compression library]) diff --git a/package/network/services/openvpn/patches/220-disable_des.patch b/package/network/services/openvpn/patches/220-disable_des.patch deleted file mode 100644 index 2b8f47a802..0000000000 --- a/package/network/services/openvpn/patches/220-disable_des.patch +++ /dev/null @@ -1,81 +0,0 @@ ---- a/src/openvpn/syshead.h -+++ b/src/openvpn/syshead.h -@@ -597,11 +597,11 @@ socket_defined(const socket_descriptor_t - /* - * Should we include NTLM proxy functionality - */ --#if defined(ENABLE_CRYPTO) --#define NTLM 1 --#else -+//#if defined(ENABLE_CRYPTO) -+//#define NTLM 1 -+//#else - #define NTLM 0 --#endif -+//#endif - - /* - * Should we include proxy digest auth functionality ---- a/src/openvpn/crypto_mbedtls.c -+++ b/src/openvpn/crypto_mbedtls.c -@@ -319,6 +319,7 @@ int - key_des_num_cblocks(const mbedtls_cipher_info_t *kt) - { - int ret = 0; -+#ifdef MBEDTLS_DES_C - if (kt->type == MBEDTLS_CIPHER_DES_CBC) - { - ret = 1; -@@ -331,6 +332,7 @@ key_des_num_cblocks(const mbedtls_cipher - { - ret = 3; - } -+#endif - - dmsg(D_CRYPTO_DEBUG, "CRYPTO INFO: n_DES_cblocks=%d", ret); - return ret; -@@ -339,6 +341,7 @@ key_des_num_cblocks(const mbedtls_cipher - bool - key_des_check(uint8_t *key, int key_len, int ndc) - { -+#ifdef MBEDTLS_DES_C - int i; - struct buffer b; - -@@ -367,11 +370,15 @@ key_des_check(uint8_t *key, int key_len, - - err: - return false; -+#else -+ return true; -+#endif - } - - void - key_des_fixup(uint8_t *key, int key_len, int ndc) - { -+#ifdef MBEDTLS_DES_C - int i; - struct buffer b; - -@@ -386,6 +393,7 @@ key_des_fixup(uint8_t *key, int key_len, - } - mbedtls_des_key_set_parity(key); - } -+#endif - } - - /* -@@ -705,10 +713,12 @@ cipher_des_encrypt_ecb(const unsigned ch - unsigned char *src, - unsigned char *dst) - { -+#ifdef MBEDTLS_DES_C - mbedtls_des_context ctx; - - ASSERT(mbed_ok(mbedtls_des_setkey_enc(&ctx, key))); - ASSERT(mbed_ok(mbedtls_des_crypt_ecb(&ctx, src, dst))); -+#endif - } - - diff --git a/package/network/utils/iftop/Makefile b/package/network/utils/iftop/Makefile deleted file mode 100644 index 98fe15c8f5..0000000000 --- a/package/network/utils/iftop/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -# -# Copyright (C) 2006 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=iftop -PKG_RELEASE:=1 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://code.blinkace.com/pdw/iftop.git -PKG_SOURCE_DATE:=2018-10-03 -PKG_SOURCE_VERSION:=77901c8c53e01359d83b8090aacfe62214658183 -PKG_MIRROR_HASH:=219231541a437f5aecd497796be0202d337e13f141359a93595bf2cd8c5c5544 -PKG_MAINTAINER:=Jo-Philipp Wich -PKG_LICENSE:=GPL-2.0 - -PKG_FIXUP:=autoreconf - -include $(INCLUDE_DIR)/package.mk - -define Package/iftop - SECTION:=net - CATEGORY:=Network - DEPENDS:=+libpcap +libncurses +libpthread - TITLE:=display bandwith usage on an interface - URL:=http://www.ex-parrot.com/~pdw/iftop/ -endef - -define Package/iftop/description - iftop does for network usage what top(1) does for CPU usage. It - listens to network traffic on a named interface and displays a - table of current bandwidth usage by pairs of hosts. Handy for - answering the question 'why is our ADSL link so slow?'. -endef - -define Package/iftop/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/iftop $(1)/usr/bin/ -endef - -$(eval $(call BuildPackage,iftop)) diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile index 90644532b2..bd4825b9f9 100644 --- a/package/system/fstools/Makefile +++ b/package/system/fstools/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git -PKG_MIRROR_HASH:=97cfe9528405d9a21c05fa1638780c27a66bfb6f21becfc3f4fdca1420711db8 -PKG_SOURCE_DATE:=2020-10-16 -PKG_SOURCE_VERSION:=f25ab8a8484215e5fc88c952f25db9a06de311f7 +PKG_MIRROR_HASH:=22670e033b5623348de37c1d1e69caf799752b38205be8b25bc7020ef9e69884 +PKG_SOURCE_DATE:=2020-12-12 +PKG_SOURCE_VERSION:=f415323b7c87d66ab11d89325937d5dae5eb65c9 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile index c29dcb891e..4a7288d2e4 100644 --- a/package/system/opkg/Makefile +++ b/package/system/opkg/Makefile @@ -14,9 +14,9 @@ PKG_FLAGS:=essential PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://git.openwrt.org/project/opkg-lede.git -PKG_SOURCE_DATE:=2020-11-25 -PKG_SOURCE_VERSION:=66f458decf9fd2839d77bf420e93d9c78025488a -PKG_MIRROR_HASH:=932cf0002fd05e8a231df6d3e2c807b2c62501aa36ac2a3e20665622872e262d +PKG_SOURCE_DATE:=2020-12-05 +PKG_SOURCE_VERSION:=efb26a35e4e5446f135307c4ff7df9e9563c23a9 +PKG_MIRROR_HASH:=9294140567f1b122a7229fc80ab1b70e167b478c1a3062e0b64631c189beeda5 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index a0e6285ca1..60936ba637 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=procd -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git -PKG_SOURCE_DATE:=2020-12-04 -PKG_SOURCE_VERSION:=6acc48c7a2faac48c534b8a5516500c270550a9e -PKG_MIRROR_HASH:=ee1a238a54fff4c71a6e52f092394b94dbcc488581e6fd3a1bb6da515ce1cbaf +PKG_SOURCE_DATE:=2020-12-12 +PKG_SOURCE_VERSION:=7f12c89d0b99a2f04e91b2327e74c049f6362b67 +PKG_MIRROR_HASH:=b71134d96a54327baae532415df430ad91c757c7862c736447f03bd22e2d5ec5 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 @@ -45,7 +45,7 @@ define Package/procd/Default SECTION:=base CATEGORY:=Base system DEPENDS:=+ubusd +ubus +libjson-script +ubox +USE_GLIBC:librt +libubox \ - +libubus +libblobmsg-json +libjson-c + +libubus +libblobmsg-json +libjson-c +jshn TITLE:=OpenWrt system process manager USERID:=:dialout=20 :audio=29 endef diff --git a/package/system/selinux-policy/Makefile b/package/system/selinux-policy/Makefile index c2cef3a270..dad57e16b8 100644 --- a/package/system/selinux-policy/Makefile +++ b/package/system/selinux-policy/Makefile @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=selinux-policy PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://git.defensec.nl/selinux-policy.git -PKG_VERSION:=0.3 -PKG_MIRROR_HASH:=8f224e4e0ecb459648563862e26fcd5d4d113de5daa277363fc4316da5a05360 +PKG_VERSION:=0.4 +PKG_MIRROR_HASH:=6bf4df7df2e1a4f641e4068ec79b1f4921e29e531d5b76843f39c79470e646f8 PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_BUILD_DEPENDS:=secilc/host policycoreutils/host @@ -44,6 +44,7 @@ endef define Package/selinux-policy/install $(INSTALL_DIR) $(1)/etc/selinux/$(PKG_NAME)/contexts/files/ $(INSTALL_DIR) $(1)/etc/selinux/$(PKG_NAME)/policy/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/customizable_types $(1)/etc/selinux/$(PKG_NAME)/contexts/ $(INSTALL_DATA) $(PKG_BUILD_DIR)/file_contexts.subs_dist $(1)/etc/selinux/$(PKG_NAME)/contexts/files/ $(INSTALL_DATA) $(PKG_BUILD_DIR)/file_contexts $(1)/etc/selinux/$(PKG_NAME)/contexts/files/ $(INSTALL_CONF) $(PKG_BUILD_DIR)/policy.* $(1)/etc/selinux/$(PKG_NAME)/policy/ diff --git a/package/utils/mtd-utils/Makefile b/package/utils/mtd-utils/Makefile index 6e5e72783f..5a4b03da96 100644 --- a/package/utils/mtd-utils/Makefile +++ b/package/utils/mtd-utils/Makefile @@ -20,7 +20,7 @@ PKG_FIXUP:=autoreconf PKG_FLAGS:=nonshared -PKG_BUILD_DEPENDS:=util-linux lzo zlib +PKG_BUILD_DEPENDS:=util-linux PKG_LICENSE:=GPLv2 PKG_LICENSE_FILES:= diff --git a/rules.mk b/rules.mk index 34222a3a71..f79340b124 100644 --- a/rules.mk +++ b/rules.mk @@ -77,7 +77,7 @@ IS_PACKAGE_BUILD := $(if $(filter package/%,$(BUILD_SUBDIR)),1) OPTIMIZE_FOR_CPU=$(subst i386,i486,$(ARCH)) -ifeq ($(ARCH),powerpc) +ifneq (,$(findstring $(ARCH) , aarch64 aarch64_be powerpc )) FPIC:=-fPIC else FPIC:=-fpic diff --git a/scripts/feeds b/scripts/feeds index 22d4f8e8f4..122f8568cb 100755 --- a/scripts/feeds +++ b/scripts/feeds @@ -517,26 +517,29 @@ sub install_src { my $force = shift; my $ret = 0; - $feed = lookup_src($feed, $name); - unless ($feed) { + my $select_feed = lookup_src($feed, $name); + unless ($select_feed) { $installed{$name} and return 0; $feed_src->{$name} or warn "WARNING: No feed for source package '$name' found\n"; return 0; } # switch to the metadata for the selected feed - get_feed($feed->[1]); + get_feed($select_feed->[1]); my $src = $feed_src->{$name} or return 1; # enable force flag if feed src line was declared with --force - if (exists($feed->[3]{force})) { + if (exists($select_feed->[3]{force})) { $force = 1; } # If it's a core package and we don't want to override, just return my $override = 0; if (is_core_src($name)) { - return 0 unless $force; + if (!$force) { + warn "Not overriding core package $name; use -f to force\n"; + return 0; + } $override = 1; } @@ -554,12 +557,12 @@ sub install_src { } if ($override) { - warn "Overriding core package '$name' with version from $feed->[1]\n"; + warn "Overriding core package '$name' with version from $select_feed->[1]\n"; } else { - warn "Installing package '$name' from $feed->[1]\n"; + warn "Installing package '$name' from $select_feed->[1]\n"; } - do_install_src($feed, $src) == 0 or do { + do_install_src($select_feed, $src) == 0 or do { warn "failed.\n"; return 1; }; @@ -594,15 +597,15 @@ sub install_package { my $name = shift; my $force = shift; - $feed = lookup_package($feed, $name); - unless ($feed) { + my $select_feed = lookup_package($feed, $name); + unless ($select_feed) { $installed_pkg{$name} and return 0; $feed_vpackage->{$name} or warn "WARNING: No feed for package '$name' found\n"; return 0; } # switch to the metadata for the selected feed - get_feed($feed->[1]); + get_feed($select_feed->[1]); my $pkg = $feed_vpackage->{$name} or return 1; return install_src($feed, $pkg->[0]{src}{name}, $force); } @@ -612,14 +615,12 @@ sub install_target_or_package { my $name = shift; my $force = shift; - my $this_feed_target = lookup_target($feed, $name); - $this_feed_target and do { - return install_target($this_feed_target, $name); + lookup_target($feed, $name) and do { + return install_target($feed, $name); }; - my $this_feed_src = lookup_src($feed, $name); - $this_feed_src and do { - return install_src($this_feed_src, $name, $force); + lookup_src($feed, $name) and do { + return install_src($feed, $name, $force); }; return install_package($feed, $name, $force); diff --git a/target/linux/ath79/dts/qca9558_belkin_f9j1108-v2.dts b/target/linux/ath79/dts/qca9558_belkin_f9j1108-v2.dts new file mode 100644 index 0000000000..0bd3af98db --- /dev/null +++ b/target/linux/ath79/dts/qca9558_belkin_f9j1108-v2.dts @@ -0,0 +1,229 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x.dtsi" + +#include +#include + +/ { + model = "Belkin F9J1108 v2 (AC1750 DB Wi-Fi)"; + compatible = "belkin,f9j1108-v2", "qca,qca9558"; + + aliases { + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + label-mac-device = ð1; + }; + + leds { + compatible = "gpio-leds"; + + usb { + label = "green:usb2"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + trigger-sources = <&hub_port0>; + linux,default-trigger = "usbport"; + }; + + status { + label = "amber:status"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + wps-amber { + label = "amber:wps"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + wps-blue { + label = "blue:wps"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + }; + + led_system: system { + label = "blue:system"; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + #size-cells = <0>; + + usb2_power { + gpio-export,name = "usb2:power"; + gpio-export,output = <1>; + gpios = <&gpio 21 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "WPS button"; + linux,code = ; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + + devices = <&fwpart1 &fwpart2>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "openwrt,okli"; + label = "firmware"; + reg = <0x0 0x0>; + }; + }; + }; +}; + +&pcie1 { + status = "okay"; +}; + +&uart { + status = "okay"; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + hub_port0: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <80000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + fwpart1: partition@50000 { + label = "fwpart1"; + reg = <0x050000 0xe20000>; + }; + + partition@e70000 { + label = "loader"; + reg = <0xe70000 0x10000>; + read-only; + }; + + fwpart2: partition@e80000 { + label = "fwpart2"; + reg = <0xe80000 0x170000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + + qca,ar8327-initvals = < + 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ + 0x0c 0x07600000 /* PORT6 PAD MODE CTRL */ + 0x50 0xc737c737 /* LED_CTRL0 */ + 0x54 0x00000000 /* LED_CTRL1 */ + 0x58 0x00000000 /* LED_CTRL2 */ + 0x5c 0x0030c300 /* LED_CTRL3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + 0x94 0x0000007e /* PORT6 STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + phy-handle = <&phy0>; + pll-data = <0xa6000000 0x00000101 0x00001616>; + + gmac-config { + device = <&gmac>; + rgmii-enabled = <1>; + }; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <(-1)>; + pll-data = <0x03000101 0x00000101 0x00001616>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&pcie0 { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0 0 0 0 0>; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 0a9a6f49c1..cd8b3b2f29 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -100,6 +100,15 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2" ;; + belkin,f9j1108-v2|\ + tplink,archer-c5-v1|\ + tplink,archer-c7-v1|\ + tplink,archer-c7-v2|\ + tplink,tl-wdr4900-v2|\ + tplink,tl-wdr7500-v3) + ucidef_add_switch "switch0" \ + "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan" + ;; buffalo,bhr-4grv|\ buffalo,wzr-hp-g450h) ucidef_add_switch "switch0" \ @@ -309,14 +318,6 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" ;; - tplink,archer-c5-v1|\ - tplink,archer-c7-v1|\ - tplink,archer-c7-v2|\ - tplink,tl-wdr4900-v2|\ - tplink,tl-wdr7500-v3) - ucidef_add_switch "switch0" \ - "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan" - ;; tplink,archer-d50-v1) ucidef_add_switch "switch0" \ "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "1:wan" diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 5298f58a33..6b44f3ca1a 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -50,6 +50,24 @@ define Build/cybertan-trx -rm $@-empty.bin endef +define Build/edimax-headers + $(eval edimax_magic=$(word 1,$(1))) + $(eval edimax_model=$(word 2,$(1))) + + $(STAGING_DIR_HOST)/bin/edimax_fw_header -M $(edimax_magic) -m $(edimax_model)\ + -v $(VERSION_DIST)$(firstword $(subst +, , $(firstword $(subst -, ,$(REVISION))))) \ + -n "uImage" \ + -i $(KDIR)/loader-$(DEVICE_NAME).uImage \ + -o $@.uImage + $(STAGING_DIR_HOST)/bin/edimax_fw_header -M $(edimax_magic) -m $(edimax_model)\ + -v $(VERSION_DIST)$(firstword $(subst +, , $(firstword $(subst -, ,$(REVISION))))) \ + -n "rootfs" \ + -i $@ \ + -o $@.rootfs + cat $@.uImage $@.rootfs > $@ + rm -rf $@.uImage $@.rootfs +endef + # This needs to make /tmp/_sys/sysupgrade.tgz an empty file prior to # sysupgrade, as otherwise it will implant the old configuration from # OEM firmware when writing rootfs from factory.bin @@ -390,6 +408,27 @@ define Device/avm_fritzdvbc endef TARGET_DEVICES += avm_fritzdvbc +define Device/belkin_f9j1108-v2 + SOC := qca9558 + DEVICE_VENDOR := Belkin + DEVICE_MODEL := F9J1108 v2 (AC1750 DB Wi-Fi) + IMAGE_SIZE := 14464k + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct kmod-usb2 \ + kmod-usb3 kmod-usb-ledtrig-usbport + LOADER_TYPE := bin + LOADER_FLASH_OFFS := 0x50000 + COMPILE := loader-$(1).bin loader-$(1).uImage + COMPILE/loader-$(1).bin := loader-okli-compile + COMPILE/loader-$(1).uImage := append-loader-okli $(1) | pad-to 64k | \ + lzma | uImage lzma + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | check-size | \ + edimax-headers F9J1108v1 BR-6679BAC | pad-to $$$$(BLOCKSIZE) +endef +TARGET_DEVICES += belkin_f9j1108-v2 + define Device/buffalo_bhr-4grv $(Device/buffalo_common) SOC := ar7242 diff --git a/target/linux/bcm63xx/base-files/etc/board.d/01_leds b/target/linux/bcm63xx/base-files/etc/board.d/01_leds index cfd4cf3c31..fe8a54f5d8 100755 --- a/target/linux/bcm63xx/base-files/etc/board.d/01_leds +++ b/target/linux/bcm63xx/base-files/etc/board.d/01_leds @@ -14,8 +14,10 @@ actiontec,r1000h) ucidef_set_led_usbport "usb" "USB" "green:usb" "usb1-port1" "usb2-port1" ;; adb,a4001n|\ +adb,pdg-a4101n-a-000-1a1-ae|\ comtrend,ar-5315u|\ comtrend,vr-3032u|\ +d-link,dsl-2750u-c1|\ huawei,hg253s-v2|\ nucom,r5010un-v2|\ sagem,fast-2704-v2) @@ -25,9 +27,8 @@ adb,a4001n1) ucidef_set_led_netdev "lan" "LAN" "green:eth" "eth0" ucidef_set_led_usbdev "usb" "USB" "green:3g" "1-1" ;; -adb,pdg-a4001n-a-000-1a1-ax) - ucidef_set_led_netdev "lan" "LAN" "green:internet" "eth0.1" - ucidef_set_led_netdev "wan" "WAN" "green:adsl" "eth0.2" +adb,pdg-a4001n-a-000-1a1-ax|\ +technicolor,tg582n-telecom-italia) ucidef_set_led_netdev "wlan0" "WIFI" "green:wifi" "wlan0" ucidef_set_led_usbdev "usb1" "USB1" "green:service" "1-1" ucidef_set_led_usbdev "usb2" "USB2" "red:service" "2-1" @@ -92,6 +93,10 @@ sercomm,h500-s-lowi|\ sercomm,h500-s-vfes) ucidef_set_led_netdev "wan" "WAN" "green:internet" "eth0.2" ;; +technicolor,tg582n) + ucidef_set_led_netdev "wlan0" "WIFI" "green:wifi" "wlan0" + ucidef_set_led_usbdev "usb" "USB" "red:power" "1-1" + ;; telsey,cpva502plus) ucidef_set_led_netdev "lan" "LAN" "amber:link" "eth0" ;; diff --git a/target/linux/bcm63xx/base-files/etc/board.d/02_network b/target/linux/bcm63xx/base-files/etc/board.d/02_network index f02eabe68f..cca607fce1 100755 --- a/target/linux/bcm63xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm63xx/base-files/etc/board.d/02_network @@ -21,6 +21,7 @@ t-com,speedport-w-500v) adb,a4001n1|\ adb,a4001n|\ adb,pdg-a4001n-a-000-1a1-ax|\ +adb,pdg-a4101n-a-000-1a1-ae|\ adb,av4202n|\ brcm,bcm963281tan|\ brcm,bcm96328avng|\ @@ -31,12 +32,15 @@ comtrend,vr-3025u|\ comtrend,vr-3025un|\ comtrend,vr-3026e|\ d-link,dsl-274xb-f1|\ +d-link,dsl-2750u-c1|\ d-link,dsl-275xb-d1|\ huawei,echolife-hg622|\ huawei,echolife-hg655b|\ nucom,r5010un-v2|\ sagem,fast-2504n|\ sagem,fast-2704-v2|\ +technicolor,tg582n|\ +technicolor,tg582n-telecom-italia|\ zyxel,p870hw-51a-v2) ucidef_add_switch "switch0" \ "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "8t@eth0" @@ -96,6 +100,7 @@ huawei,echolife-hg556a-c) "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "5t@eth0" ;; comtrend,ar-5315u|\ +innacomm,w3400v6|\ observa,vh4032n|\ sagem,fast-2704n) ucidef_add_switch "switch0" \ diff --git a/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc b/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc index 6c61f7d38c..a176eb1735 100644 --- a/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc +++ b/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc @@ -13,6 +13,7 @@ case "$(board_name)" in adb,a4001n|\ adb,a4001n1|\ adb,pdg-a4001n-a-000-1a1-ax|\ + adb,pdg-a4101n-a-000-1a1-ae|\ brcm,bcm96328avng|\ brcm,bcm963281tan|\ bt,voyager-2110|\ @@ -33,6 +34,8 @@ case "$(board_name)" in nucom,r5010un-v2|\ observa,vh4032n|\ t-com,speedport-w-303v|\ + technicolor,tg582n|\ + technicolor,tg582n-telecom-italia|\ telsey,cpva502plus|\ telsey,cpva642|\ telsey,magic|\ diff --git a/target/linux/bcm63xx/dts/bcm6328-adb-pdg-a4001n-a-000-1a1-ax.dts b/target/linux/bcm63xx/dts/bcm6328-adb-pdg-a4001n-a-000-1a1-ax.dts index 7b8c03f890..f42b970c46 100644 --- a/target/linux/bcm63xx/dts/bcm6328-adb-pdg-a4001n-a-000-1a1-ax.dts +++ b/target/linux/bcm63xx/dts/bcm6328-adb-pdg-a4001n-a-000-1a1-ax.dts @@ -135,15 +135,10 @@ }; partition@10000 { - reg = <0x010000 0xfe0000>; + reg = <0x010000 0xff0000>; label = "linux"; compatible = "brcm,bcm963xx-imagetag"; }; - - partition@ff0000 { - reg = <0xff0000 0x010000>; - label = "nvram"; - }; }; }; }; diff --git a/target/linux/bcm63xx/dts/bcm6328-adb-pdg-a4101n-a-000-1a1-ae.dts b/target/linux/bcm63xx/dts/bcm6328-adb-pdg-a4101n-a-000-1a1-ae.dts new file mode 100644 index 0000000000..7ffff4e223 --- /dev/null +++ b/target/linux/bcm63xx/dts/bcm6328-adb-pdg-a4101n-a-000-1a1-ae.dts @@ -0,0 +1,141 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "bcm6328.dtsi" + +#include + +/ { + model = "ADB P.DG A4101N A-000-1A1-AE"; + compatible = "adb,pdg-a4101n-a-000-1a1-ae", "brcm,bcm6328"; + + aliases { + led-boot = &led_dsl_green; + led-failsafe = &led_dsl_green; + led-upgrade = &led_dsl_green; + }; + + chosen { + bootargs = "rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; + }; + + keys { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + wifi { + label = "wifi"; + gpios = <&pinctrl 12 1>; + linux,code = ; + debounce-interval = <60>; + }; + + reset { + label = "reset"; + gpios = <&pinctrl 23 1>; + linux,code = ; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + gpios = <&pinctrl 24 1>; + linux,code = ; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led@31 { + label = "green:tel"; + gpios = <&pinctrl 31 1>; + }; + }; +}; + +&leds { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_leds>; + + led_dsl_green: led@3 { + reg = <3>; + active-low; + label = "green:dsl"; + }; + + led@9 { + reg = <9>; + active-low; + label = "green:wps"; + }; + + led@10 { + reg = <10>; + active-low; + label = "green:usb"; + }; + + led@11 { + reg = <11>; + active-low; + label = "green:internet"; + }; +}; + +&hsspi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <16666667>; + spi-tx-bus-width = <2>; + spi-rx-bus-width = <2>; + reg = <0>; + + #address-cells = <1>; + #size-cells = <1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x000000 0x010000>; + label = "cfe"; + read-only; + }; + + partition@10000 { + reg = <0x010000 0xff0000>; + label = "linux"; + compatible = "brcm,bcm963xx-imagetag"; + }; + }; + }; +}; + +&pinctrl { + pinctrl_leds: leds { + function = "led"; + pins = "gpio3", "gpio9", "gpio10", + "gpio11"; + }; + + green_internet_switch { + gpio-hog; + gpios = <2 1>; + output-low; + line-name = "green:internet-switch"; + }; +}; + +&uart0 { + status = "okay"; +}; diff --git a/target/linux/bcm63xx/dts/bcm6328-d-link-dsl-2750u-c1.dts b/target/linux/bcm63xx/dts/bcm6328-d-link-dsl-2750u-c1.dts new file mode 100644 index 0000000000..0915215039 --- /dev/null +++ b/target/linux/bcm63xx/dts/bcm6328-d-link-dsl-2750u-c1.dts @@ -0,0 +1,146 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "bcm6328.dtsi" + +#include + +/ { + model = "D-Link DSL-2750U rev C1"; + compatible = "d-link,dsl-2750u-c1", "brcm,bcm6328"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_green; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + chosen { + bootargs = "rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + wifi { + label = "wifi"; + gpios = <&pinctrl 12 1>; + linux,code = ; + debounce-interval = <60>; + }; + + reset { + label = "reset"; + gpios = <&pinctrl 23 1>; + linux,code = ; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + gpios = <&pinctrl 24 1>; + linux,code = ; + debounce-interval = <60>; + }; + }; +}; + +&hsspi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <16666667>; + spi-tx-bus-width = <2>; + spi-rx-bus-width = <2>; + reg = <0>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + cfe@0 { + reg = <0x000000 0x010000>; + label = "cfe"; + read-only; + }; + + linux@10000 { + reg = <0x010000 0x7e0000>; + label = "linux"; + compatible = "brcm,bcm963xx-imagetag"; + }; + + nvram@7f0000 { + reg = <0x7f0000 0x010000>; + label = "nvram"; + }; + }; + }; +}; + +&leds { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_leds>; + + led@1 { + reg = <1>; + active-low; + label = "green:inet"; + }; + + led_power_green: led@4 { + reg = <4>; + active-low; + label = "green:power"; + default-state = "on"; + }; + + led@7 { + reg = <7>; + active-low; + label = "red:inet"; + }; + + led@8 { + reg = <8>; + active-low; + label = "red:power"; + }; + + led@9 { + reg = <9>; + active-low; + label = "green:wps"; + }; + + led@10 { + reg = <10>; + active-low; + label = "green:usb"; + }; + + led@11 { + reg = <11>; + active-low; + label = "green:dsl"; + }; +}; + +&pinctrl { + pinctrl_leds: leds { + function = "led"; + pins = "gpio1", "gpio4", "gpio7", + "gpio8", "gpio9", "gpio10", + "gpio11"; + }; +}; + +&uart0 { + status = "okay"; +}; diff --git a/target/linux/bcm63xx/dts/bcm6328-innacomm-w3400v6.dts b/target/linux/bcm63xx/dts/bcm6328-innacomm-w3400v6.dts new file mode 100644 index 0000000000..dd8ab12958 --- /dev/null +++ b/target/linux/bcm63xx/dts/bcm6328-innacomm-w3400v6.dts @@ -0,0 +1,118 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "bcm6328.dtsi" + +#include + +/ { + model = "Innacomm W3400V6"; + compatible = "innacomm,w3400v6", "brcm,bcm6328"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_red; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + chosen { + bootargs = "rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; + }; + + keys { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + wps { + label = "wps"; + gpios = <&pinctrl 15 1>; + linux,code = ; + debounce-interval = <60>; + }; + + reset { + label = "reset"; + gpios = <&pinctrl 23 1>; + linux,code = ; + debounce-interval = <60>; + }; + }; +}; + +&hsspi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <16666667>; + spi-tx-bus-width = <2>; + spi-rx-bus-width = <2>; + reg = <0>; + + #address-cells = <1>; + #size-cells = <1>; + + partitions { + compatible = "brcm,bcm963xx-cfe-nor-partitions"; + }; + }; +}; + +&leds { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_leds>; + + led@1 { + reg = <1>; + active-low; + label = "green:inet"; + }; + + led@2 { + reg = <2>; + active-low; + label = "red:inet"; + }; + + led@3 { + reg = <3>; + active-low; + label = "green:dsl"; + }; + + led_power_green: led@4 { + reg = <4>; + active-low; + label = "green:power"; + default-state = "on"; + }; + + led_power_red: led@5 { + reg = <5>; + active-low; + label = "red:power"; + }; + + led@11 { + reg = <11>; + active-low; + label = "green:wps"; + }; +}; + +&pinctrl { + pinctrl_leds: leds { + function = "led"; + pins = "gpio1", "gpio2", "gpio3", + "gpio4", "gpio5", "gpio11"; + }; +}; + +&uart0 { + status = "okay"; +}; diff --git a/target/linux/bcm63xx/dts/bcm6328-technicolor-tg582n-telecom-italia.dts b/target/linux/bcm63xx/dts/bcm6328-technicolor-tg582n-telecom-italia.dts new file mode 100644 index 0000000000..0dfa38e474 --- /dev/null +++ b/target/linux/bcm63xx/dts/bcm6328-technicolor-tg582n-telecom-italia.dts @@ -0,0 +1,153 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "bcm6328.dtsi" + +#include + +/ { + model = "Technicolor TG582n Telecom Italia"; + compatible = "technicolor,tg582n-telecom-italia", "brcm,bcm6328"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_green; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + chosen { + bootargs = "rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; + }; + + keys { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&pinctrl 23 1>; + linux,code = ; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + gpios = <&pinctrl 24 1>; + linux,code = ; + debounce-interval = <60>; + }; + }; +}; + +&leds { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_leds>; + + led@1 { + reg = <1>; + active-low; + label = "green:wifi"; + }; + + led_power_green: led@4 { + reg = <4>; + active-low; + label = "green:power"; + default-state = "on"; + }; + + led@5 { + reg = <5>; + active-low; + label = "green:adsl"; + }; + + led@7 { + reg = <7>; + active-low; + label = "red:wifi"; + }; + + led@8 { + reg = <8>; + active-low; + label = "red:power"; + }; + + led@11 { + reg = <11>; + active-low; + label = "green:internet"; + }; + + led@14 { + reg = <14>; + active-low; + label = "red:internet"; + }; + + led@18 { + reg = <18>; + active-low; + label = "red:service"; + }; + + led@19 { + reg = <19>; + active-low; + label = "green:service"; + }; +}; + +&hsspi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <16666667>; + spi-tx-bus-width = <2>; + spi-rx-bus-width = <2>; + reg = <0>; + + #address-cells = <1>; + #size-cells = <1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x000000 0x010000>; + label = "cfe"; + read-only; + }; + + partition@10000 { + reg = <0x010000 0xff0000>; + label = "linux"; + compatible = "brcm,bcm963xx-imagetag"; + }; + }; + }; +}; + +&pinctrl { + pinctrl_leds: leds { + function = "led"; + pins = "gpio1", "gpio4", + "gpio5", "gpio7", + "gpio8", "gpio11", + "gpio14", "gpio18", + "gpio19"; + }; +}; + +&uart0 { + status = "okay"; +}; diff --git a/target/linux/bcm63xx/dts/bcm6328-technicolor-tg582n.dts b/target/linux/bcm63xx/dts/bcm6328-technicolor-tg582n.dts new file mode 100644 index 0000000000..6ec20048cd --- /dev/null +++ b/target/linux/bcm63xx/dts/bcm6328-technicolor-tg582n.dts @@ -0,0 +1,166 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "bcm6328.dtsi" + +#include + +/ { + model = "Technicolor TG582n"; + compatible = "technicolor,tg582n", "brcm,bcm6328"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_green; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + chosen { + bootargs = "rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; + }; + + keys { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + wifi { + label = "wifi"; + gpios = <&pinctrl 15 1>; + linux,code = ; + debounce-interval = <60>; + }; + + reset { + label = "reset"; + gpios = <&pinctrl 23 1>; + linux,code = ; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + gpios = <&pinctrl 24 1>; + linux,code = ; + debounce-interval = <60>; + }; + }; +}; + +&leds { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_leds>; + + led@1 { + reg = <1>; + active-low; + label = "green:internet"; + }; + + led@2 { + reg = <2>; + active-low; + label = "red:wifi"; + }; + + led@3 { + reg = <3>; + active-low; + label = "green:wifi"; + }; + + led_power_green: led@4 { + reg = <4>; + active-low; + label = "green:power"; + default-state = "on"; + }; + + led@5 { + reg = <5>; + active-low; + label = "green:ethernet"; + }; + + led@7 { + reg = <7>; + active-low; + label = "red:internet"; + }; + + led@8 { + reg = <8>; + active-low; + label = "red:power"; + }; + + led@9 { + reg = <9>; + active-low; + label = "green:wps"; + }; + + led@10 { + reg = <10>; + active-low; + label = "red:wps"; + }; + + led@11 { + reg = <11>; + active-low; + label = "green:broadband"; + }; +}; + +&hsspi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <16666667>; + spi-tx-bus-width = <2>; + spi-rx-bus-width = <2>; + reg = <0>; + + #address-cells = <1>; + #size-cells = <1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x000000 0x010000>; + label = "cfe"; + read-only; + }; + + partition@10000 { + reg = <0x010000 0xff0000>; + label = "linux"; + compatible = "brcm,bcm963xx-imagetag"; + }; + }; + }; +}; + +&pinctrl { + pinctrl_leds: leds { + function = "led"; + pins = "gpio1", "gpio2", + "gpio3", "gpio4", + "gpio5", "gpio7", + "gpio8", "gpio9", + "gpio10", "gpio11"; + }; +}; + +&uart0 { + status = "okay"; +}; diff --git a/target/linux/bcm63xx/image/bcm63xx.mk b/target/linux/bcm63xx/image/bcm63xx.mk index 15cc549ec4..24b150c063 100644 --- a/target/linux/bcm63xx/image/bcm63xx.mk +++ b/target/linux/bcm63xx/image/bcm63xx.mk @@ -237,6 +237,18 @@ define Device/adb_pdg-a4001n-a-000-1a1-ax endef TARGET_DEVICES += adb_pdg-a4001n-a-000-1a1-ax +define Device/adb_pdg-a4101n-a-000-1a1-ae + $(Device/bcm63xx) + DEVICE_VENDOR := ADB + DEVICE_MODEL := P.DG A4101N A-000-1A1-AE + IMAGES += sysupgrade.bin + CFE_BOARD_ID := 96328avngv + CHIP_ID := 6328 + FLASH_MB := 16 + DEVICE_PACKAGES := $(USB2_PACKAGES) $(B43_PACKAGES) +endef +TARGET_DEVICES += adb_pdg-a4101n-a-000-1a1-ae + define Device/adb_av4202n $(Device/bcm63xx) DEVICE_VENDOR := ADB @@ -571,6 +583,19 @@ define Device/d-link_dsl-274xb-f1 endef TARGET_DEVICES += d-link_dsl-274xb-f1 +define Device/d-link_dsl-2750u-c1 + $(Device/bcm63xx) + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DSL-2750U + DEVICE_VARIANT := C1 + IMAGES += sysupgrade.bin + CFE_BOARD_ID := 963281TAVNG + CHIP_ID := 6328 + FLASH_MB := 8 + DEVICE_PACKAGES := $(USB2_PACKAGES) $(B43_PACKAGES) +endef +TARGET_DEVICES += d-link_dsl-2750u-c1 + define Device/d-link_dsl-275xb-d1 $(Device/bcm63xx) DEVICE_VENDOR := D-Link @@ -756,6 +781,18 @@ define Device/huawei_echolife-hg655b endef TARGET_DEVICES += huawei_echolife-hg655b +### Innacomm ### +define Device/innacomm_w3400v6 + $(Device/bcm63xx) + DEVICE_VENDOR := Innacomm + DEVICE_MODEL := W3400V6 + CFE_BOARD_ID := 96328ang + CHIP_ID := 6328 + FLASH_MB := 8 + DEVICE_PACKAGES := $(B43_PACKAGES) +endef +TARGET_DEVICES += innacomm_w3400v6 + ### Inteno ### define Device/inteno_vg50 $(Device/bcm63xx) @@ -1073,6 +1110,32 @@ define Device/t-com_speedport-w-500v endef TARGET_DEVICES += t-com_speedport-w-500v +### Technicolor ### +define Device/technicolor_tg582n + $(Device/bcm63xx) + DEVICE_VENDOR := Technicolor + DEVICE_MODEL := TG582n + IMAGES += sysupgrade.bin + CFE_BOARD_ID := DANT-1 + CHIP_ID := 6328 + FLASH_MB := 16 + DEVICE_PACKAGES := $(USB2_PACKAGES) $(B43_PACKAGES) +endef +TARGET_DEVICES += technicolor_tg582n + +define Device/technicolor_tg582n-telecom-italia + $(Device/bcm63xx) + DEVICE_VENDOR := Technicolor + DEVICE_MODEL := TG582n + DEVICE_VARIANT := Telecom Italia + IMAGES += sysupgrade.bin + CFE_BOARD_ID := DANT-V + CHIP_ID := 6328 + FLASH_MB := 16 + DEVICE_PACKAGES := $(USB2_PACKAGES) $(B43_PACKAGES) +endef +TARGET_DEVICES += technicolor_tg582n-telecom-italia + ### Tecom ### define Device/tecom_gw6000 $(Device/bcm63xx-legacy) diff --git a/target/linux/bcm63xx/patches-5.4/442-bcm63xx_enet-add_bql_support.patch b/target/linux/bcm63xx/patches-5.4/442-bcm63xx_enet-add_bql_support.patch new file mode 100644 index 0000000000..7955b7134f --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/442-bcm63xx_enet-add_bql_support.patch @@ -0,0 +1,67 @@ +From 3c0e8e1259d223a1493c47f7e277d05b93909b6b Mon Sep 17 00:00:00 2001 +From: Sieng Piaw Liew +Date: Mon, 2 Nov 2020 11:34:06 +0800 +Subject: [PATCH 1/2] bcm63xx: add BQL support + +Add Byte Queue Limits support to reduce/remove bufferbloat in bcm63xx target. + +Signed-off-by: Sieng Piaw Liew +--- + bcm63xx_enet.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -423,9 +423,11 @@ static int bcm_enet_tx_reclaim(struct ne + { + struct bcm_enet_priv *priv; + int released; ++ unsigned int bytes; + + priv = netdev_priv(dev); + released = 0; ++ bytes = 0; + + while (priv->tx_desc_count < priv->tx_ring_size) { + struct bcm_enet_desc *desc; +@@ -461,10 +463,13 @@ static int bcm_enet_tx_reclaim(struct ne + if (desc->len_stat & DMADESC_UNDER_MASK) + dev->stats.tx_errors++; + ++ bytes += skb->len; + dev_kfree_skb(skb); + released++; + } + ++ netdev_completed_queue(dev, released, bytes); ++ + if (netif_queue_stopped(dev) && released) + netif_wake_queue(dev); + +@@ -631,6 +636,8 @@ bcm_enet_start_xmit(struct sk_buff *skb, + desc->len_stat = len_stat; + wmb(); + ++ netdev_sent_queue(dev, skb->len); ++ + /* kick tx dma */ + enet_dmac_writel(priv, priv->dma_chan_en_mask, + ENETDMAC_CHANCFG, priv->tx_chan); +@@ -1051,6 +1058,8 @@ static int bcm_enet_open(struct net_devi + else + bcm_enet_adjust_link(dev); + ++ netdev_reset_queue(dev); ++ + netif_start_queue(dev); + return 0; + +@@ -2281,6 +2290,8 @@ static int bcm_enetsw_open(struct net_de + enet_dmac_writel(priv, ENETDMAC_IR_PKTDONE_MASK, + ENETDMAC_IRMASK, priv->tx_chan); + ++ netdev_reset_queue(dev); ++ + netif_carrier_on(dev); + netif_start_queue(dev); + diff --git a/target/linux/bcm63xx/patches-5.4/443-bcm63xx_enet-support_xmit_more_in_bql.patch b/target/linux/bcm63xx/patches-5.4/443-bcm63xx_enet-support_xmit_more_in_bql.patch new file mode 100644 index 0000000000..122cbf1138 --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/443-bcm63xx_enet-support_xmit_more_in_bql.patch @@ -0,0 +1,54 @@ +From 79bfb73319098bc4cb701139a6677dcdec99182f Mon Sep 17 00:00:00 2001 +From: Sieng Piaw Liew +Date: Tue, 3 Nov 2020 08:14:35 +0800 +Subject: [PATCH 2/2] bcm63xx: support xmit_more in BQL + +Support bulking hardware TX queue by using xmit_more. + +Signed-off-by: Sieng Piaw Liew +--- + bcm63xx_enet.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -638,14 +638,16 @@ bcm_enet_start_xmit(struct sk_buff *skb, + + netdev_sent_queue(dev, skb->len); + +- /* kick tx dma */ +- enet_dmac_writel(priv, priv->dma_chan_en_mask, +- ENETDMAC_CHANCFG, priv->tx_chan); +- + /* stop queue if no more desc available */ + if (!priv->tx_desc_count) + netif_stop_queue(dev); + ++ /* kick tx dma */ ++ if(!netdev_xmit_more() || !priv->tx_desc_count) ++ enet_dmac_writel(priv, priv->dma_chan_en_mask, ++ ENETDMAC_CHANCFG, priv->tx_chan); ++ ++ + dev->stats.tx_bytes += skb->len; + dev->stats.tx_packets++; + ret = NETDEV_TX_OK; +@@ -2713,7 +2715,7 @@ static int bcm_enetsw_probe(struct platf + priv->irq_rx = irq_rx; + priv->irq_tx = irq_tx; + priv->rx_ring_size = BCMENET_DEF_RX_DESC; +- priv->tx_ring_size = BCMENET_DEF_TX_DESC; ++ priv->tx_ring_size = BCMENETSW_DEF_TX_DESC; + priv->dma_maxburst = BCMENETSW_DMA_MAXBURST; + + pd = dev_get_platdata(&pdev->dev); +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.h ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.h +@@ -15,6 +15,7 @@ + /* default number of descriptor */ + #define BCMENET_DEF_RX_DESC 64 + #define BCMENET_DEF_TX_DESC 32 ++#define BCMENETSW_DEF_TX_DESC 48 + + /* maximum burst len for dma (4 bytes unit) */ + #define BCMENET_DMA_MAXBURST 16 diff --git a/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch b/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch index abab912092..e28ff912cb 100644 --- a/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch +++ b/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -348,6 +348,482 @@ static struct board_info __initdata boar +@@ -348,6 +348,651 @@ static struct board_info __initdata boar }, }, }; @@ -438,6 +438,49 @@ + }, +}; + ++static struct board_info __initdata board_PDG_A4101N_A_000_1A1_AE = { ++ .name = "96328avngv", ++ .expected_cpu_id = 0x6328, ++ ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, ++ ++ .has_enetsw = 1, ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "Port 1", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", ++ }, ++ }, ++ }, ++ ++ .use_fallback_sprom = 1, ++ .fallback_sprom = { ++ .type = SPROM_BCM43225, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ }, ++}; ++ +static struct board_info __initdata board_R5010UNV2 = { + .name = "96328ang", + .expected_cpu_id = 0x6328, @@ -479,11 +522,137 @@ + .pci_bus = 1, + .pci_dev = 0, + }, ++}; ++ ++static struct board_info __initdata board_TG582N = { ++ .name = "DANT-1", ++ .expected_cpu_id = 0x6328, ++ ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, ++ ++ .has_enetsw = 1, ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "Port 1", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", ++ }, ++ }, ++ }, ++ ++ .use_fallback_sprom = 1, ++ .fallback_sprom = { ++ .type = SPROM_BCM43225, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ }, ++}; ++ ++static struct board_info __initdata board_TG582N_TELECOM_ITALIA = { ++ .name = "DANT-V", ++ .expected_cpu_id = 0x6328, ++ ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, ++ ++ .has_enetsw = 1, ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "Port 1", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", ++ }, ++ }, ++ }, ++ ++ .use_fallback_sprom = 1, ++ .fallback_sprom = { ++ .type = SPROM_BCM43225, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ }, ++}; ++ ++static struct board_info __initdata board_W3400V6 = { ++ .name = "96328ang", ++ .expected_cpu_id = 0x6328, ++ ++ .has_pci = 1, ++ ++ .has_enetsw = 1, ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "Port 1", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", ++ }, ++ }, ++ }, ++ ++ .use_fallback_sprom = 1, ++ .fallback_sprom = { ++ .type = SPROM_BCM4318, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ }, +}; #endif /* CONFIG_BCM63XX_CPU_6328 */ /* -@@ -703,6 +1179,16 @@ static const struct board_info __initcon +@@ -703,6 +1348,20 @@ static const struct board_info __initcon #endif /* CONFIG_BCM63XX_CPU_6318 */ #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, @@ -496,26 +665,35 @@ + &board_dsl_274xb_f1, + &board_FAST2704V2, + &board_PDG_A4001N_A_000_1A1_AX, ++ &board_PDG_A4101N_A_000_1A1_AE, ++ &board_TG582N, ++ &board_TG582N_TELECOM_ITALIA, + &board_R5010UNV2, ++ &board_W3400V6, #endif /* CONFIG_BCM63XX_CPU_6328 */ #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, -@@ -742,7 +1228,18 @@ static struct of_device_id const bcm963x +@@ -742,7 +1401,23 @@ static struct of_device_id const bcm963x { .compatible = "sagem,fast-2704n", .data = &board_FAST2704N, }, #endif /* CONFIG_BCM63XX_CPU_6318 */ #ifdef CONFIG_BCM63XX_CPU_6328 + { .compatible = "adb,a4001n", .data = &board_A4001N, }, + { .compatible = "adb,a4001n1", .data = &board_A4001N1, }, + { .compatible = "adb,pdg-a4001n-a-000-1a1-ax", .data = &board_PDG_A4001N_A_000_1A1_AX, }, ++ { .compatible = "adb,pdg-a4101n-a-000-1a1-ae", .data = &board_PDG_A4101N_A_000_1A1_AE, }, { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, + { .compatible = "brcm,bcm963281tan", .data = &board_963281TAN, }, + { .compatible = "comtrend,ar-5381u", .data = &board_AR5381u, }, + { .compatible = "comtrend,ar-5387un", .data = &board_AR5387un, }, + { .compatible = "d-link,dsl-274xb-f1", .data = &board_dsl_274xb_f1, }, ++ { .compatible = "d-link,dsl-2750u-c1", .data = &board_A4001N, }, ++ { .compatible = "innacomm,w3400v6", .data = &board_W3400V6, }, + { .compatible = "nucom,r5010un-v2", .data = &board_R5010UNV2, }, + { .compatible = "sagem,fast-2704-v2", .data = &board_FAST2704V2, }, + { .compatible = "sercomm,ad1018", .data = &board_AD1018, }, + { .compatible = "sercomm,ad1018-nor", .data = &board_AD1018, }, ++ { .compatible = "technicolor,tg582n", .data = &board_TG582N, }, ++ { .compatible = "technicolor,tg582n-telecom-italia", .data = &board_TG582N_TELECOM_ITALIA, }, #endif /* CONFIG_BCM63XX_CPU_6328 */ #ifdef CONFIG_BCM63XX_CPU_6338 { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, diff --git a/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch b/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch index 85c8e6c390..f3847c8140 100644 --- a/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch +++ b/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -857,6 +857,32 @@ static struct board_info __initdata boar +@@ -1026,6 +1026,32 @@ static struct board_info __initdata boar .force_duplex_full = 1, }, }; @@ -33,7 +33,7 @@ #endif /* CONFIG_BCM63XX_CPU_6338 */ /* -@@ -1193,6 +1219,8 @@ static const struct board_info __initcon +@@ -1366,6 +1392,8 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, &board_96338w, @@ -42,7 +42,7 @@ #endif /* CONFIG_BCM63XX_CPU_6338 */ #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, -@@ -1244,6 +1272,8 @@ static struct of_device_id const bcm963x +@@ -1422,6 +1450,8 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6338 { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, { .compatible = "brcm,bcm96338w", .data = &board_96338w, }, diff --git a/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch b/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch index d881555853..3f84c95385 100644 --- a/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch +++ b/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -893,6 +893,19 @@ static struct board_info __initdata boar +@@ -1062,6 +1062,19 @@ static struct board_info __initdata boar .name = "96345GW2", .expected_cpu_id = 0x6345, }; @@ -20,7 +20,7 @@ #endif /* CONFIG_BCM63XX_CPU_6345 */ /* -@@ -1224,6 +1237,7 @@ static const struct board_info __initcon +@@ -1397,6 +1410,7 @@ static const struct board_info __initcon #endif /* CONFIG_BCM63XX_CPU_6338 */ #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, @@ -28,7 +28,7 @@ #endif /* CONFIG_BCM63XX_CPU_6345 */ #ifdef CONFIG_BCM63XX_CPU_6348 &board_96348r, -@@ -1277,6 +1291,8 @@ static struct of_device_id const bcm963x +@@ -1455,6 +1469,8 @@ static struct of_device_id const bcm963x #endif /* CONFIG_BCM63XX_CPU_6338 */ #ifdef CONFIG_BCM63XX_CPU_6345 { .compatible = "brcm,bcm96345gw2", .data = &board_96345gw2, }, diff --git a/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch b/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch index 1e93c5e443..891184eedd 100644 --- a/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch +++ b/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1092,6 +1092,275 @@ static struct board_info __initdata boar +@@ -1261,6 +1261,275 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; @@ -276,7 +276,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ /* -@@ -1248,6 +1517,19 @@ static const struct board_info __initcon +@@ -1421,6 +1690,19 @@ static const struct board_info __initcon &board_DV201AMR, &board_96348gw_a, &board_rta1025w_16, @@ -296,7 +296,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ #ifdef CONFIG_BCM63XX_CPU_6358 &board_96358vw, -@@ -1295,15 +1577,29 @@ static struct of_device_id const bcm963x +@@ -1473,15 +1755,29 @@ static struct of_device_id const bcm963x { .compatible = "dynalink,rta770w", .data = &board_rta770w, }, #endif /* CONFIG_BCM63XX_CPU_6345 */ #ifdef CONFIG_BCM63XX_CPU_6348 diff --git a/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch b/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch index 18f813b9b8..c1a4e9bbd5 100644 --- a/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch +++ b/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch @@ -8,7 +8,7 @@ #include #include #include -@@ -1445,6 +1446,88 @@ static struct board_info __initdata boar +@@ -1614,6 +1615,88 @@ static struct board_info __initdata boar .has_ehci0 = 1, }; @@ -97,7 +97,7 @@ static struct board_info __initdata board_DWVS0 = { .name = "DWV-S0", .expected_cpu_id = 0x6358, -@@ -1469,6 +1552,238 @@ static struct board_info __initdata boar +@@ -1638,6 +1721,238 @@ static struct board_info __initdata boar .has_ohci0 = 1, .has_ehci0 = 1, }; @@ -336,7 +336,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ /* -@@ -1535,7 +1850,20 @@ static const struct board_info __initcon +@@ -1708,7 +2023,20 @@ static const struct board_info __initcon &board_96358vw, &board_96358vw2, &board_AGPFS0, @@ -357,7 +357,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ }; -@@ -1607,11 +1935,24 @@ static struct of_device_id const bcm963x +@@ -1785,11 +2113,24 @@ static struct of_device_id const bcm963x { .compatible = "alcatel,rg100a", .data = &board_96358vw2, }, { .compatible = "brcm,bcm96358vw", .data = &board_96358vw, }, { .compatible = "brcm,bcm96358vw2", .data = &board_96358vw2, }, diff --git a/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch b/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch index 8e87c0cc55..71a84937a2 100644 --- a/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch +++ b/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1786,6 +1786,117 @@ static struct board_info __initdata boar +@@ -1955,6 +1955,117 @@ static struct board_info __initdata boar }; #endif /* CONFIG_BCM63XX_CPU_6358 */ @@ -118,7 +118,7 @@ /* * all boards */ -@@ -1865,6 +1976,12 @@ static const struct board_info __initcon +@@ -2038,6 +2149,12 @@ static const struct board_info __initcon &board_nb4_fxc_r1, &board_spw303v, #endif /* CONFIG_BCM63XX_CPU_6358 */ @@ -131,7 +131,7 @@ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -1955,6 +2072,10 @@ static struct of_device_id const bcm963x +@@ -2133,6 +2250,10 @@ static struct of_device_id const bcm963x { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, #endif /* CONFIG_BCM63XX_CPU_6358 */ #ifdef CONFIG_BCM63XX_CPU_6362 diff --git a/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch b/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch index e745bf0848..e200535217 100644 --- a/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch +++ b/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch @@ -9,7 +9,7 @@ #include #include #include -@@ -1898,6 +1900,648 @@ static struct board_info __initdata boar +@@ -2067,6 +2069,648 @@ static struct board_info __initdata boar #endif /* CONFIG_BCM63XX_CPU_6362 */ /* @@ -136,7 +136,7 @@ +}; + +static struct board_info __initdata board_DGND3700v1_3800B = { -+ .name = "DGND3700v1_3800B", ++ .name = "U12L144T01", + .expected_cpu_id = 0x6368, + + .has_pci = 1, @@ -658,7 +658,7 @@ * all boards */ static const struct board_info __initconst *bcm963xx_boards[] = { -@@ -1982,6 +2626,22 @@ static const struct board_info __initcon +@@ -2155,6 +2799,22 @@ static const struct board_info __initcon &board_hg253s_v2, &board_nb6, #endif /* CONFIG_BCM63XX_CPU_6362 */ @@ -681,7 +681,7 @@ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -2078,6 +2738,20 @@ static struct of_device_id const bcm963x +@@ -2256,6 +2916,20 @@ static struct of_device_id const bcm963x { .compatible = "sfr,neufbox-6-sercomm-r0", .data = &board_nb6, }, #endif /* CONFIG_BCM63XX_CPU_6362 */ #ifdef CONFIG_BCM63XX_CPU_6368 diff --git a/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch b/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch index 2718bbdd36..f46cbbedc7 100644 --- a/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch +++ b/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2542,6 +2542,273 @@ static struct board_info __initdata boar +@@ -2711,6 +2711,273 @@ static struct board_info __initdata boar #endif /* CONFIG_BCM63XX_CPU_6368 */ /* @@ -274,7 +274,7 @@ * all boards */ static const struct board_info __initconst *bcm963xx_boards[] = { -@@ -2642,6 +2909,15 @@ static const struct board_info __initcon +@@ -2815,6 +3082,15 @@ static const struct board_info __initcon &board_VR3026e, &board_WAP5813n, #endif /* CONFIG_BCM63XX_CPU_6368 */ @@ -290,7 +290,7 @@ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -2754,6 +3030,14 @@ static struct of_device_id const bcm963x +@@ -2932,6 +3208,14 @@ static struct of_device_id const bcm963x { .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, }, #endif /* CONFIG_BCM63XX_CPU_6368 */ #ifdef CONFIG_BCM63XX_CPU_63268 diff --git a/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch b/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch index 750deb6da0..ec49e933d6 100644 --- a/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch +++ b/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -3066,6 +3066,22 @@ void __init board_bcm963xx_init(void) +@@ -3244,6 +3244,22 @@ void __init board_bcm963xx_init(void) val &= MPI_CSBASE_BASE_MASK; } boot_addr = (u8 *)KSEG1ADDR(val); diff --git a/target/linux/generic/backport-5.4/315-v5.10-usbnet-ipeth-fix-connectivity-with-ios-14.patch b/target/linux/generic/backport-5.4/315-v5.10-usbnet-ipeth-fix-connectivity-with-ios-14.patch deleted file mode 100644 index bb572b3f21..0000000000 --- a/target/linux/generic/backport-5.4/315-v5.10-usbnet-ipeth-fix-connectivity-with-ios-14.patch +++ /dev/null @@ -1,44 +0,0 @@ -From: Yves-Alexis Perez -Subject: [PATCH] usbnet: ipheth: fix connectivity with iOS 14 -Date: Thu, 19 Nov 2020 18:24:39 +0100 -Archived-At: -List-Post: - -Starting with iOS 14 released in September 2020, connectivity using the -personal hotspot USB tethering function of iOS devices is broken. - -Communication between the host and the device (for example ICMP traffic -or DNS resolution using the DNS service running in the device itself) -works fine, but communication to endpoints further away doesn't work. - -Investigation on the matter shows that UDP and ICMP traffic from the -tethered host is reaching the Internet at all. For TCP traffic there are -exchanges between tethered host and server but packets are modified in -transit leading to impossible communication. - -After some trials Matti Vuorela discovered that reducing the URB buffer -size by two bytes restored the previous behavior. While a better -solution might exist to fix the issue, since the protocol is not -publicly documented and considering the small size of the fix, let's do -that. - -Tested-by: Matti Vuorela -Signed-off-by: Yves-Alexis Perez -Link: https://lore.kernel.org/linux-usb/CAAn0qaXmysJ9vx3ZEMkViv_B19ju-_ExN8Yn_uSefxpjS6g4Lw@mail.gmail.com/ -Link: https://github.com/libimobiledevice/libimobiledevice/issues/1038 -Cc: stable@vger.kernel.org ---- - drivers/net/usb/ipheth.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/net/usb/ipheth.c -+++ b/drivers/net/usb/ipheth.c -@@ -59,7 +59,7 @@ - #define IPHETH_USBINTF_SUBCLASS 253 - #define IPHETH_USBINTF_PROTO 1 - --#define IPHETH_BUF_SIZE 1516 -+#define IPHETH_BUF_SIZE 1514 - #define IPHETH_IP_ALIGN 2 /* padding at front of URB */ - #define IPHETH_TX_TIMEOUT (5 * HZ) - diff --git a/target/linux/generic/files/drivers/net/phy/ip17xx.c b/target/linux/generic/files/drivers/net/phy/ip17xx.c index 88bdc29cb7..c369803395 100644 --- a/target/linux/generic/files/drivers/net/phy/ip17xx.c +++ b/target/linux/generic/files/drivers/net/phy/ip17xx.c @@ -1337,12 +1337,6 @@ static int ip17xx_aneg_done(struct phy_device *pdev) return 1; /* Return any positive value */ } -static int ip17xx_update_link(struct phy_device *pdev) -{ - pdev->link = 1; - return 0; -} - static int ip17xx_read_status(struct phy_device *pdev) { pdev->speed = SPEED_100; @@ -1364,7 +1358,6 @@ static struct phy_driver ip17xx_driver[] = { .config_init = ip17xx_config_init, .config_aneg = ip17xx_config_aneg, .aneg_done = ip17xx_aneg_done, - .update_link = ip17xx_update_link, .read_status = ip17xx_read_status, } }; diff --git a/target/linux/generic/hack-5.4/400-unlock_mx25l6406e_with_4bit_block_protect.patch b/target/linux/generic/hack-5.4/400-unlock_mx25l6406e_with_4bit_block_protect.patch new file mode 100644 index 0000000000..e25fdcd858 --- /dev/null +++ b/target/linux/generic/hack-5.4/400-unlock_mx25l6406e_with_4bit_block_protect.patch @@ -0,0 +1,69 @@ +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -196,7 +196,7 @@ struct flash_info { + u16 page_size; + u16 addr_width; + +- u16 flags; ++ u32 flags; + #define SECT_4K BIT(0) /* SPINOR_OP_BE_4K works uniformly */ + #define SPI_NOR_NO_ERASE BIT(1) /* No erase command needed */ + #define SST_WRITE BIT(2) /* use SST byte programming */ +@@ -233,6 +233,10 @@ struct flash_info { + #define SPI_NOR_SKIP_SFDP BIT(13) /* Skip parsing of SFDP tables */ + #define USE_CLSR BIT(14) /* use CLSR command */ + #define SPI_NOR_OCTAL_READ BIT(15) /* Flash supports Octal Read */ ++#define SPI_NOR_4BIT_BP BIT(17) /* ++ * Flash SR has 4 bit fields (BP0-3) ++ * for block protection. ++ */ + + /* Part specific fixup hooks. */ + const struct spi_nor_fixups *fixups; +@@ -1983,6 +1987,9 @@ static int spi_nor_clear_sr_bp(struct sp + int ret; + u8 mask = SR_BP2 | SR_BP1 | SR_BP0; + ++ if (nor->flags & SNOR_F_HAS_4BIT_BP) ++ mask |= SR_BP3; ++ + ret = read_sr(nor); + if (ret < 0) { + dev_err(nor->dev, "error while reading status register\n"); +@@ -2335,7 +2342,7 @@ static const struct flash_info spi_nor_i + { "mx25l1606e", INFO(0xc22015, 0, 64 * 1024, 32, SECT_4K) }, + { "mx25l3205d", INFO(0xc22016, 0, 64 * 1024, 64, SECT_4K) }, + { "mx25l3255e", INFO(0xc29e16, 0, 64 * 1024, 64, SECT_4K) }, +- { "mx25l6405d", INFO(0xc22017, 0, 64 * 1024, 128, SECT_4K) }, ++ { "mx25l6405d", INFO(0xc22017, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_4BIT_BP) }, + { "mx25u2033e", INFO(0xc22532, 0, 64 * 1024, 4, SECT_4K) }, + { "mx25u3235f", INFO(0xc22536, 0, 64 * 1024, 64, + SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, +@@ -5024,6 +5031,9 @@ int spi_nor_scan(struct spi_nor *nor, co + if (info->flags & USE_CLSR) + nor->flags |= SNOR_F_USE_CLSR; + ++ if (info->flags & SPI_NOR_4BIT_BP) ++ nor->flags |= SNOR_F_HAS_4BIT_BP; ++ + if (info->flags & SPI_NOR_NO_ERASE) + mtd->flags |= MTD_NO_ERASE; + +--- a/include/linux/mtd/spi-nor.h ++++ b/include/linux/mtd/spi-nor.h +@@ -127,6 +127,7 @@ + #define SR_BP0 BIT(2) /* Block protect 0 */ + #define SR_BP1 BIT(3) /* Block protect 1 */ + #define SR_BP2 BIT(4) /* Block protect 2 */ ++#define SR_BP3 BIT(5) /* Block protect 3 */ + #define SR_TB BIT(5) /* Top/Bottom protect */ + #define SR_SRWD BIT(7) /* SR write protect */ + /* Spansion/Cypress specific status bits */ +@@ -243,6 +244,7 @@ enum spi_nor_option_flags { + SNOR_F_4B_OPCODES = BIT(6), + SNOR_F_HAS_4BAIT = BIT(7), + SNOR_F_HAS_LOCK = BIT(8), ++ SNOR_F_HAS_4BIT_BP = BIT(12), + }; + + /** diff --git a/target/linux/generic/hack-5.4/702-phy_add_aneg_done_function.patch b/target/linux/generic/hack-5.4/702-phy_add_aneg_done_function.patch deleted file mode 100644 index 0e292f5b6f..0000000000 --- a/target/linux/generic/hack-5.4/702-phy_add_aneg_done_function.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/include/linux/phy.h -+++ b/include/linux/phy.h -@@ -524,6 +524,12 @@ struct phy_driver { - /* Determines the negotiated speed and duplex */ - int (*read_status)(struct phy_device *phydev); - -+ /* -+ * Update the value in phydev->link to reflect the -+ * current link value -+ */ -+ int (*update_link)(struct phy_device *phydev); -+ - /* Clears any pending interrupts */ - int (*ack_interrupt)(struct phy_device *phydev); - ---- a/drivers/net/phy/phy_device.c -+++ b/drivers/net/phy/phy_device.c -@@ -1912,6 +1912,9 @@ int genphy_update_link(struct phy_device - if (bmcr & BMCR_ANRESTART) - goto done; - -+ if (phydev->drv && phydev->drv->update_link) -+ return phydev->drv->update_link(phydev); -+ - /* The link state is latched low so that momentary link - * drops can be detected. Do not double-read the status - * in polling mode to detect such short link drops. diff --git a/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch b/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch index d2a9c65cdc..424061ef5e 100644 --- a/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch +++ b/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch @@ -95,7 +95,7 @@ Signed-off-by: David S. Miller } netif_tx_start_all_queues(port->dev); -@@ -5124,8 +5128,11 @@ static void mvpp2_mac_config(struct phyl +@@ -5125,8 +5129,11 @@ static void mvpp2_mac_config(struct phyl mvpp2_port_enable(port); } diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk index ea20a25a29..67f68b1770 100644 --- a/target/linux/mvebu/image/cortexa9.mk +++ b/target/linux/mvebu/image/cortexa9.mk @@ -32,8 +32,7 @@ define Device/cznic_turris-omnia DEVICE_VENDOR := CZ.NIC DEVICE_MODEL := Turris Omnia KERNEL_INSTALL := 1 - KERNEL := kernel-bin - KERNEL_INITRAMFS := kernel-bin + KERNEL := kernel-bin | append-dtb DEVICE_PACKAGES := \ mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \ wpad-basic-wolfssl kmod-ath9k kmod-ath10k-ct ath10k-firmware-qca988x-ct \ diff --git a/target/linux/ramips/dts/mt7621.dtsi b/target/linux/ramips/dts/mt7621.dtsi index baa0e7b455..41c790d3ed 100644 --- a/target/linux/ramips/dts/mt7621.dtsi +++ b/target/linux/ramips/dts/mt7621.dtsi @@ -371,7 +371,6 @@ xhci: xhci@1E1C0000 { #address-cells = <1>; #size-cells = <0>; - status = "okay"; compatible = "mediatek,mt8173-xhci"; reg = <0x1e1c0000 0x1000 diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mir3p.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts similarity index 98% rename from target/linux/ramips/dts/mt7621_xiaomi_mir3p.dts rename to target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts index 43e61e9140..b9101b7ccb 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mir3p.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts @@ -6,7 +6,7 @@ #include / { - compatible = "xiaomi,mir3p", "mediatek,mt7621-soc"; + compatible = "xiaomi,mi-router-3-pro", "mediatek,mt7621-soc"; model = "Xiaomi Mi Router 3 Pro"; aliases { diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mir3g-v2.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g-v2.dts similarity index 69% rename from target/linux/ramips/dts/mt7621_xiaomi_mir3g-v2.dts rename to target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g-v2.dts index 50c5a7dafb..fe03ff1e6a 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mir3g-v2.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g-v2.dts @@ -3,6 +3,6 @@ #include "mt7621_xiaomi_mi-router-4a-3g-v2.dtsi" / { - compatible = "xiaomi,mir3g-v2", "mediatek,mt7621-soc"; + compatible = "xiaomi,mi-router-3g-v2", "mediatek,mt7621-soc"; model = "Xiaomi Mi Router 3G v2"; }; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mir3g.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts similarity index 98% rename from target/linux/ramips/dts/mt7621_xiaomi_mir3g.dts rename to target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts index 51f4842255..479cfc354c 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mir3g.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts @@ -4,7 +4,7 @@ #include / { - compatible = "xiaomi,mir3g", "mediatek,mt7621-soc"; + compatible = "xiaomi,mi-router-3g", "mediatek,mt7621-soc"; model = "Xiaomi Mi Router 3G"; aliases { diff --git a/target/linux/ramips/dts/mt7621_youku_yk-l2.dts b/target/linux/ramips/dts/mt7621_youku_yk-l2.dts index fd4395985c..627188873d 100644 --- a/target/linux/ramips/dts/mt7621_youku_yk-l2.dts +++ b/target/linux/ramips/dts/mt7621_youku_yk-l2.dts @@ -63,10 +63,6 @@ status = "okay"; }; -&xhci { - status = "okay"; -}; - &spi0 { status = "okay"; diff --git a/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts b/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts index 4ebe0cf11f..c5e0c2e02b 100644 --- a/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts +++ b/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts @@ -131,11 +131,3 @@ &uart1 { status = "okay"; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts b/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts index 95d7750be0..6962651e1b 100644 --- a/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts +++ b/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts @@ -93,14 +93,6 @@ }; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - &sdhci { status = "okay"; }; diff --git a/target/linux/ramips/dts/mt7628an_skylab_skw92a.dts b/target/linux/ramips/dts/mt7628an_skylab_skw92a.dts index 111f70a8d5..6e1cb396b8 100644 --- a/target/linux/ramips/dts/mt7628an_skylab_skw92a.dts +++ b/target/linux/ramips/dts/mt7628an_skylab_skw92a.dts @@ -97,11 +97,3 @@ &uart1 { status = "okay"; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/mt7628an_tama_w06.dts b/target/linux/ramips/dts/mt7628an_tama_w06.dts index 26e5ab00a5..2be5f3fc88 100644 --- a/target/linux/ramips/dts/mt7628an_tama_w06.dts +++ b/target/linux/ramips/dts/mt7628an_tama_w06.dts @@ -37,18 +37,10 @@ }; }; -&ehci { - status = "okay"; -}; - ðernet { mtd-mac-address = <&factory 0x28>; }; -&ohci { - status = "okay"; -}; - &state_default { gpio { groups = "uart1", "p0led_an", "wdt"; diff --git a/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi b/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi index 7f7e5ac8b4..b6ce7b1f56 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi +++ b/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi @@ -72,14 +72,6 @@ }; }; -&ehci { - status = "disabled"; -}; - -&ohci { - status = "disabled"; -}; - &wmac { status = "okay"; mtd-mac-address = <&rom 0xf100>; diff --git a/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi b/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi index b134badb15..2faf8a87fe 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi +++ b/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi @@ -53,14 +53,6 @@ }; }; -&ehci { - status = "disabled"; -}; - -&ohci { - status = "disabled"; -}; - &wmac { status = "okay"; mtd-mac-address = <&factory 0xf100>; diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts index f6321bb15f..58743db6b4 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts @@ -69,6 +69,14 @@ }; }; +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + &wmac { mtd-mac-address-increment = <(-2)>; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts index 7969bfc733..d76ce34ca9 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts @@ -71,6 +71,14 @@ }; }; +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + &state_default { gpio { groups = "i2s", "gpio", "refclk", "p0led_an", "p1led_an", diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts index ea53870eeb..4966d56a68 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts @@ -67,6 +67,14 @@ }; }; +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + &state_default { gpio { groups = "i2c", "gpio", "p0led_an", "p1led_an", "p2led_an", diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts index 4ca0cd61a5..11bf903531 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts @@ -69,6 +69,14 @@ }; }; +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + &state_default { gpio { groups = "i2c", "p0led_an", "p1led_an", "p2led_an", diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-mr3020-v3.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3020-v3.dts index a45019e2d0..5bc12758d4 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-mr3020-v3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3020-v3.dts @@ -114,14 +114,6 @@ }; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - &state_default { gpio { groups = "i2s", "refclk", "wdt", "p2led_an", "p1led_an", "p0led_an", "wled_an"; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts index 8e602331f3..173b4cddca 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts @@ -69,14 +69,6 @@ }; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - &state_default { gpio { groups = "i2c", "i2s", "p2led_an", "refclk", "uart1", "wdt", "wled_an"; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v4.dts index 787abfad55..a142be7870 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v4.dts @@ -70,14 +70,6 @@ }; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - &state_default { gpio { groups = "p0led_an", "p1led_an", "p2led_an", "p3led_an", "p4led_an", "refclk", "uart1", "wdt", "wled_an"; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v5.dts index 71e9694dde..7ab19632e8 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v5.dts @@ -70,14 +70,6 @@ }; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - &state_default { gpio { groups = "i2c", "p0led_an", "p1led_an", "p2led_an", "p3led_an", "p4led_an", "uart1", "wdt"; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wa801nd-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wa801nd-v5.dts index 21c09ec5d9..de9a48445a 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wa801nd-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wa801nd-v5.dts @@ -58,6 +58,14 @@ }; }; +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + &state_default { gpio { groups = "p0led_an", "p1led_an", "perst", "refclk", diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts index d6077b4c0e..bce34045c6 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts @@ -33,6 +33,14 @@ }; }; +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + &state_default { gpio { groups = "refclk", "wdt"; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts index f960a0ae8f..8a8ba81ec3 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts @@ -51,6 +51,14 @@ }; }; +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + &state_default { gpio { groups = "p0led_an", "p2led_an", "perst", "refclk", "wdt", "wled_an"; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts index c4c83b8549..5c7f9836b6 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts @@ -77,6 +77,14 @@ }; }; +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + &state_default { gpio { groups = "gpio", "p0led_an", "p1led_an", "p2led_an", "p3led_an", "p4led_an", "perst", "refclk", "uart1", "wdt", "wled_an"; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts index e843672600..9077ec00ce 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts @@ -69,14 +69,6 @@ }; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - &state_default { gpio { groups = "i2c", "i2s", "p2led_an", "refclk", "uart1", "wdt", "wled_an"; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr850n-v2.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr850n-v2.dts index 1fec73d4dc..7abeae9c07 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr850n-v2.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr850n-v2.dts @@ -54,6 +54,14 @@ }; }; +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + &state_default { gpio { groups = "p0led_an", "p2led_an", "perst", "refclk", "wdt", "wled_an"; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts index bce394747b..77a68acf34 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts @@ -83,14 +83,6 @@ }; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - &pcie { status = "okay"; }; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mir4a-100m.dts b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4.dtsi similarity index 60% rename from target/linux/ramips/dts/mt7628an_xiaomi_mir4a-100m.dts rename to target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4.dtsi index c4912048f5..0f5897f5c5 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_mir4a-100m.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4.dtsi @@ -6,29 +6,26 @@ #include / { - compatible = "xiaomi,mir4a-100m", "mediatek,mt7628an-soc"; - model = "Xiaomi Mi Router 4A (100M Edition)"; + aliases { + led-boot = &led_power_yellow; + led-failsafe = &led_power_yellow; + led-running = &led_power_blue; + led-upgrade = &led_power_yellow; + }; chosen { bootargs = "console=ttyS0,115200"; }; - aliases { - led-boot = &power_yellow; - led-failsafe = &power_yellow; - led-running = &power_blue; - led-upgrade = &power_yellow; - }; - leds { compatible = "gpio-leds"; - power_blue: power_blue { + led_power_blue: power_blue { label = "blue:power"; gpios = <&gpio 11 GPIO_ACTIVE_LOW>; }; - power_yellow: power_yellow { + led_power_yellow: power_yellow { label = "yellow:power"; gpios = <&gpio 44 GPIO_ACTIVE_LOW>; }; @@ -48,12 +45,12 @@ &spi0 { status = "okay"; - flash@0 { + flash0: flash@0 { compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; - partitions { + partitions: partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; @@ -88,34 +85,11 @@ read-only; }; - partition@60000 { - label = "overlay"; - reg = <0x60000 0x100000>; - read-only; - }; - - partition@160000 { - label = "firmware"; - reg = <0x160000 0xea0000>; - compatible = "denx,uimage"; - }; + /* additional partitions in DTS */ }; }; }; -&pcie { - status = "okay"; -}; - -&pcie0 { - wifi@0,0 { - compatible = "mediatek,mt76"; - reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - ieee80211-freq-limit = <5000000 6000000>; - }; -}; - &state_default { gpio { groups = "gpio", "wdt", "wled_an"; @@ -123,16 +97,6 @@ }; }; -ðernet { - mtd-mac-address = <&factory 0x4>; - mtd-mac-address-increment = <(-1)>; -}; - -&esw { - mediatek,portmap = <0x3e>; - mediatek,portdisable = <0x2a>; -}; - &wmac { status = "okay"; }; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts new file mode 100644 index 0000000000..37797fc368 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7628an_xiaomi_mi-router-4.dtsi" + +/ { + compatible = "xiaomi,mi-router-4a-100m", "mediatek,mt7628an-soc"; + model = "Xiaomi Mi Router 4A (100M Edition)"; +}; + +&partitions { + partition@60000 { + label = "overlay"; + reg = <0x60000 0x100000>; + read-only; + }; + + partition@160000 { + label = "firmware"; + reg = <0x160000 0xea0000>; + compatible = "denx,uimage"; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0x4>; + mtd-mac-address-increment = <(-1)>; +}; + +&esw { + mediatek,portmap = <0x3e>; + mediatek,portdisable = <0x2a>; +}; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4c.dts b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4c.dts index f459ae0358..4389a9daf4 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4c.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4c.dts @@ -1,55 +1,31 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "mt7628an.dtsi" - -#include -#include +#include "mt7628an_xiaomi_mi-router-4.dtsi" / { compatible = "xiaomi,mi-router-4c", "mediatek,mt7628an-soc"; model = "Xiaomi Mi Router 4C"; aliases { - led-boot = &led_power_yellow; - led-failsafe = &led_power_yellow; - led-running = &led_power_blue; - led-upgrade = &led_power_yellow; label-mac-device = ðernet; }; - - chosen { - bootargs = "console=ttyS0,115200"; - }; - - leds { - compatible = "gpio-leds"; - - led_power_blue: power_blue { - label = "blue:power"; - gpios = <&gpio 11 GPIO_ACTIVE_LOW>; - }; - - led_power_yellow: power_yellow { - label = "yellow:power"; - gpios = <&gpio 44 GPIO_ACTIVE_LOW>; - }; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - gpios = <&gpio 38 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; }; -&state_default { - gpio { - groups = "gpio", "wdt", "wled_an"; - function = "gpio"; +&flash0 { + spi-max-frequency = <40000000>; +}; + +&partitions { + partition@60000 { + label = "overlay"; + reg = <0x60000 0x100000>; + read-only; + }; + + partition@160000 { + label = "firmware"; + reg = <0x160000 0xea0000>; + compatible = "denx,uimage"; }; }; @@ -61,73 +37,11 @@ status = "disabled"; }; -&esw { - mediatek,portmap = <0x3d>; - mediatek,portdisable = <0x29>; -}; - -&wmac { - status = "okay"; -}; - ðernet { mtd-mac-address = <&factory 0x28>; }; -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <40000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "bootloader"; - reg = <0x0 0x20000>; - read-only; - }; - - partition@20000 { - label = "config"; - reg = <0x20000 0x10000>; - read-only; - }; - - factory: partition@30000 { - label = "factory"; - reg = <0x30000 0x10000>; - read-only; - }; - - partition@40000 { - label = "crash"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - label = "cfg_bak"; - reg = <0x50000 0x10000>; - read-only; - }; - - partition@60000 { - label = "overlay"; - reg = <0x60000 0x100000>; - read-only; - }; - - partition@160000 { - label = "firmware"; - reg = <0x160000 0xea0000>; - compatible = "denx,uimage"; - }; - }; - }; +&esw { + mediatek,portmap = <0x3d>; + mediatek,portdisable = <0x29>; }; diff --git a/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts b/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts index 47e4b429a9..5e92cd2126 100644 --- a/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts +++ b/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts @@ -167,14 +167,6 @@ }; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - ðernet { mtd-mac-address = <&factory 0x4>; }; diff --git a/target/linux/ramips/dts/rt5350_allnet_all5003.dts b/target/linux/ramips/dts/rt5350_allnet_all5003.dts index 335a85dc00..96dde0fbf1 100644 --- a/target/linux/ramips/dts/rt5350_allnet_all5003.dts +++ b/target/linux/ramips/dts/rt5350_allnet_all5003.dts @@ -101,11 +101,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi b/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi index 07e088652c..80965a48b8 100644 --- a/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi +++ b/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi @@ -61,11 +61,3 @@ &esw { mediatek,portmap = <0x3f>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_dlink_dcs-930l-b1.dts b/target/linux/ramips/dts/rt5350_dlink_dcs-930l-b1.dts index fcff567885..58a8407301 100644 --- a/target/linux/ramips/dts/rt5350_dlink_dcs-930l-b1.dts +++ b/target/linux/ramips/dts/rt5350_dlink_dcs-930l-b1.dts @@ -104,11 +104,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_dlink_dir-320-b1.dts b/target/linux/ramips/dts/rt5350_dlink_dir-320-b1.dts index bc3e431982..7d9bb0e359 100644 --- a/target/linux/ramips/dts/rt5350_dlink_dir-320-b1.dts +++ b/target/linux/ramips/dts/rt5350_dlink_dir-320-b1.dts @@ -127,11 +127,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts b/target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts index 336073f155..43769eeb62 100644 --- a/target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts +++ b/target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts @@ -64,14 +64,6 @@ mediatek,portmap = <0x2f>; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; diff --git a/target/linux/ramips/dts/rt5350_hame_mpr-a1.dts b/target/linux/ramips/dts/rt5350_hame_mpr-a1.dts index 2635134348..5054a8c211 100644 --- a/target/linux/ramips/dts/rt5350_hame_mpr-a1.dts +++ b/target/linux/ramips/dts/rt5350_hame_mpr-a1.dts @@ -119,11 +119,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_hame_mpr-a2.dts b/target/linux/ramips/dts/rt5350_hame_mpr-a2.dts index 500f6ebd01..f9365d5700 100644 --- a/target/linux/ramips/dts/rt5350_hame_mpr-a2.dts +++ b/target/linux/ramips/dts/rt5350_hame_mpr-a2.dts @@ -116,11 +116,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts b/target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts index 432110b875..83b1fb2a6d 100644 --- a/target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts +++ b/target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts @@ -109,11 +109,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts b/target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts index 9d4de243aa..543fda74b7 100644 --- a/target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts +++ b/target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts @@ -106,11 +106,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_intenso_memory2move.dts b/target/linux/ramips/dts/rt5350_intenso_memory2move.dts index 769aec6a50..8ab2a87304 100644 --- a/target/linux/ramips/dts/rt5350_intenso_memory2move.dts +++ b/target/linux/ramips/dts/rt5350_intenso_memory2move.dts @@ -105,14 +105,6 @@ mediatek,portmap = <0x2f>; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; diff --git a/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi b/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi index dbe925508a..540fd253eb 100644 --- a/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi +++ b/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi @@ -32,11 +32,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi b/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi index b837d5c67c..2459c6b65b 100644 --- a/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi +++ b/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi @@ -139,11 +139,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi b/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi index 3d1968a03c..902cc6e522 100644 --- a/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi +++ b/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi @@ -78,14 +78,6 @@ ralink,led-polarity = <1>; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - &i2c { status = "okay"; }; diff --git a/target/linux/ramips/dts/rt5350_omnima_miniembplug.dts b/target/linux/ramips/dts/rt5350_omnima_miniembplug.dts index b5583eb892..499b555da4 100644 --- a/target/linux/ramips/dts/rt5350_omnima_miniembplug.dts +++ b/target/linux/ramips/dts/rt5350_omnima_miniembplug.dts @@ -111,11 +111,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_poray_m3.dts b/target/linux/ramips/dts/rt5350_poray_m3.dts index 1fc4959639..b6bad0ab77 100644 --- a/target/linux/ramips/dts/rt5350_poray_m3.dts +++ b/target/linux/ramips/dts/rt5350_poray_m3.dts @@ -102,11 +102,3 @@ ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_poray_m4.dtsi b/target/linux/ramips/dts/rt5350_poray_m4.dtsi index c4ca6ab6cd..9b36961ffb 100644 --- a/target/linux/ramips/dts/rt5350_poray_m4.dtsi +++ b/target/linux/ramips/dts/rt5350_poray_m4.dtsi @@ -54,11 +54,3 @@ ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_poray_x5.dts b/target/linux/ramips/dts/rt5350_poray_x5.dts index bbc1c14e65..9c00da82ed 100644 --- a/target/linux/ramips/dts/rt5350_poray_x5.dts +++ b/target/linux/ramips/dts/rt5350_poray_x5.dts @@ -134,11 +134,3 @@ ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_poray_x8.dts b/target/linux/ramips/dts/rt5350_poray_x8.dts index b36dd46f57..b60bb99ee9 100644 --- a/target/linux/ramips/dts/rt5350_poray_x8.dts +++ b/target/linux/ramips/dts/rt5350_poray_x8.dts @@ -95,11 +95,3 @@ ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_tenda_3g150b.dts b/target/linux/ramips/dts/rt5350_tenda_3g150b.dts index 9bfa793646..a20cd04a26 100644 --- a/target/linux/ramips/dts/rt5350_tenda_3g150b.dts +++ b/target/linux/ramips/dts/rt5350_tenda_3g150b.dts @@ -116,11 +116,3 @@ ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts b/target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts index 11765f10c6..13d1a16741 100644 --- a/target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts +++ b/target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts @@ -115,11 +115,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts b/target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts index 42e6dcfb4e..2173ec4fba 100644 --- a/target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts +++ b/target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts @@ -121,11 +121,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi b/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi index a905e023cb..0c82919669 100644 --- a/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi +++ b/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi @@ -184,14 +184,6 @@ ralink,mtd-eeprom = <&factory 0x0>; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - &spi1 { status = "okay"; diff --git a/target/linux/ramips/dts/rt5350_wansview_ncs601w.dts b/target/linux/ramips/dts/rt5350_wansview_ncs601w.dts index c6eced34ba..adb4034e8a 100644 --- a/target/linux/ramips/dts/rt5350_wansview_ncs601w.dts +++ b/target/linux/ramips/dts/rt5350_wansview_ncs601w.dts @@ -63,11 +63,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts b/target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts index 9a2c0a606c..314c4091a4 100644 --- a/target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts +++ b/target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts @@ -144,11 +144,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 40cfe6f121..fe83e69caa 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -1191,13 +1191,7 @@ define Device/xiaomi-ac2100 uboot-envtools endef -define Device/xiaomi_mi-router-ac2100 - $(Device/xiaomi-ac2100) - DEVICE_MODEL := Mi Router AC2100 -endef -TARGET_DEVICES += xiaomi_mi-router-ac2100 - -define Device/xiaomi_mir3g +define Device/xiaomi_mi-router-3g $(Device/dsa-migration) $(Device/uimage-lzma-loader) BLOCKSIZE := 128k @@ -1211,14 +1205,13 @@ define Device/xiaomi_mir3g IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata DEVICE_VENDOR := Xiaomi DEVICE_MODEL := Mi Router 3G - SUPPORTED_DEVICES += R3G - SUPPORTED_DEVICES += mir3g DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \ kmod-usb-ledtrig-usbport uboot-envtools + SUPPORTED_DEVICES += R3G mir3g xiaomi,mir3g endef -TARGET_DEVICES += xiaomi_mir3g +TARGET_DEVICES += xiaomi_mi-router-3g -define Device/xiaomi_mir3g-v2 +define Device/xiaomi_mi-router-3g-v2 $(Device/dsa-migration) $(Device/uimage-lzma-loader) IMAGE_SIZE := 14848k @@ -1226,10 +1219,11 @@ define Device/xiaomi_mir3g-v2 DEVICE_MODEL := Mi Router 3G DEVICE_VARIANT := v2 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 + SUPPORTED_DEVICES += xiaomi,mir3g-v2 endef -TARGET_DEVICES += xiaomi_mir3g-v2 +TARGET_DEVICES += xiaomi_mi-router-3g-v2 -define Device/xiaomi_mir3p +define Device/xiaomi_mi-router-3-pro $(Device/dsa-migration) $(Device/uimage-lzma-loader) BLOCKSIZE := 128k @@ -1245,8 +1239,9 @@ define Device/xiaomi_mir3p check-size DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3 \ kmod-usb-ledtrig-usbport uboot-envtools + SUPPORTED_DEVICES += xiaomi,mir3p endef -TARGET_DEVICES += xiaomi_mir3p +TARGET_DEVICES += xiaomi_mi-router-3-pro define Device/xiaomi_mi-router-4a-gigabit $(Device/dsa-migration) @@ -1259,6 +1254,12 @@ define Device/xiaomi_mi-router-4a-gigabit endef TARGET_DEVICES += xiaomi_mi-router-4a-gigabit +define Device/xiaomi_mi-router-ac2100 + $(Device/xiaomi-ac2100) + DEVICE_MODEL := Mi Router AC2100 +endef +TARGET_DEVICES += xiaomi_mi-router-ac2100 + define Device/xiaomi_redmi-router-ac2100 $(Device/xiaomi-ac2100) DEVICE_MODEL := Redmi Router AC2100 diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index edd42a4dd5..00593dd6f5 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -743,14 +743,15 @@ define Device/wrtnode_wrtnode2r endef TARGET_DEVICES += wrtnode_wrtnode2r -define Device/xiaomi_mir4a-100m +define Device/xiaomi_mi-router-4a-100m IMAGE_SIZE := 14976k DEVICE_VENDOR := Xiaomi DEVICE_MODEL := Mi Router 4A DEVICE_VARIANT := 100M Edition DEVICE_PACKAGES := kmod-mt76x2 + SUPPORTED_DEVICES += xiaomi,mir4a-100m endef -TARGET_DEVICES += xiaomi_mir4a-100m +TARGET_DEVICES += xiaomi_mi-router-4a-100m define Device/xiaomi_mi-router-4c IMAGE_SIZE := 14976k diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index fccd9c6985..c5b35145f1 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -16,8 +16,8 @@ ramips_setup_interfaces() asiarf,ap7621-nv1|\ lenovo,newifi-d1|\ mikrotik,routerboard-m33g|\ - xiaomi,mir3g|\ - xiaomi,mir3g-v2|\ + xiaomi,mi-router-3g|\ + xiaomi,mi-router-3g-v2|\ xiaomi,mi-router-4a-gigabit) ucidef_set_interfaces_lan_wan "lan1 lan2" "wan" ;; @@ -33,8 +33,8 @@ ramips_setup_interfaces() ;; gehua,ghl-r-001|\ hiwifi,hc5962|\ + xiaomi,mi-router-3-pro|\ xiaomi,mi-router-ac2100|\ - xiaomi,mir3p|\ xiaomi,redmi-router-ac2100) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" ;; diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index b4d07f8146..c68b012d0b 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -61,9 +61,9 @@ platform_do_upgrade() { netgear,wac104|\ netgear,wac124|\ netis,wf2881|\ + xiaomi,mi-router-3g|\ + xiaomi,mi-router-3-pro|\ xiaomi,mi-router-ac2100|\ - xiaomi,mir3g|\ - xiaomi,mir3p|\ xiaomi,redmi-router-ac2100) nand_do_upgrade "$1" ;; 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 6f0078c70a..fcc2630b3f 100755 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -133,7 +133,7 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:wan" "3:lan" "4:lan" "6@eth0" ;; - xiaomi,mir4a-100m) + xiaomi,mi-router-4a-100m) ucidef_add_switch "switch0" \ "4:lan:1" "2:lan:2" "0:wan" "6@eth0" ;; @@ -238,8 +238,8 @@ ramips_setup_macs() label_mac=$(mtd_get_mac_binary factory 0x4) wan_mac=$(mtd_get_mac_binary factory 0x28) ;; - xiaomi,mi-router-4c|\ - xiaomi,mir4a-100m) + xiaomi,mi-router-4a-100m|\ + xiaomi,mi-router-4c) wan_mac=$(mtd_get_mac_binary factory 0x4) ;; esac diff --git a/target/linux/realtek/files-5.4/drivers/gpio/gpio-rtl838x.c b/target/linux/realtek/files-5.4/drivers/gpio/gpio-rtl838x.c index 92cf5f765a..8207e4bb73 100644 --- a/target/linux/realtek/files-5.4/drivers/gpio/gpio-rtl838x.c +++ b/target/linux/realtek/files-5.4/drivers/gpio/gpio-rtl838x.c @@ -357,7 +357,7 @@ static int rtl838x_gpio_probe(struct platform_device *pdev) } if (soc_info.family == RTL8380_FAMILY_ID) { - gpios->led_glb_ctrl = gpios->led_glb_ctrl; + gpios->led_glb_ctrl = RTL838X_LED_GLB_CTRL; gpios->led_sw_ctrl = RTL838X_LED_SW_CTRL; gpios->led_sw_p_ctrl = rtl838x_led_sw_p_ctrl; gpios->led_sw_p_en_ctrl = rtl838x_led_sw_p_en_ctrl; diff --git a/target/linux/realtek/files-5.4/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-5.4/drivers/net/ethernet/rtl838x_eth.c index d53d5dec12..fec842674e 100644 --- a/target/linux/realtek/files-5.4/drivers/net/ethernet/rtl838x_eth.c +++ b/target/linux/realtek/files-5.4/drivers/net/ethernet/rtl838x_eth.c @@ -986,6 +986,7 @@ static int rtl838x_mac_pcs_get_state(struct phylink_config *config, case 1: state->speed = SPEED_100; break; + case 2: state->speed = SPEED_1000; break; default: diff --git a/target/linux/realtek/patches-5.4/703-include-linux-add-phy-ops-for-rtl838x.patch b/target/linux/realtek/patches-5.4/703-include-linux-add-phy-ops-for-rtl838x.patch index c61b5f6fff..03accd1e07 100644 --- a/target/linux/realtek/patches-5.4/703-include-linux-add-phy-ops-for-rtl838x.patch +++ b/target/linux/realtek/patches-5.4/703-include-linux-add-phy-ops-for-rtl838x.patch @@ -1,6 +1,6 @@ --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -650,6 +650,10 @@ struct phy_driver { +@@ -644,6 +644,10 @@ struct phy_driver { struct ethtool_tunable *tuna, const void *data); int (*set_loopback)(struct phy_device *dev, bool enable); diff --git a/toolchain/glibc/common.mk b/toolchain/glibc/common.mk index fbaad9d3ac..faf749eea3 100644 --- a/toolchain/glibc/common.mk +++ b/toolchain/glibc/common.mk @@ -12,8 +12,8 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=5c36293f067d2af16e4eb9f9465be36f346ea6d0 -PKG_MIRROR_HASH:=f01b467843af97fe29dd67d0dc52e8f2effc968258ae806af37be085239a3e4c +PKG_SOURCE_VERSION:=050022910be1d1f5c11cd5168f1685ad4f9580d2 +PKG_MIRROR_HASH:=b0a8c79acbb371badcc8477e840ab32bf796d5e7a0eab224bc8fd5aca6b1e631 PKG_SOURCE_URL:=https://sourceware.org/git/glibc.git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index 81c62d977a..9a68b80c71 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME := firmware-utils -PKG_RELEASE := 5 +PKG_RELEASE := 7 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/kernel.mk diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c index cb3cf69948..ce07a95574 100644 --- a/tools/firmware-utils/src/tplink-safeloader.c +++ b/tools/firmware-utils/src/tplink-safeloader.c @@ -70,12 +70,22 @@ struct flash_partition_entry { uint32_t size; }; +/** Partition trailing padding definitions + * Values 0x00 to 0xff are reserved to indicate the padding value + * Values from 0x100 are reserved to indicate other behaviour */ +enum partition_trail_value { + PART_TRAIL_00 = 0x00, + PART_TRAIL_FF = 0xff, + PART_TRAIL_MAX = 0xff, + PART_TRAIL_NONE = 0x100 +}; + /** Firmware layout description */ struct device_info { const char *id; const char *vendor; const char *support_list; - char support_trail; + enum partition_trail_value part_trail; const char *soft_ver; uint32_t soft_ver_compat_level; struct flash_partition_entry partitions[MAX_PARTITIONS+1]; @@ -83,10 +93,13 @@ struct device_info { const char *last_sysupgrade_partition; }; +struct __attribute__((__packed__)) meta_header { + uint32_t length; + uint32_t zero; +}; + /** The content of the soft-version structure */ struct __attribute__((__packed__)) soft_version { - uint32_t data_len; - uint32_t zero; uint8_t pad1; uint8_t version_major; uint8_t version_minor; @@ -96,6 +109,7 @@ struct __attribute__((__packed__)) soft_version { uint8_t month; uint8_t day; uint32_t rev; + uint32_t compat_level; }; @@ -131,7 +145,7 @@ static struct device_info boards[] = { "CPE220(TP-LINK|UN|N300-2):1.1\r\n" "CPE220(TP-LINK|US|N300-2):1.1\r\n" "CPE220(TP-LINK|EU|N300-2):1.1\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -171,7 +185,7 @@ static struct device_info boards[] = { "CPE210(TP-LINK|UN|N300-2):2.0\r\n" "CPE210(TP-LINK|EU|N300-2):2.0\r\n" "CPE210(TP-LINK|US|N300-2):2.0\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -213,7 +227,7 @@ static struct device_info boards[] = { "CPE210(TP-LINK|EU|N300-2|45550000):3.20\r\n" "CPE210(TP-LINK|UN|N300-2|00000000):3.20\r\n" "CPE210(TP-LINK|US|N300-2|55530000):3.20\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -254,7 +268,7 @@ static struct device_info boards[] = { "CPE220(TP-LINK|UN|N300-2):2.0\r\n" "CPE220(TP-LINK|EU|N300-2):2.0\r\n" "CPE220(TP-LINK|US|N300-2):2.0\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -294,7 +308,7 @@ static struct device_info boards[] = { "CPE220(TP-LINK|UN|N300-2):3.0\r\n" "CPE220(TP-LINK|EU|N300-2):3.0\r\n" "CPE220(TP-LINK|US|N300-2):3.0\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -333,7 +347,7 @@ static struct device_info boards[] = { "CPE520(TP-LINK|UN|N300-5):1.1\r\n" "CPE520(TP-LINK|US|N300-5):1.1\r\n" "CPE520(TP-LINK|EU|N300-5):1.1\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -375,7 +389,7 @@ static struct device_info boards[] = { "CPE510(TP-LINK|UN|N300-5):2.0\r\n" "CPE510(TP-LINK|EU|N300-5):2.0\r\n" "CPE510(TP-LINK|US|N300-5):2.0\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -417,7 +431,7 @@ static struct device_info boards[] = { "CPE510(TP-LINK|UN|N300-5):3.0\r\n" "CPE510(TP-LINK|EU|N300-5):3.0\r\n" "CPE510(TP-LINK|US|N300-5):3.0\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -457,7 +471,7 @@ static struct device_info boards[] = { "CPE610(TP-LINK|UN|N300-5):1.0\r\n" "CPE610(TP-LINK|EU|N300-5):1.0\r\n" "CPE610(TP-LINK|US|N300-5):1.0\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -497,7 +511,7 @@ static struct device_info boards[] = { "CPE610(TP-LINK|UN|N300-5):2.0\r\n" "CPE610(TP-LINK|EU|N300-5):2.0\r\n" "CPE610(TP-LINK|US|N300-5):2.0\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -529,7 +543,7 @@ static struct device_info boards[] = { "WBS210(TP-LINK|UN|N300-2):1.20\r\n" "WBS210(TP-LINK|US|N300-2):1.20\r\n" "WBS210(TP-LINK|EU|N300-2):1.20\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -561,7 +575,7 @@ static struct device_info boards[] = { "WBS210(TP-LINK|UN|N300-2|00000000):2.0\r\n" "WBS210(TP-LINK|US|N300-2|55530000):2.0\r\n" "WBS210(TP-LINK|EU|N300-2|45550000):2.0\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -594,7 +608,7 @@ static struct device_info boards[] = { "WBS510(TP-LINK|US|N300-5):1.20\r\n" "WBS510(TP-LINK|EU|N300-5):1.20\r\n" "WBS510(TP-LINK|CA|N300-5):1.20\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -627,7 +641,7 @@ static struct device_info boards[] = { "WBS510(TP-LINK|US|N300-5|55530000):2.0\r\n" "WBS510(TP-LINK|EU|N300-5|45550000):2.0\r\n" "WBS510(TP-LINK|CA|N300-5|43410000):2.0\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -658,7 +672,7 @@ static struct device_info boards[] = { .support_list = "SupportList:\r\n" "{product_name:Archer C2600,product_ver:1.0.0,special_id:00000000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /** @@ -709,7 +723,7 @@ static struct device_info boards[] = { "{product_name:Archer A7,product_ver:5.0.0,special_id:43410000}\n" "{product_name:Archer A7,product_ver:5.0.0,special_id:4A500000}\n" "{product_name:Archer A7,product_ver:5.0.0,special_id:54570000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:1.0.0\n", /* We're using a dynamic kernel/rootfs split here */ @@ -747,7 +761,7 @@ static struct device_info boards[] = { "{product_name:ArcherC2,product_ver:3.0.0,special_id:00000000}\n" "{product_name:ArcherC2,product_ver:3.0.0,special_id:55530000}\n" "{product_name:ArcherC2,product_ver:3.0.0,special_id:45550000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:3.0.1\n", /** We're using a dynamic kernel/rootfs split here */ @@ -785,7 +799,7 @@ static struct device_info boards[] = { "{product_name:ArcherC25,product_ver:1.0.0,special_id:00000000}\n" "{product_name:ArcherC25,product_ver:1.0.0,special_id:55530000}\n" "{product_name:ArcherC25,product_ver:1.0.0,special_id:45550000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:1.0.0\n", /* We're using a dynamic kernel/rootfs split here */ @@ -824,7 +838,7 @@ static struct device_info boards[] = { "{product_name:Archer C58,product_ver:1.0.0,special_id:00000000}\r\n" "{product_name:Archer C58,product_ver:1.0.0,special_id:45550000}\r\n" "{product_name:Archer C58,product_ver:1.0.0,special_id:55530000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:1.0.0\n", .partitions = { @@ -859,7 +873,7 @@ static struct device_info boards[] = { "{product_name:Archer C59,product_ver:1.0.0,special_id:45550000}\r\n" "{product_name:Archer C59,product_ver:1.0.0,special_id:52550000}\r\n" "{product_name:Archer C59,product_ver:1.0.0,special_id:55530000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:1.0.0\n", /* We're using a dynamic kernel/rootfs split here */ @@ -897,7 +911,7 @@ static struct device_info boards[] = { "{product_name:Archer C59,product_ver:2.0.0,special_id:00000000}\r\n" "{product_name:Archer C59,product_ver:2.0.0,special_id:45550000}\r\n" "{product_name:Archer C59,product_ver:2.0.0,special_id:55530000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:2.0.0 Build 20161206 rel.7303\n", /** We're using a dynamic kernel/rootfs split here */ @@ -937,7 +951,7 @@ static struct device_info boards[] = { "{product_name:Archer C6,product_ver:2.0.0,special_id:45550000}\r\n" "{product_name:Archer C6,product_ver:2.0.0,special_id:52550000}\r\n" "{product_name:Archer C6,product_ver:2.0.0,special_id:4A500000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:1.9.1\n", .partitions = { @@ -972,7 +986,7 @@ static struct device_info boards[] = { "{product_name:Archer A6,product_ver:2.0.0,special_id:55530000}\n" "{product_name:Archer A6,product_ver:2.0.0,special_id:54570000}\n" "{product_name:Archer C6,product_ver:2.0.0,special_id:55530000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:1.9.1\n", .partitions = { @@ -1007,7 +1021,7 @@ static struct device_info boards[] = { "{product_name:Archer C60,product_ver:1.0.0,special_id:00000000}\r\n" "{product_name:Archer C60,product_ver:1.0.0,special_id:45550000}\r\n" "{product_name:Archer C60,product_ver:1.0.0,special_id:55530000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:1.0.0\n", .partitions = { @@ -1041,7 +1055,7 @@ static struct device_info boards[] = { "{product_name:Archer C60,product_ver:2.0.0,special_id:42520000}\r\n" "{product_name:Archer C60,product_ver:2.0.0,special_id:45550000}\r\n" "{product_name:Archer C60,product_ver:2.0.0,special_id:55530000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:2.0.0\n", .partitions = { @@ -1077,7 +1091,7 @@ static struct device_info boards[] = { "{product_name:Archer C60,product_ver:3.0.0,special_id:42520000}\r\n" "{product_name:Archer C60,product_ver:3.0.0,special_id:45550000}\r\n" "{product_name:Archer C60,product_ver:3.0.0,special_id:55530000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:3.0.0\n", .partitions = { @@ -1113,7 +1127,7 @@ static struct device_info boards[] = { "{product_name:ArcherC5,product_ver:2.0.0,special_id:00000000}\r\n" "{product_name:ArcherC5,product_ver:2.0.0,special_id:55530000}\r\n" "{product_name:ArcherC5,product_ver:2.0.0,special_id:4A500000}\r\n", /* JP version */ - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, .partitions = { @@ -1154,7 +1168,7 @@ static struct device_info boards[] = { "{product_name:Archer C7,product_ver:4.0.0,special_id:54570000}\n" "{product_name:Archer C7,product_ver:4.0.0,special_id:55530000}\n" "{product_name:Archer C7,product_ver:4.0.0,special_id:43410000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:1.0.0\n", /* We're using a dynamic kernel/rootfs split here */ @@ -1199,7 +1213,7 @@ static struct device_info boards[] = { "{product_name:Archer C7,product_ver:5.0.0,special_id:52550000}\n" "{product_name:Archer C7,product_ver:5.0.0,special_id:4B520000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:1.0.0\n", /* We're using a dynamic kernel/rootfs split here */ @@ -1242,7 +1256,7 @@ static struct device_info boards[] = { "{product_name:ArcherC9," "product_ver:1.0.0," "special_id:00000000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, .partitions = { @@ -1275,7 +1289,7 @@ static struct device_info boards[] = { .support_list = "SupportList:\r\n" "EAP120(TP-LINK|UN|N300-2):1.0\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -1304,7 +1318,7 @@ static struct device_info boards[] = { .support_list = "SupportList:\r\n" "EAP225-Outdoor(TP-Link|UN|AC1200-D):1.0\r\n", - .support_trail = '\xff', + .part_trail = PART_TRAIL_NONE, .soft_ver = NULL, .soft_ver_compat_level = 1, @@ -1333,7 +1347,7 @@ static struct device_info boards[] = { .support_list = "SupportList:\r\n" "EAP225(TP-Link|UN|AC1350-D):3.0\r\n", - .support_trail = '\xff', + .part_trail = PART_TRAIL_NONE, .soft_ver = NULL, .soft_ver_compat_level = 1, @@ -1362,7 +1376,7 @@ static struct device_info boards[] = { .support_list = "SupportList:\r\n" "EAP225-Wall(TP-Link|UN|AC1200-D):2.0\r\n", - .support_trail = '\xff', + .part_trail = PART_TRAIL_NONE, .soft_ver = NULL, .soft_ver_compat_level = 1, @@ -1391,7 +1405,7 @@ static struct device_info boards[] = { .support_list = "SupportList:\r\n" "EAP245(TP-LINK|UN|AC1750-D):1.0\r\n", - .support_trail = '\xff', + .part_trail = PART_TRAIL_NONE, .soft_ver = NULL, .partitions = { @@ -1417,7 +1431,7 @@ static struct device_info boards[] = { .support_list = "SupportList:\r\n" "EAP245(TP-Link|UN|AC1750-D):3.0\r\n", - .support_trail = '\xff', + .part_trail = PART_TRAIL_NONE, .soft_ver = NULL, .soft_ver_compat_level = 1, @@ -1459,7 +1473,7 @@ static struct device_info boards[] = { "{product_name:TL-WA850RE,product_ver:2.0.0,special_id:43410000}\n" "{product_name:TL-WA850RE,product_ver:2.0.0,special_id:41550000}\n" "{product_name:TL-WA850RE,product_ver:2.0.0,special_id:52550000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /** @@ -1501,7 +1515,7 @@ static struct device_info boards[] = { "{product_name:TL-WA855RE,product_ver:1.0.0,special_id:43410000}\n" "{product_name:TL-WA855RE,product_ver:1.0.0,special_id:41550000}\n" "{product_name:TL-WA855RE,product_ver:1.0.0,special_id:52550000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, .partitions = { @@ -1532,7 +1546,7 @@ static struct device_info boards[] = { .support_list = "SupportList:\n" "{product_name:TL-WPA8630P,product_ver:2.0.0,special_id:45550000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, .partitions = { @@ -1569,7 +1583,7 @@ static struct device_info boards[] = { "{product_name:TL-WPA8630P,product_ver:2.0.0,special_id:41550000}\n" "{product_name:TL-WPA8630P,product_ver:2.0.0,special_id:44450000}\n" "{product_name:TL-WPA8630P,product_ver:2.1.0,special_id:41550000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, .partitions = { @@ -1604,7 +1618,7 @@ static struct device_info boards[] = { .support_list = "SupportList:\n" "{product_name:TL-WPA8630P,product_ver:2.1.0,special_id:45550000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, .partitions = { @@ -1640,7 +1654,7 @@ static struct device_info boards[] = { "SupportList:\n" "{product_name:TL-WR1043N,product_ver:5.0.0,special_id:45550000}\n" "{product_name:TL-WR1043N,product_ver:5.0.0,special_id:55530000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:1.0.0\n", .partitions = { {"factory-boot", 0x00000, 0x20000}, @@ -1674,7 +1688,7 @@ static struct device_info boards[] = { .support_list = "SupportList:\n" "{product_name:TL-WR1043ND,product_ver:4.0.0,special_id:45550000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /* We're using a dynamic kernel/rootfs split here */ @@ -1707,7 +1721,7 @@ static struct device_info boards[] = { "SupportList:\n" "{product_name:TL-WR902AC,product_ver:1.0.0,special_id:45550000}\n" "{product_name:TL-WR902AC,product_ver:1.0.0,special_id:55530000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /** @@ -1743,7 +1757,7 @@ static struct device_info boards[] = { "SupportList:\r\n" "{product_name:TL-WR942N,product_ver:1.0.0,special_id:00000000}\r\n" "{product_name:TL-WR942N,product_ver:1.0.0,special_id:52550000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, .partitions = { @@ -1790,7 +1804,7 @@ static struct device_info boards[] = { "{product_name:RE200,product_ver:2.0.0,special_id:52550000}\n" "{product_name:RE200,product_ver:2.0.0,special_id:54570000}\n" "{product_name:RE200,product_ver:2.0.0,special_id:55530000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, .partitions = { @@ -1834,7 +1848,7 @@ static struct device_info boards[] = { "{product_name:RE200,product_ver:3.0.0,special_id:52550000}\n" "{product_name:RE200,product_ver:3.0.0,special_id:54570000}\n" "{product_name:RE200,product_ver:3.0.0,special_id:55530000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, .partitions = { @@ -1878,7 +1892,7 @@ static struct device_info boards[] = { "{product_name:RE200,product_ver:4.0.0,special_id:45530000}\n" "{product_name:RE200,product_ver:4.0.0,special_id:49440000}\n" "{product_name:RE200,product_ver:4.0.0,special_id:45470000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:1.1.0\n", .partitions = { @@ -1921,7 +1935,7 @@ static struct device_info boards[] = { "{product_name:RE220,product_ver:2.0.0,special_id:52550000}\n" "{product_name:RE220,product_ver:2.0.0,special_id:54570000}\n" "{product_name:RE220,product_ver:2.0.0,special_id:55530000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, .partitions = { @@ -1958,7 +1972,7 @@ static struct device_info boards[] = { "{product_name:RE305,product_ver:1.0.0,special_id:4b520000}\n" "{product_name:RE305,product_ver:1.0.0,special_id:41550000}\n" "{product_name:RE305,product_ver:1.0.0,special_id:43410000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, .partitions = { @@ -1994,7 +2008,7 @@ static struct device_info boards[] = { "{product_name:RE350,product_ver:1.0.0,special_id:43410000}\n" "{product_name:RE350,product_ver:1.0.0,special_id:4b520000}\n" "{product_name:RE350,product_ver:1.0.0,special_id:4a500000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /** We're using a dynamic kernel/rootfs split here */ @@ -2025,7 +2039,7 @@ static struct device_info boards[] = { .support_list = "SupportList:\n" "{product_name:RE350K,product_ver:1.0.0,special_id:00000000,product_region:US}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /** We're using a dynamic kernel/rootfs split here */ @@ -2064,7 +2078,7 @@ static struct device_info boards[] = { "{product_name:RE355,product_ver:1.0.0,special_id:41550000}\r\n" "{product_name:RE355,product_ver:1.0.0,special_id:4B520000}\r\n" "{product_name:RE355,product_ver:1.0.0,special_id:55534100}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /* We're using a dynamic kernel/rootfs split here */ @@ -2102,7 +2116,7 @@ static struct device_info boards[] = { "{product_name:RE450,product_ver:1.0.0,special_id:41550000}\r\n" "{product_name:RE450,product_ver:1.0.0,special_id:4B520000}\r\n" "{product_name:RE450,product_ver:1.0.0,special_id:55534100}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /** We're using a dynamic kernel/rootfs split here */ @@ -2141,7 +2155,7 @@ static struct device_info boards[] = { "{product_name:RE450,product_ver:2.0.0,special_id:41530000}\r\n" "{product_name:RE450,product_ver:2.0.0,special_id:4B520000}\r\n" "{product_name:RE450,product_ver:2.0.0,special_id:42520000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /* We're using a dynamic kernel/rootfs split here */ @@ -2180,7 +2194,7 @@ static struct device_info boards[] = { "{product_name:RE450,product_ver:3.0.0,special_id:41530000}\r\n" "{product_name:RE450,product_ver:3.0.0,special_id:4B520000}\r\n" "{product_name:RE450,product_ver:3.0.0,special_id:42520000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /* We're using a dynamic kernel/rootfs split here */ @@ -2218,7 +2232,7 @@ static struct device_info boards[] = { "{product_name:RE500,product_ver:1.0.0,special_id:43410000}\r\n" "{product_name:RE500,product_ver:1.0.0,special_id:41550000}\r\n" "{product_name:RE500,product_ver:1.0.0,special_id:41530000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /* We're using a dynamic kernel/rootfs split here */ @@ -2255,7 +2269,7 @@ static struct device_info boards[] = { "{product_name:RE650,product_ver:1.0.0,special_id:43410000}\r\n" "{product_name:RE650,product_ver:1.0.0,special_id:41550000}\r\n" "{product_name:RE650,product_ver:1.0.0,special_id:41530000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /* We're using a dynamic kernel/rootfs split here */ @@ -2299,6 +2313,44 @@ static inline void put32(uint8_t *buf, uint32_t val) { buf[3] = val; } +static inline bool meta_partition_should_pad(enum partition_trail_value pv) +{ + return (pv >= 0) && (pv <= PART_TRAIL_MAX); +} + +/** Allocate a padded meta partition with a correctly initialised header + * If the `data` pointer is NULL, then the required space is only allocated, + * otherwise `data_len` bytes will be copied from `data` into the partition + * entry. */ +static struct image_partition_entry init_meta_partition_entry( + const char *name, const void *data, uint32_t data_len, + enum partition_trail_value pad_value) +{ + uint32_t total_len = sizeof(struct meta_header) + data_len; + if (meta_partition_should_pad(pad_value)) + total_len += 1; + + struct image_partition_entry entry = { + .name = name, + .size = total_len, + .data = malloc(total_len) + }; + if (!entry.data) + error(1, errno, "failed to allocate meta partition entry"); + + struct meta_header *header = (struct meta_header *)entry.data; + header->length = htonl(data_len); + header->zero = 0; + + if (data) + memcpy(entry.data+sizeof(*header), data, data_len); + + if (meta_partition_should_pad(pad_value)) + entry.data[total_len - 1] = (uint8_t) pad_value; + + return entry; +} + /** Allocates a new image partition */ static struct image_partition_entry alloc_image_partition(const char *name, size_t len) { struct image_partition_entry entry = {name, len, malloc(len)}; @@ -2364,14 +2416,16 @@ static inline uint8_t bcd(uint8_t v) { /** Generates the soft-version partition */ -static struct image_partition_entry make_soft_version(struct device_info *info, uint32_t rev) { - size_t part_len = sizeof(struct soft_version); - if (info->soft_ver_compat_level > 0) - part_len += sizeof(uint32_t); - - struct image_partition_entry entry = - alloc_image_partition("soft-version", part_len+1); - struct soft_version *s = (struct soft_version *)entry.data; +static struct image_partition_entry make_soft_version( + const struct device_info *info, uint32_t rev) +{ + /** If an info string is provided, use this instead of + * the structured data, and include the null-termination */ + if (info->soft_ver) { + uint32_t len = strlen(info->soft_ver) + 1; + return init_meta_partition_entry("soft-version", + info->soft_ver, len, info->part_trail); + } time_t t; @@ -2382,58 +2436,45 @@ static struct image_partition_entry make_soft_version(struct device_info *info, struct tm *tm = gmtime(&t); - /* Partition contents size, minus 8 byte header and trailing byte */ - s->data_len = htonl(entry.size-9); - s->zero = 0; - s->pad1 = 0xff; + struct soft_version s = { + .pad1 = 0xff, - s->version_major = 0; - s->version_minor = 0; - s->version_patch = 0; + .version_major = 0, + .version_minor = 0, + .version_patch = 0, - s->year_hi = bcd((1900+tm->tm_year)/100); - s->year_lo = bcd(tm->tm_year%100); - s->month = bcd(tm->tm_mon+1); - s->day = bcd(tm->tm_mday); - s->rev = htonl(rev); + .year_hi = bcd((1900+tm->tm_year)/100), + .year_lo = bcd(tm->tm_year%100), + .month = bcd(tm->tm_mon+1), + .day = bcd(tm->tm_mday), - if (info->soft_ver_compat_level > 0) - *(uint32_t *)(entry.data + sizeof(struct soft_version)) = - htonl(info->soft_ver_compat_level); + .compat_level = htonl(info->soft_ver_compat_level) + }; - entry.data[entry.size-1] = 0xff; - - return entry; -} - -static struct image_partition_entry make_soft_version_from_string(const char *soft_ver) { - /** String length _including_ the terminating zero byte */ - uint32_t ver_len = strlen(soft_ver) + 1; - /** Partition contains 64 bit header, the version string, and one additional null byte */ - size_t partition_len = 2*sizeof(uint32_t) + ver_len + 1; - struct image_partition_entry entry = alloc_image_partition("soft-version", partition_len); - - uint32_t *len = (uint32_t *)entry.data; - len[0] = htonl(ver_len); - len[1] = 0; - memcpy(&len[2], soft_ver, ver_len); - - entry.data[partition_len - 1] = 0; - - return entry; + if (info->soft_ver_compat_level == 0) + return init_meta_partition_entry("soft-version", &s, + (uint8_t *)(&s.compat_level) - (uint8_t *)(&s), + info->part_trail); + else + return init_meta_partition_entry("soft-version", &s, + sizeof(s), info->part_trail); } /** Generates the support-list partition */ -static struct image_partition_entry make_support_list(struct device_info *info) { - size_t len = strlen(info->support_list); - struct image_partition_entry entry = alloc_image_partition("support-list", len + 9); +static struct image_partition_entry make_support_list( + const struct device_info *info) +{ + uint32_t len = strlen(info->support_list); + return init_meta_partition_entry("support-list", info->support_list, + len, info->part_trail); +} - put32(entry.data, len); - memset(entry.data+4, 0, 4); - memcpy(entry.data+8, info->support_list, len); - entry.data[len+8] = info->support_trail; - - return entry; +/** Partition with extra-para data */ +static struct image_partition_entry make_extra_para( + const struct device_info *info, const uint8_t *extra_para, size_t len) +{ + return init_meta_partition_entry("extra-para", extra_para, len, + info->part_trail); } /** Creates a new image partition with an arbitrary name from a file */ @@ -2473,16 +2514,6 @@ static struct image_partition_entry read_file(const char *part_name, const char return entry; } -/** Creates a new image partition from arbitrary data */ -static struct image_partition_entry put_data(const char *part_name, const char *datain, size_t len) { - - struct image_partition_entry entry = alloc_image_partition(part_name, len); - - memcpy(entry.data, datain, len); - - return entry; -} - /** Copies a list of image partitions into an image buffer and generates the image partition table while doing so @@ -2710,36 +2741,33 @@ static void build_image(const char *output, } parts[0] = make_partition_table(info->partitions); - if (info->soft_ver) - parts[1] = make_soft_version_from_string(info->soft_ver); - else - parts[1] = make_soft_version(info, rev); - + parts[1] = make_soft_version(info, rev); parts[2] = make_support_list(info); parts[3] = read_file("os-image", kernel_image, false, NULL); parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof, file_system_partition); /* Some devices need the extra-para partition to accept the firmware */ - if (strcasecmp(info->id, "ARCHER-C2-V3") == 0 || + if (strcasecmp(info->id, "ARCHER-A7-V5") == 0 || + strcasecmp(info->id, "ARCHER-C2-V3") == 0 || + strcasecmp(info->id, "ARCHER-C7-V4") == 0 || + strcasecmp(info->id, "ARCHER-C7-V5") == 0 || strcasecmp(info->id, "ARCHER-C25-V1") == 0 || strcasecmp(info->id, "ARCHER-C59-V2") == 0 || strcasecmp(info->id, "ARCHER-C60-V2") == 0 || strcasecmp(info->id, "ARCHER-C60-V3") == 0 || strcasecmp(info->id, "TLWR1043NV5") == 0) { - const char mdat[11] = {0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00}; - parts[5] = put_data("extra-para", mdat, 11); - } else if (strcasecmp(info->id, "ARCHER-A7-V5") == 0 || strcasecmp(info->id, "ARCHER-C7-V4") == 0 || strcasecmp(info->id, "ARCHER-C7-V5") == 0) { - const char mdat[11] = {0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0xca, 0x00, 0x01, 0x00, 0x00}; - parts[5] = put_data("extra-para", mdat, 11); + const uint8_t extra_para[2] = {0x01, 0x00}; + parts[5] = make_extra_para(info, extra_para, + sizeof(extra_para)); } else if (strcasecmp(info->id, "ARCHER-C6-V2") == 0) { - const char mdat[11] = {0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00}; - parts[5] = put_data("extra-para", mdat, 11); - } else if (strcasecmp(info->id, "ARCHER-C6-V2-US") == 0) { - const char mdat[11] = {0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00}; - parts[5] = put_data("extra-para", mdat, 11); - } else if (strcasecmp(info->id, "EAP245-V3") == 0) { - const char mdat[10] = {0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01}; - parts[5] = put_data("extra-para", mdat, 10); + const uint8_t extra_para[2] = {0x00, 0x01}; + parts[5] = make_extra_para(info, extra_para, + sizeof(extra_para)); + } else if (strcasecmp(info->id, "ARCHER-C6-V2-US") == 0 || + strcasecmp(info->id, "EAP245-V3") == 0) { + const uint8_t extra_para[2] = {0x01, 0x01}; + parts[5] = make_extra_para(info, extra_para, + sizeof(extra_para)); } size_t len;