From 6fa39900b6132575ee8c9cb820a09a763e7cf342 Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Sat, 8 Mar 2025 19:41:16 +0000 Subject: [PATCH 1/8] kernel: igc: enable HW vlan tag insertion/stripping by default Add a pending patch [1] in order to do so. This will be moved to the backports section as soon as we know on which Linux version it will be merged. [1] https://lore.kernel.org/netdev/20250313093615.8037-1-rsalvaterra@gmail.com/ Signed-off-by: Rui Salvaterra --- ...an-tag-insertion-stripping-by-defaul.patch | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 target/linux/generic/pending-6.6/792-igc-enable-HW-vlan-tag-insertion-stripping-by-defaul.patch diff --git a/target/linux/generic/pending-6.6/792-igc-enable-HW-vlan-tag-insertion-stripping-by-defaul.patch b/target/linux/generic/pending-6.6/792-igc-enable-HW-vlan-tag-insertion-stripping-by-defaul.patch new file mode 100644 index 0000000000..0ca219457c --- /dev/null +++ b/target/linux/generic/pending-6.6/792-igc-enable-HW-vlan-tag-insertion-stripping-by-defaul.patch @@ -0,0 +1,32 @@ +From 8cae5a0d91fea01d90ce7c1827e26934a22ca2fa Mon Sep 17 00:00:00 2001 +From: Rui Salvaterra +Date: Wed, 5 Mar 2025 11:53:56 +0000 +Subject: [PATCH] igc: enable HW vlan tag insertion/stripping by default + +This is enabled by default in other Intel drivers I've checked (e1000, e1000e, +iavf, igb and ice). Fixes an out-of-the-box performance issue when running +OpenWrt on typical mini-PCs with igc-supported Ethernet controllers and 802.1Q +VLAN configurations, as ethtool isn't part of the default packages and sane +defaults are expected. + +In my specific case, with an Intel N100-based machine with four I226-V Ethernet +controllers, my upload performance increased from under 30 Mb/s to the expected +~1 Gb/s. + +Signed-off-by: Rui Salvaterra +--- + drivers/net/ethernet/intel/igc/igc_main.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/net/ethernet/intel/igc/igc_main.c ++++ b/drivers/net/ethernet/intel/igc/igc_main.c +@@ -6850,6 +6850,9 @@ static int igc_probe(struct pci_dev *pde + netdev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT | + NETDEV_XDP_ACT_XSK_ZEROCOPY; + ++ /* enable HW vlan tag insertion/stripping by default */ ++ netdev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX; ++ + /* MTU range: 68 - 9216 */ + netdev->min_mtu = ETH_MIN_MTU; + netdev->max_mtu = MAX_STD_JUMBO_FRAME_SIZE; From 696ad7b1aa09f89fccee1f5bc05275e282b8ccea Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 21 Mar 2025 11:39:07 +0000 Subject: [PATCH 2/8] mediatek: filogic: fix case statement in 01_leds Remove a stray '|' character from 01_leds which has accidentally been added. Reported-by: Chukun Pan Fixes: 63d56af6c6 ("mediatek: filogic: migrate Netgate N60 to upstream PHY LED control") Signed-off-by: Daniel Golle --- target/linux/mediatek/filogic/base-files/etc/board.d/01_leds | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds index b1ab57f97b..b63e33d68a 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds @@ -76,7 +76,7 @@ mercusys,mr90x-v1-ubi) ucidef_set_led_netdev "lan-2" "lan-2" "green:lan-2" "lan2" "link tx rx" ucidef_set_led_netdev "wan" "wan" "green:wan" "eth1" "link tx rx" ;; -netcore,n60|) +netcore,n60) ucidef_set_led_netdev "wan" "WAN" "mdio-bus:06:green:wan" "eth1" "link tx rx" ;; netgear,wax220) From 6ef0a35bb1a48f7c7daebaf8eeca877feffb47c7 Mon Sep 17 00:00:00 2001 From: "Daniel F. Dickinson" Date: Tue, 18 Feb 2025 23:58:06 -0500 Subject: [PATCH 3/8] ubox: fix logging to external filesystem As described in #13873, from 23.05.0 onwards logging to a file on an external filesystem fails under some conditions. This occurs because the log initscript had code added to prevent start logging to an external filesystem on boot, and added a trigger to start said logging when the external filesystem gets mounted. The issue is that for filesystems mount with fstab uci, the fstab scripts runs at START=11, while log runs at START=12, which means the external filesystem may already be mounted by the time the log initscript runs. Since the external filesystem is already mounted it does not trigger a hotplug event to trigger the trigger to start logging. This combination means the logging never automatically starts when the log file is on an external filesystem. We therefore add a check for the presence of a mounted filesystem when the log file is being sent to an fstab mounted filesystem. If the filesystem is mounted, we don't skip starting logging during boot. If the filesystem is not mounted then file logging is not started and the trigger will start the logging when the filesystem is mounted. Signed-off-by: Daniel F. Dickinson [improved commit message] Signed-off-by: Daniel Golle --- package/system/ubox/files/log.init | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package/system/ubox/files/log.init b/package/system/ubox/files/log.init index c6fdf44292..e02cc273da 100644 --- a/package/system/ubox/files/log.init +++ b/package/system/ubox/files/log.init @@ -52,8 +52,12 @@ start_service_file() } [ -z "${log_file}" ] && return + local mountpoint="$(procd_get_mountpoints "${log_file}")" + [ "$_BOOT" = "1" ] && - [ "$(procd_get_mountpoints "${log_file}")" ] && return 0 + [ "$mountpoint" ] && + ! grep -q ".* $mountpoint " /proc/mounts && + return 0 mkdir -p "$(dirname "${log_file}")" From 96cb1c88402aab9421f05679d7a3206d45df5835 Mon Sep 17 00:00:00 2001 From: Scott Mercer Date: Sun, 16 Mar 2025 23:40:13 -0400 Subject: [PATCH 4/8] uboot-tools: add stub package skeleton Add uboot-tools stub package skeleton which will replace uboot-envtools and also provide target-builds for other U-Boot tools. Signed-off-by: Scott Mercer --- package/boot/uboot-tools/Makefile | 49 +++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 package/boot/uboot-tools/Makefile diff --git a/package/boot/uboot-tools/Makefile b/package/boot/uboot-tools/Makefile new file mode 100644 index 0000000000..03917bd949 --- /dev/null +++ b/package/boot/uboot-tools/Makefile @@ -0,0 +1,49 @@ +include $(TOPDIR)/rules.mk + +PKG_DISTNAME:=u-boot +PKG_VERSION:=2025.01 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:= \ + https://ftp.denx.de/pub/u-boot \ + https://mirror.cyberbits.eu/u-boot \ + ftp://ftp.denx.de/pub/u-boot +PKG_HASH:=cdef7d507c93f1bbd9f015ea9bc21fa074268481405501945abc6f854d5b686f +PKG_SOURCE_SUBDIR:=$(PKG_DISTNAME)-$(PKG_VERSION) +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_DISTNAME)-$(PKG_VERSION) + +PKG_BUILD_DEPENDS:=fstools + +PKG_LICENSE:=GPL-2.0 GPL-2.0+ +PKG_LICENSE_FILES:=Licenses/README + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/uboot-tools + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=Boot Loaders + TITLE:=U-Boot bootloader Tools + URL:=http://www.denx.de/wiki/U-Boot +endef + +define Package/uboot-tools/description + U-Boot tools are a collection of utilities designed + to work with the U-Boot bootloader, +endef + +define Build/Configure + $(MAKE) -C $(PKG_BUILD_DIR) tools-only_defconfig + $(MAKE) -C $(PKG_BUILD_DIR) syncconfig +endef + +MAKE_FLAGS += \ + ARCH="sandbox" \ + TARGET_CFLAGS="$(TARGET_CFLAGS)" \ + TARGET_LDFLAGS="$(TARGET_LDFLAGS)" + +define Build/Compile +endef From 46e376c93514b63ca130075dc8b968c517f12ff7 Mon Sep 17 00:00:00 2001 From: Scott Mercer Date: Sun, 16 Mar 2025 23:50:33 -0400 Subject: [PATCH 5/8] uboot-tools: migrate uboot-envtools to uboot-tools Generalize and merge uboot-envtools package into uboot-tools package. Remove existing uboot-envtools package. Signed-off-by: Scott Mercer --- package/boot/uboot-envtools/Makefile | 90 ------------------- package/boot/uboot-tools/Makefile | 45 ++++++++++ .../patches/001-envtools-compile.patch} | 0 ...tools-env-use-run-to-store-lockfile.patch} | 0 .../uboot-envtools/files/apm821xx | 0 .../uboot-envtools/files/ath79 | 0 .../uboot-envtools/files/cns3xxx | 0 .../uboot-envtools/files/fw_defaults | 0 .../uboot-envtools/files/fw_loadenv | 0 .../uboot-envtools/files/fw_printsys | 0 .../uboot-envtools/files/fw_setsys | 0 .../uboot-envtools/files/imx_cortexa7 | 0 .../uboot-envtools/files/imx_cortexa9 | 0 .../uboot-envtools/files/ipq40xx | 0 .../uboot-envtools/files/ipq806x | 0 .../uboot-envtools/files/kirkwood | 0 .../uboot-envtools/files/lantiq | 0 .../uboot-envtools/files/layerscape | 0 .../uboot-envtools/files/mediatek_filogic | 0 .../uboot-envtools/files/mediatek_mt7622 | 0 .../uboot-envtools/files/mediatek_mt7623 | 0 .../uboot-envtools/files/mediatek_mt7629 | 0 .../uboot-envtools/files/mpc85xx | 0 .../uboot-envtools/files/mvebu | 0 .../uboot-envtools/files/mxs | 0 .../uboot-envtools/files/octeon | 0 .../uboot-envtools/files/oxnas | 0 .../uboot-envtools/files/pistachio | 0 .../uboot-envtools/files/qoriq | 0 .../uboot-envtools/files/qualcommax_ipq50xx | 0 .../uboot-envtools/files/qualcommax_ipq60xx | 0 .../uboot-envtools/files/qualcommax_ipq807x | 0 .../uboot-envtools/files/ramips | 0 .../uboot-envtools/files/realtek | 0 .../uboot-envtools/files/rockchip_armv8 | 0 .../uboot-envtools/files/uboot-envtools.sh | 0 36 files changed, 45 insertions(+), 90 deletions(-) delete mode 100644 package/boot/uboot-envtools/Makefile rename package/boot/{uboot-envtools/patches/001-compile.patch => uboot-tools/patches/001-envtools-compile.patch} (100%) rename package/boot/{uboot-envtools/patches/002-Revert-tools-env-use-run-to-store-lockfile.patch => uboot-tools/patches/002-envtools-revert-tools-env-use-run-to-store-lockfile.patch} (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/apm821xx (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/ath79 (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/cns3xxx (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/fw_defaults (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/fw_loadenv (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/fw_printsys (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/fw_setsys (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/imx_cortexa7 (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/imx_cortexa9 (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/ipq40xx (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/ipq806x (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/kirkwood (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/lantiq (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/layerscape (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/mediatek_filogic (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/mediatek_mt7622 (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/mediatek_mt7623 (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/mediatek_mt7629 (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/mpc85xx (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/mvebu (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/mxs (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/octeon (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/oxnas (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/pistachio (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/qoriq (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/qualcommax_ipq50xx (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/qualcommax_ipq60xx (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/qualcommax_ipq807x (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/ramips (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/realtek (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/rockchip_armv8 (100%) rename package/boot/{ => uboot-tools}/uboot-envtools/files/uboot-envtools.sh (100%) diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile deleted file mode 100644 index 5b52c3b395..0000000000 --- a/package/boot/uboot-envtools/Makefile +++ /dev/null @@ -1,90 +0,0 @@ -# -# Copyright (C) 2006-2014 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:=uboot-envtools -PKG_DISTNAME:=u-boot -PKG_VERSION:=2025.01 -PKG_RELEASE:=1 - -PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:= \ - https://ftp.denx.de/pub/u-boot \ - https://mirror.cyberbits.eu/u-boot \ - ftp://ftp.denx.de/pub/u-boot -PKG_HASH:=cdef7d507c93f1bbd9f015ea9bc21fa074268481405501945abc6f854d5b686f -PKG_SOURCE_SUBDIR:=$(PKG_DISTNAME)-$(PKG_VERSION) -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_DISTNAME)-$(PKG_VERSION) - -PKG_BUILD_DEPENDS:=fstools - -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - -PKG_FLAGS:=nonshared - -PKG_BUILD_PARALLEL:=1 - -include $(INCLUDE_DIR)/package.mk - -define Package/uboot-envtools - SECTION:=utils - CATEGORY:=Utilities - SUBMENU:=Boot Loaders - TITLE:=read/modify U-Boot bootloader environment - URL:=http://www.denx.de/wiki/U-Boot -endef - -define Package/uboot-envtools/description - This package includes tools to read and modify U-Boot bootloader environment. -endef - -define Build/Configure - $(call Build/Compile/Default,tools-only_defconfig) -endef - -define Build/Compile - $(call Build/Compile/Default,envtools) -endef - -# We need to override the ARCH passed by buildsystem as otherwise the defconfig -# for tools-only wont match and the includes for sandbox will be dropped -MAKE_FLAGS += \ - ARCH="sandbox" \ - TARGET_CFLAGS="$(TARGET_CFLAGS)" \ - TARGET_LDFLAGS="$(TARGET_LDFLAGS)" - -define Package/uboot-envtools/conffiles -/etc/config/ubootenv -/etc/fw_env.config -/etc/fw_sys.config -endef - -define Package/uboot-envtools/install - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/env/fw_printenv $(1)/usr/sbin - $(LN) fw_printenv $(1)/usr/sbin/fw_setenv - $(INSTALL_BIN) ./files/fw_printsys $(1)/usr/sbin - $(INSTALL_BIN) ./files/fw_setsys $(1)/usr/sbin - $(INSTALL_BIN) ./files/fw_loadenv $(1)/usr/sbin - $(INSTALL_DIR) $(1)/etc/board.d - $(INSTALL_DATA) ./files/fw_defaults $(1)/etc/board.d/05_fw_defaults - $(INSTALL_DIR) $(1)/lib - $(INSTALL_DATA) ./files/uboot-envtools.sh $(1)/lib - $(INSTALL_DIR) $(1)/etc/uci-defaults - $(if $(wildcard ./files/$(BOARD)_$(SUBTARGET)), \ - $(INSTALL_DATA) ./files/$(BOARD)_$(SUBTARGET) \ - $(1)/etc/uci-defaults/30_uboot-envtools, \ - $(if $(wildcard ./files/$(BOARD)), \ - $(INSTALL_DATA) ./files/$(BOARD) \ - $(1)/etc/uci-defaults/30_uboot-envtools \ - ) \ - ) -endef - -$(eval $(call BuildPackage,uboot-envtools)) diff --git a/package/boot/uboot-tools/Makefile b/package/boot/uboot-tools/Makefile index 03917bd949..de738725f2 100644 --- a/package/boot/uboot-tools/Makefile +++ b/package/boot/uboot-tools/Makefile @@ -35,6 +35,26 @@ define Package/uboot-tools/description to work with the U-Boot bootloader, endef +define Package/uboot-envtools + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=Boot Loaders + PKG_FLAGS+=nonshared + TITLE:=read/modify U-Boot bootloader environment + URL:=http://www.denx.de/wiki/U-Boot +endef + +define Package/uboot-envtools/description + This package includes tools to read and modify U-Boot + bootloader environment. +endef + +define Package/uboot-envtools/conffiles + /etc/config/ubootenv + /etc/fw_env.config + /etc/fw_sys.config +endef + define Build/Configure $(MAKE) -C $(PKG_BUILD_DIR) tools-only_defconfig $(MAKE) -C $(PKG_BUILD_DIR) syncconfig @@ -46,4 +66,29 @@ MAKE_FLAGS += \ TARGET_LDFLAGS="$(TARGET_LDFLAGS)" define Build/Compile + $(call Build/Compile/Default,envtools) endef + +define Package/uboot-envtools/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/env/fw_printenv $(1)/usr/sbin + $(LN) fw_printenv $(1)/usr/sbin/fw_setenv + $(INSTALL_BIN) ./uboot-envtools/files/fw_printsys $(1)/usr/sbin + $(INSTALL_BIN) ./uboot-envtools/files/fw_setsys $(1)/usr/sbin + $(INSTALL_BIN) ./uboot-envtools/files/fw_loadenv $(1)/usr/sbin + $(INSTALL_DIR) $(1)/etc/board.d + $(INSTALL_DATA) ./uboot-envtools/files/fw_defaults $(1)/etc/board.d/05_fw_defaults + $(INSTALL_DIR) $(1)/lib + $(INSTALL_DATA) ./uboot-envtools/files/uboot-envtools.sh $(1)/lib + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(if $(wildcard ./uboot-envtools/files/$(BOARD)_$(SUBTARGET)), \ + $(INSTALL_DATA) ./uboot-envtools/files/$(BOARD)_$(SUBTARGET) \ + $(1)/etc/uci-defaults/30_uboot-envtools, \ + $(if $(wildcard ./uboot-envtools/files/$(BOARD)), \ + $(INSTALL_DATA) ./uboot-envtools/files/$(BOARD) \ + $(1)/etc/uci-defaults/30_uboot-envtools \ + ) \ + ) +endef + +$(eval $(call BuildPackage,uboot-envtools)) diff --git a/package/boot/uboot-envtools/patches/001-compile.patch b/package/boot/uboot-tools/patches/001-envtools-compile.patch similarity index 100% rename from package/boot/uboot-envtools/patches/001-compile.patch rename to package/boot/uboot-tools/patches/001-envtools-compile.patch diff --git a/package/boot/uboot-envtools/patches/002-Revert-tools-env-use-run-to-store-lockfile.patch b/package/boot/uboot-tools/patches/002-envtools-revert-tools-env-use-run-to-store-lockfile.patch similarity index 100% rename from package/boot/uboot-envtools/patches/002-Revert-tools-env-use-run-to-store-lockfile.patch rename to package/boot/uboot-tools/patches/002-envtools-revert-tools-env-use-run-to-store-lockfile.patch diff --git a/package/boot/uboot-envtools/files/apm821xx b/package/boot/uboot-tools/uboot-envtools/files/apm821xx similarity index 100% rename from package/boot/uboot-envtools/files/apm821xx rename to package/boot/uboot-tools/uboot-envtools/files/apm821xx diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-tools/uboot-envtools/files/ath79 similarity index 100% rename from package/boot/uboot-envtools/files/ath79 rename to package/boot/uboot-tools/uboot-envtools/files/ath79 diff --git a/package/boot/uboot-envtools/files/cns3xxx b/package/boot/uboot-tools/uboot-envtools/files/cns3xxx similarity index 100% rename from package/boot/uboot-envtools/files/cns3xxx rename to package/boot/uboot-tools/uboot-envtools/files/cns3xxx diff --git a/package/boot/uboot-envtools/files/fw_defaults b/package/boot/uboot-tools/uboot-envtools/files/fw_defaults similarity index 100% rename from package/boot/uboot-envtools/files/fw_defaults rename to package/boot/uboot-tools/uboot-envtools/files/fw_defaults diff --git a/package/boot/uboot-envtools/files/fw_loadenv b/package/boot/uboot-tools/uboot-envtools/files/fw_loadenv similarity index 100% rename from package/boot/uboot-envtools/files/fw_loadenv rename to package/boot/uboot-tools/uboot-envtools/files/fw_loadenv diff --git a/package/boot/uboot-envtools/files/fw_printsys b/package/boot/uboot-tools/uboot-envtools/files/fw_printsys similarity index 100% rename from package/boot/uboot-envtools/files/fw_printsys rename to package/boot/uboot-tools/uboot-envtools/files/fw_printsys diff --git a/package/boot/uboot-envtools/files/fw_setsys b/package/boot/uboot-tools/uboot-envtools/files/fw_setsys similarity index 100% rename from package/boot/uboot-envtools/files/fw_setsys rename to package/boot/uboot-tools/uboot-envtools/files/fw_setsys diff --git a/package/boot/uboot-envtools/files/imx_cortexa7 b/package/boot/uboot-tools/uboot-envtools/files/imx_cortexa7 similarity index 100% rename from package/boot/uboot-envtools/files/imx_cortexa7 rename to package/boot/uboot-tools/uboot-envtools/files/imx_cortexa7 diff --git a/package/boot/uboot-envtools/files/imx_cortexa9 b/package/boot/uboot-tools/uboot-envtools/files/imx_cortexa9 similarity index 100% rename from package/boot/uboot-envtools/files/imx_cortexa9 rename to package/boot/uboot-tools/uboot-envtools/files/imx_cortexa9 diff --git a/package/boot/uboot-envtools/files/ipq40xx b/package/boot/uboot-tools/uboot-envtools/files/ipq40xx similarity index 100% rename from package/boot/uboot-envtools/files/ipq40xx rename to package/boot/uboot-tools/uboot-envtools/files/ipq40xx diff --git a/package/boot/uboot-envtools/files/ipq806x b/package/boot/uboot-tools/uboot-envtools/files/ipq806x similarity index 100% rename from package/boot/uboot-envtools/files/ipq806x rename to package/boot/uboot-tools/uboot-envtools/files/ipq806x diff --git a/package/boot/uboot-envtools/files/kirkwood b/package/boot/uboot-tools/uboot-envtools/files/kirkwood similarity index 100% rename from package/boot/uboot-envtools/files/kirkwood rename to package/boot/uboot-tools/uboot-envtools/files/kirkwood diff --git a/package/boot/uboot-envtools/files/lantiq b/package/boot/uboot-tools/uboot-envtools/files/lantiq similarity index 100% rename from package/boot/uboot-envtools/files/lantiq rename to package/boot/uboot-tools/uboot-envtools/files/lantiq diff --git a/package/boot/uboot-envtools/files/layerscape b/package/boot/uboot-tools/uboot-envtools/files/layerscape similarity index 100% rename from package/boot/uboot-envtools/files/layerscape rename to package/boot/uboot-tools/uboot-envtools/files/layerscape diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic similarity index 100% rename from package/boot/uboot-envtools/files/mediatek_filogic rename to package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic diff --git a/package/boot/uboot-envtools/files/mediatek_mt7622 b/package/boot/uboot-tools/uboot-envtools/files/mediatek_mt7622 similarity index 100% rename from package/boot/uboot-envtools/files/mediatek_mt7622 rename to package/boot/uboot-tools/uboot-envtools/files/mediatek_mt7622 diff --git a/package/boot/uboot-envtools/files/mediatek_mt7623 b/package/boot/uboot-tools/uboot-envtools/files/mediatek_mt7623 similarity index 100% rename from package/boot/uboot-envtools/files/mediatek_mt7623 rename to package/boot/uboot-tools/uboot-envtools/files/mediatek_mt7623 diff --git a/package/boot/uboot-envtools/files/mediatek_mt7629 b/package/boot/uboot-tools/uboot-envtools/files/mediatek_mt7629 similarity index 100% rename from package/boot/uboot-envtools/files/mediatek_mt7629 rename to package/boot/uboot-tools/uboot-envtools/files/mediatek_mt7629 diff --git a/package/boot/uboot-envtools/files/mpc85xx b/package/boot/uboot-tools/uboot-envtools/files/mpc85xx similarity index 100% rename from package/boot/uboot-envtools/files/mpc85xx rename to package/boot/uboot-tools/uboot-envtools/files/mpc85xx diff --git a/package/boot/uboot-envtools/files/mvebu b/package/boot/uboot-tools/uboot-envtools/files/mvebu similarity index 100% rename from package/boot/uboot-envtools/files/mvebu rename to package/boot/uboot-tools/uboot-envtools/files/mvebu diff --git a/package/boot/uboot-envtools/files/mxs b/package/boot/uboot-tools/uboot-envtools/files/mxs similarity index 100% rename from package/boot/uboot-envtools/files/mxs rename to package/boot/uboot-tools/uboot-envtools/files/mxs diff --git a/package/boot/uboot-envtools/files/octeon b/package/boot/uboot-tools/uboot-envtools/files/octeon similarity index 100% rename from package/boot/uboot-envtools/files/octeon rename to package/boot/uboot-tools/uboot-envtools/files/octeon diff --git a/package/boot/uboot-envtools/files/oxnas b/package/boot/uboot-tools/uboot-envtools/files/oxnas similarity index 100% rename from package/boot/uboot-envtools/files/oxnas rename to package/boot/uboot-tools/uboot-envtools/files/oxnas diff --git a/package/boot/uboot-envtools/files/pistachio b/package/boot/uboot-tools/uboot-envtools/files/pistachio similarity index 100% rename from package/boot/uboot-envtools/files/pistachio rename to package/boot/uboot-tools/uboot-envtools/files/pistachio diff --git a/package/boot/uboot-envtools/files/qoriq b/package/boot/uboot-tools/uboot-envtools/files/qoriq similarity index 100% rename from package/boot/uboot-envtools/files/qoriq rename to package/boot/uboot-tools/uboot-envtools/files/qoriq diff --git a/package/boot/uboot-envtools/files/qualcommax_ipq50xx b/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq50xx similarity index 100% rename from package/boot/uboot-envtools/files/qualcommax_ipq50xx rename to package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq50xx diff --git a/package/boot/uboot-envtools/files/qualcommax_ipq60xx b/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq60xx similarity index 100% rename from package/boot/uboot-envtools/files/qualcommax_ipq60xx rename to package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq60xx diff --git a/package/boot/uboot-envtools/files/qualcommax_ipq807x b/package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq807x similarity index 100% rename from package/boot/uboot-envtools/files/qualcommax_ipq807x rename to package/boot/uboot-tools/uboot-envtools/files/qualcommax_ipq807x diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-tools/uboot-envtools/files/ramips similarity index 100% rename from package/boot/uboot-envtools/files/ramips rename to package/boot/uboot-tools/uboot-envtools/files/ramips diff --git a/package/boot/uboot-envtools/files/realtek b/package/boot/uboot-tools/uboot-envtools/files/realtek similarity index 100% rename from package/boot/uboot-envtools/files/realtek rename to package/boot/uboot-tools/uboot-envtools/files/realtek diff --git a/package/boot/uboot-envtools/files/rockchip_armv8 b/package/boot/uboot-tools/uboot-envtools/files/rockchip_armv8 similarity index 100% rename from package/boot/uboot-envtools/files/rockchip_armv8 rename to package/boot/uboot-tools/uboot-envtools/files/rockchip_armv8 diff --git a/package/boot/uboot-envtools/files/uboot-envtools.sh b/package/boot/uboot-tools/uboot-envtools/files/uboot-envtools.sh similarity index 100% rename from package/boot/uboot-envtools/files/uboot-envtools.sh rename to package/boot/uboot-tools/uboot-envtools/files/uboot-envtools.sh From 635be2a3293f00e41186934cc721b78b1f0712d4 Mon Sep 17 00:00:00 2001 From: Scott Mercer Date: Sun, 16 Mar 2025 23:57:29 -0400 Subject: [PATCH 6/8] uboot-tools: create dumpimage package Ddd dumpimage package to uboot-tools. Add patches to fix compile for uboot versions >= 2024.01 Signed-off-by: Scott Mercer --- package/boot/uboot-tools/Makefile | 24 ++++++ ...001-tools-dumpimage-disable-kwbimage.patch | 32 +++++++ ...02-tools-dumpimage-fix-tools-compile.patch | 84 +++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 package/boot/uboot-tools/patches/0001-tools-dumpimage-disable-kwbimage.patch create mode 100644 package/boot/uboot-tools/patches/0002-tools-dumpimage-fix-tools-compile.patch diff --git a/package/boot/uboot-tools/Makefile b/package/boot/uboot-tools/Makefile index de738725f2..dd47d84a59 100644 --- a/package/boot/uboot-tools/Makefile +++ b/package/boot/uboot-tools/Makefile @@ -35,6 +35,22 @@ define Package/uboot-tools/description to work with the U-Boot bootloader, endef +define Package/dumpimage + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=Boot Loaders + DEPENDS := +libopenssl + TITLE:=dumpimage lists and extracts data from U-Boot images. + URL:=http://www.denx.de/wiki/U-Boot +endef + +define Package/dumpimage/description + dumpimage lists and extracts data from U-Boot images. + If -l is specified, dumpimage lists the components in + image.Otherwise, dumpimage extracts the component at + position to outfile. +endef + define Package/uboot-envtools SECTION:=utils CATEGORY:=Utilities @@ -58,6 +74,7 @@ endef define Build/Configure $(MAKE) -C $(PKG_BUILD_DIR) tools-only_defconfig $(MAKE) -C $(PKG_BUILD_DIR) syncconfig + $(SED) 's/CONFIG_TOOLS_LIBCRYPTO=y/# CONFIG_TOOLS_LIBCRYPTO is not set/' $(PKG_BUILD_DIR)/.config endef MAKE_FLAGS += \ @@ -67,6 +84,12 @@ MAKE_FLAGS += \ define Build/Compile $(call Build/Compile/Default,envtools) + $(call Build/Compile/Default,cross_tools) +endef + +define Package/dumpimage/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/dumpimage $(1)/usr/bin endef define Package/uboot-envtools/install @@ -91,4 +114,5 @@ define Package/uboot-envtools/install ) endef +$(eval $(call BuildPackage,dumpimage)) $(eval $(call BuildPackage,uboot-envtools)) diff --git a/package/boot/uboot-tools/patches/0001-tools-dumpimage-disable-kwbimage.patch b/package/boot/uboot-tools/patches/0001-tools-dumpimage-disable-kwbimage.patch new file mode 100644 index 0000000000..4af6510c44 --- /dev/null +++ b/package/boot/uboot-tools/patches/0001-tools-dumpimage-disable-kwbimage.patch @@ -0,0 +1,32 @@ +diff --git a/package/boot/u-boot-tools/patches/0001-tools-disable-kwbimage.patch b/package/boot/u-boot-tools/patches/0001-tools-disable-kwbimage.patch +new file mode 100644 +index 0000000000..69a42ec383 +--- /dev/null ++++ b/package/boot/u-boot-tools/patches/0001-tools-disable-kwbimage.patch +@@ -0,0 +1,25 @@ ++From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= ++Date: Tue, 30 Nov 2021 11:29:19 +0100 ++Subject: [PATCH] tools: disable kwbimage ++MIME-Version: 1.0 ++Content-Type: text/plain; charset=UTF-8 ++Content-Transfer-Encoding: 8bit ++ ++Without CONFIG_TOOLS_LIBCRYPTO kwbimage doesn't compile because of ++multiple "undefined reference"s to SSL functions. ++ ++Signed-off-by: Rafał Miłecki ++--- ++ tools/Makefile | 1 - ++ 1 file changed, 1 deletion(-) ++ ++--- a/tools/Makefile +++++ b/tools/Makefile ++@@ -117,7 +117,6 @@ dumpimage-mkimage-objs := aisimage.o \ ++ imximage.o \ ++ imx8image.o \ ++ imx8mimage.o \ ++- kwbimage.o \ ++ lib/md5.o \ ++ lpc32xximage.o \ ++ mxsimage.o \ + diff --git a/package/boot/uboot-tools/patches/0002-tools-dumpimage-fix-tools-compile.patch b/package/boot/uboot-tools/patches/0002-tools-dumpimage-fix-tools-compile.patch new file mode 100644 index 0000000000..ab2e817b57 --- /dev/null +++ b/package/boot/uboot-tools/patches/0002-tools-dumpimage-fix-tools-compile.patch @@ -0,0 +1,84 @@ +From 1ceffec2523888b4701405b7cf1710489e17011a Mon Sep 17 00:00:00 2001 +From: Scott Mercer +Date: Wed, 19 Mar 2025 06:31:44 -0400 +Subject: [PATCH] ipq50xx: packages: dumpimage: fix compile patch + +This patch is to fix compilation for uboot-tool V2025.01 in openwrt. + +* same "compile for enviroment patch" to makefile, that is used + in uboot-envtools. + +* remove mkeficapsule from build to avoid gnulib dependencies + +* disable bmp_logo from build to allow compilation + +Signed-off-by: Scott Mercer +--- + tools/Makefile | 38 ++++++++++++++++++++++++++------------ + 1 file changed, 26 insertions(+), 12 deletions(-) + +diff --git a/tools/Makefile b/tools/Makefile +index ee08a9675df8..a72b7909a066 100644 +--- a/tools/Makefile ++++ b/tools/Makefile +@@ -22,6 +22,26 @@ + # That's as long as the features of those tools aren't modified. + # + ++override HOSTCC = $(CC) ++ ++ifneq ($(TARGET_CFLAGS),) ++KBUILD_HOSTCFLAGS = $(TARGET_CFLAGS) ++endif ++ifneq ($(TARGET_LDFLAGS),) ++KBUILD_HOSTLDFLAGS = $(TARGET_LDFLAGS) ++endif ++ ++# Compile for a hosted environment on the target ++HOST_EXTRACFLAGS = -I$(srctree)/tools \ ++ $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \ ++ -idirafter $(srctree)/tools/env \ ++ -DUSE_HOSTCC \ ++ -DTEXT_BASE=$(TEXT_BASE) ++ ++ifeq ($(MTD_VERSION),old) ++HOST_EXTRACFLAGS += -DMTD_OLD ++endif ++ + # Enable all the config-independent tools + ifneq ($(HOST_TOOLS_ALL),) + CONFIG_ARCH_KIRKWOOD = y +@@ -244,15 +264,10 @@ hostprogs-$(CONFIG_MIPS) += mips-relocs + hostprogs-$(CONFIG_ASN1_COMPILER) += asn1_compiler + HOSTCFLAGS_asn1_compiler.o = -idirafter $(srctree)/include + +-HOSTCFLAGS_mkeficapsule.o += \ +- $(shell pkg-config --cflags gnutls 2> /dev/null || echo "") +-HOSTLDLIBS_mkeficapsule += \ +- $(shell pkg-config --libs gnutls 2> /dev/null || echo "-lgnutls") +-mkeficapsule-objs := generated/lib/uuid.o \ +- generated/lib/sha1.o \ +- $(LIBFDT_OBJS) \ +- mkeficapsule.o +-hostprogs-$(CONFIG_TOOLS_MKEFICAPSULE) += mkeficapsule ++HOSTCFLAGS_mkeficapsule.o += ++HOSTLDLIBS_mkeficapsule += ++mkeficapsule-objs := ++hostprogs-$(CONFIG_TOOLS_MKEFICAPSULE) += + + mkfwumdata-objs := mkfwumdata.o generated/lib/crc32.o + HOSTLDLIBS_mkfwumdata += -luuid +@@ -313,10 +328,9 @@ HOST_EXTRACFLAGS += -include $(srctree)/include/compiler.h \ + -I$(srctree)/scripts/dtc/libfdt \ + -I$(srctree)/tools \ + -DUSE_HOSTCC \ +- -D__KERNEL_STRICT_NAMES \ +- -D_GNU_SOURCE ++ -D__KERNEL_STRICT_NAMES + +-__build: $(LOGO-y) ++__build: $(LOGO-n) + + $(LOGO_H): $(obj)/bmp_logo $(LOGO_BMP) + $(obj)/bmp_logo --gen-info $(LOGO_BMP) > $@ + From a015f59880c72a1bdd07de32491f85ce7f8d2a1c Mon Sep 17 00:00:00 2001 From: Paul Donald Date: Sun, 21 Apr 2024 23:18:36 +0200 Subject: [PATCH 7/8] lldpd: get_config_cid_ifaces() -> get_interface_csv() where csv = comma separated value(s) Make the function more generic. Can use it for not only 'config'. Now it can be used to parse interfaces for additional lldpd settings, e.g. custom-tlv. Tested on: 22.03.6 Signed-off-by: Paul Donald Link: https://github.com/openwrt/openwrt/pull/14872 Signed-off-by: Robert Marko --- package/network/services/lldpd/files/lldpd.init | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init index 6c1c184bfa..2ad59f8cb1 100644 --- a/package/network/services/lldpd/files/lldpd.init +++ b/package/network/services/lldpd/files/lldpd.init @@ -75,9 +75,9 @@ get_config_restart_hash() { export -n "$var=$_hash" } -get_config_cid_ifaces() { +get_interface_csv() { local _ifaces - config_get _ifaces 'config' "$2" + config_get _ifaces "$2" "$3" local _iface _ifnames="" # Set noglob to prevent '*' capturing diverse file names in the for ... in @@ -109,7 +109,7 @@ write_lldpd_conf() config_get lldp_hostname 'config' 'lldp_hostname' "$(cat /proc/sys/kernel/hostname)" local ifnames - get_config_cid_ifaces ifnames "interface" + get_interface_csv ifnames 'config' "interface" local lldp_mgmt_ip config_get lldp_mgmt_ip 'config' 'lldp_mgmt_ip' @@ -335,7 +335,7 @@ start_service() { # ChassisID interfaces local ifnames - get_config_cid_ifaces ifnames "cid_interface" + get_interface_csv ifnames 'config' "cid_interface" [ -n "$ifnames" ] && procd_append_param command -C "$ifnames" From 8d1fe32c2c46a8de519f9926be2bc062cef66f24 Mon Sep 17 00:00:00 2001 From: Paul Donald Date: Mon, 22 Apr 2024 00:08:48 +0200 Subject: [PATCH 8/8] lldpd: add `custom-tlv` handling Do not verify the format of TLV. Leave that to lldpd. These lldpd config entries: config custom-tlv list ports 'eth0' option tlv 'replace oui 33,44,55 subtype 254 oui-info 55,55,55,55,55' config custom-tlv option tlv 'oui 33,44,44 subtype 232' list ports 'br-lan' list ports 'eth0' config custom-tlv # oui-info truncated option tlv 'add oui 33,44,33 subtype 66 oui-info 5555555555' config custom-tlv option tlv 'add oui 33,44,31 subtype 44' config custom-tlv # invalid oui option tlv 'add oui 3322 subtype 79' config custom-tlv # invalid oui option tlv 'oui 3312 subtype 74' Produce the following lldpd.conf content: configure ports eth0 lldp custom-tlv replace oui 33,44,55 subtype 254 oui-info 55,55,55,55,55 configure ports br-lan,eth0 lldp custom-tlv oui 33,44,44 subtype 232 configure lldp custom-tlv add oui 33,44,33 subtype 66 oui-info 5555555555 configure lldp custom-tlv add oui 33,44,31 subtype 44 configure lldp custom-tlv add oui 3322 subtype 79 configure lldp custom-tlv oui 3312 subtype 74 And lldpd (v1.0.13 on v22) logs the following: Sat Mar 16 19:11:39 2024 daemon.info lldpd[10916]: custom TLV op replace oui 33:44:55 subtype fe Sat Mar 16 19:11:39 2024 daemon.info lldpd[10916]: custom TLV op add oui 33:44:44 subtype e8 Sat Mar 16 19:11:39 2024 daemon.info lldpd[10916]: custom TLV op add oui 33:44:33 subtype 42 Sat Mar 16 19:11:39 2024 daemon.info lldpd[10916]: custom TLV op add oui 33:44:33 subtype 42 Sat Mar 16 19:11:39 2024 daemon.info lldpd[10916]: custom TLV op add oui 33:44:31 subtype 2c Sat Mar 16 19:11:39 2024 daemon.info lldpd[10916]: custom TLV op add oui 33:44:31 subtype 2c Sat Mar 16 19:11:39 2024 daemon.warn lldpcli[10915]: invalid OUI value '3322' Sat Mar 16 19:11:39 2024 daemon.info lldpcli[10915]: an error occurred while executing last command Sat Mar 16 19:11:39 2024 daemon.warn lldpcli[10915]: invalid OUI value '3312' Sat Mar 16 19:11:39 2024 daemon.info lldpcli[10915]: an error occurred while executing last command Sat Mar 16 19:11:39 2024 daemon.info lldpcli[10915]: lldpd should resume operations ( The last two TLV are invalid: their oui must be three hex bytes, comma separated. Only the first hex byte of oui-info 5555555555 is used ) Depends on #14867 and its release version bump Tested on: 22.03.6 Signed-off-by: Paul Donald Link: https://github.com/openwrt/openwrt/pull/14872 Signed-off-by: Robert Marko --- .../network/services/lldpd/files/lldpd.init | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init index 2ad59f8cb1..e60cc82fd3 100644 --- a/package/network/services/lldpd/files/lldpd.init +++ b/package/network/services/lldpd/files/lldpd.init @@ -98,6 +98,21 @@ get_interface_csv() { export -n "${1}=$_ifnames" } +add_custom_tlv_callback() +{ + # syntax: configure [ports ethX[,…]] lldp custom-tlv [add|replace] oui XX,XX,XX subtype XX oui-info XX[,XX,...] + # ex: configure ports br-lan,eth0 lldp custom-tlv replace oui 33,44,55 subtype 254 oui-info 55,55,55,55,55 + # ex: configure lldp custom-tlv oui 33,44,44 subtype 232 + + local _ports + local _tlv + # CSV of device ports + get_interface_csv _ports "$1" 'ports' + config_get _tlv "$1" 'tlv' + + echo "configure ${_ports:+ports $_ports }lldp custom-tlv $_tlv" >> "$LLDPD_CONF" +} + write_lldpd_conf() { local lldp_description @@ -197,6 +212,9 @@ write_lldpd_conf() [ "$lldp_mgmt_addr_advertisements" -gt 0 ] && echo "configure lldp management-addresses-advertisements" >> "$LLDPD_CONF" ||\ echo "unconfigure lldp management-addresses-advertisements" >> "$LLDPD_CONF" + # Custom TLV handling + config_foreach add_custom_tlv_callback 'custom-tlv' + # Since lldpd's sysconfdir is /tmp, we'll symlink /etc/lldpd.d to /tmp/$LLDPD_CONFS_DIR [ -e "$LLDPD_CONFS_DIR" ] || ln -s /etc/lldpd.d "$LLDPD_CONFS_DIR" }