diff --git a/include/kernel-build.mk b/include/kernel-build.mk index 7108ee10f1..f1b3448f6d 100644 --- a/include/kernel-build.mk +++ b/include/kernel-build.mk @@ -157,7 +157,7 @@ define BuildKernel compile: $(LINUX_DIR)/.modules $(MAKE) -C image compile TARGET_BUILD= - oldconfig menuconfig nconfig: $(STAMP_PREPARED) $(STAMP_CHECKED) FORCE + oldconfig menuconfig nconfig xconfig: $(STAMP_PREPARED) $(STAMP_CHECKED) FORCE rm -f $(LINUX_DIR)/.config.prev rm -f $(STAMP_CONFIGURED) $(LINUX_RECONF_CMD) > $(LINUX_DIR)/.config diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 1aa025f576..f6c9c7b3d3 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -6,14 +6,14 @@ ifdef CONFIG_TESTING_KERNEL KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER) endif -LINUX_VERSION-4.9 = .229 -LINUX_VERSION-4.14 = .187 -LINUX_VERSION-4.19 = .131 +LINUX_VERSION-4.9 = .230 +LINUX_VERSION-4.14 = .188 +LINUX_VERSION-4.19 = .132 LINUX_VERSION-5.4 = .51 -LINUX_KERNEL_HASH-4.9.229 = 3256c2835fd95a1a739603e78b02d363eac2ce73a39fa19b13b32da4fc370fdc -LINUX_KERNEL_HASH-4.14.187 = 5b223475eaeea196aa7e127d3f253bca5c35d8afdc72ca75230ce1ecdd1454bd -LINUX_KERNEL_HASH-4.19.131 = 19dfb9f6cc4ba30104b65dcce7d78240a4ae188cb366747d5f8eae35e98964ba +LINUX_KERNEL_HASH-4.9.230 = d5ba9256e3ebf1cead127f323acc8124965d89cc88e75eca377fcca3bd6c037c +LINUX_KERNEL_HASH-4.14.188 = 766fe01387b1d1b7bd37ca45a5048cdad13e3a51c6c43746dbb657a0ba67064b +LINUX_KERNEL_HASH-4.19.132 = d7d7ee94962ce4cc070e8db7f7f3755cbef122a3fd77c436d5381a61819a7d44 LINUX_KERNEL_HASH-5.4.51 = 9e8bea8b4cd636726b7e495a3b467c8ffe96f8eddc159a45fe4a7e6e07a2069d remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk index 569edcbf03..622cbf3223 100644 --- a/include/package-ipkg.mk +++ b/include/package-ipkg.mk @@ -18,6 +18,18 @@ IPKG_REMOVE:= \ IPKG_STATE_DIR:=$(TARGET_DIR)/usr/lib/opkg +# Generates a make statement to return a wildcard for candidate ipkg files +# 1: package name +define gen_ipkg_wildcard + $(1)$$(if $$(filter -%,$$(ABIV_$(1))),,[^a-z-])* +endef + +# 1: package name +# 2: candidate ipk files +define remove_ipkg_files + $(if $(strip $(2)),$(IPKG_REMOVE) $(1) $(2)) +endef + # 1: package name # 2: variable name # 3: variable suffix @@ -185,7 +197,8 @@ $(_endef) $$(IPKG_$(1)) : export DESCRIPTION=$$(Package/$(1)/description) $$(IPKG_$(1)) : export PATH=$$(TARGET_PATH_PKG) $(PKG_INFO_DIR)/$(1).provides $$(IPKG_$(1)): $(STAMP_BUILT) $(INCLUDE_DIR)/package-ipkg.mk - @rm -rf $$(IDIR_$(1)) $$(if $$(call opkg_package_files,$(1)*),; $$(IPKG_REMOVE) $(1) $$(call opkg_package_files,$(1)*)) + @rm -rf $$(IDIR_$(1)); \ + $$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(call gen_ipkg_wildcard,$(1)))) mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/CONTROL $(PKG_INFO_DIR) $(call Package/$(1)/install,$$(IDIR_$(1))) $(if $(Package/$(1)/install-overlay),mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/rootfs-overlay) @@ -253,7 +266,7 @@ $(_endef) @[ -f $$(IPKG_$(1)) ] $(1)-clean: - $$(if $$(call opkg_package_files,$(1)*),$$(IPKG_REMOVE) $(1) $$(call opkg_package_files,$(1)*)) + $$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(call gen_ipkg_wildcard,$(1)))) clean: $(1)-clean diff --git a/include/target.mk b/include/target.mk index 24b740ccfd..45c69a76f2 100644 --- a/include/target.mk +++ b/include/target.mk @@ -179,8 +179,8 @@ ifeq ($(DUMP),1) CPU_CFLAGS_octeonplus = -march=octeon+ -mabi=64 endif ifeq ($(ARCH),i386) - CPU_TYPE ?= pentium - CPU_CFLAGS_pentium = -march=pentium-mmx + CPU_TYPE ?= pentium-mmx + CPU_CFLAGS_pentium-mmx = -march=pentium-mmx CPU_CFLAGS_pentium4 = -march=pentium4 endif ifneq ($(findstring arm,$(ARCH)),) diff --git a/include/toplevel.mk b/include/toplevel.mk index ba59595764..8564a4de73 100644 --- a/include/toplevel.mk +++ b/include/toplevel.mk @@ -169,6 +169,7 @@ kernel_oldconfig: prepare_kernel_conf ifneq ($(DISTRO_PKG_CONFIG),) kernel_menuconfig: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH) kernel_nconfig: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH) +kernel_xconfig: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH) endif kernel_menuconfig: prepare_kernel_conf $(_SINGLE)$(NO_TRACE_MAKE) -C target/linux menuconfig @@ -176,6 +177,9 @@ kernel_menuconfig: prepare_kernel_conf kernel_nconfig: prepare_kernel_conf $(_SINGLE)$(NO_TRACE_MAKE) -C target/linux nconfig +kernel_xconfig: prepare_kernel_conf + $(_SINGLE)$(NO_TRACE_MAKE) -C target/linux xconfig + staging_dir/host/.prereq-build: include/prereq-build.mk mkdir -p tmp @$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f $(TOPDIR)/include/prereq-build.mk prereq 2>/dev/null || { \ diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index 50a7b40869..0f02d67d18 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -160,7 +160,7 @@ default_prerm() { ret=$? fi - local shell="$(which bash)" + local shell="$(command -v bash)" for i in $(grep -s "^/etc/init.d/" "$root/usr/lib/opkg/info/${pkgname}.list"); do if [ -n "$root" ]; then ${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" disable @@ -242,7 +242,7 @@ default_postinst() { [ -n "$root" ] || rm -f /tmp/luci-indexcache 2>/dev/null - local shell="$(which bash)" + local shell="$(command -v bash)" for i in $(grep -s "^/etc/init.d/" "$root/usr/lib/opkg/info/${pkgname}.list"); do if [ -n "$root" ]; then ${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" enable diff --git a/package/ctcgfw/subconverter/Makefile b/package/ctcgfw/subconverter/Makefile index 430758b64c..38e62f6a8b 100644 --- a/package/ctcgfw/subconverter/Makefile +++ b/package/ctcgfw/subconverter/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=subconverter -PKG_VERSION:=0.6.0-6629f86 +PKG_VERSION:=0.6.1-081b5ad PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/tindy2013/subconverter.git -PKG_SOURCE_VERSION:=6629f861da73fc673e5b9a89e1d9168fd1815d38 +PKG_SOURCE_VERSION:=081b5adb71f9dee918dc0a026d350efe6ff392b5 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz diff --git a/package/firmware/linux-firmware/misc.mk b/package/firmware/linux-firmware/misc.mk new file mode 100644 index 0000000000..d0956f77b3 --- /dev/null +++ b/package/firmware/linux-firmware/misc.mk @@ -0,0 +1,9 @@ +Package/eip197-mini-firmware = $(call Package/firmware-default,Inside Secure EIP197 mini firmware) +define Package/eip197-mini-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/inside-secure/eip197_minifw + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/inside-secure/eip197_minifw/ifpp.bin \ + $(PKG_BUILD_DIR)/inside-secure/eip197_minifw/ipue.bin \ + $(1)/lib/firmware/inside-secure/eip197_minifw +endef +$(eval $(call BuildPackage,eip197-mini-firmware)) diff --git a/package/kernel/linux/modules/block.mk b/package/kernel/linux/modules/block.mk index 61a7d5bb8c..4fb419fbcf 100644 --- a/package/kernel/linux/modules/block.mk +++ b/package/kernel/linux/modules/block.mk @@ -271,6 +271,32 @@ endef $(eval $(call KernelPackage,dm-raid)) +define KernelPackage/iscsi-initiator + SUBMENU:=$(BLOCK_MENU) + TITLE:=iSCSI Initiator over TCP/IP + DEPENDS:=+kmod-scsi-core +kmod-crypto-hash + KCONFIG:= \ + CONFIG_INET \ + CONFIG_SCSI_LOWLEVEL=y \ + CONFIG_ISCSI_TCP \ + CONFIG_SCSI_ISCSI_ATTRS=y + FILES:= \ + $(LINUX_DIR)/drivers/scsi/iscsi_tcp.ko \ + $(LINUX_DIR)/drivers/scsi/libiscsi.ko \ + $(LINUX_DIR)/drivers/scsi/libiscsi_tcp.ko \ + $(LINUX_DIR)/drivers/scsi/scsi_transport_iscsi.ko + AUTOLOAD:=$(call AutoProbe,libiscsi libiscsi_tcp scsi_transport_iscsi iscsi_tcp) +endef + +define KernelPackage/iscsi-initiator/description +The iSCSI Driver provides a host with the ability to access storage through an +IP network. The driver uses the iSCSI protocol to transport SCSI requests and +responses over a TCP/IP network between the host (the "initiator") and "targets". +endef + +$(eval $(call KernelPackage,iscsi-initiator)) + + define KernelPackage/md-mod SUBMENU:=$(BLOCK_MENU) TITLE:=MD RAID diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index dfde6836e5..8d630c0335 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -377,7 +377,7 @@ $(eval $(call KernelPackage,crypto-hw-padlock)) define KernelPackage/crypto-hw-safexcel TITLE:= MVEBU SafeXcel Crypto Engine module - DEPENDS:=@!LINUX_4_14 @(TARGET_mvebu_cortexa53||TARGET_mvebu_cortexa72) \ + DEPENDS:=@!LINUX_4_14 @(TARGET_mvebu_cortexa53||TARGET_mvebu_cortexa72) +eip197-mini-firmware \ +kmod-crypto-authenc +kmod-crypto-md5 +kmod-crypto-hmac +kmod-crypto-sha256 +kmod-crypto-sha512 KCONFIG:= \ CONFIG_CRYPTO_HW=y \ @@ -392,9 +392,11 @@ MVEBU's EIP97 and EIP197 Cryptographic Engine driver designed by Inside Secure. This is found on Marvell Armada 37xx/7k/8k SoCs. Particular version of these IP (EIP197B and EIP197D) require firmware. -Unfortunately it's not freely available and needs signed Non-Disclosure -Agreement (NDA) with Marvell. For those who have signed NDA the firmware can be -obtained at https://extranet.marvell.com. +The mini firmware package provides limited functionality, for most operations +a full-featured firmware is required. Unfortunately the "full" firmware is not +freely available and needs signed Non-Disclosure Agreement (NDA) with Marvell. +For those who have signed NDA the firmware can be obtained at +https://extranet.marvell.com. endef $(eval $(call KernelPackage,crypto-hw-safexcel)) diff --git a/package/kernel/linux/modules/lib.mk b/package/kernel/linux/modules/lib.mk index 01e6efbceb..5d88f6856d 100644 --- a/package/kernel/linux/modules/lib.mk +++ b/package/kernel/linux/modules/lib.mk @@ -147,7 +147,6 @@ define KernelPackage/lib-lz4 SUBMENU:=$(LIB_MENU) TITLE:=LZ4 support DEPENDS:=+!LINUX_4_9:kmod-crypto-acompress - HIDDEN:=1 KCONFIG:= \ CONFIG_CRYPTO_LZ4@ge4.9 \ CONFIG_LZ4_COMPRESS \ diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index 4d058e7d9e..0e4ec502c3 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -720,6 +720,23 @@ endef $(eval $(call KernelPackage,rtc-rx8025)) +define KernelPackage/rtc-s35390a + SUBMENU:=$(OTHER_MENU) + TITLE:=Seico S-35390A + DEFAULT:=m if ALL_KMODS && RTC_SUPPORT + DEPENDS:=+kmod-i2c-core + KCONFIG:=CONFIG_RTC_DRV_S35390A \ + CONFIG_RTC_CLASS=y + FILES:=$(LINUX_DIR)/drivers/rtc/rtc-s35390a.ko + AUTOLOAD:=$(call AutoLoad,50,rtc-s35390a,1) +endef + +define KernelPackage/rtc-s35390a/description + Kernel module for Seiko Instruments S-35390A I2C RTC chip +endef + +$(eval $(call KernelPackage,rtc-s35390a)) + define KernelPackage/mtdtests SUBMENU:=$(OTHER_MENU) @@ -901,15 +918,14 @@ $(eval $(call KernelPackage,ikconfig)) define KernelPackage/zram SUBMENU:=$(OTHER_MENU) TITLE:=ZRAM - DEPENDS:=+kmod-lib-lzo +kmod-lib-lz4 + DEPENDS:=+kmod-lib-lzo KCONFIG:= \ CONFIG_ZSMALLOC \ CONFIG_ZRAM \ CONFIG_ZRAM_DEBUG=n \ CONFIG_PGTABLE_MAPPING=n \ CONFIG_ZRAM_WRITEBACK=n \ - CONFIG_ZSMALLOC_STAT=n \ - CONFIG_ZRAM_LZ4_COMPRESS=y + CONFIG_ZSMALLOC_STAT=n FILES:= \ $(LINUX_DIR)/mm/zsmalloc.ko \ $(LINUX_DIR)/drivers/block/zram/zram.ko diff --git a/package/lean/gmediarender/Makefile b/package/lean/gmediarender/Makefile index f80287595e..57444ec52b 100644 --- a/package/lean/gmediarender/Makefile +++ b/package/lean/gmediarender/Makefile @@ -27,7 +27,7 @@ include $(INCLUDE_DIR)/nls.mk define Package/gmediarender SECTION:=multimedia CATEGORY:=Multimedia - DEPENDS:= +gstreamer1 +libgstreamer1 +glib2 +libupnp + DEPENDS:= +gstreamer1 +libgstreamer1 +gstreamer1-libs +glib2 +libupnp TITLE:=A Headless UPnP Renderer endef diff --git a/package/lean/ipv6-helper/Makefile b/package/lean/ipv6-helper/Makefile index ae4242f995..255495646a 100644 --- a/package/lean/ipv6-helper/Makefile +++ b/package/lean/ipv6-helper/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ipv6helper PKG_VERSION:=1.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_LICENSE:=GPLv3 PKG_LICENSE_FILES:=LICENSE @@ -23,7 +23,7 @@ define Package/ipv6helper SECTION:=ipv6 TITLE:=IPv6 Helper and Dynamic Update he.net of ip PKGARCH:=all - DEPENDS:=+luci-proto-ipv6 +wget +ip6tables +ip6tables-mod-nat +kmod-ipt-nat6 +kmod-nf-nat6 +odhcpd-ipv6only +odhcp6c +6in4 + DEPENDS:=+luci-proto-ipv6 +wget ++libip6tc +ip6tables +ip6tables-mod-nat +kmod-ipt-nat6 +kmod-nf-nat6 +odhcpd-ipv6only +odhcp6c +6in4 endef define Package/ipv6helper/description diff --git a/package/lean/luci-app-ipsec-vpnd/Makefile b/package/lean/luci-app-ipsec-vpnd/Makefile index b7a83920f5..46bef920f6 100644 --- a/package/lean/luci-app-ipsec-vpnd/Makefile +++ b/package/lean/luci-app-ipsec-vpnd/Makefile @@ -6,10 +6,10 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI support for IPSec VPN Server (IKEv1 with PSK and Xauth) -LUCI_DEPENDS:=+strongswan-minimal +strongswan-mod-xauth-generic +LUCI_DEPENDS:=+strongswan +strongswan-minimal +strongswan-mod-xauth-generic +strongswan-mod-kernel-libipsec LUCI_PKGARCH:=all PKG_VERSION:=1.0 -PKG_RELEASE:=7 +PKG_RELEASE:=9 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/package/lean/luci-app-webadmin/Makefile b/package/lean/luci-app-webadmin/Makefile index 711673fab5..d469a60fdd 100644 --- a/package/lean/luci-app-webadmin/Makefile +++ b/package/lean/luci-app-webadmin/Makefile @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI page for Web Admin LUCI_DEPENDS:=+uhttpd -PKG_VERSION:=1.0 -PKG_RELEASE:=3 +PKG_VERSION:=2 +PKG_RELEASE:=1 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/package/lean/luci-app-webadmin/po/zh-cn/webadmin.po b/package/lean/luci-app-webadmin/po/zh-cn/webadmin.po index bca5e5c2ad..d2dab011e1 100644 --- a/package/lean/luci-app-webadmin/po/zh-cn/webadmin.po +++ b/package/lean/luci-app-webadmin/po/zh-cn/webadmin.po @@ -21,8 +21,8 @@ msgstr "Web 管理页面设置" msgid "Web Admin Settings Page" msgstr "设置更改Web管理页面端口,绑定地址,是否允许从互联网访问等" -msgid "HTTP listeners (address:port)\"" -msgstr "HTTP 监听 (IP地址:端口)\"" +msgid "HTTP listeners (address:port)" +msgstr "HTTP 监听 (IP地址:端口)" msgid "Bind to specific interface:port (by specifying interface address" msgstr "绑定到指定的IP地址:端口" diff --git a/package/lean/luci-app-xlnetacc/root/etc/hotplug.d/iface/95-xlnetacc b/package/lean/luci-app-xlnetacc/root/etc/hotplug.d/iface/95-xlnetacc index be0271ad8f..f10ae70166 100755 --- a/package/lean/luci-app-xlnetacc/root/etc/hotplug.d/iface/95-xlnetacc +++ b/package/lean/luci-app-xlnetacc/root/etc/hotplug.d/iface/95-xlnetacc @@ -5,9 +5,9 @@ case "$ACTION" in ifup) - /etc/init.d/xlnetacc start + /etc/init.d/xlnetacc restart ;; ifdown) - /etc/init.d/xlnetacc stop + #/etc/init.d/xlnetacc stop ;; esac diff --git a/package/libs/lzo/Makefile b/package/libs/lzo/Makefile index 1ae2f3ce05..3ce5f53349 100644 --- a/package/libs/lzo/Makefile +++ b/package/libs/lzo/Makefile @@ -9,19 +9,20 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lzo PKG_VERSION:=2.10 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.oberhumer.com/opensource/lzo/download/ PKG_HASH:=c0f892943208266f9b6543b3ae308fab6284c5c90e627931446fb49b4221a072 -PKG_FIXUP:=autoreconf -PKG_INSTALL:=1 -PKG_LICENSE:=GPL-2.0+ +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 @@ -36,17 +37,18 @@ define Package/liblzo/description in real-time. This means it favours speed over compression ratio. endef -CONFIGURE_ARGS += \ - --enable-shared \ - --enable-static \ - -TARGET_CFLAGS += $(FPIC) -MAKE_FLAGS += CFLAGS_O="$(TARGET_CFLAGS)" +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 + $(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 endef define Package/liblzo/install diff --git a/package/libs/uclibc++/Makefile b/package/libs/uclibc++/Makefile index 7a0d9094ff..0e3210a5b9 100644 --- a/package/libs/uclibc++/Makefile +++ b/package/libs/uclibc++/Makefile @@ -55,6 +55,14 @@ ifeq ($(CONFIG_USE_MUSL),y) SSP_LIB=-lssp_nonshared endif +ifeq (${V}, s) +MAKE_VARS+= \ + V=1 +else ifeq (${V}, sc) +MAKE_VARS+= \ + V=2 +endif + MAKE_FLAGS:= \ $(TARGET_CONFIGURE_OPTS) \ CPU_CFLAGS="$(TARGET_CFLAGS)" \ diff --git a/package/network/services/ppp/Makefile b/package/network/services/ppp/Makefile index babc7a90bf..8cd2cbc1d9 100644 --- a/package/network/services/ppp/Makefile +++ b/package/network/services/ppp/Makefile @@ -13,9 +13,9 @@ PKG_RELEASE:=5 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/paulusmack/ppp -PKG_SOURCE_DATE:=2020-03-21 -PKG_SOURCE_VERSION:=41a73232c16e9a063cfe3fad461c94af3f450f6c -PKG_MIRROR_HASH:=7b966003b7c1bec95156159119b52583778405f0229dc7590911fa93f031552b +PKG_SOURCE_DATE:=2020-05-25 +PKG_SOURCE_VERSION:=ddd57c279f467e18c4fb3a661f21a069a5a37a1f +PKG_MIRROR_HASH:=aac65e65dd25eaf8978a7a0b3258c863d90e29e247dd33d95276c0c189bcd424 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-4-Clause PKG_CPE_ID:=cpe:/a:samba:ppp diff --git a/package/network/services/ppp/patches/100-debian_ip-ip_option.patch b/package/network/services/ppp/patches/100-debian_ip-ip_option.patch index 335ce72b0a..a996622922 100644 --- a/package/network/services/ppp/patches/100-debian_ip-ip_option.patch +++ b/package/network/services/ppp/patches/100-debian_ip-ip_option.patch @@ -85,7 +85,7 @@ Signed-off-by: Jo-Philipp Wich "Enable multilink operation", OPT_PRIO | 1 }, --- a/pppd/pppd.h +++ b/pppd/pppd.h -@@ -334,6 +334,8 @@ extern int connect_delay; /* Time to del +@@ -335,6 +335,8 @@ extern int connect_delay; /* Time to del extern int max_data_rate; /* max bytes/sec through charshunt */ extern int req_unit; /* interface unit number to use */ extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */ diff --git a/package/network/services/ppp/patches/105-debian_demand.patch b/package/network/services/ppp/patches/105-debian_demand.patch index c68bafa8df..fb6f39f4b9 100644 --- a/package/network/services/ppp/patches/105-debian_demand.patch +++ b/package/network/services/ppp/patches/105-debian_demand.patch @@ -161,7 +161,7 @@ } else { --- a/pppd/pppd.h +++ b/pppd/pppd.h -@@ -601,7 +601,7 @@ void demand_conf __P((void)); /* config +@@ -602,7 +602,7 @@ void demand_conf __P((void)); /* config void demand_block __P((void)); /* set all NPs to queue up packets */ void demand_unblock __P((void)); /* set all NPs to pass packets */ void demand_discard __P((void)); /* set all NPs to discard packets */ diff --git a/package/network/services/ppp/patches/110-debian_defaultroute.patch b/package/network/services/ppp/patches/110-debian_defaultroute.patch index 38739a5243..e474571767 100644 --- a/package/network/services/ppp/patches/110-debian_defaultroute.patch +++ b/package/network/services/ppp/patches/110-debian_defaultroute.patch @@ -137,7 +137,7 @@ Signed-off-by: Jo-Philipp Wich .B disconnect \fIscript Execute the command specified by \fIscript\fR, by passing it to a shell, after -@@ -746,7 +751,12 @@ disable both forms of hardware flow cont +@@ -751,7 +756,12 @@ disable both forms of hardware flow cont .TP .B nodefaultroute Disable the \fIdefaultroute\fR option. The system administrator who @@ -153,7 +153,7 @@ Signed-off-by: Jo-Philipp Wich .B nodefaultroute6 --- a/pppd/pppd.h +++ b/pppd/pppd.h -@@ -683,7 +683,7 @@ int sif6addr __P((int, eui64_t, eui64_t +@@ -684,7 +684,7 @@ int sif6addr __P((int, eui64_t, eui64_t int cif6addr __P((int, eui64_t, eui64_t)); /* Remove an IPv6 address from i/f */ #endif @@ -292,7 +292,7 @@ Signed-off-by: Jo-Philipp Wich } --- a/pppd/sys-solaris.c +++ b/pppd/sys-solaris.c -@@ -2119,12 +2119,18 @@ cifaddr(u, o, h) +@@ -2120,12 +2120,18 @@ cifaddr(u, o, h) * sifdefaultroute - assign a default route through the address given. */ int diff --git a/package/network/services/ppp/patches/120-debian_ipv6_updown_option.patch b/package/network/services/ppp/patches/120-debian_ipv6_updown_option.patch index 4a9ca7d5e7..5ef09b3f3e 100644 --- a/package/network/services/ppp/patches/120-debian_ipv6_updown_option.patch +++ b/package/network/services/ppp/patches/120-debian_ipv6_updown_option.patch @@ -84,7 +84,7 @@ Signed-off-by: Jo-Philipp Wich } --- a/pppd/pppd.h +++ b/pppd/pppd.h -@@ -336,6 +336,8 @@ extern int req_unit; /* interface unit n +@@ -337,6 +337,8 @@ extern int req_unit; /* interface unit n extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */ extern char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */ extern char path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */ diff --git a/package/network/services/ppp/patches/121-debian_adaptive_lcp_echo.patch b/package/network/services/ppp/patches/121-debian_adaptive_lcp_echo.patch deleted file mode 100644 index 510c96ba97..0000000000 --- a/package/network/services/ppp/patches/121-debian_adaptive_lcp_echo.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- a/pppd/lcp.c -+++ b/pppd/lcp.c -@@ -72,6 +72,7 @@ static void lcp_delayed_up __P((void *)) - */ - int lcp_echo_interval = 0; /* Interval between LCP echo-requests */ - int lcp_echo_fails = 0; /* Tolerance to unanswered echo-requests */ -+bool lcp_echo_adaptive = 0; /* request echo only if the link was idle */ - bool lax_recv = 0; /* accept control chars in asyncmap */ - bool noendpoint = 0; /* don't send/accept endpoint discriminator */ - -@@ -150,6 +151,8 @@ static option_t lcp_option_list[] = { - OPT_PRIO }, - { "lcp-echo-interval", o_int, &lcp_echo_interval, - "Set time in seconds between LCP echo requests", OPT_PRIO }, -+ { "lcp-echo-adaptive", o_bool, &lcp_echo_adaptive, -+ "Suppress LCP echo requests if traffic was received", 1 }, - { "lcp-restart", o_int, &lcp_fsm[0].timeouttime, - "Set time in seconds between LCP retransmissions", OPT_PRIO }, - { "lcp-max-terminate", o_int, &lcp_fsm[0].maxtermtransmits, -@@ -2330,6 +2333,22 @@ LcpSendEchoRequest (f) - } - } - -+ /* -+ * If adaptive echos have been enabled, only send the echo request if -+ * no traffic was received since the last one. -+ */ -+ if (lcp_echo_adaptive) { -+ static unsigned int last_pkts_in = 0; -+ -+ update_link_stats(f->unit); -+ link_stats_valid = 0; -+ -+ if (link_stats.pkts_in != last_pkts_in) { -+ last_pkts_in = link_stats.pkts_in; -+ return; -+ } -+ } -+ - /* - * Make and send the echo request frame. - */ ---- a/pppd/pppd.8 -+++ b/pppd/pppd.8 -@@ -575,6 +575,11 @@ to 1) if the \fIproxyarp\fR option is us - dynamic IP address option (i.e. set /proc/sys/net/ipv4/ip_dynaddr to - 1) in demand mode if the local address changes. - .TP -+.B lcp\-echo\-adaptive -+If this option is used with the \fIlcp\-echo\-failure\fR option then -+pppd will send LCP echo\-request frames only if no traffic was received -+from the peer since the last echo\-request was sent. -+.TP - .B lcp\-echo\-failure \fIn - If this option is given, pppd will presume the peer to be dead - if \fIn\fR LCP echo\-requests are sent without receiving a valid LCP diff --git a/package/network/services/ppp/patches/206-compensate_time_change.patch b/package/network/services/ppp/patches/206-compensate_time_change.patch deleted file mode 100644 index a1eb6a716c..0000000000 --- a/package/network/services/ppp/patches/206-compensate_time_change.patch +++ /dev/null @@ -1,94 +0,0 @@ -pppd: Watch out for time warps - -On many embedded systems there is no battery backed RTC and a proper system -time only becomes available through NTP after establishing a connection. - -When the clock suddenly jumps forward, the internal accounting (connect time) -is confused resulting in unreliable data. - -This patch implements periodic clock checking to look for time warps, if one -is detected, the internal counters are adjusted accordingly. - -Signed-off-by: Jo-Philipp Wich - ---- a/pppd/main.c -+++ b/pppd/main.c -@@ -89,6 +89,7 @@ - #include - #include - #include -+#include - - #include "pppd.h" - #include "magic.h" -@@ -226,6 +227,7 @@ static struct subprocess *children; - - /* Prototypes for procedures local to this file. */ - -+static void check_time(void); - static void setup_signals __P((void)); - static void create_pidfile __P((int pid)); - static void create_linkpidfile __P((int pid)); -@@ -525,6 +527,7 @@ main(argc, argv) - info("Starting link"); - } - -+ check_time(); - gettimeofday(&start_time, NULL); - script_unsetenv("CONNECT_TIME"); - script_unsetenv("BYTES_SENT"); -@@ -1274,6 +1277,36 @@ struct callout { - - static struct callout *callout = NULL; /* Callout list */ - static struct timeval timenow; /* Current time */ -+static long uptime_diff = 0; -+static int uptime_diff_set = 0; -+ -+static void check_time(void) -+{ -+ long new_diff; -+ struct timeval t; -+ struct sysinfo i; -+ struct callout *p; -+ -+ gettimeofday(&t, NULL); -+ sysinfo(&i); -+ new_diff = t.tv_sec - i.uptime; -+ -+ if (!uptime_diff_set) { -+ uptime_diff = new_diff; -+ uptime_diff_set = 1; -+ return; -+ } -+ -+ if ((new_diff - 5 > uptime_diff) || (new_diff + 5 < uptime_diff)) { -+ /* system time has changed, update counters and timeouts */ -+ info("System time change detected."); -+ start_time.tv_sec += new_diff - uptime_diff; -+ -+ for (p = callout; p != NULL; p = p->c_next) -+ p->c_time.tv_sec += new_diff - uptime_diff; -+ } -+ uptime_diff = new_diff; -+} - - /* - * timeout - Schedule a timeout. -@@ -1344,6 +1377,8 @@ calltimeout() - { - struct callout *p; - -+ check_time(); -+ - while (callout != NULL) { - p = callout; - -@@ -1371,6 +1406,8 @@ timeleft(tvp) - { - if (callout == NULL) - return NULL; -+ -+ check_time(); - - gettimeofday(&timenow, NULL); - tvp->tv_sec = callout->c_time.tv_sec - timenow.tv_sec; diff --git a/package/network/services/ppp/patches/208-fix_status_code.patch b/package/network/services/ppp/patches/208-fix_status_code.patch index 31460148a4..f1a12006a5 100644 --- a/package/network/services/ppp/patches/208-fix_status_code.patch +++ b/package/network/services/ppp/patches/208-fix_status_code.patch @@ -12,7 +12,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/main.c +++ b/pppd/main.c -@@ -1055,7 +1055,8 @@ get_input() +@@ -1052,7 +1052,8 @@ get_input() } notice("Modem hangup"); hungup = 1; diff --git a/package/network/services/ppp/patches/401-no_record_file.patch b/package/network/services/ppp/patches/401-no_record_file.patch index 56a9f02eb8..f707fda8ab 100644 --- a/package/network/services/ppp/patches/401-no_record_file.patch +++ b/package/network/services/ppp/patches/401-no_record_file.patch @@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/pppd.h +++ b/pppd/pppd.h -@@ -325,7 +325,6 @@ extern int holdoff; /* Dead time before +@@ -326,7 +326,6 @@ extern int holdoff; /* Dead time before extern bool holdoff_specified; /* true if user gave a holdoff value */ extern bool notty; /* Stdin/out is not a tty */ extern char *pty_socket; /* Socket to connect to pty */ diff --git a/package/network/services/ppp/patches/404-remove_obsolete_protocol_names.patch b/package/network/services/ppp/patches/404-remove_obsolete_protocol_names.patch index 1d94873f35..d37fc03539 100644 --- a/package/network/services/ppp/patches/404-remove_obsolete_protocol_names.patch +++ b/package/network/services/ppp/patches/404-remove_obsolete_protocol_names.patch @@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/main.c +++ b/pppd/main.c -@@ -886,14 +886,17 @@ struct protocol_list { +@@ -883,14 +883,17 @@ struct protocol_list { const char *name; } protocol_list[] = { { 0x21, "IP" }, @@ -25,7 +25,7 @@ Signed-off-by: Jo-Philipp Wich { 0x33, "Stream Protocol ST-II" }, { 0x35, "Banyan Vines" }, { 0x39, "AppleTalk EDDP" }, -@@ -907,8 +910,11 @@ struct protocol_list { +@@ -904,8 +907,11 @@ struct protocol_list { { 0x49, "Serial Data Transport Protocol (PPP-SDTP)" }, { 0x4b, "SNA over 802.2" }, { 0x4d, "SNA" }, @@ -37,7 +37,7 @@ Signed-off-by: Jo-Philipp Wich { 0x53, "Encryption" }, { 0x55, "Individual Link Encryption" }, { 0x57, "IPv6" }, -@@ -919,12 +925,15 @@ struct protocol_list { +@@ -916,12 +922,15 @@ struct protocol_list { { 0x65, "RTP IPHC Compressed non-TCP" }, { 0x67, "RTP IPHC Compressed UDP 8" }, { 0x69, "RTP IPHC Compressed RTP 8" }, @@ -53,7 +53,7 @@ Signed-off-by: Jo-Philipp Wich { 0x0203, "IBM Source Routing BPDU" }, { 0x0205, "DEC LANBridge100 Spanning Tree" }, { 0x0207, "Cisco Discovery Protocol" }, -@@ -936,15 +945,19 @@ struct protocol_list { +@@ -933,15 +942,19 @@ struct protocol_list { { 0x0231, "Luxcom" }, { 0x0233, "Sigma Network Systems" }, { 0x0235, "Apple Client Server Protocol" }, @@ -73,7 +73,7 @@ Signed-off-by: Jo-Philipp Wich { 0x4001, "Cray Communications Control Protocol" }, { 0x4003, "CDPD Mobile Network Registration Protocol" }, { 0x4005, "Expand accelerator protocol" }, -@@ -955,8 +968,10 @@ struct protocol_list { +@@ -952,8 +965,10 @@ struct protocol_list { { 0x4023, "RefTek Protocol" }, { 0x4025, "Fibre Channel" }, { 0x4027, "EMIT Protocols" }, @@ -84,7 +84,7 @@ Signed-off-by: Jo-Philipp Wich { 0x8023, "OSI Network Layer Control Protocol" }, { 0x8025, "Xerox NS IDP Control Protocol" }, { 0x8027, "DECnet Phase IV Control Protocol" }, -@@ -965,7 +980,9 @@ struct protocol_list { +@@ -962,7 +977,9 @@ struct protocol_list { { 0x8031, "Bridging NCP" }, { 0x8033, "Stream Protocol Control Protocol" }, { 0x8035, "Banyan Vines Control Protocol" }, @@ -94,7 +94,7 @@ Signed-off-by: Jo-Philipp Wich { 0x803f, "NETBIOS Framing Control Protocol" }, { 0x8041, "Cisco Systems Control Protocol" }, { 0x8043, "Ascom Timeplex" }, -@@ -974,18 +991,24 @@ struct protocol_list { +@@ -971,18 +988,24 @@ struct protocol_list { { 0x8049, "Serial Data Control Protocol (PPP-SDCP)" }, { 0x804b, "SNA over 802.2 Control Protocol" }, { 0x804d, "SNA Control Protocol" }, @@ -119,7 +119,7 @@ Signed-off-by: Jo-Philipp Wich { 0x8207, "Cisco Discovery Protocol Control" }, { 0x8209, "Netcs Twin Routing" }, { 0x820b, "STP - Control Protocol" }, -@@ -994,24 +1017,29 @@ struct protocol_list { +@@ -991,24 +1014,29 @@ struct protocol_list { { 0x8281, "MPLSCP" }, { 0x8285, "IEEE p1284.4 standard - Protocol Control" }, { 0x8287, "ETSI TETRA TNP1 Control Protocol" }, diff --git a/package/network/services/ppp/patches/511-syncppp.patch b/package/network/services/ppp/patches/511-syncppp.patch index 8b8b6cce6a..455ae1fd22 100644 --- a/package/network/services/ppp/patches/511-syncppp.patch +++ b/package/network/services/ppp/patches/511-syncppp.patch @@ -9,22 +9,21 @@ #ifdef CHAPMS #include "chap_ms.h" #define MDTYPE_ALL (MDTYPE_MICROSOFT_V2 | MDTYPE_MICROSOFT | MDTYPE_MD5) -@@ -492,6 +494,19 @@ chap_respond(struct chap_client_state *c +@@ -481,6 +483,18 @@ chap_respond(struct chap_client_state *cs, int id, p[2] = len >> 8; p[3] = len; -+ if (npppd > 1) { -+ if (syncppp(npppd) < 0) { -+ error("syncppp sync fail"); -+ sem_unlink(SEM_COUNT_NAME); -+ sem_unlink(SEM_BLOCK_NAME); -+ } else { -+ info("syncppp sync succeeded"); -+ } -+ } else { -+ info("syncppp not active"); -+ } -+ ++ if (npppd > 1) { ++ if (syncppp(npppd) < 0) { ++ error("syncppp sync fail"); ++ sem_unlink(SEM_COUNT_NAME); ++ sem_unlink(SEM_BLOCK_NAME); ++ } else { ++ info("syncppp sync succeeded"); ++ } ++ } else { ++ info("syncppp not active"); ++ } + output(0, response, PPP_HDRLEN + len); } @@ -55,39 +54,38 @@ # CC = gcc # COPTS = -O2 -pipe -Wall -g --LIBS = +-LIBS = -lrt +LIBS = -lpthread # Uncomment the next line to include support for Microsoft's # MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux. --- a/pppd/options.c +++ b/pppd/options.c -@@ -128,6 +128,7 @@ bool dump_options; /* print out option +@@ -123,6 +123,7 @@ bool dump_options; /* print out option values */ bool dryrun; /* print out option values and exit */ char *domain; /* domain name set by domain option */ int child_wait = 5; /* # seconds to wait for children at exit */ -+int npppd = 0; /* synchronize between multiple pppd */ ++int npppd = 0; /* synchronize between multiple pppd */ struct userenv *userenv_list; /* user environment variables */ int dfl_route_metric = -1; /* metric of the default route to set over the PPP link */ -@@ -342,6 +343,10 @@ option_t general_options[] = { - "Set pathname of ipv6-down script", - OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, +@@ -312,6 +313,9 @@ option_t general_options[] = { + "Unset user environment variable", + OPT_A2PRINTER | OPT_NOPRINT, (void *)user_unsetprint }, + { "syncppp", o_int, &npppd, + "sync among multiple pppd when sending chap/pap respond", OPT_PRIO }, + -+ - #ifdef HAVE_MULTILINK - { "multilink", o_bool, &multilink, - "Enable multilink operation", OPT_PRIO | 1 }, + { "defaultroute-metric", o_int, &dfl_route_metric, + "Metric to use for the default route (Linux only; -1 for default behavior)", + OPT_PRIV|OPT_LLIMIT|OPT_INITONLY, NULL, 0, -1 }, --- a/pppd/pppd.h +++ b/pppd/pppd.h -@@ -343,6 +343,7 @@ extern char *bundle_name; /* bundle name +@@ -341,6 +341,7 @@ extern char *bundle_name; /* bundle name for multilink */ extern bool dump_options; /* print out option values */ extern bool dryrun; /* check everything, print options, exit */ extern int child_wait; /* # seconds to wait for children at end */ -+extern int npppd; /* synchronize between multiple pppd */ ++extern int npppd; /* synchronize between multiple pppd */ #ifdef MAXOCTETS extern unsigned int maxoctets; /* Maximum octetes per session (in bytes) */ @@ -199,9 +197,8 @@ + } + } else { + info("syncppp not active"); -+ } ++ } + output(u->us_unit, outpacket_buf, outlen + PPP_HDRLEN); TIMEOUT(upap_timeout, u, u->us_timeouttime); - diff --git a/package/network/services/ppp/patches/600-Revert-pppd-Use-openssl-for-the-DES-instead-of-the-l.patch b/package/network/services/ppp/patches/600-Revert-pppd-Use-openssl-for-the-DES-instead-of-the-l.patch index 331ec09ed2..49bdb28fe2 100644 --- a/package/network/services/ppp/patches/600-Revert-pppd-Use-openssl-for-the-DES-instead-of-the-l.patch +++ b/package/network/services/ppp/patches/600-Revert-pppd-Use-openssl-for-the-DES-instead-of-the-l.patch @@ -17,7 +17,7 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875. +++ b/pppd/Makefile.linux @@ -35,10 +35,10 @@ endif COPTS = -O2 -pipe -Wall -g - LIBS = + LIBS = -lpthread -# Uncomment the next line to include support for Microsoft's +# Uncomment the next 2 lines to include support for Microsoft's diff --git a/package/network/utils/wireguard-tools/files/wireguard_watchdog b/package/network/utils/wireguard-tools/files/wireguard_watchdog index 5fbbeafec1..c0a5a0aa33 100644 --- a/package/network/utils/wireguard-tools/files/wireguard_watchdog +++ b/package/network/utils/wireguard-tools/files/wireguard_watchdog @@ -27,7 +27,7 @@ check_peer_activity() { config_get public_key "${cfg}" "public_key" config_get endpoint_host "${cfg}" "endpoint_host" config_get endpoint_port "${cfg}" "endpoint_port" - persistent_keepalive=`wg show ${iface} persistent-keepalive | grep ${public_key} | awk '{print $2}'` + persistent_keepalive=$(wg show ${iface} persistent-keepalive | grep ${public_key} | awk '{print $2}') # only process peers with endpoints and keepalive set [ -z ${endpoint_host} ] && return 0; @@ -42,16 +42,16 @@ check_peer_activity() { [ -n "${IPV4}" -o -n "${IPV6}" ] && return 0; # re-resolve endpoint hostname if not responding for too long - last_handshake=`wg show ${iface} latest-handshakes | grep ${public_key} | awk '{print $2}'` + last_handshake=$(wg show ${iface} latest-handshakes | grep ${public_key} | awk '{print $2}') [ -z ${last_handshake} ] && return 0; - idle_seconds=$((`date +%s`-${last_handshake})) + idle_seconds=$(($(date +%s)-${last_handshake})) [ ${idle_seconds} -lt 150 ] && return 0; logger -t "wireguard_monitor" "${iface} endpoint ${endpoint_host}:${endpoint_port} is not responding for ${idle_seconds} seconds, trying to re-resolve hostname" wg set ${iface} peer ${public_key} endpoint "${endpoint_host}:${endpoint_port}" } # query ubus for all active wireguard interfaces -wg_ifaces=`ubus -S call network.interface dump | jsonfilter -e '@.interface[@.up=true]' | jsonfilter -a -e '@[@.proto="wireguard"].interface' | tr "\n" " "` +wg_ifaces=$(ubus -S call network.interface dump | jsonfilter -e '@.interface[@.up=true]' | jsonfilter -a -e '@[@.proto="wireguard"].interface' | tr "\n" " ") # check every peer in every active wireguard interface config_load network diff --git a/package/system/zram-swap/Makefile b/package/system/zram-swap/Makefile index 99dd9a675f..87ffaae068 100644 --- a/package/system/zram-swap/Makefile +++ b/package/system/zram-swap/Makefile @@ -18,7 +18,7 @@ include $(INCLUDE_DIR)/package.mk define Package/zram-swap SECTION:=utils CATEGORY:=Base system - DEPENDS:=+kmod-zram +!BUSYBOX_CONFIG_MKSWAP:swap-utils +!BUSYBOX_CONFIG_SWAPONOFF:block-mount + DEPENDS:=+kmod-zram +!(BUSYBOX_CONFIG_MKSWAP&&BUSYBOX_CONFIG_SWAPON&&BUSYBOX_CONFIG_SWAPOFF):swap-utils TITLE:=ZRAM swap scripts PKGARCH:=all endef diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init index 584fdc36c9..9df9d7d22b 100755 --- a/package/system/zram-swap/files/zram.init +++ b/package/system/zram-swap/files/zram.init @@ -126,7 +126,7 @@ start() zram_comp_streams "$zram_dev" echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename "$zram_dev" )/disksize" mkswap "$zram_dev" - swapon "$zram_dev" + swapon -d $zram_priority "$zram_dev" } stop() diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in index 91c9b9b5b9..29724041f4 100644 --- a/package/utils/busybox/Config-defaults.in +++ b/package/utils/busybox/Config-defaults.in @@ -24,7 +24,7 @@ config BUSYBOX_DEFAULT_FEATURE_VERBOSE_USAGE default y config BUSYBOX_DEFAULT_FEATURE_COMPRESS_USAGE bool - default y + default n config BUSYBOX_DEFAULT_LFS bool default y @@ -303,7 +303,7 @@ config BUSYBOX_DEFAULT_FEATURE_SKIP_ROOTFS default n config BUSYBOX_DEFAULT_MONOTONIC_SYSCALL bool - default n + default y config BUSYBOX_DEFAULT_IOCTL_HEX2STR_ERROR bool default y diff --git a/scripts/env b/scripts/env index 7bfca58c5d..726a354b57 100755 --- a/scripts/env +++ b/scripts/env @@ -22,7 +22,7 @@ Commands: Options: EOF - exit ${1:-1} + exit "${1:-1}" } error() { @@ -42,7 +42,7 @@ ask_bool() { local VAL echo -n "$* ($defstr): " - read VAL + read -r VAL case "$VAL" in y*|Y*) val=0;; n*|N*) val=1;; @@ -57,7 +57,7 @@ env_init() { if [ -z "$CREATE" ]; then [ -d "$ENVDIR" ] || exit 0 fi - [ -x "$(which git 2>/dev/null)" ] || error "Git is not installed" + command -v git || error "Git is not installed" mkdir -p "$ENVDIR" || error "Failed to create the environment directory" cd "$ENVDIR" || error "Failed to switch to the environment directory" [ -d .git ] || { @@ -73,7 +73,7 @@ env_init() { } env_sync_data() { - [ \! -L "$BASEDIR/.config" ] && [ -f "$BASEDIR/.config" ] && mv "$BASEDIR/.config" "$ENVDIR" + [ ! -L "$BASEDIR/.config" ] && [ -f "$BASEDIR/.config" ] && mv "$BASEDIR/.config" "$ENVDIR" git add . git add -u } @@ -147,7 +147,7 @@ env_clear() { else rm -rf "$BASEDIR/files" "$BASEDIR/.config" fi - cd "$BASEDIR" + cd "$BASEDIR" || exit 1 rm -rf "$ENVDIR" } @@ -195,7 +195,7 @@ env_new() { git checkout -b "$1" "$from" if [ -f "$BASEDIR/.config" ] || [ -d "$BASEDIR/files" ]; then if ask_bool 1 "Do you want to start your configuration repository with the current configuration?"; then - if [ -d "$BASEDIR/files" ] && [ \! -L "$BASEDIR/files" ]; then + if [ -d "$BASEDIR/files" ] && [ ! -L "$BASEDIR/files" ]; then mkdir -p "$ENVDIR/files" shopt -s dotglob mv "$BASEDIR/files/"* "$ENVDIR/files/" 2>/dev/null diff --git a/scripts/gen_image_generic.sh b/scripts/gen_image_generic.sh index 2c57d56f07..5162be11dd 100755 --- a/scripts/gen_image_generic.sh +++ b/scripts/gen_image_generic.sh @@ -1,10 +1,10 @@ -#!/usr/bin/env bash +#!/bin/sh # Copyright (C) 2006-2012 OpenWrt.org set -e -x -[ $# == 5 -o $# == 6 ] || { +if [ $# -ne 5 ] && [ $# -ne 6 ]; then echo "SYNTAX: $0 []" exit 1 -} +fi OUTPUT="$1" KERNELSIZE="$2" diff --git a/scripts/mkits.sh b/scripts/mkits.sh index 32a978e18d..468ef670e6 100755 --- a/scripts/mkits.sh +++ b/scripts/mkits.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # # Licensed under the terms of the GNU GPL License version 2 or later. # @@ -15,18 +15,19 @@ # usage() { - echo "Usage: $(basename $0) -A arch -C comp -a addr -e entry" \ - "-v version -k kernel [-D name -d dtb] -o its_file" - echo -e "\t-A ==> set architecture to 'arch'" - echo -e "\t-C ==> set compression type 'comp'" - echo -e "\t-c ==> set config name 'config'" - echo -e "\t-a ==> set load address to 'addr' (hex)" - echo -e "\t-e ==> set entry point to 'entry' (hex)" - echo -e "\t-v ==> set kernel version to 'version'" - echo -e "\t-k ==> include kernel image 'kernel'" - echo -e "\t-D ==> human friendly Device Tree Blob 'name'" - echo -e "\t-d ==> include Device Tree Blob 'dtb'" - echo -e "\t-o ==> create output file 'its_file'" + printf "Usage: %s -A arch -C comp -a addr -e entry" "$(basename "$0")" + printf " -v version -k kernel [-D name -d dtb] -o its_file" + + printf "\n\t-A ==> set architecture to 'arch'" + printf "\n\t-C ==> set compression type 'comp'" + printf "\n\t-c ==> set config name 'config'" + printf "\n\t-a ==> set load address to 'addr' (hex)" + printf "\n\t-e ==> set entry point to 'entry' (hex)" + printf "\n\t-v ==> set kernel version to 'version'" + printf "\n\t-k ==> include kernel image 'kernel'" + printf "\n\t-D ==> human friendly Device Tree Blob 'name'" + printf "\n\t-d ==> include Device Tree Blob 'dtb'" + printf "\n\t-o ==> create output file 'its_file'\n" exit 1 } @@ -43,7 +44,7 @@ do k ) KERNEL=$OPTARG;; o ) OUTPUT=$OPTARG;; v ) VERSION=$OPTARG;; - * ) echo "Invalid option passed to '$0' (options:$@)" + * ) echo "Invalid option passed to '$0' (options:$*)" usage;; esac done @@ -55,7 +56,7 @@ if [ -z "${ARCH}" ] || [ -z "${COMPRESS}" ] || [ -z "${LOAD_ADDR}" ] || \ usage fi -ARCH_UPPER=$(echo $ARCH | tr '[:lower:]' '[:upper:]') +ARCH_UPPER=$(echo "$ARCH" | tr '[:lower:]' '[:upper:]') # Conditionally create fdt information if [ -n "${DTB}" ]; then @@ -115,4 +116,4 @@ ${FDT_NODE} };" # Write .its file to disk -echo "$DATA" > ${OUTPUT} +echo "$DATA" > "${OUTPUT}" diff --git a/target/linux/Makefile b/target/linux/Makefile index f7bbdffbf8..3a70b80bb3 100644 --- a/target/linux/Makefile +++ b/target/linux/Makefile @@ -9,5 +9,5 @@ include $(INCLUDE_DIR)/target.mk export TARGET_BUILD=1 -prereq clean download prepare compile install menuconfig nconfig oldconfig update refresh: FORCE +prereq clean download prepare compile install oldconfig menuconfig nconfig xconfig update refresh: FORCE @+$(NO_TRACE_MAKE) -C $(BOARD) $@ diff --git a/target/linux/ar71xx/patches-4.14/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.14/910-unaligned_access_hacks.patch index 52f48d0d0e..94eab1138f 100644 --- a/target/linux/ar71xx/patches-4.14/910-unaligned_access_hacks.patch +++ b/target/linux/ar71xx/patches-4.14/910-unaligned_access_hacks.patch @@ -733,7 +733,7 @@ static struct fib6_node *node_alloc(void) --- a/net/netfilter/nf_conntrack_proto_tcp.c +++ b/net/netfilter/nf_conntrack_proto_tcp.c -@@ -447,7 +447,7 @@ static void tcp_sack(const struct sk_buf +@@ -453,7 +453,7 @@ static void tcp_sack(const struct sk_buf /* Fast path for timestamp-only option */ if (length == TCPOLEN_TSTAMP_ALIGNED diff --git a/target/linux/ath79/patches-4.19/910-unaligned_access_hacks.patch b/target/linux/ath79/patches-4.19/910-unaligned_access_hacks.patch index 61695ae55f..7c066c4f7d 100644 --- a/target/linux/ath79/patches-4.19/910-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-4.19/910-unaligned_access_hacks.patch @@ -704,7 +704,7 @@ struct fib6_info *fib6_info_alloc(gfp_t gfp_flags) --- a/net/netfilter/nf_conntrack_proto_tcp.c +++ b/net/netfilter/nf_conntrack_proto_tcp.c -@@ -423,7 +423,7 @@ static void tcp_sack(const struct sk_buf +@@ -429,7 +429,7 @@ static void tcp_sack(const struct sk_buf /* Fast path for timestamp-only option */ if (length == TCPOLEN_TSTAMP_ALIGNED diff --git a/target/linux/bcm27xx/patches-4.19/950-0021-kbuild-Ignore-dtco-targets-when-filtering-symbols.patch b/target/linux/bcm27xx/patches-4.19/950-0021-kbuild-Ignore-dtco-targets-when-filtering-symbols.patch index 6d5d7d4d8b..d15f3adbc4 100644 --- a/target/linux/bcm27xx/patches-4.19/950-0021-kbuild-Ignore-dtco-targets-when-filtering-symbols.patch +++ b/target/linux/bcm27xx/patches-4.19/950-0021-kbuild-Ignore-dtco-targets-when-filtering-symbols.patch @@ -9,7 +9,7 @@ Subject: [PATCH] kbuild: Ignore dtco targets when filtering symbols --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include -@@ -287,7 +287,7 @@ ksym_dep_filter = +@@ -288,7 +288,7 @@ ksym_dep_filter = $(CPP) $(call flags_nodeps,c_flags) -D__KSYM_DEPS__ $< ;; \ as_*_S|cpp_s_S) \ $(CPP) $(call flags_nodeps,a_flags) -D__KSYM_DEPS__ $< ;; \ diff --git a/target/linux/bcm27xx/patches-4.19/950-0470-bcmgenet-Better-coalescing-parameter-defaults.patch b/target/linux/bcm27xx/patches-4.19/950-0470-bcmgenet-Better-coalescing-parameter-defaults.patch index 15f8d2a9fa..5d3403c96c 100644 --- a/target/linux/bcm27xx/patches-4.19/950-0470-bcmgenet-Better-coalescing-parameter-defaults.patch +++ b/target/linux/bcm27xx/patches-4.19/950-0470-bcmgenet-Better-coalescing-parameter-defaults.patch @@ -18,7 +18,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c -@@ -2153,7 +2153,7 @@ static void bcmgenet_init_tx_ring(struct +@@ -2151,7 +2151,7 @@ static void bcmgenet_init_tx_ring(struct bcmgenet_tdma_ring_writel(priv, index, 0, TDMA_PROD_INDEX); bcmgenet_tdma_ring_writel(priv, index, 0, TDMA_CONS_INDEX); @@ -27,7 +27,7 @@ Signed-off-by: Phil Elwell /* Disable rate control for now */ bcmgenet_tdma_ring_writel(priv, index, flow_period_val, TDMA_FLOW_PERIOD); -@@ -3584,9 +3584,12 @@ static int bcmgenet_probe(struct platfor +@@ -3582,9 +3582,12 @@ static int bcmgenet_probe(struct platfor netif_set_real_num_rx_queues(priv->dev, priv->hw_params->rx_queues + 1); /* Set default coalescing parameters */ diff --git a/target/linux/bcm27xx/patches-4.19/950-0573-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch b/target/linux/bcm27xx/patches-4.19/950-0573-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch index 5df9ceca9c..f098ff8d22 100644 --- a/target/linux/bcm27xx/patches-4.19/950-0573-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch +++ b/target/linux/bcm27xx/patches-4.19/950-0573-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch @@ -15,7 +15,7 @@ Signed-off-by: Jonathan Bell --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -1427,6 +1427,103 @@ command_cleanup: +@@ -1428,6 +1428,103 @@ command_cleanup: } /* @@ -119,7 +119,7 @@ Signed-off-by: Jonathan Bell * non-error returns are a promise to giveback() the urb later * we drop ownership so next owner (or urb unlink) can get it */ -@@ -5219,6 +5316,7 @@ static const struct hc_driver xhci_hc_dr +@@ -5226,6 +5323,7 @@ static const struct hc_driver xhci_hc_dr .endpoint_reset = xhci_endpoint_reset, .check_bandwidth = xhci_check_bandwidth, .reset_bandwidth = xhci_reset_bandwidth, diff --git a/target/linux/bcm27xx/patches-4.19/950-0658-net-bcmgenet-Workaround-2-for-Pi4-Ethernet-fail.patch b/target/linux/bcm27xx/patches-4.19/950-0658-net-bcmgenet-Workaround-2-for-Pi4-Ethernet-fail.patch index 44061a11ce..2eb92c616b 100644 --- a/target/linux/bcm27xx/patches-4.19/950-0658-net-bcmgenet-Workaround-2-for-Pi4-Ethernet-fail.patch +++ b/target/linux/bcm27xx/patches-4.19/950-0658-net-bcmgenet-Workaround-2-for-Pi4-Ethernet-fail.patch @@ -38,7 +38,7 @@ Signed-off-by: Phil Elwell static inline void bcmgenet_writel(u32 value, void __iomem *offset) { /* MIPS chips strapped for BE will automagically configure the -@@ -1999,6 +2003,11 @@ static void reset_umac(struct bcmgenet_p +@@ -1997,6 +2001,11 @@ static void reset_umac(struct bcmgenet_p bcmgenet_rbuf_ctrl_set(priv, 0); udelay(10); diff --git a/target/linux/generic/config-4.19 b/target/linux/generic/config-4.19 index 69c943b236..43cbd740cc 100644 --- a/target/linux/generic/config-4.19 +++ b/target/linux/generic/config-4.19 @@ -2927,6 +2927,7 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MPL115_SPI is not set # CONFIG_MPL3115 is not set # CONFIG_MPLS is not set +# CONFIG_MPLS_ROUTING is not set # CONFIG_MPU3050_I2C is not set # CONFIG_MQ_IOSCHED_DEADLINE is not set # CONFIG_MQ_IOSCHED_KYBER is not set @@ -4069,7 +4070,6 @@ CONFIG_RFKILL=y # CONFIG_ROMFS_FS is not set # CONFIG_ROSE is not set # CONFIG_RPCSEC_GSS_KRB5 is not set -# CONFIG_RPI_AXIPERF is not set # CONFIG_RPMSG_QCOM_GLINK_RPM is not set # CONFIG_RPMSG_VIRTIO is not set # CONFIG_RPR0521 is not set diff --git a/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c b/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c index 992689605d..4559418de7 100644 --- a/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c +++ b/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c @@ -39,7 +39,7 @@ #include "routerboot.h" -#define RB_HARDCONFIG_VER "0.04" +#define RB_HARDCONFIG_VER "0.05" #define RB_HC_PR_PFX "[rb_hardconfig] " /* ID values for hardware settings */ @@ -58,6 +58,7 @@ #define RB_ID_BOARD_IDENTIFIER 0x17 #define RB_ID_PRODUCT_NAME 0x21 #define RB_ID_DEFCONF 0x26 +#define RB_ID_BOARD_REVISION 0x27 /* Bit definitions for hardware options */ #define RB_HW_OPT_NO_UART BIT(0) @@ -415,6 +416,10 @@ static struct hc_attr { .tag_id = RB_ID_DEFCONF, .tshow = routerboot_tag_show_string, .kattr = __ATTR(defconf, S_IRUSR, hc_attr_show, NULL), + }, { + .tag_id = RB_ID_BOARD_REVISION, + .tshow = routerboot_tag_show_string, + .kattr = __ATTR(board_revision, S_IRUSR, hc_attr_show, NULL), } }; diff --git a/target/linux/generic/files/drivers/platform/mikrotik/rb_softconfig.c b/target/linux/generic/files/drivers/platform/mikrotik/rb_softconfig.c index 7bef497c9b..51a178ec7c 100644 --- a/target/linux/generic/files/drivers/platform/mikrotik/rb_softconfig.c +++ b/target/linux/generic/files/drivers/platform/mikrotik/rb_softconfig.c @@ -56,7 +56,7 @@ #include "routerboot.h" -#define RB_SOFTCONFIG_VER "0.02" +#define RB_SOFTCONFIG_VER "0.03" #define RB_SC_PR_PFX "[rb_softconfig] " /* @@ -121,22 +121,36 @@ #define RB_BOOT_DEVICE_FLSHONCE 8 // "boot in flash configuration mode once, then NAND" /* - * ATH79 CPU frequency indices. + * ATH79 9xxx CPU frequency indices. * It is unknown if they apply to all ATH79 RBs, and some do not seem to feature - * the up levels (QCA955x), while U3 is presumably AR9344-only. + * the upper levels (QCA955x), while F is presumably AR9344-only. */ -#define RB_CPU_FREQ_IDX_ATH79_D2 (0 << 3) -#define RB_CPU_FREQ_IDX_ATH79_D1 (1 << 3) // 0x8 -#define RB_CPU_FREQ_IDX_ATH79_N0 (2 << 3) // 0x10 - factory freq for many devices -#define RB_CPU_FREQ_IDX_ATH79_U1 (3 << 3) // 0x18 -#define RB_CPU_FREQ_IDX_ATH79_U2 (4 << 3) // 0x20 -#define RB_CPU_FREQ_IDX_ATH79_U3 (5 << 3) // 0x28 +#define RB_CPU_FREQ_IDX_ATH79_9X_A (0 << 3) +#define RB_CPU_FREQ_IDX_ATH79_9X_B (1 << 3) // 0x8 +#define RB_CPU_FREQ_IDX_ATH79_9X_C (2 << 3) // 0x10 - factory freq for many devices +#define RB_CPU_FREQ_IDX_ATH79_9X_D (3 << 3) // 0x18 +#define RB_CPU_FREQ_IDX_ATH79_9X_E (4 << 3) // 0x20 +#define RB_CPU_FREQ_IDX_ATH79_9X_F (5 << 3) // 0x28 -#define RB_CPU_FREQ_IDX_ATH79_MIN 0 // all devices support lowest setting -#define RB_CPU_FREQ_IDX_ATH79_AR9334_MAX 5 // stops at U3 -#define RB_CPU_FREQ_IDX_ATH79_QCA953X_MAX 4 // stops at U2 -#define RB_CPU_FREQ_IDX_ATH79_QCA9556_MAX 2 // stops at N0 -#define RB_CPU_FREQ_IDX_ATH79_QCA9558_MAX 3 // stops at U1 +#define RB_CPU_FREQ_IDX_ATH79_9X_MIN 0 // all devices support lowest setting +#define RB_CPU_FREQ_IDX_ATH79_9X_AR9334_MAX 5 // stops at F +#define RB_CPU_FREQ_IDX_ATH79_9X_QCA953X_MAX 4 // stops at E +#define RB_CPU_FREQ_IDX_ATH79_9X_QCA9556_MAX 2 // stops at C +#define RB_CPU_FREQ_IDX_ATH79_9X_QCA9558_MAX 3 // stops at D + +/* ATH79 7xxx CPU frequency indices. */ +#define RB_CPU_FREQ_IDX_ATH79_7X_A ((0 * 9) << 4) +#define RB_CPU_FREQ_IDX_ATH79_7X_B ((1 * 9) << 4) +#define RB_CPU_FREQ_IDX_ATH79_7X_C ((2 * 9) << 4) +#define RB_CPU_FREQ_IDX_ATH79_7X_D ((3 * 9) << 4) +#define RB_CPU_FREQ_IDX_ATH79_7X_E ((4 * 9) << 4) +#define RB_CPU_FREQ_IDX_ATH79_7X_F ((5 * 9) << 4) +#define RB_CPU_FREQ_IDX_ATH79_7X_G ((6 * 9) << 4) +#define RB_CPU_FREQ_IDX_ATH79_7X_H ((7 * 9) << 4) + +#define RB_CPU_FREQ_IDX_ATH79_7X_MIN 0 // all devices support lowest setting +#define RB_CPU_FREQ_IDX_ATH79_7X_AR724X_MAX 3 // stops at D +#define RB_CPU_FREQ_IDX_ATH79_7X_AR7161_MAX 7 // stops at H - check if applies to all AR71xx devices #define RB_SC_CRC32_OFFSET 4 // located right after magic @@ -168,8 +182,9 @@ static ssize_t sc_tag_show_u32tvs(const u8 *pld, u16 pld_len, char *buf, u32 data; // cpu-endian int i; + // fallback to raw hex output if we can't handle the input if (tvselmts < 0) - return tvselmts; + return routerboot_tag_show_u32s(pld, pld_len, buf); if (sizeof(data) != pld_len) return -EINVAL; @@ -387,39 +402,71 @@ static ssize_t sc_tag_store_bootdelays(const u8 *pld, u16 pld_len, const char *b /* Support CPU frequency accessors only when the tag format has been asserted */ #if defined(CONFIG_ATH79) -static struct sc_u32tvs const sc_cpufreq_indexes_ath79[] = { - RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_D2, "-2"), - RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_D1, "-1"), - RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_N0, "0"), - RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_U1, "+1"), - RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_U2, "+2"), - RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_U3, "+3"), +/* Use the same letter-based nomenclature as RouterBOOT */ +static struct sc_u32tvs const sc_cpufreq_indexes_ath79_9x[] = { + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_9X_A, "a"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_9X_B, "b"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_9X_C, "c"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_9X_D, "d"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_9X_E, "e"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_9X_F, "f"), }; -static int sc_tag_cpufreq_ath79_idxmax(void) -{ - int idx_max = -EOPNOTSUPP; +static struct sc_u32tvs const sc_cpufreq_indexes_ath79_7x[] = { + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_A, "a"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_B, "b"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_C, "c"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_D, "d"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_E, "e"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_F, "f"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_G, "g"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_H, "h"), +}; - if (soc_is_ar9344()) - idx_max = RB_CPU_FREQ_IDX_ATH79_AR9334_MAX; +static int sc_tag_cpufreq_ath79_arraysize(void) +{ + int idx_max; + + if (ATH79_SOC_AR7161 == ath79_soc) + idx_max = RB_CPU_FREQ_IDX_ATH79_7X_AR7161_MAX+1; + else if (soc_is_ar724x()) + idx_max = RB_CPU_FREQ_IDX_ATH79_7X_AR724X_MAX+1; + else if (soc_is_ar9344()) + idx_max = RB_CPU_FREQ_IDX_ATH79_9X_AR9334_MAX+1; else if (soc_is_qca953x()) - idx_max = RB_CPU_FREQ_IDX_ATH79_QCA953X_MAX; + idx_max = RB_CPU_FREQ_IDX_ATH79_9X_QCA953X_MAX+1; else if (soc_is_qca9556()) - idx_max = RB_CPU_FREQ_IDX_ATH79_QCA9556_MAX; + idx_max = RB_CPU_FREQ_IDX_ATH79_9X_QCA9556_MAX+1; else if (soc_is_qca9558()) - idx_max = RB_CPU_FREQ_IDX_ATH79_QCA9558_MAX; + idx_max = RB_CPU_FREQ_IDX_ATH79_9X_QCA9558_MAX+1; + else + idx_max = -EOPNOTSUPP; return idx_max; } -static ssize_t sc_tag_show_cpufreq_indexes(const u8 *pld, u16 pld_len, char * buf) +static ssize_t sc_tag_show_cpufreq_indexes(const u8 *pld, u16 pld_len, char *buf) { - return sc_tag_show_u32tvs(pld, pld_len, buf, sc_cpufreq_indexes_ath79, sc_tag_cpufreq_ath79_idxmax()+1); + const struct sc_u32tvs *tvs; + + if (soc_is_ar71xx() || soc_is_ar724x()) + tvs = sc_cpufreq_indexes_ath79_7x; + else + tvs = sc_cpufreq_indexes_ath79_9x; + + return sc_tag_show_u32tvs(pld, pld_len, buf, tvs, sc_tag_cpufreq_ath79_arraysize()); } static ssize_t sc_tag_store_cpufreq_indexes(const u8 *pld, u16 pld_len, const char *buf, size_t count) { - return sc_tag_store_u32tvs(pld, pld_len, buf, count, sc_cpufreq_indexes_ath79, sc_tag_cpufreq_ath79_idxmax()+1); + const struct sc_u32tvs *tvs; + + if (soc_is_ar71xx() || soc_is_ar724x()) + tvs = sc_cpufreq_indexes_ath79_7x; + else + tvs = sc_cpufreq_indexes_ath79_9x; + + return sc_tag_store_u32tvs(pld, pld_len, buf, count, tvs, sc_tag_cpufreq_ath79_arraysize()); } #else /* By default we only show the raw value to help with reverse-engineering */ diff --git a/target/linux/generic/files/drivers/platform/mikrotik/routerboot.c b/target/linux/generic/files/drivers/platform/mikrotik/routerboot.c index 47e4471f8e..4c8c0bfac5 100644 --- a/target/linux/generic/files/drivers/platform/mikrotik/routerboot.c +++ b/target/linux/generic/files/drivers/platform/mikrotik/routerboot.c @@ -194,18 +194,18 @@ ssize_t routerboot_tag_show_string(const u8 *pld, u16 pld_len, char *buf) ssize_t routerboot_tag_show_u32s(const u8 *pld, u16 pld_len, char *buf) { char *out = buf; - u32 data; // cpu-endian + u32 *data; // cpu-endian /* Caller ensures pld_len > 0 */ - if (pld_len % sizeof(data)) + if (pld_len % sizeof(*data)) return -EINVAL; - data = *(u32 *)pld; + data = (u32 *)pld; do { - out += sprintf(out, "0x%08x\n", data); + out += sprintf(out, "0x%08x\n", *data); data++; - } while ((pld_len -= sizeof(data))); + } while ((pld_len -= sizeof(*data))); return out - buf; } diff --git a/target/linux/generic/hack-4.19/250-netfilter_depends.patch b/target/linux/generic/hack-4.19/250-netfilter_depends.patch index cb744bd8ab..e18d201c1e 100644 --- a/target/linux/generic/hack-4.19/250-netfilter_depends.patch +++ b/target/linux/generic/hack-4.19/250-netfilter_depends.patch @@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau depends on NETFILTER_ADVANCED help H.323 is a VoIP signalling protocol from ITU-T. As one of the most -@@ -1077,7 +1076,6 @@ config NETFILTER_XT_TARGET_SECMARK +@@ -1089,7 +1088,6 @@ config NETFILTER_XT_TARGET_SECMARK config NETFILTER_XT_TARGET_TCPMSS tristate '"TCPMSS" target support' diff --git a/target/linux/generic/hack-4.19/661-use_fq_codel_by_default.patch b/target/linux/generic/hack-4.19/661-use_fq_codel_by_default.patch index 1710c13b15..398c143108 100644 --- a/target/linux/generic/hack-4.19/661-use_fq_codel_by_default.patch +++ b/target/linux/generic/hack-4.19/661-use_fq_codel_by_default.patch @@ -83,7 +83,7 @@ Signed-off-by: Felix Fietkau EXPORT_SYMBOL(default_qdisc_ops); /* Main transmission queue. */ -@@ -1026,7 +1026,7 @@ static void attach_one_default_qdisc(str +@@ -1034,7 +1034,7 @@ static void attach_one_default_qdisc(str void *_unused) { struct Qdisc *qdisc; diff --git a/target/linux/generic/hack-4.19/662-remove_pfifo_fast.patch b/target/linux/generic/hack-4.19/662-remove_pfifo_fast.patch index c89329c1cc..4164955edb 100644 --- a/target/linux/generic/hack-4.19/662-remove_pfifo_fast.patch +++ b/target/linux/generic/hack-4.19/662-remove_pfifo_fast.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c -@@ -613,207 +613,6 @@ struct Qdisc_ops noqueue_qdisc_ops __rea +@@ -621,207 +621,6 @@ struct Qdisc_ops noqueue_qdisc_ops __rea .owner = THIS_MODULE, }; diff --git a/target/linux/generic/hack-4.19/721-phy_packets.patch b/target/linux/generic/hack-4.19/721-phy_packets.patch index 0a3a0664d3..1f1e5bf43d 100644 --- a/target/linux/generic/hack-4.19/721-phy_packets.patch +++ b/target/linux/generic/hack-4.19/721-phy_packets.patch @@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau */ --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2547,6 +2547,10 @@ static inline int pskb_trim(struct sk_bu +@@ -2566,6 +2566,10 @@ static inline int pskb_trim(struct sk_bu return (len < skb->len) ? __pskb_trim(skb, len) : 0; } @@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau /** * pskb_trim_unique - remove end from a paged unique (not cloned) buffer * @skb: buffer to alter -@@ -2678,16 +2682,6 @@ static inline struct sk_buff *dev_alloc_ +@@ -2697,16 +2701,6 @@ static inline struct sk_buff *dev_alloc_ } @@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3251,10 +3251,20 @@ static int xmit_one(struct sk_buff *skb, +@@ -3259,10 +3259,20 @@ static int xmit_one(struct sk_buff *skb, #endif dev_queue_xmit_nit(skb, dev); @@ -136,7 +136,7 @@ Signed-off-by: Felix Fietkau #include #include -@@ -503,6 +504,22 @@ skb_fail: +@@ -555,6 +556,22 @@ skb_fail: } EXPORT_SYMBOL(__napi_alloc_skb); diff --git a/target/linux/generic/pending-4.19/601-add-kernel-imq-support.patch b/target/linux/generic/pending-4.19/601-add-kernel-imq-support.patch index 92ec940669..6ba37b6042 100644 --- a/target/linux/generic/pending-4.19/601-add-kernel-imq-support.patch +++ b/target/linux/generic/pending-4.19/601-add-kernel-imq-support.patch @@ -1132,7 +1132,7 @@ /* Interface address info used in eth_type_trans() */ unsigned char *dev_addr; -@@ -3940,6 +3945,19 @@ static inline void netif_tx_unlock_bh(st +@@ -3959,6 +3964,19 @@ static inline void netif_tx_unlock_bh(st } \ } diff --git a/target/linux/generic/pending-4.19/655-increase_skb_pad.patch b/target/linux/generic/pending-4.19/655-increase_skb_pad.patch index 94e325b0cc..4fce3c3025 100644 --- a/target/linux/generic/pending-4.19/655-increase_skb_pad.patch +++ b/target/linux/generic/pending-4.19/655-increase_skb_pad.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2511,7 +2511,7 @@ static inline int pskb_network_may_pull( +@@ -2530,7 +2530,7 @@ static inline int pskb_network_may_pull( * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8) */ #ifndef NET_SKB_PAD diff --git a/target/linux/generic/pending-4.19/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-4.19/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index 1a5b9c2a14..03e310a695 100644 --- a/target/linux/generic/pending-4.19/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-4.19/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau __u16 tc_index; /* traffic control index */ --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -5473,6 +5473,9 @@ static enum gro_result dev_gro_receive(s +@@ -5471,6 +5471,9 @@ static enum gro_result dev_gro_receive(s int same_flow; int grow; @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau if (netif_elide_gro(skb->dev)) goto normal; -@@ -7131,6 +7134,48 @@ static void __netdev_adjacent_dev_unlink +@@ -7129,6 +7132,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info, -@@ -7181,6 +7226,7 @@ static int __netdev_upper_dev_link(struc +@@ -7179,6 +7224,7 @@ static int __netdev_upper_dev_link(struc if (ret) return ret; @@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); ret = notifier_to_errno(ret); -@@ -7273,6 +7319,7 @@ void netdev_upper_dev_unlink(struct net_ +@@ -7271,6 +7317,7 @@ void netdev_upper_dev_unlink(struct net_ __netdev_adjacent_dev_unlink_neighbour(dev, upper_dev); @@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); -@@ -7912,6 +7959,7 @@ int dev_set_mac_address(struct net_devic +@@ -7910,6 +7957,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/ipq806x/Makefile b/target/linux/ipq806x/Makefile index 3b572d79af..6615b46440 100644 --- a/target/linux/ipq806x/Makefile +++ b/target/linux/ipq806x/Makefile @@ -24,7 +24,7 @@ DEFAULT_PACKAGES += \ kmod-ata-core kmod-ata-ahci kmod-ata-ahci-platform \ kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \ kmod-usb3 kmod-usb-dwc3-of-simple kmod-usb-phy-qcom-dwc3 kmod-usb-dwc3-qcom \ - kmod-ath10k-ct wpad uboot-envtools e2fsprogs autocore-arm \ + kmod-ath10k-ct wpad uboot-envtools e2fsprogs \ automount autosamba v2ray shadowsocks-libev-ss-redir shadowsocksr-libev-server \ luci-app-ipsec-vpnd luci-app-unblockmusic luci-app-zerotier ca-certificates diff --git a/target/toolchain/files/wrapper.sh b/target/toolchain/files/wrapper.sh index 2cbcc8c1e6..6a0cdfff6c 100755 --- a/target/toolchain/files/wrapper.sh +++ b/target/toolchain/files/wrapper.sh @@ -15,10 +15,10 @@ # PROGNAME=$0 -REALNAME=$(readlink -f $0) +REALNAME=$(readlink -f "$0") -REALNAME_BASE=$(basename $REALNAME) -REALNAME_DIR=$(dirname $REALNAME) +REALNAME_BASE=$(basename "$REALNAME") +REALNAME_DIR=$(dirname "$REALNAME") TARGET_FUNDAMENTAL_ASFLAGS='' TARGET_FUNDAMENTAL_CFLAGS='' @@ -30,7 +30,7 @@ TARGET_TOOLCHAIN_TRIPLET=${REALNAME_BASE%-*} BINARY=${PROGNAME##*-} # Parse our tool name, splitting it at '-' characters. -IFS=- read TOOLCHAIN_ARCH TOOLCHAIN_BUILDROOT TOOLCHAIN_OS TOOLCHAIN_PLATFORM PROGNAME << EOF +IFS=- read -r _ _ _ TOOLCHAIN_PLATFORM PROGNAME << EOF $REALNAME_BASE EOF @@ -71,16 +71,16 @@ esac # case $BINARY in cc|gcc|g++|c++|cpp) - exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin $GCC_SYSROOT_FLAGS $TARGET_FUNDAMENTAL_CFLAGS $TARGET_ROOTFS_CFLAGS "$@" + exec "$TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin" $GCC_SYSROOT_FLAGS $TARGET_FUNDAMENTAL_CFLAGS $TARGET_ROOTFS_CFLAGS "$@" ;; ld) - exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin $LD_SYSROOT_FLAGS $TARGET_FUNDAMENTAL_LDFLAGS "$@" + exec "$TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin" $LD_SYSROOT_FLAGS $TARGET_FUNDAMENTAL_LDFLAGS "$@" ;; as) - exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin $TARGET_FUNDAMENTAL_ASFLAGS "$@" + exec "$TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin" $TARGET_FUNDAMENTAL_ASFLAGS "$@" ;; *) - exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin "$@" + exec "$TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin" "$@" ;; esac diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile index 41ba9853fd..c25d181990 100644 --- a/toolchain/gdb/Makefile +++ b/toolchain/gdb/Makefile @@ -7,23 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gdb - -ifeq ($(CONFIG_arc),y) -PKG_VERSION:=arc-2017.09-gdb - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/arc-2017.09-gdb -PKG_HASH:=7e3c2a763bf500a40c5c4591a7e22c591dafc1f214b1d514895c1096e85c883a -GDB_DIR:=binutils-$(PKG_NAME)-$(PKG_VERSION) -PATCH_DIR:=./patches-arc -else PKG_VERSION:=8.3.1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gdb PKG_HASH:=1e55b4d7cdca7b34be12f4ceae651623aa73b2fd640152313f9f66a7149757c4 GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION) -endif HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(GDB_DIR) diff --git a/tools/firmware-utils/src/fw.h b/tools/firmware-utils/src/fw.h index 53a92a573c..778143d2c4 100644 --- a/tools/firmware-utils/src/fw.h +++ b/tools/firmware-utils/src/fw.h @@ -19,6 +19,7 @@ #ifndef FW_INCLUDED #define FW_INCLUDED +#include #include #define MAGIC_HEADER "OPEN" @@ -30,16 +31,16 @@ #define PART_NAME_LENGTH 16 typedef struct header { - char magic[MAGIC_LENGTH]; - char version[256]; + uint8_t magic[MAGIC_LENGTH]; + uint8_t version[256]; u_int32_t crc; u_int32_t pad; } __attribute__ ((packed)) header_t; typedef struct part { - char magic[MAGIC_LENGTH]; - char name[PART_NAME_LENGTH]; - char pad[12]; + uint8_t magic[MAGIC_LENGTH]; + uint8_t name[PART_NAME_LENGTH]; + uint8_t pad[12]; u_int32_t memaddr; u_int32_t index; u_int32_t baseaddr; @@ -54,13 +55,13 @@ typedef struct part_crc { } __attribute__ ((packed)) part_crc_t; typedef struct signature { - char magic[MAGIC_LENGTH]; + uint8_t magic[MAGIC_LENGTH]; u_int32_t crc; u_int32_t pad; } __attribute__ ((packed)) signature_t; typedef struct signature_rsa { - char magic[MAGIC_LENGTH]; + uint8_t magic[MAGIC_LENGTH]; // u_int32_t crc; unsigned char rsa_signature[256]; u_int32_t pad; diff --git a/tools/firmware-utils/src/hcsmakeimage.c b/tools/firmware-utils/src/hcsmakeimage.c index 7baa7b5845..2888810cc7 100644 --- a/tools/firmware-utils/src/hcsmakeimage.c +++ b/tools/firmware-utils/src/hcsmakeimage.c @@ -183,6 +183,7 @@ int main ( int argc, char** argv ) char* filebuffer = malloc ( buf.st_size+10 ); FILE* fd = fopen ( input,"r" ); fread ( filebuffer, 1, buf.st_size,fd ); + fclose (fd); if (!output) { output = malloc(strlen(input+5)); @@ -194,10 +195,13 @@ int main ( int argc, char** argv ) if (!fd_out) { fprintf(stderr, "Failed to open output file: %s\n", output); + free(filebuffer); exit(1); } fwrite ( head,1,sizeof ( ldr_header_t ),fd_out ); fwrite ( filebuffer,1,buf.st_size,fd_out ); printf("Firmware image %s is ready\n", output); + free(filebuffer); + fclose(fd_out); return 0; } diff --git a/tools/firmware-utils/src/mkfwimage.c b/tools/firmware-utils/src/mkfwimage.c index ff9011a0c4..591ce44a78 100644 --- a/tools/firmware-utils/src/mkfwimage.c +++ b/tools/firmware-utils/src/mkfwimage.c @@ -32,6 +32,7 @@ #include #include #include "fw.h" +#include "utils.h" typedef struct fw_layout_data { u_int32_t kern_start; @@ -204,21 +205,20 @@ static void write_header(void* mem, const char *magic, const char* version) header_t* header = mem; memset(header, 0, sizeof(header_t)); - memcpy(header->magic, magic, MAGIC_LENGTH); - strncpy(header->version, version, sizeof(header->version)); - header->crc = htonl(crc32(0L, (unsigned char *)header, - sizeof(header_t) - 2 * sizeof(u_int32_t))); + FW_MEMCPY_STR(header->magic, magic); + FW_MEMCPY_STR(header->version, version); + header->crc = htonl(crc32(0L, (uint8_t*) header, + sizeof(header_t) - 2 * sizeof(u_int32_t))); header->pad = 0L; } - static void write_signature(void* mem, u_int32_t sig_offset) { /* write signature */ signature_t* sign = (signature_t*)(mem + sig_offset); memset(sign, 0, sizeof(signature_t)); - memcpy(sign->magic, MAGIC_END, MAGIC_LENGTH); + FW_MEMCPY_STR(sign->magic, MAGIC_END); sign->crc = htonl(crc32(0L,(unsigned char *)mem, sig_offset)); sign->pad = 0L; } @@ -229,7 +229,7 @@ static void write_signature_rsa(void* mem, u_int32_t sig_offset) signature_rsa_t* sign = (signature_rsa_t*)(mem + sig_offset); memset(sign, 0, sizeof(signature_rsa_t)); - memcpy(sign->magic, MAGIC_ENDS, MAGIC_LENGTH); + FW_MEMCPY_STR(sign->magic, MAGIC_ENDS); // sign->crc = htonl(crc32(0L,(unsigned char *)mem, sig_offset)); sign->pad = 0L; } @@ -259,8 +259,8 @@ static int write_part(void* mem, part_data_t* d) munmap(addr, d->stats.st_size); memset(p->name, 0, PART_NAME_LENGTH); - memcpy(p->magic, MAGIC_PART, MAGIC_LENGTH); - memcpy(p->name, d->partition_name, PART_NAME_LENGTH); + FW_MEMCPY_STR(p->magic, MAGIC_PART); + FW_MEMCPY_STR(p->name, d->partition_name); p->index = htonl(d->partition_index); p->data_size = htonl(d->stats.st_size); diff --git a/tools/firmware-utils/src/utils.h b/tools/firmware-utils/src/utils.h new file mode 100644 index 0000000000..11ec740069 --- /dev/null +++ b/tools/firmware-utils/src/utils.h @@ -0,0 +1,11 @@ +#include +#include + +#pragma once + +#define FW_MEMCPY_STR(dst, src) \ + do { \ + size_t slen = strlen(src); \ + size_t dlen = sizeof(dst); \ + memcpy(dst, src, slen > dlen ? dlen : slen); \ + } while (0);