From d4d6c48b6e055dca5480d49d44503d1175539485 Mon Sep 17 00:00:00 2001 From: Jonas Jelonek Date: Mon, 25 Nov 2024 23:04:15 +0000 Subject: [PATCH 1/6] mediatek: filogic: support openwrt,netdev-name for renaming interfaces Add support in filogic subtarget for our own custom property `openwrt,netdev-name` in the device tree instead of `label` for renaming interfaces. This was suggested upstream to avoid potential conflicts [1]. [1] https://lore.kernel.org/netdev/20240709124503.pubki5nwjfbedhhy@skbuf/ Signed-off-by: Jonas Jelonek --- .../filogic/base-files/lib/preinit/04_set_netdev_label | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target/linux/mediatek/filogic/base-files/lib/preinit/04_set_netdev_label b/target/linux/mediatek/filogic/base-files/lib/preinit/04_set_netdev_label index 110e023b962d3d..2c5e420f93bd17 100644 --- a/target/linux/mediatek/filogic/base-files/lib/preinit/04_set_netdev_label +++ b/target/linux/mediatek/filogic/base-files/lib/preinit/04_set_netdev_label @@ -10,6 +10,14 @@ set_netdev_labels() { [ "$netdev" = "$label" ] && continue ip link set "$netdev" name "$label" done + + for dir in /sys/class/net/*; do + [ -r "$dir/of_node/openwrt,netdev-name" ] || continue + read -r label < "$dir/of_node/openwrt,netdev-name" + netdev="${dir##*/}" + [ "$netdev" = "$label" ] && continue + ip link set "$netdev" name "$label" + done } boot_hook_add preinit_main set_netdev_labels From 84fc59c0d5285a0a0fe50e3cb2a85f6224362c55 Mon Sep 17 00:00:00 2001 From: Jonas Jelonek Date: Sun, 10 Nov 2024 00:43:23 +0000 Subject: [PATCH 2/6] mediatek: filogic: bpi-r3: set netdev-name for sfp1 port Sets openwrt,netdev-name for the gmac1 node in the dts of BPI-R3, which corresponds to the sfp1 slot, to have a proper naming and match the label on the official BPI-R3 metal case. This renames the port from eth1 to sfp1. The COMPAT_VERSION is increased to denote that configuration has to be adjusted manually. Signed-off-by: Jonas Jelonek --- .../mediatek/filogic/base-files/etc/board.d/02_network | 2 +- .../filogic/base-files/etc/board.d/05_compat-version | 2 +- target/linux/mediatek/image/filogic.mk | 4 ++-- ...t7968a-bpi-r3-add-label-to-gmac-for-sfp1-port.patch | 10 ++++++++++ 4 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 target/linux/mediatek/patches-6.6/955-dts-mt7968a-bpi-r3-add-label-to-gmac-for-sfp1-port.patch diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index 2a133813263c16..85422fe1f63ee5 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -59,7 +59,7 @@ mediatek_setup_interfaces() ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5" eth1 ;; bananapi,bpi-r3) - ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 sfp2" "eth1 wan" + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 sfp2" "sfp1 wan" ;; bananapi,bpi-r3-mini|\ edgecore,eap111) diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version b/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version index 9b704b983cb7f0..48c040613c952d 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version @@ -6,7 +6,7 @@ board_config_update case "$(board_name)" in bananapi,bpi-r3) - ucidef_set_compat_version "1.2" + ucidef_set_compat_version "1.3" ;; routerich,ax3000) ucidef_set_compat_version "1.1" diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 1fdb3036776852..825e4abbad54f3 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -375,8 +375,8 @@ endif fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | pad-rootfs | append-metadata DEVICE_DTC_FLAGS := --pad 4096 - DEVICE_COMPAT_VERSION := 1.2 - DEVICE_COMPAT_MESSAGE := SPI-NAND flash layout changes require bootloader update + DEVICE_COMPAT_VERSION := 1.3 + DEVICE_COMPAT_MESSAGE := First sfp port renamed from eth1 to sfp1 endef TARGET_DEVICES += bananapi_bpi-r3 diff --git a/target/linux/mediatek/patches-6.6/955-dts-mt7968a-bpi-r3-add-label-to-gmac-for-sfp1-port.patch b/target/linux/mediatek/patches-6.6/955-dts-mt7968a-bpi-r3-add-label-to-gmac-for-sfp1-port.patch new file mode 100644 index 00000000000000..f11cf01686850f --- /dev/null +++ b/target/linux/mediatek/patches-6.6/955-dts-mt7968a-bpi-r3-add-label-to-gmac-for-sfp1-port.patch @@ -0,0 +1,10 @@ +--- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts ++++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts +@@ -195,6 +195,7 @@ + phy-mode = "2500base-x"; + sfp = <&sfp1>; + managed = "in-band-status"; ++ openwrt,netdev-name = "sfp1"; + }; + + mdio: mdio-bus { From cd8dcfef378044a1687adfa3738f01f9a9622baf Mon Sep 17 00:00:00 2001 From: Jonas Jelonek Date: Wed, 13 Nov 2024 22:25:09 +0000 Subject: [PATCH 3/6] mediatek: filogic: bpi-r4: set netdev-name for sfp ports Sets openwrt,netdev-name for the gmac nodes in the dts of BPI-R4 which correspond to the two sfp slots. By default they are automatically named as eth1 and eth2 in bad order, however 'SFP1-WAN' and 'SFP2-LAN' are printed on the PCB and the official metal case has labels 'SFP-WAN' and 'SFP-LAN'. Thus, label the ports accordingly to match the board/case labels. The COMPAT_VERSION is increased to denote that configuration has to be adjusted manually. Signed-off-by: Jonas Jelonek --- .../arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-poe.dts | 1 + .../arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts | 1 + .../arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi | 1 + .../mediatek/filogic/base-files/etc/board.d/02_network | 6 ++++-- .../filogic/base-files/etc/board.d/05_compat-version | 4 ++++ target/linux/mediatek/image/filogic.mk | 2 ++ 6 files changed, 13 insertions(+), 2 deletions(-) diff --git a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-poe.dts b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-poe.dts index efcf0ec35851cc..910f60d11b2255 100644 --- a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-poe.dts +++ b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-poe.dts @@ -17,6 +17,7 @@ phy-connection-type = "internal"; phy = <&int_2p5g_phy>; status = "okay"; + openwrt,netdev-name = "lan4"; }; &int_2p5g_phy { diff --git a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts index d2c223b4efaaa4..0f8b6e3d03f5ad 100644 --- a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +++ b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts @@ -29,6 +29,7 @@ managed = "in-band-status"; phy-mode = "usxgmii"; status = "okay"; + openwrt,netdev-name = "sfp-lan"; }; &pca9545 { diff --git a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi index c4455fbc7471ed..8dba5b4275fbca 100644 --- a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi +++ b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi @@ -90,6 +90,7 @@ managed = "in-band-status"; phy-mode = "usxgmii"; status = "okay"; + openwrt,netdev-name = "sfp-wan"; }; &switch { diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index 85422fe1f63ee5..12dca517127268 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -65,9 +65,11 @@ mediatek_setup_interfaces() edgecore,eap111) ucidef_set_interfaces_lan_wan eth0 eth1 ;; - bananapi,bpi-r4|\ + bananapi,bpi-r4) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 sfp-lan" "wan sfp-wan" + ;; bananapi,bpi-r4-poe) - ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 eth1" "wan eth2" + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan sfp-wan" ;; comfast,cf-e393ax) ucidef_set_interfaces_lan_wan "lan1" eth1 diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version b/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version index 48c040613c952d..5ffc4e33743ba9 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version @@ -11,6 +11,10 @@ case "$(board_name)" in routerich,ax3000) ucidef_set_compat_version "1.1" ;; + bananapi,bpi-r4|\ + bananapi,bpi-r4-poe) + ucidef_set_compat_version "1.1" + ;; esac board_config_flush diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 825e4abbad54f3..abc6fc1e091031 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -433,6 +433,8 @@ define Device/bananapi_bpi-r4-common DEVICE_DTC_FLAGS := --pad 4096 DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-i2c-mux-pca954x kmod-eeprom-at24 kmod-mt7996-firmware kmod-mt7996-233-firmware \ kmod-rtc-pcf8563 kmod-sfp kmod-usb3 e2fsprogs f2fsck mkf2fs mt7988-wo-firmware + DEVICE_COMPAT_VERSION := 1.1 + DEVICE_COMPAT_MESSAGE := The non-switch ports were renamed to match the board/case labels IMAGES := sysupgrade.itb KERNEL_LOADADDR := 0x46000000 KERNEL_INITRAMFS_SUFFIX := -recovery.itb From d7f638bc692a7a81cf13c8ca50c7dc4a73c0fed9 Mon Sep 17 00:00:00 2001 From: Marco von Rosenberg Date: Wed, 18 Dec 2024 23:32:42 +0100 Subject: [PATCH 4/6] generic: fix BCM54612E suspend/resume backport patch This backport patch inserted suspend/resume callbacks for the wrong PHY driver. The fixed patch is needed for Huawei AP5030DN to initialize its second PHY. Refresh all affected patch with make target/linux/refresh. Fixes: 06cdc07f8cc7 ("ath79: add support for Huawei AP5030DN") Signed-off-by: Marco von Rosenberg Link: https://github.com/openwrt/openwrt/pull/17312 Signed-off-by: Hauke Mehrtens --- ...y-broadcom-split-out-the-BCM54213PE-from-the-BCM54.patch | 4 ++-- .../950-0382-Populate-phy-driver-block-for-BCM54213PE.patch | 2 +- .../734-v6.8-net-phy-bcm54612e-add-suspend-resume.patch | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target/linux/bcm27xx/patches-6.6/950-0260-phy-broadcom-split-out-the-BCM54213PE-from-the-BCM54.patch b/target/linux/bcm27xx/patches-6.6/950-0260-phy-broadcom-split-out-the-BCM54213PE-from-the-BCM54.patch index 69008c65de0b39..b4133150918860 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0260-phy-broadcom-split-out-the-BCM54213PE-from-the-BCM54.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0260-phy-broadcom-split-out-the-BCM54213PE-from-the-BCM54.patch @@ -26,7 +26,7 @@ Signed-off-by: Jonathan Bell return; val = bcm_phy_read_shadow(phydev, BCM54XX_SHD_SCR3); -@@ -1021,7 +1022,7 @@ static struct phy_driver broadcom_driver +@@ -1019,7 +1020,7 @@ static struct phy_driver broadcom_driver .link_change_notify = bcm54xx_link_change_notify, }, { .phy_id = PHY_ID_BCM54210E, @@ -35,7 +35,7 @@ Signed-off-by: Jonathan Bell .name = "Broadcom BCM54210E", /* PHY_GBIT_FEATURES */ .flags = PHY_ALWAYS_CALL_SUSPEND, -@@ -1039,6 +1040,13 @@ static struct phy_driver broadcom_driver +@@ -1037,6 +1038,13 @@ static struct phy_driver broadcom_driver .set_wol = bcm54xx_phy_set_wol, .led_brightness_set = bcm_phy_led_brightness_set, }, { diff --git a/target/linux/bcm27xx/patches-6.6/950-0382-Populate-phy-driver-block-for-BCM54213PE.patch b/target/linux/bcm27xx/patches-6.6/950-0382-Populate-phy-driver-block-for-BCM54213PE.patch index 218743e942ceed..e74d2d361d547f 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0382-Populate-phy-driver-block-for-BCM54213PE.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0382-Populate-phy-driver-block-for-BCM54213PE.patch @@ -16,7 +16,7 @@ Signed-off-by: Jonathan Lemon --- a/drivers/net/phy/broadcom.c +++ b/drivers/net/phy/broadcom.c -@@ -1052,8 +1052,14 @@ static struct phy_driver broadcom_driver +@@ -1050,8 +1050,14 @@ static struct phy_driver broadcom_driver .phy_id_mask = 0xffffffff, .name = "Broadcom BCM54213PE", /* PHY_GBIT_FEATURES */ diff --git a/target/linux/generic/backport-6.6/734-v6.8-net-phy-bcm54612e-add-suspend-resume.patch b/target/linux/generic/backport-6.6/734-v6.8-net-phy-bcm54612e-add-suspend-resume.patch index 28524a3dcf4cd8..12a89dae74a3e3 100644 --- a/target/linux/generic/backport-6.6/734-v6.8-net-phy-bcm54612e-add-suspend-resume.patch +++ b/target/linux/generic/backport-6.6/734-v6.8-net-phy-bcm54612e-add-suspend-resume.patch @@ -16,12 +16,12 @@ Signed-off-by: David S. Miller --- a/drivers/net/phy/broadcom.c +++ b/drivers/net/phy/broadcom.c -@@ -1001,6 +1001,8 @@ static struct phy_driver broadcom_driver - .config_intr = bcm_phy_config_intr, +@@ -1061,6 +1061,8 @@ static struct phy_driver broadcom_driver .handle_interrupt = bcm_phy_handle_interrupt, .link_change_notify = bcm54xx_link_change_notify, + .led_brightness_set = bcm_phy_led_brightness_set, + .suspend = bcm54xx_suspend, + .resume = bcm54xx_resume, }, { - .phy_id = PHY_ID_BCM5421, + .phy_id = PHY_ID_BCM54616S, .phy_id_mask = 0xfffffff0, From efe9fb084659ba9da4246ebc43435ea147eaf610 Mon Sep 17 00:00:00 2001 From: John Audia Date: Thu, 19 Dec 2024 14:01:20 -0500 Subject: [PATCH 5/6] kernel: bump 6.6 to 6.6.67 Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.67 All patches automatically rebased. Build system: x86/64 Build-tested: flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3, x86/64 Run-tested: flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3, x86/64 Signed-off-by: John Audia Link: https://github.com/openwrt/openwrt/pull/17309 Signed-off-by: Hauke Mehrtens --- include/kernel-6.6 | 4 ++-- ...Add-support-for-all-the-downstream-rpi-sound-card-dr.patch | 2 +- ...compiler.h-only-include-asm-rwonce.h-for-kernel-code.patch | 4 ++-- ...netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/kernel-6.6 b/include/kernel-6.6 index 1e5dc77de0eb75..3b76c2be062c65 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .66 -LINUX_KERNEL_HASH-6.6.66 = 9d757937c4661c2f512c62641b74ef74eff9bb13dc5dbcbaaa108c21152f1e52 +LINUX_VERSION-6.6 = .67 +LINUX_KERNEL_HASH-6.6.67 = e41da482ec42a3b0e2b8ed2574c1d327e3dcf95cdf025c55a356b04307113e1a diff --git a/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch b/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch index 6ffc9364da8889..ecb7bffa025a7e 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch @@ -17583,7 +17583,7 @@ Signed-off-by: Phil Elwell * For devices with more than one control interface, we assume the --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c -@@ -2233,6 +2233,8 @@ static const struct usb_audio_quirk_flag +@@ -2247,6 +2247,8 @@ static const struct usb_audio_quirk_flag QUIRK_FLAG_ALIGN_TRANSFER), DEVICE_FLG(0x534d, 0x2109, /* MacroSilicon MS2109 */ QUIRK_FLAG_ALIGN_TRANSFER), diff --git a/target/linux/generic/pending-6.6/100-compiler.h-only-include-asm-rwonce.h-for-kernel-code.patch b/target/linux/generic/pending-6.6/100-compiler.h-only-include-asm-rwonce.h-for-kernel-code.patch index 0844fcd6dbd657..50fcdbaed8108b 100644 --- a/target/linux/generic/pending-6.6/100-compiler.h-only-include-asm-rwonce.h-for-kernel-code.patch +++ b/target/linux/generic/pending-6.6/100-compiler.h-only-include-asm-rwonce.h-for-kernel-code.patch @@ -19,8 +19,8 @@ Signed-off-by: Felix Fietkau + #endif /* __KERNEL__ */ - /* -@@ -243,6 +245,4 @@ static inline void *offset_to_ptr(const + /** +@@ -258,6 +260,4 @@ static inline void *offset_to_ptr(const */ #define prevent_tail_call_optimization() mb() diff --git a/target/linux/generic/pending-6.6/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch b/target/linux/generic/pending-6.6/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch index d13641064063fa..572aad2a3b3dde 100644 --- a/target/linux/generic/pending-6.6/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch +++ b/target/linux/generic/pending-6.6/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch @@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -8417,7 +8417,7 @@ static int nft_register_flowtable_net_ho +@@ -8421,7 +8421,7 @@ static int nft_register_flowtable_net_ho err = flowtable->data.type->setup(&flowtable->data, hook->ops.dev, FLOW_BLOCK_BIND); From 69582e71fabfb42aa2842d24eecb1f4392048404 Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Thu, 19 Dec 2024 20:45:40 +0200 Subject: [PATCH 6/6] busybox: Fix hexdump applet Fix the hexdump applet's formatting with certain format types by applying the upstream fix for 1.37.0. Also refresh patches. Signed-off-by: Hannu Nyman Link: https://github.com/openwrt/openwrt/pull/17308 [Changed to 002- patch file name prefix] Signed-off-by: Hauke Mehrtens --- package/utils/busybox/Makefile | 2 +- .../patches/001-fix-non-x86-build.patch | 6 +-- .../patches/002-upstream-fix-hexdump.patch | 49 +++++++++++++++++++ 3 files changed, 52 insertions(+), 5 deletions(-) create mode 100644 package/utils/busybox/patches/002-upstream-fix-hexdump.patch diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index c2fc609610e80a..cda3be9f2f505d 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=busybox PKG_VERSION:=1.37.0 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_FLAGS:=essential PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 diff --git a/package/utils/busybox/patches/001-fix-non-x86-build.patch b/package/utils/busybox/patches/001-fix-non-x86-build.patch index b33ec98bf29968..7a47292474fac4 100644 --- a/package/utils/busybox/patches/001-fix-non-x86-build.patch +++ b/package/utils/busybox/patches/001-fix-non-x86-build.patch @@ -1,7 +1,5 @@ -Index: busybox-1.37.0/libbb/hash_md5_sha.c -=================================================================== ---- busybox-1.37.0.orig/libbb/hash_md5_sha.c -+++ busybox-1.37.0/libbb/hash_md5_sha.c +--- a/libbb/hash_md5_sha.c ++++ b/libbb/hash_md5_sha.c @@ -1313,7 +1313,9 @@ unsigned FAST_FUNC sha1_end(sha1_ctx_t * hash_size = 8; if (ctx->process_block == sha1_process_block64 diff --git a/package/utils/busybox/patches/002-upstream-fix-hexdump.patch b/package/utils/busybox/patches/002-upstream-fix-hexdump.patch new file mode 100644 index 00000000000000..a123fe3a5f1684 --- /dev/null +++ b/package/utils/busybox/patches/002-upstream-fix-hexdump.patch @@ -0,0 +1,49 @@ +From 87e60dcf0f7ef917b73353d8605188a420bd91f9 Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Mon, 28 Oct 2024 15:26:21 +0100 +Subject: hexdump: fix regression with -n4 -e '"%u"' + +Fix bug introduced in busybox 1.37.0 that broke kernel builds. + +Fixes commit e2287f99fe6f (od: for !DESKTOP, match output more closely +to GNU coreutils 9.1, implement -s) + +function old new delta +rewrite 967 976 +9 + +Signed-off-by: Natanael Copa +Signed-off-by: Denys Vlasenko +--- + libbb/dump.c | 6 ++++-- + testsuite/hexdump.tests | 6 ++++++ + 2 files changed, 10 insertions(+), 2 deletions(-) + +--- a/libbb/dump.c ++++ b/libbb/dump.c +@@ -198,9 +198,11 @@ static NOINLINE void rewrite(priv_dumper + if (!e) + goto DO_BAD_CONV_CHAR; + pr->flags = F_INT; +- if (e > int_convs + 1) /* not d or i? */ +- pr->flags = F_UINT; + byte_count_str = "\010\004\002\001"; ++ if (e > int_convs + 1) { /* not d or i? */ ++ pr->flags = F_UINT; ++ byte_count_str++; ++ } + goto DO_BYTE_COUNT; + } else + if (strchr(int_convs, *p1)) { /* %d etc */ +--- a/testsuite/hexdump.tests ++++ b/testsuite/hexdump.tests +@@ -82,4 +82,10 @@ testing "hexdump -e /2 %d" \ + "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"\ + "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"\ + ++testing "hexdump -n4 -e '\"%u\"'" \ ++ "hexdump -n4 -e '\"%u\"'" \ ++ "12345678" \ ++ "" \ ++ "\x4e\x61\xbc\x00AAAA" ++ + exit $FAILCOUNT