From bc54e5ea6ea40dd0beb4beaefc8e9ae6966e53e3 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Mon, 13 Sep 2021 07:59:14 +0800 Subject: [PATCH 01/38] ar71xx: tiny: add missing mkbuffaloimg method Signed-off-by: Tianling Shen --- target/linux/ar71xx/image/tiny.mk | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/target/linux/ar71xx/image/tiny.mk b/target/linux/ar71xx/image/tiny.mk index 86ed2c7f2b..3b4a2ae540 100644 --- a/target/linux/ar71xx/image/tiny.mk +++ b/target/linux/ar71xx/image/tiny.mk @@ -1,3 +1,11 @@ +define Build/mkbuffaloimg + $(STAGING_DIR_HOST)/bin/mkbuffaloimg -B $(BOARDNAME) \ + -R $$(($(subst k, * 1024,$(ROOTFS_SIZE)))) \ + -K $$(($(subst k, * 1024,$(KERNEL_SIZE)))) \ + -i $@ -o $@.new + mv $@.new $@ +endef + define Device/bhr-4grv2 DEVICE_TITLE := Buffalo BHR-4GRV2 BOARDNAME := BHR-4GRV2 @@ -21,4 +29,4 @@ define Device/zbt-we1526 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware) IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to $$$$(ROOTFS_SIZE) | append-kernel | check-size $$$$(IMAGE_SIZE) endef -TARGET_DEVICES += zbt-we1526 \ No newline at end of file +TARGET_DEVICES += zbt-we1526 From 7f022898e920daa49c27fa22a9d19b744edcf3f4 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Mon, 13 Sep 2021 08:05:58 +0800 Subject: [PATCH 02/38] ath79: nand: add KERNEL_SIZE for glinet_gl-ar750s-nor-nand The recipe check-kernel-size was deprecated and use KERNEL_SIZE to check the size of the kernel image. Signed-off-by: Tianling Shen --- target/linux/ath79/image/nand.mk | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk index fd15b1e465..9c1610b063 100644 --- a/target/linux/ath79/image/nand.mk +++ b/target/linux/ath79/image/nand.mk @@ -92,11 +92,10 @@ endef define Device/glinet_gl-ar750s-nor-nand $(Device/glinet_gl-ar750s-common) DEVICE_VARIANT := NOR/NAND + KERNEL_SIZE:= 2048k BLOCKSIZE := 128k - GL_UBOOT_UBI_OFFSET := 2048k IMAGES += factory.img - IMAGE/factory.img := append-kernel | pad-to $$$$(GL_UBOOT_UBI_OFFSET) | \ - append-ubi | check-kernel-size $$$$(GL_UBOOT_UBI_OFFSET) + IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata SUPPORTED_DEVICES += glinet,gl-ar750s-nor endef From aa5b96beaca3ea1e301f68613760b6b27ccadf28 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Mon, 13 Sep 2021 08:45:42 +0800 Subject: [PATCH 03/38] autocore: drop extra `%` from CPU usage Fixes: #458 Signed-off-by: Tianling Shen --- package/emortal/autocore/files/arm/index.htm | 2 +- package/emortal/autocore/files/x86/index.htm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/emortal/autocore/files/arm/index.htm b/package/emortal/autocore/files/arm/index.htm index 065ddcc503..b7da0f75e9 100644 --- a/package/emortal/autocore/files/arm/index.htm +++ b/package/emortal/autocore/files/arm/index.htm @@ -49,7 +49,7 @@ local user_info = luci.sys.exec("cat /proc/net/arp | grep 'br-lan' | grep '0x2' | wc -l") - local cpu_usage = luci.sys.exec("top -n1 | awk '/^CPU/ {printf(\"%d%%\", 100 - $8)}'") or "6%" + local cpu_usage = luci.sys.exec("top -n1 | awk '/^CPU/ {printf(\"%d%\", 100 - $8)}'") or "6%" local cpu_info = luci.sys.exec("/sbin/cpuinfo") or "ARM Processor" local rv = { diff --git a/package/emortal/autocore/files/x86/index.htm b/package/emortal/autocore/files/x86/index.htm index 777f9f8b68..6506f87bf3 100644 --- a/package/emortal/autocore/files/x86/index.htm +++ b/package/emortal/autocore/files/x86/index.htm @@ -52,7 +52,7 @@ local user_info = luci.sys.exec("cat /proc/net/arp | grep '0x2' | wc -l") or 0 - local cpu_usage = luci.sys.exec("top -n1 | awk '/^CPU/ {printf(\"%d%%\", 100 - $8)}'") or "6%" + local cpu_usage = luci.sys.exec("top -n1 | awk '/^CPU/ {printf(\"%d%\", 100 - $8)}'") or "6%" local rv = { cpuusage = cpu_usage, From f4d680bd161f5c3c20850ba5432fae26ba33b6d3 Mon Sep 17 00:00:00 2001 From: Chuanhong Guo Date: Thu, 9 Apr 2020 18:40:01 +0800 Subject: [PATCH 04/38] ramips: disable images for 4M devices default initramfs for 5.4 kernel is larger than 4M, causing build error for oversized initramfs image. disable these images because we have no mechanism for ignoring initramfs errors and the squashfs image will be larger than initramfs anyway. Signed-off-by: Chuanhong Guo (cherry picked from commit d7d46da938e3f5c4ace815870c95f67d8b663ebe) --- target/linux/ramips/image/mt7620.mk | 2 ++ target/linux/ramips/image/mt76x8.mk | 2 ++ target/linux/ramips/image/rt288x.mk | 7 +++++ target/linux/ramips/image/rt305x.mk | 48 +++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+) diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index 1dd4ca9c39..756d43f927 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -673,6 +673,7 @@ define Device/nexx_wt3020-4m DEVICE_MODEL := WT3020 DEVICE_VARIANT := 4M SUPPORTED_DEVICES += wt3020 wt3020-4M + DEFAULT := n endef TARGET_DEVICES += nexx_wt3020-4m @@ -961,6 +962,7 @@ define Device/vonets_var11n-300 BLOCKSIZE := 4k DEVICE_VENDOR := Vonets DEVICE_MODEL := VAR11N-300 + DEFAULT := n endef TARGET_DEVICES += vonets_var11n-300 diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 7cc792b2aa..a3042e8e1a 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -406,6 +406,7 @@ define Device/tplink_tl-wr840n-v5 TPLINK_HWREVADD := 0x5 IMAGES := sysupgrade.bin SUPPORTED_DEVICES += tl-wr840n-v5 + DEFAULT := n endef TARGET_DEVICES += tplink_tl-wr840n-v5 @@ -434,6 +435,7 @@ define Device/tplink_tl-wr841n-v14 TPLINK_HWREVADD := 0x14 IMAGES := sysupgrade.bin tftp-recovery.bin IMAGE/tftp-recovery.bin := pad-extra 64k | $$(IMAGE/factory.bin) + DEFAULT := n endef TARGET_DEVICES += tplink_tl-wr841n-v14 diff --git a/target/linux/ramips/image/rt288x.mk b/target/linux/ramips/image/rt288x.mk index 720ff65741..79a61860b8 100644 --- a/target/linux/ramips/image/rt288x.mk +++ b/target/linux/ramips/image/rt288x.mk @@ -21,6 +21,7 @@ define Device/airlink101_ar670w IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \ wrg-header wrgn16a_airlink_ar670w SUPPORTED_DEVICES += ar670w + DEFAULT := n endef TARGET_DEVICES += airlink101_ar670w @@ -32,6 +33,7 @@ define Device/airlink101_ar725w IMAGE/factory.bin := $$(sysupgrade_bin) | check-size 3328k | \ gemtek-header ar725w SUPPORTED_DEVICES += ar725w + DEFAULT := n endef TARGET_DEVICES += airlink101_ar725w @@ -42,6 +44,7 @@ define Device/asus_rt-n15 DEVICE_MODEL := RT-N15 DEVICE_PACKAGES := kmod-switch-rtl8366s SUPPORTED_DEVICES += rt-n15 + DEFAULT := n endef TARGET_DEVICES += asus_rt-n15 @@ -63,6 +66,7 @@ define Device/buffalo_wli-tx4-ag300n DEVICE_MODEL := WLI-TX4-AG300N DEVICE_PACKAGES := kmod-switch-ip17xx SUPPORTED_DEVICES += wli-tx4-ag300n + DEFAULT := n endef TARGET_DEVICES += buffalo_wli-tx4-ag300n @@ -73,6 +77,7 @@ define Device/buffalo_wzr-agl300nh DEVICE_MODEL := WZR-AGL300NH DEVICE_PACKAGES := kmod-switch-rtl8366s SUPPORTED_DEVICES += wzr-agl300nh + DEFAULT := n endef TARGET_DEVICES += buffalo_wzr-agl300nh @@ -88,6 +93,7 @@ define Device/dlink_dap-1522-a1 IMAGE/factory.bin := append-kernel | pad-offset $$$$(BLOCKSIZE) 96 | \ append-rootfs | pad-rootfs -x 96 | wrg-header wapnd01_dlink_dap1522 | \ check-size + DEFAULT := n endef TARGET_DEVICES += dlink_dap-1522-a1 @@ -97,5 +103,6 @@ define Device/ralink_v11st-fe DEVICE_VENDOR := Ralink DEVICE_MODEL := V11ST-FE SUPPORTED_DEVICES += v11st-fe + DEFAULT := n endef TARGET_DEVICES += ralink_v11st-fe diff --git a/target/linux/ramips/image/rt305x.mk b/target/linux/ramips/image/rt305x.mk index 2654918abb..8f9d5856a0 100644 --- a/target/linux/ramips/image/rt305x.mk +++ b/target/linux/ramips/image/rt305x.mk @@ -30,6 +30,7 @@ define Device/7links_px-4885-4m DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb2 kmod-usb-ohci \ kmod-usb-ledtrig-usbport kmod-leds-gpio SUPPORTED_DEVICES += px-4885-4M + DEFAULT := n endef TARGET_DEVICES += 7links_px-4885-4m @@ -71,6 +72,7 @@ define Device/airlive_air3gii DEVICE_VENDOR := AirLive DEVICE_MODEL := Air3GII SUPPORTED_DEVICES += air3gii + DEFAULT := n endef TARGET_DEVICES += airlive_air3gii @@ -91,6 +93,7 @@ define Device/allnet_all0256n-4m DEVICE_VARIANT := 4M DEVICE_PACKAGES := rssileds SUPPORTED_DEVICES += all0256n-4M + DEFAULT := n endef TARGET_DEVICES += allnet_all0256n-4m @@ -175,6 +178,7 @@ define Device/asiarf_awapn2403 DEVICE_VENDOR := AsiaRF DEVICE_MODEL := AWAPN2403 SUPPORTED_DEVICES += awapn2403 + DEFAULT := n endef TARGET_DEVICES += asiarf_awapn2403 @@ -186,6 +190,7 @@ define Device/asiarf_awm002-evb-4m DEVICE_VARIANT := 4M DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-core kmod-i2c-gpio SUPPORTED_DEVICES += awm002-evb-4M + DEFAULT := n endef TARGET_DEVICES += asiarf_awm002-evb-4m @@ -208,6 +213,7 @@ define Device/asus_rt-g32-b1 DEVICE_MODEL := RT-G32 DEVICE_VARIANT := B1 SUPPORTED_DEVICES += rt-g32-b1 + DEFAULT := n endef TARGET_DEVICES += asus_rt-g32-b1 @@ -218,6 +224,7 @@ define Device/asus_rt-n10-plus DEVICE_VENDOR := Asus DEVICE_MODEL := RT-N10+ SUPPORTED_DEVICES += rt-n10-plus + DEFAULT := n endef TARGET_DEVICES += asus_rt-n10-plus @@ -238,6 +245,7 @@ define Device/asus_wl-330n DEVICE_VENDOR := Asus DEVICE_MODEL := WL-330N SUPPORTED_DEVICES += wl-330n + DEFAULT := n endef TARGET_DEVICES += asus_wl-330n @@ -249,6 +257,7 @@ define Device/asus_wl-330n3g DEVICE_MODEL := WL-330N3G DEVICE_PACKAGES := SUPPORTED_DEVICES += wl-330n3g + DEFAULT := n endef TARGET_DEVICES += asus_wl-330n3g @@ -304,6 +313,7 @@ define Device/buffalo_whr-g300n IMAGE/tftp.bin := $$(sysupgrade_bin) | check-size | \ buffalo-tftp-header SUPPORTED_DEVICES += whr-g300n + DEFAULT := n endef TARGET_DEVICES += buffalo_whr-g300n @@ -329,6 +339,7 @@ define Device/dlink_dcs-930 DEVICE_PACKAGES := kmod-video-core kmod-video-uvc kmod-sound-core \ kmod-usb-audio kmod-usb-dwc2 SUPPORTED_DEVICES += dcs-930 + DEFAULT := n endef TARGET_DEVICES += dlink_dcs-930 @@ -341,6 +352,7 @@ define Device/dlink_dcs-930l-b1 DEVICE_PACKAGES := kmod-video-core kmod-video-uvc kmod-sound-core \ kmod-usb-audio kmod-usb-ohci kmod-usb2 SUPPORTED_DEVICES += dcs-930l-b1 + DEFAULT := n endef TARGET_DEVICES += dlink_dcs-930l-b1 @@ -354,6 +366,7 @@ define Device/dlink_dir-300-b1 DEVICE_MODEL := DIR-300 DEVICE_VARIANT := B1 SUPPORTED_DEVICES += dir-300-b1 + DEFAULT := n endef TARGET_DEVICES += dlink_dir-300-b1 @@ -388,6 +401,7 @@ define Device/dlink_dir-600-b1 DEVICE_MODEL := DIR-600 DEVICE_VARIANT := B1/B2 SUPPORTED_DEVICES += dir-600-b1 dir-600-b2 + DEFAULT := n endef TARGET_DEVICES += dlink_dir-600-b1 @@ -403,6 +417,7 @@ define Device/dlink_dir-610-a1 DEVICE_VARIANT := A1 DEVICE_PACKAGES := kmod-ledtrig-netdev kmod-ledtrig-timer SUPPORTED_DEVICES += dir-610-a1 + DEFAULT := n endef TARGET_DEVICES += dlink_dir-610-a1 @@ -416,6 +431,7 @@ define Device/dlink_dir-615-d DEVICE_MODEL := DIR-615 DEVICE_VARIANT := D SUPPORTED_DEVICES += dir-615-d + DEFAULT := n endef TARGET_DEVICES += dlink_dir-615-d @@ -429,6 +445,7 @@ define Device/dlink_dir-615-h1 DEVICE_MODEL := DIR-615 DEVICE_VARIANT := H1 SUPPORTED_DEVICES += dir-615-h1 + DEFAULT := n endef TARGET_DEVICES += dlink_dir-615-h1 @@ -490,6 +507,7 @@ define Device/edimax_3g-6200n DEVICE_VENDOR := Edimax DEVICE_MODEL := 3g-6200n SUPPORTED_DEVICES += 3g-6200n + DEFAULT := n endef TARGET_DEVICES += edimax_3g-6200n @@ -502,6 +520,7 @@ define Device/edimax_3g-6200nl DEVICE_VENDOR := Edimax DEVICE_MODEL := 3g-6200nl SUPPORTED_DEVICES += 3g-6200nl + DEFAULT := n endef TARGET_DEVICES += edimax_3g-6200nl @@ -512,6 +531,7 @@ define Device/engenius_esr-9753 DEVICE_VENDOR := EnGenius DEVICE_MODEL := ESR-9753 SUPPORTED_DEVICES += esr-9753 + DEFAULT := n endef TARGET_DEVICES += engenius_esr-9753 @@ -538,6 +558,7 @@ define Device/hame_mpr-a1 DEVICE_VARIANT := A1 DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-ledtrig-netdev SUPPORTED_DEVICES += mpr-a1 + DEFAULT := n endef TARGET_DEVICES += hame_mpr-a1 @@ -573,6 +594,7 @@ define Device/hilink_hlk-rm04 DEVICE_VENDOR := Hi-Link DEVICE_MODEL := HLK-RM04 SUPPORTED_DEVICES += hlk-rm04 + DEFAULT := n endef TARGET_DEVICES += hilink_hlk-rm04 @@ -593,6 +615,7 @@ define Device/huawei_d105 DEVICE_VENDOR := Huawei DEVICE_MODEL := D105 SUPPORTED_DEVICES += d105 + DEFAULT := n endef TARGET_DEVICES += huawei_d105 @@ -626,6 +649,7 @@ define Device/jcg_jhr-n805r DEVICE_VENDOR := JCG DEVICE_MODEL := JHR-N805R SUPPORTED_DEVICES += jhr-n805r + DEFAULT := n endef TARGET_DEVICES += jcg_jhr-n805r @@ -638,6 +662,7 @@ define Device/jcg_jhr-n825r DEVICE_VENDOR := JCG DEVICE_MODEL := JHR-N825R SUPPORTED_DEVICES += jhr-n825r + DEFAULT := n endef TARGET_DEVICES += jcg_jhr-n825r @@ -650,6 +675,7 @@ define Device/jcg_jhr-n926r DEVICE_VENDOR := JCG DEVICE_MODEL := JHR-N926R SUPPORTED_DEVICES += jhr-n926r + DEFAULT := n endef TARGET_DEVICES += jcg_jhr-n926r @@ -669,6 +695,7 @@ define Device/netcore_nw718 DEVICE_VENDOR := Netcore DEVICE_MODEL := NW718 SUPPORTED_DEVICES += nw718 + DEFAULT := n endef TARGET_DEVICES += netcore_nw718 @@ -705,6 +732,7 @@ define Device/nexx_wt1520-4m DEVICE_MODEL := WT1520 DEVICE_VARIANT := 4M SUPPORTED_DEVICES += wt1520-4M + DEFAULT := n endef TARGET_DEVICES += nexx_wt1520-4m @@ -792,6 +820,7 @@ define Device/petatel_psr-680w DEVICE_VENDOR := Petatel DEVICE_MODEL := PSR-680W Wireless 3G Router SUPPORTED_DEVICES += psr-680w + DEFAULT := n endef TARGET_DEVICES += petatel_psr-680w @@ -803,6 +832,7 @@ define Device/planex_mzk-dp150n DEVICE_MODEL := MZK-DP150N DEVICE_PACKAGES := kmod-spi-dev SUPPORTED_DEVICES += mzk-dp150n + DEFAULT := n endef TARGET_DEVICES += planex_mzk-dp150n @@ -815,6 +845,7 @@ define Device/planex_mzk-w300nh2 DEVICE_VENDOR := Planex DEVICE_MODEL := MZK-W300NH2 SUPPORTED_DEVICES += mzk-w300nh2 + DEFAULT := n endef TARGET_DEVICES += planex_mzk-w300nh2 @@ -846,6 +877,7 @@ define Device/poray_m3 DEVICE_MODEL := M3 DEVICE_PACKAGES := kmod-usb2 kmod-ledtrig-netdev kmod-ledtrig-timer SUPPORTED_DEVICES += m3 + DEFAULT := n endef TARGET_DEVICES += poray_m3 @@ -860,6 +892,7 @@ define Device/poray_m4-4m DEVICE_VARIANT := 4M DEVICE_PACKAGES := kmod-usb2 kmod-ledtrig-netdev kmod-ledtrig-timer SUPPORTED_DEVICES += m4-4M + DEFAULT := n endef TARGET_DEVICES += poray_m4-4m @@ -920,6 +953,7 @@ define Device/ralink_v22rw-2x2 DEVICE_VENDOR := Ralink DEVICE_MODEL := AP-RT3052-V22RW-2X2 SUPPORTED_DEVICES += v22rw-2x2 + DEFAULT := n endef TARGET_DEVICES += ralink_v22rw-2x2 @@ -931,6 +965,7 @@ define Device/sitecom_wl-351 DEVICE_MODEL := WL-351 v1 DEVICE_PACKAGES := kmod-switch-rtl8366rb kmod-swconfig swconfig SUPPORTED_DEVICES += wl-351 + DEFAULT := n endef TARGET_DEVICES += sitecom_wl-351 @@ -941,6 +976,7 @@ define Device/skyline_sl-r7205 DEVICE_VENDOR := Skyline DEVICE_MODEL := SL-R7205 Wireless 3G Router SUPPORTED_DEVICES += sl-r7205 + DEFAULT := n endef TARGET_DEVICES += skyline_sl-r7205 @@ -951,6 +987,7 @@ define Device/sparklan_wcr-150gn DEVICE_VENDOR := Sparklan DEVICE_MODEL := WCR-150GN SUPPORTED_DEVICES += wcr-150gn + DEFAULT := n endef TARGET_DEVICES += sparklan_wcr-150gn @@ -973,6 +1010,7 @@ define Device/tenda_3g150b DEVICE_MODEL := 3G150B DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport SUPPORTED_DEVICES += 3g150b + DEFAULT := n endef TARGET_DEVICES += tenda_3g150b @@ -984,6 +1022,7 @@ define Device/tenda_3g300m DEVICE_MODEL := 3G300M DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport SUPPORTED_DEVICES += 3g300m + DEFAULT := n endef TARGET_DEVICES += tenda_3g300m @@ -994,6 +1033,7 @@ define Device/tenda_w150m DEVICE_VENDOR := Tenda DEVICE_MODEL := W150M SUPPORTED_DEVICES += w150m + DEFAULT := n endef TARGET_DEVICES += tenda_w150m @@ -1005,6 +1045,7 @@ define Device/tenda_w306r-v2 DEVICE_MODEL := W306R DEVICE_VARIANT := V2.0 SUPPORTED_DEVICES += w306r-v20 + DEFAULT := n endef TARGET_DEVICES += tenda_w306r-v2 @@ -1018,6 +1059,7 @@ define Device/trendnet_tew-638apb-v2 DEVICE_MODEL := TEW-638APB DEVICE_VARIANT := v2 SUPPORTED_DEVICES += tew-638apb-v2 + DEFAULT := n endef TARGET_DEVICES += trendnet_tew-638apb-v2 @@ -1040,6 +1082,7 @@ define Device/unbranded_a5-v11 DEVICE_MODEL := A5-V11 DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 SUPPORTED_DEVICES += a5-v11 + DEFAULT := n endef TARGET_DEVICES += unbranded_a5-v11 @@ -1050,6 +1093,7 @@ define Device/unbranded_wr512-3gn-4m DEVICE_MODEL := WR512-3GN DEVICE_VARIANT := 4M SUPPORTED_DEVICES += wr512-3gn-4M + DEFAULT := n endef TARGET_DEVICES += unbranded_wr512-3gn-4m @@ -1070,6 +1114,7 @@ define Device/unbranded_xdx-rn502j DEVICE_VENDOR := XDX DEVICE_MODEL := RN502J SUPPORTED_DEVICES += xdxrn502j + DEFAULT := n endef TARGET_DEVICES += unbranded_xdx-rn502j @@ -1081,6 +1126,7 @@ define Device/upvel_ur-326n4g DEVICE_MODEL := UR-326N4G DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport SUPPORTED_DEVICES += ur-326n4g + DEFAULT := n endef TARGET_DEVICES += upvel_ur-326n4g @@ -1163,6 +1209,7 @@ define Device/zyxel_keenetic-start IMAGE_SIZE := 3776k DEVICE_VENDOR := ZyXEL DEVICE_MODEL := Keenetic Start + DEFAULT := n endef TARGET_DEVICES += zyxel_keenetic-start @@ -1173,6 +1220,7 @@ define Device/zyxel_nbg-419n DEVICE_VENDOR := ZyXEL DEVICE_MODEL := NBG-419N SUPPORTED_DEVICES += nbg-419n + DEFAULT := n endef TARGET_DEVICES += zyxel_nbg-419n From 91b245d0f22eac0069b9be4b462135dff8791c29 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Thu, 2 Sep 2021 12:15:30 +0800 Subject: [PATCH 05/38] mediatek/4.19: build error fixes --- ...-mt7531-gsw-internal_phy_calibration.patch | 118 +++++++++--------- 1 file changed, 61 insertions(+), 57 deletions(-) diff --git a/target/linux/mediatek/patches-4.19/0003-mt7531-gsw-internal_phy_calibration.patch b/target/linux/mediatek/patches-4.19/0003-mt7531-gsw-internal_phy_calibration.patch index db22cc2189..66b6646682 100644 --- a/target/linux/mediatek/patches-4.19/0003-mt7531-gsw-internal_phy_calibration.patch +++ b/target/linux/mediatek/patches-4.19/0003-mt7531-gsw-internal_phy_calibration.patch @@ -49,7 +49,7 @@ #define MMD_CMD_S 14 --- /dev/null +++ b/drivers/net/phy/mtk/mt753x/mt753x_phy.c -@@ -0,0 +1,1061 @@ +@@ -0,0 +1,1065 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Common part for MediaTek MT753x gigabit switch @@ -70,7 +70,7 @@ +{ + u32 phy_val; + phy_val = gsw->mmd_read(gsw, port_num, dev_addr, reg_addr); -+ ++ + //printk("switch phy cl45 r %d 0x%x 0x%x = %x\n",port_num, dev_addr, reg_addr, phy_val); + //switch_phy_read_cl45(port_num, dev_addr, reg_addr, &phy_val); + return phy_val; @@ -117,14 +117,14 @@ + +u8 ge_cal_flag; + -+u8 all_ge_ana_cal_wait(struct gsw_mt753x *gsw, u32 delay, u32 phyaddr) // for EN7512 ++u8 all_ge_ana_cal_wait(struct gsw_mt753x *gsw, u32 delay, u32 phyaddr) // for EN7512 +{ -+ u8 all_ana_cal_status; ++ u8 all_ana_cal_status; + u32 cnt, tmp_1e_17c; + //tc_phy_write_dev_reg(gsw, phyaddr, 0x1e, 0x017c, 0x0001); // da_calin_flag pull high + tc_phy_write_dev_reg(gsw, PHY0, 0x1e, 0x17c, 0x0001); + //printk("delay = %d\n", delay); -+ ++ + cnt = 10000; + do { + udelay(delay); @@ -145,7 +145,7 @@ + + } + printk("re-K again\n"); -+ ++ + tc_phy_write_dev_reg(gsw, PHY0, 0x1e, 0x17c, 0); + tc_phy_write_dev_reg(gsw, PHY0, 0x1e, 0x17c, 0x0001); + cnt = 10000; @@ -167,22 +167,19 @@ + udelay(delay); + cnt--; + all_ana_cal_status = tc_phy_read_dev_reg(gsw, PHY0, 0x1e, 0x17b) & 0x1; -+ ++ + } while ((all_ana_cal_status == 0) && (cnt != 0)); -+ ++ + tc_phy_write_dev_reg(gsw, PHY0, 0x1e, 0x17c, 0); + } + + if(all_ana_cal_status == 0){ + pr_info("!!!!!!!!!!!! dev1Eh_reg17b ERROR\n"); + } -+ ++ + return all_ana_cal_status; +} + -+ -+ -+ +int ge_cal_rext(struct gsw_mt753x *gsw, u8 phyaddr, u32 delay) +{ + u8 rg_zcal_ctrl, all_ana_cal_status; @@ -204,7 +201,7 @@ + tc_phy_write_dev_reg(gsw, PHY0, 0x1e, 0x00dc, 0); + //tc_phy_write_dev_reg(phyaddr, 0x1e, 0x00e1, 0x0000); + //tc_phy_write_dev_reg(gsw, PHY0, 0x1e, 0x00e1, 0x10); -+ ++ + rg_zcal_ctrl = 0x20;/* start with 0 dB */ + dev1e_e0_ana_cal_r5 = tc_phy_read_dev_reg(gsw, PHY0, 0x1e, 0xe0); // get default value + /* 1e_e0[5:0]:rg_zcal_ctrl */ @@ -243,7 +240,7 @@ + all_ana_cal_status = ANACAL_SATURATION; /* need to FT(IC fail?) */ + printk(" GE Rext AnaCal Saturation! \r\n"); + rg_zcal_ctrl = 0x20; /* 0 dB */ -+ } ++ } + } + } + @@ -266,6 +263,8 @@ + tc_phy_write_dev_reg(gsw, phyaddr, 0x1e, 0x00db, 0x0000); + tc_phy_write_dev_reg(gsw, PHY0, 0x1e, 0x00dc, 0x0000); + tc_phy_write_dev_reg(gsw, phyaddr, 0x1e, 0x00dc, 0x0000); ++ ++ return 0; +} + +//----------------------------------------------------------------- @@ -286,7 +285,7 @@ + if(calibration_pair == ANACAL_PAIR_A) + { + tc_phy_write_dev_reg(gsw, phyaddr, 0x1e, 0x00db, 0x1101); // 1e_db[12]:rg_cal_ckinv, [8]:rg_ana_calen, [4]:rg_rext_calen, [0]:rg_zcalen_a -+ tc_phy_write_dev_reg(gsw, phyaddr, 0x1e, 0x00dc, 0x0000); ++ tc_phy_write_dev_reg(gsw, phyaddr, 0x1e, 0x00dc, 0x0000); + //printk("R50 pair A 1e_db=%x 1e_db=%x\n", tc_phy_read_dev_reg(gsw, phyaddr, 0x1e, 0x00db), tc_phy_read_dev_reg(gsw, phyaddr, 0x1e, 0x00dc)); + + } @@ -315,12 +314,12 @@ + all_ana_cal_status = all_ge_ana_cal_wait(gsw, delay, phyaddr); // delay 20 usec + if(all_ana_cal_status == 0) + { -+ all_ana_cal_status = ANACAL_ERROR; ++ all_ana_cal_status = ANACAL_ERROR; + printk( "GE R50 AnaCal ERROR init! \r\n"); + return -1; + } -+ -+ ad_cal_comp_out_init = (tc_phy_read_dev_reg(gsw, PHY0, 0x1e, 0x017a)>>8) & 0x1; // 1e_17a[8]:ad_cal_comp_out ++ ++ ad_cal_comp_out_init = (tc_phy_read_dev_reg(gsw, PHY0, 0x1e, 0x017a)>>8) & 0x1; // 1e_17a[8]:ad_cal_comp_out + if(ad_cal_comp_out_init == 1) + calibration_polarity = -1; + else @@ -336,24 +335,24 @@ + + if(all_ana_cal_status == 0) + { -+ all_ana_cal_status = ANACAL_ERROR; ++ all_ana_cal_status = ANACAL_ERROR; + printk( " GE R50 AnaCal ERROR 2! \r\n"); + return -1; + } -+ else if(((tc_phy_read_dev_reg(gsw, PHY0, 0x1e, 0x017a)>>8)&0x1) != ad_cal_comp_out_init) ++ else if(((tc_phy_read_dev_reg(gsw, PHY0, 0x1e, 0x017a)>>8)&0x1) != ad_cal_comp_out_init) + { -+ all_ana_cal_status = ANACAL_FINISH; ++ all_ana_cal_status = ANACAL_FINISH; + } + else { -+ if((rg_zcal_ctrl == 0x3F)||(rg_zcal_ctrl == 0x00)) ++ if((rg_zcal_ctrl == 0x3F)||(rg_zcal_ctrl == 0x00)) + { + all_ana_cal_status = ANACAL_SATURATION; // need to FT + printk( " GE R50 AnaCal Saturation! \r\n"); + } + } + } -+ -+ if(all_ana_cal_status == ANACAL_ERROR) { ++ ++ if(all_ana_cal_status == ANACAL_ERROR) { + rg_zcal_ctrl = 0x20; // 0 dB + //tc_phy_write_dev_reg(gsw, phyaddr, 0x1e, 0x00e0, (dev1e_e0_ana_cal_r5 | rg_zcal_ctrl)); + } @@ -361,7 +360,7 @@ + rg_zcal_ctrl = MT753x_ZCAL_TO_R50ohm_GE_TBL_100[rg_zcal_ctrl - 9]; // wait Mog zcal/r50 mapping table + printk( " GE R50 AnaCal Done! (%d) (0x%x)(0x%x) \r\n", cnt, rg_zcal_ctrl, (rg_zcal_ctrl|0x80)); + } -+ ++ + if(calibration_pair == ANACAL_PAIR_A) { + ad_cal_comp_out_init = tc_phy_read_dev_reg(gsw, phyaddr, 0x1e, 0x0174) & (~0x7f00); + //ad_cal_comp_out_init = tc_phy_read_dev_reg(gsw, phyaddr, 0x1e, 0x0174); @@ -373,7 +372,7 @@ + ad_cal_comp_out_init = tc_phy_read_dev_reg(gsw, phyaddr, 0x1e, 0x0174) & (~0x007f); + //ad_cal_comp_out_init = tc_phy_read_dev_reg(gsw, phyaddr, 0x1e, 0x0174); + //printk( " GE-b 1e_174(0x%x)(0x%x), 1e_175(0x%x) \r\n", tc_phy_read_dev_reg(gsw, phyaddr, 0x1e, 0x0174), ad_cal_comp_out_init, tc_phy_read_dev_reg(gsw, phyaddr, 0x1e, 0x0175)); -+ ++ + tc_phy_write_dev_reg(gsw, phyaddr, 0x1e, 0x0174, (ad_cal_comp_out_init | (((rg_zcal_ctrl<<0)&0x00ff) | 0x0080))); // 1e_174[7:0] + //printk( " GE-b 1e_174(0x%x), 1e_175(0x%x) \r\n", tc_phy_read_dev_reg(gsw, phyaddr, 0x1e, 0x0174), tc_phy_read_dev_reg(gsw, phyaddr, 0x1e, 0x0175)); + } @@ -382,7 +381,7 @@ + //ad_cal_comp_out_init = tc_phy_read_dev_reg(gsw, phyaddr, 0x1e, 0x0175); + tc_phy_write_dev_reg(gsw, phyaddr, 0x1e, 0x0175, (ad_cal_comp_out_init | (((rg_zcal_ctrl<<8)&0xff00) | 0x8000))); // 1e_175[15:8] + //printk( " GE-c 1e_174(0x%x), 1e_175(0x%x) \r\n", tc_phy_read_dev_reg(gsw, phyaddr, 0x1e, 0x0174), tc_phy_read_dev_reg(gsw, phyaddr, 0x1e, 0x0175)); -+ } else {// if(calibration_pair == ANACAL_PAIR_D) ++ } else {// if(calibration_pair == ANACAL_PAIR_D) + ad_cal_comp_out_init = tc_phy_read_dev_reg(gsw, phyaddr, 0x1e, 0x0175) & (~0x007f); + //ad_cal_comp_out_init = tc_phy_read_dev_reg(gsw, phyaddr, 0x1e, 0x0175); + tc_phy_write_dev_reg(gsw, phyaddr, 0x1e, 0x0175, (ad_cal_comp_out_init | (((rg_zcal_ctrl<<0)&0x00ff) | 0x0080))); // 1e_175[7:0] @@ -390,12 +389,14 @@ + } + //tc_phy_write_dev_reg(gsw, phyaddr, 0x1e, 0x00e0, ((rg_zcal_ctrl<<8)|rg_zcal_ctrl)); + } -+ ++ + printk( " GE 1e_174(0x%x), 1e_175(0x%x) \r\n", tc_phy_read_dev_reg(gsw, phyaddr, 0x1e, 0x0174), tc_phy_read_dev_reg(gsw, phyaddr, 0x1e, 0x0175)); + tc_phy_write_dev_reg(gsw, PHY0, 0x1e, 0x00db, 0x0000); + tc_phy_write_dev_reg(gsw, phyaddr, 0x1e, 0x00db, 0x0000); + tc_phy_write_dev_reg(gsw, PHY0, 0x1e, 0x00dc, 0x0000); + tc_phy_write_dev_reg(gsw, phyaddr, 0x1e, 0x00dc, 0x0000); ++ ++ return 0; +} + +int ge_cal_tx_offset(struct gsw_mt753x *gsw, u8 phyaddr, u32 delay) @@ -412,7 +413,7 @@ + tc_phy_write_dev_reg(gsw, phyaddr, 0x1e, 0x0096, 0x8000); // 1e_96[15]:bypass_tx_offset_cal, Hw bypass, Fw cal + tc_phy_write_dev_reg(gsw, phyaddr, 0x1e, 0x003e, 0xf808); // 1e_3e + for(i = 0; i <= 4; i++) -+ tc_phy_write_dev_reg(gsw, i, 0x1e, 0x00dd, 0x0000); ++ tc_phy_write_dev_reg(gsw, i, 0x1e, 0x00dd, 0x0000); + for(calibration_pair = ANACAL_PAIR_A; calibration_pair <= ANACAL_PAIR_D; calibration_pair ++) + { + tabl_idx = 31; @@ -461,12 +462,12 @@ + tc_phy_write_dev_reg(gsw, phyaddr, 0x1e, tx_offset_reg, (reg_temp|(tx_offset_temp<>8) & 0x1; // 1e_17a[8]:ad_cal_comp_out ++ ++ ad_cal_comp_out_init = (tc_phy_read_dev_reg(gsw, PHY0, 0x1e, 0x017a)>>8) & 0x1; // 1e_17a[8]:ad_cal_comp_out + if(ad_cal_comp_out_init == 1) + calibration_polarity = 1; + else @@ -475,7 +476,7 @@ + cnt = 0; + //printk("TX offset cnt = %d, tabl_idx= %x, offset_val = %x\n", cnt, tabl_idx, MT753x_TX_OFFSET_TBL[tabl_idx]); + while(all_ana_cal_status < ANACAL_ERROR) { -+ ++ + cnt ++; + tabl_idx += calibration_polarity; + //tx_offset_temp += calibration_polarity; @@ -486,11 +487,11 @@ + + all_ana_cal_status = all_ge_ana_cal_wait(gsw, delay, phyaddr); // delay 20 usec + if(all_ana_cal_status == 0) { -+ all_ana_cal_status = ANACAL_ERROR; ++ all_ana_cal_status = ANACAL_ERROR; + printk( " GE Tx offset AnaCal ERROR init 2! \r\n"); + return -1; + } else if(((tc_phy_read_dev_reg(gsw, PHY0, 0x1e, 0x017a)>>8)&0x1) != ad_cal_comp_out_init) { -+ all_ana_cal_status = ANACAL_FINISH; ++ all_ana_cal_status = ANACAL_FINISH; + } else { + if((tabl_idx == 0)||(tabl_idx == 0x3f)) { + all_ana_cal_status = ANACAL_SATURATION; // need to FT @@ -498,8 +499,8 @@ + } + } + } -+ -+ if(all_ana_cal_status == ANACAL_ERROR) { ++ ++ if(all_ana_cal_status == ANACAL_ERROR) { + tx_offset_temp = TX_AMP_OFFSET_0MV; + tc_phy_write_dev_reg(gsw, phyaddr, 0x1e, tx_offset_reg, (reg_temp|(tx_offset_temp<>8) & 0x1; // 1e_17a[8]:ad_cal_comp_out + if(ad_cal_comp_out_init == 1) + calibration_polarity = -1; @@ -604,7 +607,7 @@ + tc_phy_write_dev_reg(gsw, phyaddr, 0x1e, tx_amp_reg_100, (tx_amp_temp|(tx_amp_temp<>8)&0x1) != ad_cal_comp_out_init) { @@ -648,7 +651,7 @@ + tx_amp_temp = tx_amp_temp; + else if(calibration_pair == ANACAL_PAIR_D) + tx_amp_temp = tx_amp_temp; -+ } ++ } + reg_temp = tc_phy_read_dev_reg(gsw, phyaddr, 0x1e, tx_amp_reg)&(~0xff00); + tc_phy_write_dev_reg(gsw, phyaddr, 0x1e, tx_amp_reg_100,(tx_amp_temp|((tx_amp_temp)< Date: Sat, 28 Aug 2021 12:15:09 +0800 Subject: [PATCH 06/38] rtl8192eu: add new package Also removed obsolete packages. --- package/kernel/rtl8192du/Makefile | 66 ----------------- .../patches/010-missing-header-in-ipv6.patch | 14 ---- package/kernel/rtl8192eu/Makefile | 73 +++++++++++++++++++ .../patches/001-use-kernel-byteorder.patch | 15 ++++ .../010-disable-default-build-x86.patch | 11 +++ .../patches/020-remove-repeat-flies.patch | 39 ++++++++++ 6 files changed, 138 insertions(+), 80 deletions(-) delete mode 100644 package/kernel/rtl8192du/Makefile delete mode 100644 package/kernel/rtl8192du/patches/010-missing-header-in-ipv6.patch create mode 100644 package/kernel/rtl8192eu/Makefile create mode 100644 package/kernel/rtl8192eu/patches/001-use-kernel-byteorder.patch create mode 100644 package/kernel/rtl8192eu/patches/010-disable-default-build-x86.patch create mode 100644 package/kernel/rtl8192eu/patches/020-remove-repeat-flies.patch diff --git a/package/kernel/rtl8192du/Makefile b/package/kernel/rtl8192du/Makefile deleted file mode 100644 index 1d82d9b410..0000000000 --- a/package/kernel/rtl8192du/Makefile +++ /dev/null @@ -1,66 +0,0 @@ -# -# Copyright (C) 2006-2018 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:=rtl8192du -PKG_RELEASE:=1 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/lwfinger/rtl8192du -PKG_SOURCE_DATE:=2019-06-01 -PKG_SOURCE_VERSION:=54c95aaa23fe332afaa1ed4aacbb0db43aa3c7dd -PKG_MIRROR_HASH:=d7cee3b7e8601c8e850570401628128f595faa4ad2895237708ba0e58bee3020 - -PKG_BUILD_PARALLEL:=1 -PKG_MAINTAINER:=Larry Finger - -STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h - -include $(INCLUDE_DIR)/kernel.mk -include $(INCLUDE_DIR)/package.mk - -define KernelPackage/rtl8192du - SUBMENU:=Wireless Drivers - TITLE:=Realtek RTL8192DU support - DEPENDS:=+kmod-cfg80211 +kmod-usb-core +@DRIVER_11N_SUPPORT - FILES:= $(PKG_BUILD_DIR)/8192du.ko - AUTOLOAD:=$(call AutoProbe,8192du) -endef - -define KernelPackage/rtl8192du/description - Kernel modules for the Realtek 8192DU USB 802.11n wireless USB adapters -endef - -NOSTDINC_FLAGS = \ - -I$(PKG_BUILD_DIR) \ - -I$(PKG_BUILD_DIR)/include \ - -I$(STAGING_DIR)/usr/include/mac80211-backport \ - -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \ - -I$(STAGING_DIR)/usr/include/mac80211 \ - -I$(STAGING_DIR)/usr/include/mac80211/uapi \ - -include backport/autoconf.h \ - -include backport/backport.h - -NOSTDINC_FLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -DCONFIG_CONCURRENT_MODE - -define Build/Compile - +$(MAKE) $(PKG_JOBS) -C $(LINUX_DIR) \ - $(KERNEL_MAKE_FLAGS) \ - M="$(PKG_BUILD_DIR)" \ - NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \ - CONFIG_RTL8192DU=m \ - modules -endef - -define KernelPackage/rtl8192du/install - $(INSTALL_DIR) $(1)/lib/firmware/rtlwifi - $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtl8192dufw.bin $(1)/lib/firmware/rtlwifi/ - $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtl8192dufw_wol.bin $(1)/lib/firmware/rtlwifi/ -endef - -$(eval $(call KernelPackage,rtl8192du)) diff --git a/package/kernel/rtl8192du/patches/010-missing-header-in-ipv6.patch b/package/kernel/rtl8192du/patches/010-missing-header-in-ipv6.patch deleted file mode 100644 index 57938b2df2..0000000000 --- a/package/kernel/rtl8192du/patches/010-missing-header-in-ipv6.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/core/rtw_br_ext.c b/core/rtw_br_ext.c -index 964b366..ec1c620 100644 ---- a/core/rtw_br_ext.c -+++ b/core/rtw_br_ext.c -@@ -51,6 +51,9 @@ - #include - #include - #include -+#ifndef _HAVE_ARCH_IPV6_CSUM -+#include -+#endif - #endif - #endif - diff --git a/package/kernel/rtl8192eu/Makefile b/package/kernel/rtl8192eu/Makefile new file mode 100644 index 0000000000..d22e858d3e --- /dev/null +++ b/package/kernel/rtl8192eu/Makefile @@ -0,0 +1,73 @@ +# +# Copyright (C) 2021 ImmortalWrt +# +# This is free software, licensed under the GNU General Public License v3. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=rtl8192eu +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=https://github.com/Mange/rtl8192eu-linux-driver.git +PKG_SOURCE_PROTO:=git +PKG_SOURCE_DATE:=2021-05-12 +PKG_SOURCE_VERSION:=546419675335bb80d4548e22ccef915573a5a1e2 +PKG_MIRROR_HASH:=a425a934d973aad20bc51ab2d1131bb81d2c6ebab687a029310e78cf9c81c4f3 + +PKG_BUILD_PARALLEL:=1 + +STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h + +include $(INCLUDE_DIR)/kernel.mk +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/rtl8192eu + SUBMENU:=Wireless Drivers + TITLE:=Realtek RTL8192EU support + DEPENDS:=+kmod-cfg80211 +kmod-usb-core +@DRIVER_11N_SUPPORT + FILES:=$(PKG_BUILD_DIR)/rtl8192eu.ko + AUTOLOAD:=$(call AutoProbe,rtl8192eu) +endef + +NOSTDINC_FLAGS = \ + -I$(PKG_BUILD_DIR) \ + -I$(PKG_BUILD_DIR)/include \ + -I$(STAGING_DIR)/usr/include/mac80211-backport \ + -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \ + -I$(STAGING_DIR)/usr/include/mac80211 \ + -I$(STAGING_DIR)/usr/include/mac80211/uapi \ + -include backport/autoconf.h \ + -include backport/backport.h + +EXTRA_CFLAGS:= \ + -DRTW_SINGLE_WIPHY \ + -DRTW_USE_CFG80211_STA_EVENT \ + -DCONFIG_IOCTL_CFG80211 \ + -DCONFIG_CONCURRENT_MODE + +ifeq ($(CONFIG_BIG_ENDIAN),y) +EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN +else +EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN +endif + +EXTRA_KCONFIG:= \ + CONFIG_RTL8192EU=m \ + USER_MODULE_NAME=rtl8192eu + +MAKE_OPTS:= \ + $(KERNEL_MAKE_FLAGS) \ + M="$(PKG_BUILD_DIR)" \ + NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \ + USER_EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ + $(EXTRA_KCONFIG) + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \ + $(MAKE_OPTS) \ + modules +endef + +$(eval $(call KernelPackage,rtl8192eu)) diff --git a/package/kernel/rtl8192eu/patches/001-use-kernel-byteorder.patch b/package/kernel/rtl8192eu/patches/001-use-kernel-byteorder.patch new file mode 100644 index 0000000000..e75a278339 --- /dev/null +++ b/package/kernel/rtl8192eu/patches/001-use-kernel-byteorder.patch @@ -0,0 +1,15 @@ +Fix compile problem when rtw_byteorder.h and asm/byteorder.h gets +included in addition for example indirectly, do not use realtek own copy +of the byteorder headers. + +--- a/include/drv_types.h ++++ b/include/drv_types.h +@@ -25,7 +25,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include diff --git a/package/kernel/rtl8192eu/patches/010-disable-default-build-x86.patch b/package/kernel/rtl8192eu/patches/010-disable-default-build-x86.patch new file mode 100644 index 0000000000..861f241000 --- /dev/null +++ b/package/kernel/rtl8192eu/patches/010-disable-default-build-x86.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -124,7 +124,7 @@ CONFIG_MP_VHT_HW_TX_MODE = n + ###################### Platform Related ####################### + CONFIG_PLATFORM_ARM_RPI = n + CONFIG_PLATFORM_ARM_AARCH64 = n +-CONFIG_PLATFORM_I386_PC = y ++CONFIG_PLATFORM_I386_PC = n + CONFIG_PLATFORM_ANDROID_X86 = n + CONFIG_PLATFORM_ANDROID_INTEL_X86 = n + CONFIG_PLATFORM_JB_X86 = n diff --git a/package/kernel/rtl8192eu/patches/020-remove-repeat-flies.patch b/package/kernel/rtl8192eu/patches/020-remove-repeat-flies.patch new file mode 100644 index 0000000000..51bbd8d3e0 --- /dev/null +++ b/package/kernel/rtl8192eu/patches/020-remove-repeat-flies.patch @@ -0,0 +1,39 @@ +From 9b2b0ec1bc2d31ddf93ed74d63fdfa6044e329a4 Mon Sep 17 00:00:00 2001 +From: Ben Greear +Date: Fri, 9 Nov 2018 16:21:43 -0800 +Subject: [PATCH] Fix build against openwrt backports tree. + +Like breaks builds elsewhere, can fix it up later. + +Signed-off-by: Ben Greear +--- + include/drv_conf.h | 4 +++- + .../{wireless.h => old_unused_rtl_wireless.h} | 0 + include/{autoconf.h => rtl_autoconf.h} | 0 + 3 files changed, 3 insertions(+), 1 deletions(-) + rename include/linux/{wireless.h => old_unused_rtl_wireless.h} (100%) + rename include/{autoconf.h => rtl_autoconf.h} (100%) + +diff --git a/include/drv_conf.h b/include/drv_conf.h +index 0d20a7e..f0a9f88 100644 +--- a/include/drv_conf.h ++++ b/include/drv_conf.h +@@ -14,7 +14,9 @@ + *****************************************************************************/ + #ifndef __DRV_CONF_H__ + #define __DRV_CONF_H__ +-#include "autoconf.h" ++ ++#include ++#include "rtl_autoconf.h" + #include "hal_ic_cfg.h" + #if defined(PLATFORM_LINUX) && defined (PLATFORM_WINDOWS) + +diff --git a/include/linux/wireless.h b/include/linux/old_unused_rtl_wireless.h +similarity index 100% +rename from include/linux/wireless.h +rename to include/linux/old_unused_rtl_wireless.h +diff --git a/include/autoconf.h b/include/rtl_autoconf.h +similarity index 100% +rename from include/autoconf.h +rename to include/rtl_autoconf.h From e890caecb3b65e3ae8605c230aafeb60d4fc13db Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Tue, 14 Sep 2021 01:31:07 +0800 Subject: [PATCH 07/38] glibc: rollback to 2.27 for kernel 4.x Signed-off-by: Tianling Shen --- toolchain/glibc/common.mk | 12 +- .../patches/001-regex-read-overrun.patch | 26 + ...use-of-DES-encryption-functions-in-n.patch | 677 ------------------ .../glibc/patches/100-fix_cross_rpcgen.patch | 16 + .../patches/200-add-dl-search-paths.patch | 2 +- toolchain/glibc/patches/300-arc.patch | 55 -- 6 files changed, 49 insertions(+), 739 deletions(-) create mode 100644 toolchain/glibc/patches/001-regex-read-overrun.patch delete mode 100644 toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch delete mode 100644 toolchain/glibc/patches/300-arc.patch diff --git a/toolchain/glibc/common.mk b/toolchain/glibc/common.mk index 48f2aa26a4..d0a2664057 100644 --- a/toolchain/glibc/common.mk +++ b/toolchain/glibc/common.mk @@ -1,5 +1,5 @@ # -# Copyright (C) 2006-2020 OpenWrt.org +# Copyright (C) 2006-2016 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -7,13 +7,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=glibc -PKG_VERSION:=2.33 +PKG_VERSION:=2.27 PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=b5711025bc138c0c94d90b2015d57eda404decbe -PKG_MIRROR_HASH:=6910af6ca27ea80e600c59fad25d88c51618928316f3bfcc78ad2f0c1794da16 +PKG_SOURCE_VERSION:=daf88b1dd1a41fcb324801c02ead7a8d5aac3851 +PKG_MIRROR_HASH:=fc78ef46c52c922ea44d079533d4d3017a0c921b4ed9aab8bb1dd071322b169f PKG_SOURCE_URL:=https://sourceware.org/git/glibc.git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz @@ -62,8 +62,8 @@ GLIBC_CONFIGURE:= \ --enable-add-ons \ --$(if $(CONFIG_SOFT_FLOAT),without,with)-fp \ $(if $(CONFIG_PKG_CC_STACKPROTECTOR_REGULAR),--enable-stack-protector=yes) \ - $(if $(CONFIG_PKG_CC_STACKPROTECTOR_STRONG),--enable-stack-protector=strong) \ - --enable-kernel=4.14.0 + $(if $(CONFIG_PKG_CC_STACKPROTECTOR_STRONG),--enable-stack-protector=strong) + export libc_cv_ssp=no export libc_cv_ssp_strong=no diff --git a/toolchain/glibc/patches/001-regex-read-overrun.patch b/toolchain/glibc/patches/001-regex-read-overrun.patch new file mode 100644 index 0000000000..c4e4307aa6 --- /dev/null +++ b/toolchain/glibc/patches/001-regex-read-overrun.patch @@ -0,0 +1,26 @@ +commit 583dd860d5b833037175247230a328f0050dbfe9 +Author: Paul Eggert +Date: Mon Jan 21 11:08:13 2019 -0800 + + regex: fix read overrun [BZ #24114] + + Problem found by AddressSanitizer, reported by Hongxu Chen in: + https://debbugs.gnu.org/34140 + * posix/regexec.c (proceed_next_node): + Do not read past end of input buffer. + +--- a/posix/regexec.c ++++ b/posix/regexec.c +@@ -1293,8 +1293,10 @@ proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs, + else if (naccepted) + { + char *buf = (char *) re_string_get_buffer (&mctx->input); +- if (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx, +- naccepted) != 0) ++ if (mctx->input.valid_len - *pidx < naccepted ++ || (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx, ++ naccepted) ++ != 0)) + return -1; + } + } diff --git a/toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch b/toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch deleted file mode 100644 index 10d9f65d18..0000000000 --- a/toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch +++ /dev/null @@ -1,677 +0,0 @@ -From 08f5e0df46ce1ad617bcde1fd5542545397630b9 Mon Sep 17 00:00:00 2001 -From: Hans Dedecker -Date: Sat, 24 Oct 2020 21:13:30 +0200 -Subject: Revert "Disallow use of DES encryption functions in new programs." - -This reverts commit b10a0accee709a5efff2fadf0b0bbb79ff0ad759. - -ppp still uses the encrypt functions from the libc while musl libc also -provides them. ---- - conform/data/stdlib.h-data | 3 + - conform/data/unistd.h-data | 6 ++ - crypt/cert.c | 26 ----- - crypt/crypt-entry.c | 15 ++- - crypt/crypt.h | 16 +++ - crypt/crypt_util.c | 9 -- - manual/conf.texi | 2 - - manual/crypt.texi | 204 +++++++++++++++++++++++++++++++++++++ - manual/string.texi | 82 +++++++-------- - posix/unistd.h | 17 +++- - stdlib/stdlib.h | 6 ++ - sunrpc/des_crypt.c | 7 +- - sunrpc/des_soft.c | 2 +- - 13 files changed, 305 insertions(+), 90 deletions(-) - ---- a/conform/data/stdlib.h-data -+++ b/conform/data/stdlib.h-data -@@ -149,6 +149,9 @@ function {unsigned short int*} seed48 (u - #if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 - function int setenv (const char*, const char*, int) - #endif -+#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 -+function void setkey (const char*) -+#endif - #if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined POSIX && !defined POSIX2008 - function {char*} setstate (char*) - #endif ---- a/conform/data/unistd.h-data -+++ b/conform/data/unistd.h-data -@@ -437,6 +437,9 @@ function int chroot (const char*) - function int chown (const char*, uid_t, gid_t) - function int close (int) - function size_t confstr (int, char*, size_t) -+#if !defined POSIX && !defined POSIX2008 -+function {char*} crypt (const char*, const char*) -+#endif - #if defined XPG4 || defined XPG42 || defined UNIX98 - function {char*} ctermid (char*) - function {char*} cuserid (char*) -@@ -446,6 +449,9 @@ allow cuserid - #endif - function int dup (int) - function int dup2 (int, int) -+#if !defined POSIX && !defined POSIX2008 -+function void encrypt (char[64], int) -+#endif - function int execl (const char*, const char*, ...) - function int execle (const char*, const char*, ...) - function int execlp (const char*, const char*, ...) ---- a/crypt/cert.c -+++ b/crypt/cert.c -@@ -10,22 +10,6 @@ - #include - #include "crypt.h" - --/* This file tests the deprecated setkey/encrypt interface. */ --#include --#if TEST_COMPAT (libcrypt, GLIBC_2_0, GLIBC_2_28) -- --#define libcrypt_version_reference(symbol, version) \ -- _libcrypt_version_reference (symbol, VERSION_libcrypt_##version) --#define _libcrypt_version_reference(symbol, version) \ -- __libcrypt_version_reference (symbol, version) --#define __libcrypt_version_reference(symbol, version) \ -- __asm__ (".symver " #symbol ", " #symbol "@" #version) -- --extern void setkey (const char *); --extern void encrypt (const char *, int); --libcrypt_version_reference (setkey, GLIBC_2_0); --libcrypt_version_reference (encrypt, GLIBC_2_0); -- - int totfails = 0; - - int main (int argc, char *argv[]); -@@ -120,13 +104,3 @@ put8 (char *cp) - printf("%02x", t); - } - } -- --#else /* encrypt and setkey are not available. */ -- --int --main (void) --{ -- return 77; /* UNSUPPORTED */ --} -- --#endif ---- a/crypt/crypt-entry.c -+++ b/crypt/crypt-entry.c -@@ -35,7 +35,6 @@ - #endif - - #include "crypt-private.h" --#include - - /* Prototypes for local functions. */ - #ifndef __GNU_LIBRARY__ -@@ -177,7 +176,17 @@ crypt (const char *key, const char *salt - return __crypt_r (key, salt, &_ufc_foobar); - } - --#if SHLIB_COMPAT (libcrypt, GLIBC_2_0, GLIBC_2_28) -+ -+/* -+ * To make fcrypt users happy. -+ * They don't need to call init_des. -+ */ -+#ifdef _LIBC - weak_alias (crypt, fcrypt) --compat_symbol (libcrypt, fcrypt, fcrypt, GLIBC_2_0); -+#else -+char * -+__fcrypt (const char *key, const char *salt) -+{ -+ return crypt (key, salt); -+} - #endif ---- a/crypt/crypt.h -+++ b/crypt/crypt.h -@@ -36,6 +36,14 @@ __BEGIN_DECLS - extern char *crypt (const char *__phrase, const char *__salt) - __THROW __nonnull ((1, 2)); - -+/* Setup DES tables according KEY. */ -+extern void setkey (const char *__key) __THROW __nonnull ((1)); -+ -+/* Encrypt data in BLOCK in place if EDFLAG is zero; otherwise decrypt -+ block in place. */ -+extern void encrypt (char *__glibc_block, int __edflag) -+ __THROW __nonnull ((1)); -+ - #ifdef __USE_GNU - - /* This structure provides scratch and output buffers for 'crypt_r'. -@@ -63,6 +71,14 @@ struct crypt_data - extern char *crypt_r (const char *__phrase, const char *__salt, - struct crypt_data * __restrict __data) - __THROW __nonnull ((1, 2, 3)); -+ -+extern void setkey_r (const char *__key, -+ struct crypt_data * __restrict __data) -+ __THROW __nonnull ((1, 2)); -+ -+extern void encrypt_r (char *__glibc_block, int __edflag, -+ struct crypt_data * __restrict __data) -+ __THROW __nonnull ((1, 3)); - #endif - - __END_DECLS ---- a/crypt/crypt_util.c -+++ b/crypt/crypt_util.c -@@ -34,7 +34,6 @@ - #endif - - #include "crypt-private.h" --#include - - /* Prototypes for local functions. */ - #ifndef __GNU_LIBRARY__ -@@ -151,7 +150,6 @@ static const int sbox[8][4][16]= { - } - }; - --#if SHLIB_COMPAT (libcrypt, GLIBC_2_0, GLIBC_2_28) - /* - * This is the initial - * permutation matrix -@@ -162,7 +160,6 @@ static const int initial_perm[64] = { - 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3, - 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7 - }; --#endif - - /* - * This is the final -@@ -788,7 +785,6 @@ _ufc_output_conversion_r (ufc_long v1, u - __data->crypt_3_buf[13] = 0; - } - --#if SHLIB_COMPAT (libcrypt, GLIBC_2_0, GLIBC_2_28) - - /* - * UNIX encrypt function. Takes a bitvector -@@ -889,14 +885,12 @@ __encrypt_r (char *__block, int __edflag - } - } - weak_alias (__encrypt_r, encrypt_r) --compat_symbol (libcrypt, encrypt_r, encrypt_r, GLIBC_2_0); - - void - encrypt (char *__block, int __edflag) - { - __encrypt_r(__block, __edflag, &_ufc_foobar); - } --compat_symbol (libcrypt, encrypt, encrypt, GLIBC_2_0); - - - /* -@@ -921,15 +915,12 @@ __setkey_r (const char *__key, struct cr - _ufc_mk_keytab_r((char *) ktab, __data); - } - weak_alias (__setkey_r, setkey_r) --compat_symbol (libcrypt, setkey_r, setkey_r, GLIBC_2_0); - - void - setkey (const char *__key) - { - __setkey_r(__key, &_ufc_foobar); - } --compat_symbol (libcrypt, setkey, setkey, GLIBC_2_0); --#endif /* SHLIB_COMPAT (libcrypt, GLIBC_2_0, GLIBC_2_28) */ - - void - __b64_from_24bit (char **cp, int *buflen, ---- a/manual/conf.texi -+++ b/manual/conf.texi -@@ -780,8 +780,6 @@ Inquire about the parameter correspondin - @item _SC_XOPEN_CRYPT - @standards{X/Open, unistd.h} - Inquire about the parameter corresponding to @code{_XOPEN_CRYPT}. --@Theglibc no longer implements the @code{_XOPEN_CRYPT} extensions, --so @samp{sysconf (_SC_XOPEN_CRYPT)} always returns @code{-1}. - - @item _SC_XOPEN_ENH_I18N - @standards{X/Open, unistd.h} ---- a/manual/crypt.texi -+++ b/manual/crypt.texi -@@ -16,8 +16,19 @@ subject to them, even if you do not use - yourself. The restrictions vary from place to place and are changed - often, so we cannot give any more specific advice than this warning. - -+@vindex AUTH_DES -+@cindex FIPS 140-2 -+It also provides support for Secure RPC, and some library functions that -+can be used to perform normal DES encryption. The @code{AUTH_DES} -+authentication flavor in Secure RPC, as provided by @theglibc{}, -+uses DES and does not comply with FIPS 140-2 nor does any other use of DES -+within @theglibc{}. It is recommended that Secure RPC should not be used -+for systems that need to comply with FIPS 140-2 since all flavors of -+encrypted authentication use normal DES. -+ - @menu - * Passphrase Storage:: One-way hashing for passphrases. -+* crypt:: A one-way function for passwords. - * Unpredictable Bytes:: Randomness for cryptographic purposes. - @end menu - -@@ -190,6 +201,199 @@ unpredictable as possible; @pxref{Unpred - @include genpass.c.texi - @end smallexample - -+@node DES Encryption -+@section DES Encryption -+ -+@cindex FIPS 46-3 -+The Data Encryption Standard is described in the US Government Federal -+Information Processing Standards (FIPS) 46-3 published by the National -+Institute of Standards and Technology. The DES has been very thoroughly -+analyzed since it was developed in the late 1970s, and no new -+significant flaws have been found. -+ -+However, the DES uses only a 56-bit key (plus 8 parity bits), and a -+machine has been built in 1998 which can search through all possible -+keys in about 6 days, which cost about US$200000; faster searches would -+be possible with more money. This makes simple DES insecure for most -+purposes, and NIST no longer permits new US government systems -+to use simple DES. -+ -+For serious encryption functionality, it is recommended that one of the -+many free encryption libraries be used instead of these routines. -+ -+The DES is a reversible operation which takes a 64-bit block and a -+64-bit key, and produces another 64-bit block. Usually the bits are -+numbered so that the most-significant bit, the first bit, of each block -+is numbered 1. -+ -+Under that numbering, every 8th bit of the key (the 8th, 16th, and so -+on) is not used by the encryption algorithm itself. But the key must -+have odd parity; that is, out of bits 1 through 8, and 9 through 16, and -+so on, there must be an odd number of `1' bits, and this completely -+specifies the unused bits. -+ -+@deftypefun void setkey (const char *@var{key}) -+@standards{BSD, crypt.h} -+@standards{SVID, crypt.h} -+@safety{@prelim{}@mtunsafe{@mtasurace{:crypt}}@asunsafe{@asucorrupt{} @asulock{}}@acunsafe{@aculock{}}} -+@c The static buffer stores the key, making it fundamentally -+@c thread-unsafe. The locking issues are only in the initialization -+@c path; cancelling the initialization will leave the lock held, it -+@c would otherwise repeat the initialization on the next call. -+ -+The @code{setkey} function sets an internal data structure to be an -+expanded form of @var{key}. @var{key} is specified as an array of 64 -+bits each stored in a @code{char}, the first bit is @code{key[0]} and -+the 64th bit is @code{key[63]}. The @var{key} should have the correct -+parity. -+@end deftypefun -+ -+@deftypefun void encrypt (char *@var{block}, int @var{edflag}) -+@standards{BSD, crypt.h} -+@standards{SVID, crypt.h} -+@safety{@prelim{}@mtunsafe{@mtasurace{:crypt}}@asunsafe{@asucorrupt{} @asulock{}}@acunsafe{@aculock{}}} -+@c Same issues as setkey. -+ -+The @code{encrypt} function encrypts @var{block} if -+@var{edflag} is 0, otherwise it decrypts @var{block}, using a key -+previously set by @code{setkey}. The result is -+placed in @var{block}. -+ -+Like @code{setkey}, @var{block} is specified as an array of 64 bits each -+stored in a @code{char}, but there are no parity bits in @var{block}. -+@end deftypefun -+ -+@deftypefun void setkey_r (const char *@var{key}, {struct crypt_data *} @var{data}) -+@deftypefunx void encrypt_r (char *@var{block}, int @var{edflag}, {struct crypt_data *} @var{data}) -+@standards{GNU, crypt.h} -+@c setkey_r: @safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{} @asulock{}}@acunsafe{@aculock{}}} -+@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{} @asulock{}}@acunsafe{@aculock{}}} -+ -+These are reentrant versions of @code{setkey} and @code{encrypt}. The -+only difference is the extra parameter, which stores the expanded -+version of @var{key}. Before calling @code{setkey_r} the first time, -+@code{data->initialized} must be cleared to zero. -+@end deftypefun -+ -+The @code{setkey_r} and @code{encrypt_r} functions are GNU extensions. -+@code{setkey}, @code{encrypt}, @code{setkey_r}, and @code{encrypt_r} are -+defined in @file{crypt.h}. -+ -+@deftypefun int ecb_crypt (char *@var{key}, char *@var{blocks}, unsigned int @var{len}, unsigned int @var{mode}) -+@standards{SUNRPC, rpc/des_crypt.h} -+@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} -+ -+The function @code{ecb_crypt} encrypts or decrypts one or more blocks -+using DES. Each block is encrypted independently. -+ -+The @var{blocks} and the @var{key} are stored packed in 8-bit bytes, so -+that the first bit of the key is the most-significant bit of -+@code{key[0]} and the 63rd bit of the key is stored as the -+least-significant bit of @code{key[7]}. The @var{key} should have the -+correct parity. -+ -+@var{len} is the number of bytes in @var{blocks}. It should be a -+multiple of 8 (so that there are a whole number of blocks to encrypt). -+@var{len} is limited to a maximum of @code{DES_MAXDATA} bytes. -+ -+The result of the encryption replaces the input in @var{blocks}. -+ -+The @var{mode} parameter is the bitwise OR of two of the following: -+ -+@vtable @code -+@item DES_ENCRYPT -+@standards{SUNRPC, rpc/des_crypt.h} -+This constant, used in the @var{mode} parameter, specifies that -+@var{blocks} is to be encrypted. -+ -+@item DES_DECRYPT -+@standards{SUNRPC, rpc/des_crypt.h} -+This constant, used in the @var{mode} parameter, specifies that -+@var{blocks} is to be decrypted. -+ -+@item DES_HW -+@standards{SUNRPC, rpc/des_crypt.h} -+This constant, used in the @var{mode} parameter, asks to use a hardware -+device. If no hardware device is available, encryption happens anyway, -+but in software. -+ -+@item DES_SW -+@standards{SUNRPC, rpc/des_crypt.h} -+This constant, used in the @var{mode} parameter, specifies that no -+hardware device is to be used. -+@end vtable -+ -+The result of the function will be one of these values: -+ -+@vtable @code -+@item DESERR_NONE -+@standards{SUNRPC, rpc/des_crypt.h} -+The encryption succeeded. -+ -+@item DESERR_NOHWDEVICE -+@standards{SUNRPC, rpc/des_crypt.h} -+The encryption succeeded, but there was no hardware device available. -+ -+@item DESERR_HWERROR -+@standards{SUNRPC, rpc/des_crypt.h} -+The encryption failed because of a hardware problem. -+ -+@item DESERR_BADPARAM -+@standards{SUNRPC, rpc/des_crypt.h} -+The encryption failed because of a bad parameter, for instance @var{len} -+is not a multiple of 8 or @var{len} is larger than @code{DES_MAXDATA}. -+@end vtable -+@end deftypefun -+ -+@deftypefun int DES_FAILED (int @var{err}) -+@standards{SUNRPC, rpc/des_crypt.h} -+@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} -+This macro returns 1 if @var{err} is a `success' result code from -+@code{ecb_crypt} or @code{cbc_crypt}, and 0 otherwise. -+@end deftypefun -+ -+@deftypefun int cbc_crypt (char *@var{key}, char *@var{blocks}, unsigned int @var{len}, unsigned int @var{mode}, char *@var{ivec}) -+@standards{SUNRPC, rpc/des_crypt.h} -+@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} -+ -+The function @code{cbc_crypt} encrypts or decrypts one or more blocks -+using DES in Cipher Block Chaining mode. -+ -+For encryption in CBC mode, each block is exclusive-ored with @var{ivec} -+before being encrypted, then @var{ivec} is replaced with the result of -+the encryption, then the next block is processed. Decryption is the -+reverse of this process. -+ -+This has the advantage that blocks which are the same before being -+encrypted are very unlikely to be the same after being encrypted, making -+it much harder to detect patterns in the data. -+ -+Usually, @var{ivec} is set to 8 random bytes before encryption starts. -+Then the 8 random bytes are transmitted along with the encrypted data -+(without themselves being encrypted), and passed back in as @var{ivec} -+for decryption. Another possibility is to set @var{ivec} to 8 zeroes -+initially, and have the first block encrypted consist of 8 random -+bytes. -+ -+Otherwise, all the parameters are similar to those for @code{ecb_crypt}. -+@end deftypefun -+ -+@deftypefun void des_setparity (char *@var{key}) -+@standards{SUNRPC, rpc/des_crypt.h} -+@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} -+ -+The function @code{des_setparity} changes the 64-bit @var{key}, stored -+packed in 8-bit bytes, to have odd parity by altering the low bits of -+each byte. -+@end deftypefun -+ -+The @code{ecb_crypt}, @code{cbc_crypt}, and @code{des_setparity} -+functions and their accompanying macros are all defined in the header -+@file{rpc/des_crypt.h}. -+ -+@node Unpredictable Bytes -+@section Generating Unpredictable Bytes -+ - The next program demonstrates how to verify a passphrase. It checks a - hash hardcoded into the program, because looking up real users' hashed - passphrases may require special privileges (@pxref{User Database}). ---- a/manual/string.texi -+++ b/manual/string.texi -@@ -36,8 +36,8 @@ too. - for delimiters. - * Erasing Sensitive Data:: Clearing memory which contains sensitive - data, after it's no longer needed. --* Shuffling Bytes:: Or how to flash-cook a string. --* Obfuscating Data:: Reversibly obscuring data from casual view. -+* strfry:: Function for flash-cooking a string. -+* Trivial Encryption:: Obscuring data. - * Encode Binary Data:: Encoding and Decoding of Binary Data. - * Argz and Envz Vectors:: Null-separated string vectors. - @end menu -@@ -2426,73 +2426,73 @@ functionality under a different name, su - systems it may be in @file{strings.h} instead. - @end deftypefun - -- --@node Shuffling Bytes --@section Shuffling Bytes -+@node strfry -+@section strfry - - The function below addresses the perennial programming quandary: ``How do - I take good data in string form and painlessly turn it into garbage?'' --This is not a difficult thing to code for oneself, but the authors of --@theglibc{} wish to make it as convenient as possible. -+This is actually a fairly simple task for C programmers who do not use -+@theglibc{} string functions, but for programs based on @theglibc{}, -+the @code{strfry} function is the preferred method for -+destroying string data. - --To @emph{erase} data, use @code{explicit_bzero} (@pxref{Erasing --Sensitive Data}); to obfuscate it reversibly, use @code{memfrob} --(@pxref{Obfuscating Data}). -+The prototype for this function is in @file{string.h}. - - @deftypefun {char *} strfry (char *@var{string}) - @standards{GNU, string.h} - @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} - @c Calls initstate_r, time, getpid, strlen, and random_r. - --@code{strfry} performs an in-place shuffle on @var{string}. Each --character is swapped to a position selected at random, within the --portion of the string starting with the character's original position. --(This is the Fisher-Yates algorithm for unbiased shuffling.) -- --Calling @code{strfry} will not disturb any of the random number --generators that have global state (@pxref{Pseudo-Random Numbers}). -+@code{strfry} creates a pseudorandom anagram of a string, replacing the -+input with the anagram in place. For each position in the string, -+@code{strfry} swaps it with a position in the string selected at random -+(from a uniform distribution). The two positions may be the same. - - The return value of @code{strfry} is always @var{string}. - - @strong{Portability Note:} This function is unique to @theglibc{}. --It is declared in @file{string.h}. -+ - @end deftypefun - - --@node Obfuscating Data --@section Obfuscating Data -+@node Trivial Encryption -+@section Trivial Encryption -+@cindex encryption -+ -+ -+The @code{memfrob} function converts an array of data to something -+unrecognizable and back again. It is not encryption in its usual sense -+since it is easy for someone to convert the encrypted data back to clear -+text. The transformation is analogous to Usenet's ``Rot13'' encryption -+method for obscuring offensive jokes from sensitive eyes and such. -+Unlike Rot13, @code{memfrob} works on arbitrary binary data, not just -+text. - @cindex Rot13 - --The @code{memfrob} function reversibly obfuscates an array of binary --data. This is not true encryption; the obfuscated data still bears a --clear relationship to the original, and no secret key is required to --undo the obfuscation. It is analogous to the ``Rot13'' cipher used on --Usenet for obscuring offensive jokes, spoilers for works of fiction, --and so on, but it can be applied to arbitrary binary data. -- --Programs that need true encryption---a transformation that completely --obscures the original and cannot be reversed without knowledge of a --secret key---should use a dedicated cryptography library, such as --@uref{https://www.gnu.org/software/libgcrypt/,,libgcrypt}. -- --Programs that need to @emph{destroy} data should use --@code{explicit_bzero} (@pxref{Erasing Sensitive Data}), or possibly --@code{strfry} (@pxref{Shuffling Bytes}). -+For true encryption, @xref{Cryptographic Functions}. -+ -+This function is declared in @file{string.h}. -+@pindex string.h - - @deftypefun {void *} memfrob (void *@var{mem}, size_t @var{length}) - @standards{GNU, string.h} - @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} - --The function @code{memfrob} obfuscates @var{length} bytes of data --beginning at @var{mem}, in place. Each byte is bitwise xor-ed with --the binary pattern 00101010 (hexadecimal 0x2A). The return value is --always @var{mem}. -- --@code{memfrob} a second time on the same data returns it to --its original state. -+@code{memfrob} transforms (frobnicates) each byte of the data structure -+at @var{mem}, which is @var{length} bytes long, by bitwise exclusive -+oring it with binary 00101010. It does the transformation in place and -+its return value is always @var{mem}. -+ -+Note that @code{memfrob} a second time on the same data structure -+returns it to its original state. -+ -+This is a good function for hiding information from someone who doesn't -+want to see it or doesn't want to see it very much. To really prevent -+people from retrieving the information, use stronger encryption such as -+that described in @xref{Cryptographic Functions}. - - @strong{Portability Note:} This function is unique to @theglibc{}. --It is declared in @file{string.h}. -+ - @end deftypefun - - @node Encode Binary Data ---- a/posix/unistd.h -+++ b/posix/unistd.h -@@ -107,6 +107,9 @@ __BEGIN_DECLS - /* The X/Open Unix extensions are available. */ - #define _XOPEN_UNIX 1 - -+/* Encryption is present. */ -+#define _XOPEN_CRYPT 1 -+ - /* The enhanced internationalization capabilities according to XPG4.2 - are present. */ - #define _XOPEN_ENH_I18N 1 -@@ -1129,17 +1132,25 @@ ssize_t copy_file_range (int __infd, __o - extern int fdatasync (int __fildes); - #endif /* Use POSIX199309 */ - --#ifdef __USE_MISC -+/* XPG4.2 specifies that prototypes for the encryption functions must -+ be defined here. */ -+#ifdef __USE_XOPEN - /* One-way hash PHRASE, returning a string suitable for storage in the - user database. SALT selects the one-way function to use, and - ensures that no two users' hashes are the same, even if they use - the same passphrase. The return value points to static storage - which will be overwritten by the next call to crypt. */ -+ -+/* Encrypt at most 8 characters from KEY using salt to perturb DES. */ - extern char *crypt (const char *__key, const char *__salt) - __THROW __nonnull ((1, 2)); --#endif - --#ifdef __USE_XOPEN -+/* Encrypt data in BLOCK in place if EDFLAG is zero; otherwise decrypt -+ block in place. */ -+extern void encrypt (char *__glibc_block, int __edflag) -+ __THROW __nonnull ((1)); -+ -+ - /* Swab pairs bytes in the first N bytes of the area pointed to by - FROM and copy the result to TO. The value of TO must not be in the - range [FROM - N + 1, FROM - 1]. If N is odd the first byte in FROM ---- a/stdlib/stdlib.h -+++ b/stdlib/stdlib.h -@@ -962,6 +962,12 @@ extern int getsubopt (char **__restrict - #endif - - -+#ifdef __USE_XOPEN -+/* Setup DES tables according KEY. */ -+extern void setkey (const char *__key) __THROW __nonnull ((1)); -+#endif -+ -+ - /* X/Open pseudo terminal handling. */ - - #ifdef __USE_XOPEN2KXSI ---- a/sunrpc/des_crypt.c -+++ b/sunrpc/des_crypt.c -@@ -86,9 +86,6 @@ common_crypt (char *key, char *buf, regi - return desdev == DES_SW ? DESERR_NONE : DESERR_NOHWDEVICE; - } - --/* Note: these cannot be excluded from the build yet, because they are -- still used internally. */ -- - /* - * CBC mode encryption - */ -@@ -105,7 +102,7 @@ cbc_crypt (char *key, char *buf, unsigne - COPY8 (dp.des_ivec, ivec); - return err; - } --hidden_nolink (cbc_crypt, libc, GLIBC_2_1) -+libc_hidden_nolink_sunrpc (cbc_crypt, GLIBC_2_1) - - /* - * ECB mode encryption -@@ -118,4 +115,4 @@ ecb_crypt (char *key, char *buf, unsigne - dp.des_mode = ECB; - return common_crypt (key, buf, len, mode, &dp); - } --hidden_nolink (ecb_crypt, libc, GLIBC_2_1) -+libc_hidden_nolink_sunrpc (ecb_crypt, GLIBC_2_1) ---- a/sunrpc/des_soft.c -+++ b/sunrpc/des_soft.c -@@ -71,4 +71,4 @@ des_setparity (char *p) - p++; - } - } --hidden_nolink (des_setparity, libc, GLIBC_2_1) -+libc_hidden_nolink_sunrpc (des_setparity, GLIBC_2_1) diff --git a/toolchain/glibc/patches/100-fix_cross_rpcgen.patch b/toolchain/glibc/patches/100-fix_cross_rpcgen.patch index 9baed08139..f10efcc5d6 100644 --- a/toolchain/glibc/patches/100-fix_cross_rpcgen.patch +++ b/toolchain/glibc/patches/100-fix_cross_rpcgen.patch @@ -34,3 +34,19 @@ # define __daddr_t_defined #endif +--- a/sunrpc/rpc_main.c ++++ b/sunrpc/rpc_main.c +@@ -958,9 +958,10 @@ mkfile_output (struct commandline *cmd) + abort (); + temp = strrchr (cmd->infile, '.'); + cp = stpcpy (mkfilename, "Makefile."); +- if (temp != NULL) +- *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0'; +- else ++ if (temp != NULL) { ++ strncpy(cp, cmd->infile, temp - cmd->infile); ++ cp[temp - cmd->infile - 1] = 0; ++ } else + stpcpy (cp, cmd->infile); + + } diff --git a/toolchain/glibc/patches/200-add-dl-search-paths.patch b/toolchain/glibc/patches/200-add-dl-search-paths.patch index 18d751dd1a..5585ee1f0e 100644 --- a/toolchain/glibc/patches/200-add-dl-search-paths.patch +++ b/toolchain/glibc/patches/200-add-dl-search-paths.patch @@ -2,7 +2,7 @@ add /usr/lib to default search path for the dynamic linker --- a/Makeconfig +++ b/Makeconfig -@@ -601,6 +601,9 @@ else +@@ -589,6 +589,9 @@ else default-rpath = $(libdir) endif diff --git a/toolchain/glibc/patches/300-arc.patch b/toolchain/glibc/patches/300-arc.patch deleted file mode 100644 index 66f7aeb3ef..0000000000 --- a/toolchain/glibc/patches/300-arc.patch +++ /dev/null @@ -1,55 +0,0 @@ ---- a/sysdeps/arc/atomic-machine.h -+++ b/sysdeps/arc/atomic-machine.h -@@ -64,6 +64,10 @@ typedef uintmax_t uatomic_max_t; - __atomic_val_bysize (__arch_compare_and_exchange_val, int, \ - mem, new, old, __ATOMIC_ACQUIRE) - -+#ifdef __ARC700__ -+#define atomic_full_barrier() ({ asm volatile ("sync":::"memory"); }) -+#else - #define atomic_full_barrier() ({ asm volatile ("dmb 3":::"memory"); }) -+#endif - - #endif /* _ARC_BITS_ATOMIC_H */ ---- a/sysdeps/unix/sysv/linux/arc/syscall.S -+++ b/sysdeps/unix/sysv/linux/arc/syscall.S -@@ -24,8 +24,13 @@ ENTRY (syscall) - mov_s r1, r2 - mov_s r2, r3 - mov_s r3, r4 -+#ifdef __ARC700__ -+ mov r4, r5 -+ mov r5, r6 -+#else - mov_s r4, r5 - mov_s r5, r6 -+#endif - - ARC_TRAP_INSN - brhi r0, -4096, L (call_syscall_err) ---- a/sysdeps/unix/sysv/linux/arc/sysdep.h -+++ b/sysdeps/unix/sysv/linux/arc/sysdep.h -@@ -128,7 +128,11 @@ L (call_syscall_err): ASM_LINE_SEP \ - mov r8, __NR_##syscall_name ASM_LINE_SEP \ - ARC_TRAP_INSN ASM_LINE_SEP - -+# ifdef __ARC700__ -+# define ARC_TRAP_INSN trap0 -+# else - # define ARC_TRAP_INSN trap_s 0 -+# endif - - #else /* !__ASSEMBLER__ */ - -@@ -139,7 +143,11 @@ extern long int __syscall_error (long in - hidden_proto (__syscall_error) - # endif - -+# ifdef __ARC700__ -+# define ARC_TRAP_INSN "trap0 \n\t" -+# else - # define ARC_TRAP_INSN "trap_s 0 \n\t" -+#endif - - # undef INTERNAL_SYSCALL_NCS - # define INTERNAL_SYSCALL_NCS(number, nr_args, args...) \ From cf1a90eb7fdb06aa350d5fb85dce64b02d8d6005 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Tue, 14 Sep 2021 03:10:42 +0800 Subject: [PATCH 08/38] glibc: depends on !arc Signed-off-by: Tianling Shen --- toolchain/Config.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/toolchain/Config.in b/toolchain/Config.in index 8ff5438d79..b2f59a3924 100644 --- a/toolchain/Config.in +++ b/toolchain/Config.in @@ -231,7 +231,6 @@ comment "C Library" choice prompt "C Library implementation" if TOOLCHAINOPTS - default LIBC_USE_GLIBC if arc default LIBC_USE_MUSL help Select the C library implementation. @@ -239,6 +238,7 @@ choice config LIBC_USE_GLIBC bool "Use glibc" select USE_GLIBC + depends on !arc config LIBC_USE_MUSL select USE_MUSL @@ -268,7 +268,6 @@ config GDB_PYTHON Enable the python bindings for GDB to allow using python in the gdb shell. config USE_GLIBC - default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc) bool config USE_MUSL From 4fa4878e6b31b78d24c3ada44194579212f6bfc0 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Tue, 14 Sep 2021 03:11:27 +0800 Subject: [PATCH 09/38] arc770: drop target I've never heard somebody use this target, and it requires uClibc to work, which was removed in the past. Signed-off-by: Tianling Shen --- target/linux/arc770/Makefile | 25 --- .../arc770/base-files/etc/board.d/02_network | 18 -- target/linux/arc770/base-files/lib/arc.sh | 40 ---- .../base-files/lib/preinit/01_preinit_arc.sh | 9 - target/linux/arc770/config-4.14 | 200 ------------------ .../arc770/generic/profiles/00-default.mk | 16 -- target/linux/arc770/generic/target.mk | 8 - target/linux/arc770/image/Config.in | 5 - target/linux/arc770/image/Makefile | 84 -------- .../arc770/image/gen_axs10x_sdcard_img.sh | 33 --- target/linux/arc770/image/uEnv.txt | 7 - ...c-Disable-frame-filtering-completely.patch | 31 --- 12 files changed, 476 deletions(-) delete mode 100644 target/linux/arc770/Makefile delete mode 100755 target/linux/arc770/base-files/etc/board.d/02_network delete mode 100644 target/linux/arc770/base-files/lib/arc.sh delete mode 100644 target/linux/arc770/base-files/lib/preinit/01_preinit_arc.sh delete mode 100644 target/linux/arc770/config-4.14 delete mode 100644 target/linux/arc770/generic/profiles/00-default.mk delete mode 100644 target/linux/arc770/generic/target.mk delete mode 100644 target/linux/arc770/image/Config.in delete mode 100644 target/linux/arc770/image/Makefile delete mode 100755 target/linux/arc770/image/gen_axs10x_sdcard_img.sh delete mode 100644 target/linux/arc770/image/uEnv.txt delete mode 100644 target/linux/arc770/patches-4.14/700-stmmac-Disable-frame-filtering-completely.patch diff --git a/target/linux/arc770/Makefile b/target/linux/arc770/Makefile deleted file mode 100644 index b5e2d54065..0000000000 --- a/target/linux/arc770/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -# -# Copyright (C) 2015 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# -include $(TOPDIR)/rules.mk - -ARCH:=arc -BOARD:=arc770 -BOARDNAME:=Synopsys DesignWare ARC 770D -MAINTAINER:=Alexey Brodkin -SUBTARGETS:=generic - -KERNEL_PATCHVER:=4.14 - -DEVICE_TYPE:=developerboard - -define Target/Description - Synopsys DesignWare boards -endef - -include $(INCLUDE_DIR)/target.mk - -$(eval $(call BuildTarget)) diff --git a/target/linux/arc770/base-files/etc/board.d/02_network b/target/linux/arc770/base-files/etc/board.d/02_network deleted file mode 100755 index 3f53293700..0000000000 --- a/target/linux/arc770/base-files/etc/board.d/02_network +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2015 OpenWrt.org -# - -. /lib/functions/uci-defaults.sh - -board_config_update - -case "$(board_name)" in -"arc-sdp"*) - ucidef_set_interface_lan "eth0" "dhcp" - ;; -esac - -board_config_flush - -exit 0 diff --git a/target/linux/arc770/base-files/lib/arc.sh b/target/linux/arc770/base-files/lib/arc.sh deleted file mode 100644 index 185aeedb2d..0000000000 --- a/target/linux/arc770/base-files/lib/arc.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2015 OpenWrt.org -# - -# defaults -ARC_BOARD_NAME="generic" -ARC_BOARD_MODEL="Generic ARC board" - -arc_board_detect() { - local board - local model - local compatible - - [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" - - model="$( cat /proc/device-tree/model )" - compatible="$( cat /proc/device-tree/compatible )" - - case "$compatible" in - "snps,axs101""snps,arc-sdp") - board="arc-sdp"; - ;; - "snps,nsim") - board="arc-nsim"; - ;; - esac - - if [ "$board" != "" ]; then - ARC_BOARD_NAME="$board" - fi - - if [ "$model" != "" ]; then - ARC_BOARD_MODEL="$model" - fi - - echo "$ARC_BOARD_NAME" > /tmp/sysinfo/board_name - echo "$ARC_BOARD_MODEL" > /tmp/sysinfo/model - echo "Detected $ARC_BOARD_NAME // $ARC_BOARD_MODEL" -} diff --git a/target/linux/arc770/base-files/lib/preinit/01_preinit_arc.sh b/target/linux/arc770/base-files/lib/preinit/01_preinit_arc.sh deleted file mode 100644 index 192c91bf2d..0000000000 --- a/target/linux/arc770/base-files/lib/preinit/01_preinit_arc.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -do_arc() { - . /lib/arc.sh - - arc_board_detect -} - -boot_hook_add preinit_main do_arc diff --git a/target/linux/arc770/config-4.14 b/target/linux/arc770/config-4.14 deleted file mode 100644 index 525075f1b8..0000000000 --- a/target/linux/arc770/config-4.14 +++ /dev/null @@ -1,200 +0,0 @@ -# CONFIG_16KSTACKS is not set -CONFIG_ARC=y -# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set -# CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set -CONFIG_ARCH_HAS_SG_CHAIN=y -# CONFIG_ARCH_HAS_STRICT_KERNEL_RWX is not set -# CONFIG_ARCH_HAS_STRICT_MODULE_RWX is not set -# CONFIG_ARCH_OPTIONAL_KERNEL_RWX is not set -# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set -CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y -# CONFIG_ARCH_WANTS_THP_SWAP is not set -CONFIG_ARC_BUILTIN_DTB_NAME="" -CONFIG_ARC_CACHE=y -CONFIG_ARC_CACHE_LINE_SHIFT=5 -CONFIG_ARC_CACHE_PAGES=y -# CONFIG_ARC_CACHE_VIPT_ALIASING is not set -# CONFIG_ARC_CANT_LLSC is not set -# CONFIG_ARC_COMPACT_IRQ_LEVELS is not set -# CONFIG_ARC_CPU_750D is not set -CONFIG_ARC_CPU_770=y -CONFIG_ARC_CURR_IN_REG=y -CONFIG_ARC_DBG=y -# CONFIG_ARC_DBG_TLB_PARANOIA is not set -CONFIG_ARC_DW2_UNWIND=y -CONFIG_ARC_EMUL_UNALIGNED=y -# CONFIG_ARC_FPU_SAVE_RESTORE is not set -CONFIG_ARC_HAS_DCACHE=y -# CONFIG_ARC_HAS_DCCM is not set -CONFIG_ARC_HAS_ICACHE=y -# CONFIG_ARC_HAS_ICCM is not set -CONFIG_ARC_HAS_LLSC=y -CONFIG_ARC_HAS_SWAPE=y -CONFIG_ARC_KVADDR_SIZE=256 -# CONFIG_ARC_METAWARE_HLINK is not set -# CONFIG_ARC_MMU_V1 is not set -# CONFIG_ARC_MMU_V2 is not set -CONFIG_ARC_MMU_V3=y -# CONFIG_ARC_PAGE_SIZE_16K is not set -# CONFIG_ARC_PAGE_SIZE_4K is not set -CONFIG_ARC_PAGE_SIZE_8K=y -CONFIG_ARC_PLAT_AXS10X=y -# CONFIG_ARC_PLAT_EZNPS is not set -# CONFIG_ARC_PLAT_TB10X is not set -# CONFIG_ARC_SOC_HSDK is not set -CONFIG_ARC_TIMERS=y -CONFIG_ARC_UBOOT_SUPPORT=y -CONFIG_AXS101=y -CONFIG_CLKDEV_LOOKUP=y -CONFIG_CLONE_BACKWARDS=y -CONFIG_COMMON_CLK=y -# CONFIG_CPU_BIG_ENDIAN is not set -CONFIG_CPU_NO_EFFICIENT_FFS=y -CONFIG_CRC16=y -CONFIG_CRYPTO_CRC32C=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_WORKQUEUE=y -# CONFIG_DMA_NOOP_OPS is not set -# CONFIG_DMA_VIRT_OPS is not set -# CONFIG_DRM_LIB_RANDOM is not set -CONFIG_DTC=y -CONFIG_DWMAC_ANARION=y -# CONFIG_DWMAC_DWC_QOS_ETH is not set -CONFIG_DWMAC_GENERIC=y -CONFIG_DW_APB_ICTL=y -CONFIG_EXPORTFS=y -CONFIG_EXT4_FS=y -# CONFIG_EZNPS_GIC is not set -CONFIG_FIXED_PHY=y -CONFIG_FS_MBCACHE=y -CONFIG_FUTEX_PI=y -CONFIG_GENERIC_ATOMIC64=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CSUM=y -CONFIG_GENERIC_FIND_FIRST_BIT=y -CONFIG_GENERIC_IO=y -CONFIG_GENERIC_IRQ_CHIP=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GPIOLIB=y -CONFIG_GPIO_DWAPB=y -CONFIG_GPIO_GENERIC=y -# CONFIG_GRO_CELLS is not set -CONFIG_HANDLE_DOMAIN_IRQ=y -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set -# CONFIG_HAVE_ARCH_BITREVERSE is not set -CONFIG_HAVE_ARCH_KGDB=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_HAVE_CLK=y -CONFIG_HAVE_CLK_PREPARE=y -CONFIG_HAVE_DEBUG_STACKOVERFLOW=y -CONFIG_HAVE_FUTEX_CMPXCHG=y -CONFIG_HAVE_GENERIC_DMA_COHERENT=y -CONFIG_HAVE_IOREMAP_PROT=y -CONFIG_HAVE_MEMBLOCK=y -CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -CONFIG_HAVE_NET_DSA=y -CONFIG_HAVE_OPROFILE=y -CONFIG_HAVE_PERF_EVENTS=y -CONFIG_HZ_PERIODIC=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_IRQCHIP=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_WORK=y -CONFIG_ISA_ARCOMPACT=y -# CONFIG_ISA_ARCV2 is not set -CONFIG_JBD2=y -CONFIG_KALLSYMS=y -CONFIG_KERNEL_GZIP=y -CONFIG_LIBFDT=y -CONFIG_LINUX_LINK_BASE=0x80000000 -CONFIG_LINUX_RAM_BASE=0x80000000 -CONFIG_MDIO_BUS=y -CONFIG_MDIO_DEVICE=y -CONFIG_MFD_SYSCON=y -CONFIG_MIGHT_HAVE_PCI=y -CONFIG_MMC=y -CONFIG_MMC_BLOCK=y -CONFIG_MMC_DW=y -# CONFIG_MMC_DW_EXYNOS is not set -# CONFIG_MMC_DW_K3 is not set -CONFIG_MMC_DW_PLTFM=y -CONFIG_MMC_SDHCI=y -CONFIG_MMC_SDHCI_PLTFM=y -CONFIG_MODULES_USE_ELF_RELA=y -CONFIG_NATIONAL_PHY=y -CONFIG_NEED_PER_CPU_KM=y -# CONFIG_NET_CADENCE is not set -CONFIG_NET_PTP_CLASSIFY=y -# CONFIG_NET_VENDOR_ARC is not set -# CONFIG_NET_VENDOR_BROADCOM is not set -# CONFIG_NET_VENDOR_INTEL is not set -# CONFIG_NET_VENDOR_MARVELL is not set -# CONFIG_NET_VENDOR_MICREL is not set -# CONFIG_NET_VENDOR_NATSEMI is not set -# CONFIG_NET_VENDOR_QUALCOMM is not set -# CONFIG_NET_VENDOR_ROCKER is not set -# CONFIG_NET_VENDOR_SAMSUNG is not set -# CONFIG_NET_VENDOR_SEEQ is not set -# CONFIG_NET_VENDOR_VIA is not set -# CONFIG_NET_VENDOR_WIZNET is not set -CONFIG_NO_BOOTMEM=y -CONFIG_NO_IOPORT_MAP=y -CONFIG_OF=y -CONFIG_OF_ADDRESS=y -CONFIG_OF_EARLY_FLATTREE=y -CONFIG_OF_FLATTREE=y -CONFIG_OF_GPIO=y -CONFIG_OF_IRQ=y -CONFIG_OF_MDIO=y -CONFIG_OF_NET=y -CONFIG_OF_RESERVED_MEM=y -# CONFIG_PCI_SYSCALL is not set -CONFIG_PERF_USE_VMALLOC=y -CONFIG_PGTABLE_LEVELS=2 -CONFIG_PHYLIB=y -CONFIG_PPS=y -CONFIG_PREEMPT=y -CONFIG_PREEMPT_COUNT=y -# CONFIG_PREEMPT_NONE is not set -CONFIG_PREEMPT_RCU=y -CONFIG_PTP_1588_CLOCK=y -CONFIG_RATIONAL=y -# CONFIG_RCU_BOOST is not set -CONFIG_RCU_NEED_SEGCBLIST=y -CONFIG_RCU_STALL_COMMON=y -CONFIG_REGMAP=y -CONFIG_REGMAP_MMIO=y -CONFIG_RESET_CONTROLLER=y -# CONFIG_SCHED_INFO is not set -# CONFIG_SCSI_DMA is not set -CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y -CONFIG_SERIAL_8250_DW=y -# CONFIG_SERIAL_8250_FSL is not set -CONFIG_SERIAL_8250_NR_UARTS=4 -CONFIG_SERIAL_8250_RUNTIME_UARTS=4 -CONFIG_SERIAL_ARC=y -CONFIG_SERIAL_ARC_CONSOLE=y -CONFIG_SERIAL_ARC_NR_PORTS=1 -CONFIG_SERIAL_OF_PLATFORM=y -CONFIG_SRCU=y -CONFIG_STACKTRACE=y -CONFIG_STMMAC_ETH=y -CONFIG_STMMAC_PLATFORM=y -CONFIG_SWPHY=y -CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW=y -CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN=y -CONFIG_TASKS_RCU=y -CONFIG_THIN_ARCHIVES=y -CONFIG_TICK_CPU_ACCOUNTING=y -CONFIG_TIMER_OF=y -CONFIG_TIMER_PROBE=y -CONFIG_TREE_SRCU=y -CONFIG_UNINLINE_SPIN_UNLOCK=y -CONFIG_USB_SUPPORT=y diff --git a/target/linux/arc770/generic/profiles/00-default.mk b/target/linux/arc770/generic/profiles/00-default.mk deleted file mode 100644 index 798478b616..0000000000 --- a/target/linux/arc770/generic/profiles/00-default.mk +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (C) 2015 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -define Profile/Default - NAME:=Default Profile (all drivers) - PACKAGES:= kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ath9k-htc wpad-basic -endef - -define Profile/Default/Description - Default package set compatible with most boards. -endef -$(eval $(call Profile,Default)) diff --git a/target/linux/arc770/generic/target.mk b/target/linux/arc770/generic/target.mk deleted file mode 100644 index 5a7595d65a..0000000000 --- a/target/linux/arc770/generic/target.mk +++ /dev/null @@ -1,8 +0,0 @@ -BOARDNAME:=Generic -FEATURES += ramdisk usb ext4 - -define Target/Description - Build firmware images for generic ARC 770D based boards. -endef - - diff --git a/target/linux/arc770/image/Config.in b/target/linux/arc770/image/Config.in deleted file mode 100644 index 52f68ba241..0000000000 --- a/target/linux/arc770/image/Config.in +++ /dev/null @@ -1,5 +0,0 @@ -config AXS10X_SD_BOOT_PARTSIZE - int "Boot (SD Card) filesystem partition size (in MB)" - depends on TARGET_arc770 - default 20 - diff --git a/target/linux/arc770/image/Makefile b/target/linux/arc770/image/Makefile deleted file mode 100644 index 260757845e..0000000000 --- a/target/linux/arc770/image/Makefile +++ /dev/null @@ -1,84 +0,0 @@ -# -# Copyright (C) 2016 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/image.mk - -# On ARC initramfs is put before entry point and so entry point moves -# in memory from build to built. Thus we need to extract EP from vmlinux -# every time before generation of uImage. -kernel_ep = `$(KERNEL_CROSS)readelf -h $(1) | grep "Entry point address" | grep -o 0x.*` - -define Build/patch-dtb - $(STAGING_DIR_HOST)/bin/patch-dtb $@ $(DTS_DIR)/$(DEVICE_DTS).dtb -endef - -ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) -# Root FS built-in -define Device/vmlinux - KERNEL_SUFFIX := .elf - KERNEL := kernel-bin | patch-dtb - KERNEL_INITRAMFS_NAME = vmlinux-initramfs.elf -endef - -define Device/nsim - $(call Device/vmlinux) - DEVICE_PROFILE := nsim - DEVICE_DTS := nsim_700 -endef -TARGET_DEVICES += nsim -endif - -# Root FS on SD-card -KERNEL_LOADADDR := 0x80000000 -DEVICE_DTS_LIST:= axs101 nsim_700 -FAT32_BLOCK_SIZE=1024 -FAT32_BLOCKS=$(shell echo $$(($(CONFIG_AXS10X_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE)))) - -define Image/Prepare - # Build .dtb for all boards we may run on - $(foreach dts,$(DEVICE_DTS_LIST), - $(call Image/BuildDTB,$(DTS_DIR)/$(dts).dts,$(DTS_DIR)/$(dts).dtb) - ) -endef - -define Image/Build/SDCard - rm -f $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img - mkfs.fat $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img -C $(FAT32_BLOCKS) - mkimage -C none -A arc -T script -d uEnv.txt $(BIN_DIR)/uEnv.scr - mcopy -i $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img $(BIN_DIR)/uEnv.scr ::boot.scr - mcopy -i $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img $(DTS_DIR)/*.dtb :: - mcopy -i $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img $(BIN_DIR)/$(IMG_PREFIX)-uImage ::uImage - - ./gen_axs10x_sdcard_img.sh \ - $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-sdcard-vfat-$(1).img \ - $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img \ - $(KDIR)/root.$(1) \ - $(CONFIG_AXS10X_SD_BOOT_PARTSIZE) \ - $(CONFIG_TARGET_ROOTFS_PARTSIZE) - -ifneq ($(CONFIG_TARGET_IMAGES_GZIP),) - gzip -f9n $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-sdcard-vfat-$(1).img -endif -endef - -define Image/BuildKernel - # Build unified uImage - $(call Image/BuildKernel/MkuImage, \ - none, $(KERNEL_LOADADDR),$(call kernel_ep,$(KDIR)/vmlinux.elf) , \ - $(KDIR)/vmlinux, \ - $(BIN_DIR)/$(IMG_PREFIX)-uImage \ - ) -endef - -define Image/Build - $(call Image/Build/$(1),$(1)) - $(call Image/Build/SDCard,$(1)) - dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync - $(call Image/Gzip,$(BIN_DIR)/$(IMG_PREFIX)-root.$(1)) -endef - -$(eval $(call BuildImage)) diff --git a/target/linux/arc770/image/gen_axs10x_sdcard_img.sh b/target/linux/arc770/image/gen_axs10x_sdcard_img.sh deleted file mode 100755 index 9a6f93d0d9..0000000000 --- a/target/linux/arc770/image/gen_axs10x_sdcard_img.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -# -# Copyright (C) 2016 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -set -x -[ $# -eq 5 ] || { - echo "SYNTAX: $0 " - exit 1 -} - -OUTPUT="$1" -BOOTFS="$2" -ROOTFS="$3" -BOOTFSSIZE="$4" -ROOTFSSIZE="$5" - -head=4 -sect=63 - -set `ptgen -o $OUTPUT -h $head -s $sect -l 1024 -t c -p ${BOOTFSSIZE}M -t 83 -p ${ROOTFSSIZE}M` - -BOOTOFFSET="$(($1 / 512))" -BOOTSIZE="$(($2 / 512))" -ROOTFSOFFSET="$(($3 / 512))" -ROOTFSSIZE="$(($4 / 512))" - -dd bs=512 if="$BOOTFS" of="$OUTPUT" seek="$BOOTOFFSET" conv=notrunc -dd bs=512 if="$ROOTFS" of="$OUTPUT" seek="$ROOTFSOFFSET" conv=notrunc diff --git a/target/linux/arc770/image/uEnv.txt b/target/linux/arc770/image/uEnv.txt deleted file mode 100644 index 53632e8bb6..0000000000 --- a/target/linux/arc770/image/uEnv.txt +++ /dev/null @@ -1,7 +0,0 @@ -setenv kernel_addr_r 0x82000000 -setenv fdt_addr_r 0x83000000 -setenv loadkernel fatload mmc 0 \${kernel_addr_r} uImage -setenv loaddtb fatload mmc 0 \${fdt_addr_r} \${dts} -setenv bootargs earlycon=uart8250,mmio32,0xe0022000,115200n8 console=ttyS3,115200n8 root=/dev/mmcblk0p2 rootwait print-fatal-signals=1 -setenv uenvcmd run loadkernel\; run loaddtb\; bootm \${kernel_addr_r} - \${fdt_addr_r} -run uenvcmd diff --git a/target/linux/arc770/patches-4.14/700-stmmac-Disable-frame-filtering-completely.patch b/target/linux/arc770/patches-4.14/700-stmmac-Disable-frame-filtering-completely.patch deleted file mode 100644 index e63c2e934b..0000000000 --- a/target/linux/arc770/patches-4.14/700-stmmac-Disable-frame-filtering-completely.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0031b9011cb2b2b1de4dbb4f9620303aec760db4 Mon Sep 17 00:00:00 2001 -From: Alexey Brodkin -Date: Wed, 27 Jul 2016 11:33:14 +0300 -Subject: [PATCH] stmmac: Disable frame filtering completely - -For some [still unknown] reason in ARC SDP boards -DW GMAC doesn't enter promiscuous mode if eth0 gets -added to the br-lan interface before Ethernet PHY finishes -autonegotiation (PHY gets reset on DW GMAC start). - -As a work-around we completely disable frame filtering -in GMAC hardware which gives us working bridge that consists -of eth0 and wlan0 (USB Wi-Fi dongle). I.e. we finally have -working "Dumb AP" setup made of ARC AXS10x boards. - -Signed-off-by: Alexey Brodkin ---- - drivers/net/ethernet/stmicro/stmmac/common.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/net/ethernet/stmicro/stmmac/common.h -+++ b/drivers/net/ethernet/stmicro/stmmac/common.h -@@ -46,7 +46,7 @@ - #define STMMAC_GET_ENTRY(x, size) ((x + 1) & (size - 1)) - - #undef FRAME_FILTER_DEBUG --/* #define FRAME_FILTER_DEBUG */ -+#define FRAME_FILTER_DEBUG - - /* Extra statistic and debug information exposed by ethtool */ - struct stmmac_extra_stats { From 17e4ffc4187c8c38f746cc433bec678dc958aea2 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Tue, 14 Sep 2021 03:14:27 +0800 Subject: [PATCH 10/38] archs38: drop target I've never heard somebody use this target, and it requires uClibc to work, which was removed in the past. Signed-off-by: Tianling Shen --- target/linux/archs38/Makefile | 26 --- .../archs38/base-files/etc/board.d/02_network | 18 -- target/linux/archs38/base-files/lib/arc.sh | 43 ---- .../base-files/lib/preinit/01_preinit_arc.sh | 9 - target/linux/archs38/config-4.14 | 208 ------------------ .../archs38/generic/profiles/00-default.mk | 16 -- target/linux/archs38/generic/target.mk | 8 - target/linux/archs38/image/Config.in | 5 - target/linux/archs38/image/Makefile | 86 -------- .../archs38/image/gen_axs10x_sdcard_img.sh | 33 --- target/linux/archs38/image/uEnv.txt | 7 - target/linux/archs38/image/uboot.env.txt | 29 --- ...c-Disable-frame-filtering-completely.patch | 31 --- 13 files changed, 519 deletions(-) delete mode 100644 target/linux/archs38/Makefile delete mode 100755 target/linux/archs38/base-files/etc/board.d/02_network delete mode 100644 target/linux/archs38/base-files/lib/arc.sh delete mode 100644 target/linux/archs38/base-files/lib/preinit/01_preinit_arc.sh delete mode 100644 target/linux/archs38/config-4.14 delete mode 100644 target/linux/archs38/generic/profiles/00-default.mk delete mode 100644 target/linux/archs38/generic/target.mk delete mode 100644 target/linux/archs38/image/Config.in delete mode 100644 target/linux/archs38/image/Makefile delete mode 100755 target/linux/archs38/image/gen_axs10x_sdcard_img.sh delete mode 100644 target/linux/archs38/image/uEnv.txt delete mode 100644 target/linux/archs38/image/uboot.env.txt delete mode 100644 target/linux/archs38/patches-4.14/700-stmmac-Disable-frame-filtering-completely.patch diff --git a/target/linux/archs38/Makefile b/target/linux/archs38/Makefile deleted file mode 100644 index be6be0472b..0000000000 --- a/target/linux/archs38/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -# -# Copyright (C) 2016 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# -include $(TOPDIR)/rules.mk - -ARCH:=arc -CPU_TYPE:=archs -BOARD:=archs38 -BOARDNAME:=Synopsys DesignWare ARC HS38 -MAINTAINER:=Alexey Brodkin -SUBTARGETS:=generic - -KERNEL_PATCHVER:=4.14 - -DEVICE_TYPE:=developerboard - -define Target/Description - Synopsys DesignWare boards -endef - -include $(INCLUDE_DIR)/target.mk - -$(eval $(call BuildTarget)) diff --git a/target/linux/archs38/base-files/etc/board.d/02_network b/target/linux/archs38/base-files/etc/board.d/02_network deleted file mode 100755 index 60a2602316..0000000000 --- a/target/linux/archs38/base-files/etc/board.d/02_network +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2016 OpenWrt.org -# - -. /lib/functions/uci-defaults.sh - -board_config_update - -case "$(board_name)" in -"arc-sdp"*|"arc-hsdk"*) - ucidef_set_interface_lan "eth0" "dhcp" - ;; -esac - -board_config_flush - -exit 0 diff --git a/target/linux/archs38/base-files/lib/arc.sh b/target/linux/archs38/base-files/lib/arc.sh deleted file mode 100644 index 50aaaa2d27..0000000000 --- a/target/linux/archs38/base-files/lib/arc.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2016 OpenWrt.org -# - -# defaults -ARC_BOARD_NAME="generic" -ARC_BOARD_MODEL="Generic ARC board" - -arc_board_detect() { - local board - local model - local compatible - - [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" - - model="$( cat /proc/device-tree/model )" - compatible="$( cat /proc/device-tree/compatible )" - - case "$compatible" in - "snps,axs103""snps,arc-sdp") - board="arc-sdp"; - ;; - "snps,hsdk") - board="arc-hsdk"; - ;; - "snps,nsim_hs") - board="arc-nsim"; - ;; - esac - - if [ "$board" != "" ]; then - ARC_BOARD_NAME="$board" - fi - - if [ "$model" != "" ]; then - ARC_BOARD_MODEL="$model" - fi - - echo "$ARC_BOARD_NAME" > /tmp/sysinfo/board_name - echo "$ARC_BOARD_MODEL" > /tmp/sysinfo/model - echo "Detected $ARC_BOARD_NAME // $ARC_BOARD_MODEL" -} diff --git a/target/linux/archs38/base-files/lib/preinit/01_preinit_arc.sh b/target/linux/archs38/base-files/lib/preinit/01_preinit_arc.sh deleted file mode 100644 index 192c91bf2d..0000000000 --- a/target/linux/archs38/base-files/lib/preinit/01_preinit_arc.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -do_arc() { - . /lib/arc.sh - - arc_board_detect -} - -boot_hook_add preinit_main do_arc diff --git a/target/linux/archs38/config-4.14 b/target/linux/archs38/config-4.14 deleted file mode 100644 index 21983479b0..0000000000 --- a/target/linux/archs38/config-4.14 +++ /dev/null @@ -1,208 +0,0 @@ -# CONFIG_16KSTACKS is not set -CONFIG_ARC=y -# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set -# CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set -CONFIG_ARCH_HAS_SG_CHAIN=y -# CONFIG_ARCH_HAS_STRICT_KERNEL_RWX is not set -# CONFIG_ARCH_HAS_STRICT_MODULE_RWX is not set -# CONFIG_ARCH_OPTIONAL_KERNEL_RWX is not set -# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set -CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y -CONFIG_ARC_BUILTIN_DTB_NAME="" -CONFIG_ARC_CACHE=y -CONFIG_ARC_CACHE_LINE_SHIFT=6 -CONFIG_ARC_CACHE_PAGES=y -# CONFIG_ARC_CANT_LLSC is not set -CONFIG_ARC_CPU_HS=y -CONFIG_ARC_CURR_IN_REG=y -CONFIG_ARC_DBG=y -# CONFIG_ARC_DBG_TLB_PARANOIA is not set -CONFIG_ARC_DW2_UNWIND=y -# CONFIG_ARC_HAS_ACCL_REGS is not set -CONFIG_ARC_HAS_DCACHE=y -# CONFIG_ARC_HAS_DCCM is not set -CONFIG_ARC_HAS_DIV_REM=y -CONFIG_ARC_HAS_ICACHE=y -# CONFIG_ARC_HAS_ICCM is not set -CONFIG_ARC_HAS_LL64=y -CONFIG_ARC_HAS_LLSC=y -# CONFIG_ARC_HAS_PAE40 is not set -CONFIG_ARC_HAS_SWAPE=y -CONFIG_ARC_KVADDR_SIZE=256 -CONFIG_ARC_MCIP=y -# CONFIG_ARC_METAWARE_HLINK is not set -CONFIG_ARC_MMU_V4=y -# CONFIG_ARC_PAGE_SIZE_16K is not set -# CONFIG_ARC_PAGE_SIZE_4K is not set -CONFIG_ARC_PAGE_SIZE_8K=y -CONFIG_ARC_PLAT_AXS10X=y -# CONFIG_ARC_PLAT_EZNPS is not set -# CONFIG_ARC_PLAT_TB10X is not set -# CONFIG_ARC_SMP_HALT_ON_RESET is not set -CONFIG_ARC_SOC_HSDK=y -CONFIG_ARC_TIMERS=y -CONFIG_ARC_TIMERS_64BIT=y -CONFIG_ARC_UBOOT_SUPPORT=y -CONFIG_AXS103=y -CONFIG_CLKDEV_LOOKUP=y -CONFIG_CLK_HSDK=y -CONFIG_CLONE_BACKWARDS=y -CONFIG_COMMON_CLK=y -# CONFIG_CPU_BIG_ENDIAN is not set -CONFIG_CPU_RMAP=y -CONFIG_CRC16=y -CONFIG_CRYPTO_AEAD=y -CONFIG_CRYPTO_AEAD2=y -CONFIG_CRYPTO_CRC32C=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_MANAGER2=y -CONFIG_CRYPTO_NULL2=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_WORKQUEUE=y -CONFIG_DTC=y -CONFIG_DWMAC_ANARION=y -# CONFIG_DWMAC_DWC_QOS_ETH is not set -CONFIG_DWMAC_GENERIC=y -CONFIG_DW_APB_ICTL=y -CONFIG_EXT4_FS=y -# CONFIG_EZNPS_GIC is not set -CONFIG_FIXED_PHY=y -CONFIG_FS_MBCACHE=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CSUM=y -CONFIG_GENERIC_FIND_FIRST_BIT=y -CONFIG_GENERIC_IO=y -CONFIG_GENERIC_IRQ_CHIP=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_PENDING_IRQ=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GPIOLIB=y -CONFIG_GPIO_DWAPB=y -CONFIG_GPIO_GENERIC=y -# CONFIG_GRO_CELLS is not set -CONFIG_HANDLE_DOMAIN_IRQ=y -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set -# CONFIG_HAVE_ARCH_BITREVERSE is not set -CONFIG_HAVE_ARCH_KGDB=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y -# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_HAVE_CLK=y -CONFIG_HAVE_CLK_PREPARE=y -CONFIG_HAVE_DEBUG_STACKOVERFLOW=y -CONFIG_HAVE_FUTEX_CMPXCHG=y -CONFIG_HAVE_GENERIC_DMA_COHERENT=y -CONFIG_HAVE_IOREMAP_PROT=y -CONFIG_HAVE_MEMBLOCK=y -CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -CONFIG_HAVE_NET_DSA=y -CONFIG_HAVE_OPROFILE=y -CONFIG_HAVE_PERF_EVENTS=y -CONFIG_HZ_PERIODIC=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_IRQCHIP=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_WORK=y -# CONFIG_ISA_ARCOMPACT is not set -CONFIG_ISA_ARCV2=y -CONFIG_JBD2=y -CONFIG_KALLSYMS=y -CONFIG_KERNEL_GZIP=y -CONFIG_LIBFDT=y -CONFIG_LINUX_LINK_BASE=0x90000000 -CONFIG_LINUX_RAM_BASE=0x80000000 -CONFIG_LOCK_SPIN_ON_OWNER=y -CONFIG_MDIO_BUS=y -CONFIG_MDIO_DEVICE=y -CONFIG_MFD_SYSCON=y -CONFIG_MIGHT_HAVE_PCI=y -CONFIG_MMC=y -CONFIG_MMC_BLOCK=y -CONFIG_MMC_DW=y -# CONFIG_MMC_DW_EXYNOS is not set -# CONFIG_MMC_DW_K3 is not set -CONFIG_MMC_DW_PLTFM=y -CONFIG_MMC_SDHCI=y -CONFIG_MMC_SDHCI_PLTFM=y -CONFIG_MODULES_USE_ELF_RELA=y -CONFIG_MUTEX_SPIN_ON_OWNER=y -CONFIG_NATIONAL_PHY=y -# CONFIG_NET_CADENCE is not set -CONFIG_NET_FLOW_LIMIT=y -CONFIG_NET_PTP_CLASSIFY=y -# CONFIG_NET_VENDOR_ARC is not set -# CONFIG_NET_VENDOR_BROADCOM is not set -# CONFIG_NET_VENDOR_INTEL is not set -# CONFIG_NET_VENDOR_MARVELL is not set -# CONFIG_NET_VENDOR_MICREL is not set -# CONFIG_NET_VENDOR_NATSEMI is not set -# CONFIG_NET_VENDOR_QUALCOMM is not set -# CONFIG_NET_VENDOR_ROCKER is not set -# CONFIG_NET_VENDOR_SAMSUNG is not set -# CONFIG_NET_VENDOR_SEEQ is not set -# CONFIG_NET_VENDOR_VIA is not set -# CONFIG_NET_VENDOR_WIZNET is not set -CONFIG_NLS=y -CONFIG_NO_BOOTMEM=y -CONFIG_NO_IOPORT_MAP=y -CONFIG_NR_CPUS=4 -CONFIG_OF=y -CONFIG_OF_ADDRESS=y -CONFIG_OF_EARLY_FLATTREE=y -CONFIG_OF_FLATTREE=y -CONFIG_OF_GPIO=y -CONFIG_OF_IRQ=y -CONFIG_OF_MDIO=y -CONFIG_OF_NET=y -CONFIG_OF_RESERVED_MEM=y -CONFIG_PADATA=y -# CONFIG_PCI_SYSCALL is not set -CONFIG_PERF_USE_VMALLOC=y -CONFIG_PGTABLE_LEVELS=2 -CONFIG_PHYLIB=y -CONFIG_PPS=y -CONFIG_PREEMPT=y -CONFIG_PREEMPT_COUNT=y -# CONFIG_PREEMPT_NONE is not set -CONFIG_PREEMPT_RCU=y -CONFIG_PTP_1588_CLOCK=y -CONFIG_RATIONAL=y -# CONFIG_RCU_BOOST is not set -CONFIG_RCU_NEED_SEGCBLIST=y -CONFIG_RCU_STALL_COMMON=y -CONFIG_REGMAP=y -CONFIG_REGMAP_MMIO=y -CONFIG_RESET_CONTROLLER=y -CONFIG_RESET_HSDK=y -CONFIG_RFS_ACCEL=y -CONFIG_RPS=y -# CONFIG_SCHED_INFO is not set -# CONFIG_SCSI_DMA is not set -CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y -CONFIG_SERIAL_8250_DW=y -# CONFIG_SERIAL_8250_FSL is not set -CONFIG_SERIAL_8250_NR_UARTS=4 -CONFIG_SERIAL_8250_RUNTIME_UARTS=4 -CONFIG_SERIAL_ARC=y -CONFIG_SERIAL_ARC_CONSOLE=y -CONFIG_SERIAL_ARC_NR_PORTS=1 -CONFIG_SERIAL_OF_PLATFORM=y -CONFIG_SMP=y -CONFIG_SRCU=y -CONFIG_STACKTRACE=y -CONFIG_STMMAC_ETH=y -CONFIG_STMMAC_PLATFORM=y -CONFIG_SWPHY=y -CONFIG_TASKS_RCU=y -CONFIG_TICK_CPU_ACCOUNTING=y -CONFIG_TIMER_OF=y -CONFIG_TIMER_PROBE=y -CONFIG_TREE_SRCU=y -CONFIG_UNINLINE_SPIN_UNLOCK=y -CONFIG_USB_SUPPORT=y -CONFIG_XPS=y diff --git a/target/linux/archs38/generic/profiles/00-default.mk b/target/linux/archs38/generic/profiles/00-default.mk deleted file mode 100644 index 747967df94..0000000000 --- a/target/linux/archs38/generic/profiles/00-default.mk +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (C) 2016 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -define Profile/Default - NAME:=Default Profile (all drivers) - PACKAGES:= kmod-usb-core kmod-usb2 kmod-ath9k-htc wpad-basic -endef - -define Profile/Default/Description - Default package set compatible with most boards. -endef -$(eval $(call Profile,Default)) diff --git a/target/linux/archs38/generic/target.mk b/target/linux/archs38/generic/target.mk deleted file mode 100644 index 7642c6b261..0000000000 --- a/target/linux/archs38/generic/target.mk +++ /dev/null @@ -1,8 +0,0 @@ -BOARDNAME:=Generic -FEATURES += ext4 usb ramdisk - -define Target/Description - Build firmware images for ARC HS38 based boards. -endef - - diff --git a/target/linux/archs38/image/Config.in b/target/linux/archs38/image/Config.in deleted file mode 100644 index e51db8338b..0000000000 --- a/target/linux/archs38/image/Config.in +++ /dev/null @@ -1,5 +0,0 @@ -config AXS10X_SD_BOOT_PARTSIZE - int "Boot (SD Card) filesystem partition size (in MB)" - depends on TARGET_archs38 - default 20 - diff --git a/target/linux/archs38/image/Makefile b/target/linux/archs38/image/Makefile deleted file mode 100644 index 1e0d3e99fd..0000000000 --- a/target/linux/archs38/image/Makefile +++ /dev/null @@ -1,86 +0,0 @@ -# -# Copyright (C) 2016 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/image.mk - -# On ARC initramfs is put before entry point and so entry point moves -# in memory from build to built. Thus we need to extract EP from vmlinux -# every time before generation of uImage. -kernel_ep = `$(KERNEL_CROSS)readelf -h $(1) | grep "Entry point address" | grep -o 0x.*` - -define Build/patch-dtb - $(STAGING_DIR_HOST)/bin/patch-dtb $@ $(DTS_DIR)/$(DEVICE_DTS).dtb -endef - -ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) -# Root FS built-in -define Device/vmlinux - KERNEL_SUFFIX := .elf - KERNEL := kernel-bin | patch-dtb - KERNEL_INITRAMFS_NAME = vmlinux-initramfs.elf -endef - -define Device/nsim_hs - $(call Device/vmlinux) - DEVICE_PROFILE := nsim_hs - DEVICE_DTS := nsim_hs_idu -endef -TARGET_DEVICES += nsim_hs -endif - -# Root FS on SD-card -KERNEL_LOADADDR := 0x90000000 -DEVICE_DTS_LIST:= axs103_idu nsim_hs_idu hsdk -FAT32_BLOCK_SIZE=1024 -FAT32_BLOCKS=$(shell echo $$(($(CONFIG_AXS10X_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE)))) - -define Image/Prepare - # Build .dtb for all boards we may run on - $(foreach dts,$(DEVICE_DTS_LIST), - $(call Image/BuildDTB,$(DTS_DIR)/$(dts).dts,$(DTS_DIR)/$(dts).dtb) - ) -endef - -define Image/Build/SDCard - rm -f $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img - mkfs.fat $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img -C $(FAT32_BLOCKS) - mkimage -C none -A arc -T script -d uEnv.txt $(BIN_DIR)/uEnv.scr - mkenvimage -s 0x4000 -o $(BIN_DIR)/uboot.env ./uboot.env.txt - mcopy -i $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img $(BIN_DIR)/uEnv.scr ::boot.scr - mcopy -i $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img $(DTS_DIR)/*.dtb :: - mcopy -i $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img $(BIN_DIR)/$(IMG_PREFIX)-uImage ::uImage - mcopy -i $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img $(BIN_DIR)/uboot.env ::uboot.env - - ./gen_axs10x_sdcard_img.sh \ - $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-sdcard-vfat-$(1).img \ - $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img \ - $(KDIR)/root.$(1) \ - $(CONFIG_AXS10X_SD_BOOT_PARTSIZE) \ - $(CONFIG_TARGET_ROOTFS_PARTSIZE) - -ifneq ($(CONFIG_TARGET_IMAGES_GZIP),) - gzip -f9n $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-sdcard-vfat-$(1).img -endif -endef - -define Image/BuildKernel - # Build unified uImage - $(call Image/BuildKernel/MkuImage, \ - none, $(KERNEL_LOADADDR),$(call kernel_ep,$(KDIR)/vmlinux.elf) , \ - $(KDIR)/vmlinux, \ - $(BIN_DIR)/$(IMG_PREFIX)-uImage \ - ) -endef - -define Image/Build - $(call Image/Build/$(1),$(1)) - $(call Image/Build/SDCard,$(1)) - dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync - $(call Image/Gzip,$(BIN_DIR)/$(IMG_PREFIX)-root.$(1)) -endef - -$(eval $(call BuildImage)) diff --git a/target/linux/archs38/image/gen_axs10x_sdcard_img.sh b/target/linux/archs38/image/gen_axs10x_sdcard_img.sh deleted file mode 100755 index 9a6f93d0d9..0000000000 --- a/target/linux/archs38/image/gen_axs10x_sdcard_img.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -# -# Copyright (C) 2016 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -set -x -[ $# -eq 5 ] || { - echo "SYNTAX: $0 " - exit 1 -} - -OUTPUT="$1" -BOOTFS="$2" -ROOTFS="$3" -BOOTFSSIZE="$4" -ROOTFSSIZE="$5" - -head=4 -sect=63 - -set `ptgen -o $OUTPUT -h $head -s $sect -l 1024 -t c -p ${BOOTFSSIZE}M -t 83 -p ${ROOTFSSIZE}M` - -BOOTOFFSET="$(($1 / 512))" -BOOTSIZE="$(($2 / 512))" -ROOTFSOFFSET="$(($3 / 512))" -ROOTFSSIZE="$(($4 / 512))" - -dd bs=512 if="$BOOTFS" of="$OUTPUT" seek="$BOOTOFFSET" conv=notrunc -dd bs=512 if="$ROOTFS" of="$OUTPUT" seek="$ROOTFSOFFSET" conv=notrunc diff --git a/target/linux/archs38/image/uEnv.txt b/target/linux/archs38/image/uEnv.txt deleted file mode 100644 index 53632e8bb6..0000000000 --- a/target/linux/archs38/image/uEnv.txt +++ /dev/null @@ -1,7 +0,0 @@ -setenv kernel_addr_r 0x82000000 -setenv fdt_addr_r 0x83000000 -setenv loadkernel fatload mmc 0 \${kernel_addr_r} uImage -setenv loaddtb fatload mmc 0 \${fdt_addr_r} \${dts} -setenv bootargs earlycon=uart8250,mmio32,0xe0022000,115200n8 console=ttyS3,115200n8 root=/dev/mmcblk0p2 rootwait print-fatal-signals=1 -setenv uenvcmd run loadkernel\; run loaddtb\; bootm \${kernel_addr_r} - \${fdt_addr_r} -run uenvcmd diff --git a/target/linux/archs38/image/uboot.env.txt b/target/linux/archs38/image/uboot.env.txt deleted file mode 100644 index 9ae7bd0c62..0000000000 --- a/target/linux/archs38/image/uboot.env.txt +++ /dev/null @@ -1,29 +0,0 @@ -baudrate=115200 -bootargs=console=ttyS0,115200n8 root=/dev/mmcblk0p2 rootwait -bootcmd=fatload mmc 0:1 0x82000000 uImage && fatload mmc 0:1 0x81000000 hsdk.dtb && bootm 0x82000000 - 0x81000000 -bootdelay=2 -bootfile=uImage -loadaddr=0x82000000 -stderr=serial0@f0005000 -stdin=serial0@f0005000 -stdout=serial0@f0005000 -core_dccm_0=0x10 -core_dccm_1=0x6 -core_dccm_2=0x10 -core_dccm_3=0x6 -core_iccm_0=0x10 -core_iccm_1=0x6 -core_iccm_2=0x10 -core_iccm_3=0x6 -core_mask=0xF -dcache_ena=0x1 -icache_ena=0x1 -non_volatile_limit=0xE -hsdk_hs34=setenv core_mask 0x2; setenv icache_ena 0x0; setenv dcache_ena 0x0; setenv core_iccm_1 0x7; setenv core_dccm_1 0x8; setenv non_volatile_limit 0x0; -hsdk_hs36=setenv core_mask 0x1; setenv icache_ena 0x1; setenv dcache_ena 0x1; setenv core_iccm_0 0x10; setenv core_dccm_0 0x10; setenv non_volatile_limit 0xE; -hsdk_hs36_ccm=setenv core_mask 0x2; setenv icache_ena 0x1; setenv dcache_ena 0x1; setenv core_iccm_1 0x7; setenv core_dccm_1 0x8; setenv non_volatile_limit 0xE; -hsdk_hs38=setenv core_mask 0x1; setenv icache_ena 0x1; setenv dcache_ena 0x1; setenv core_iccm_0 0x10; setenv core_dccm_0 0x10; setenv non_volatile_limit 0xE; -hsdk_hs38_ccm=setenv core_mask 0x2; setenv icache_ena 0x1; setenv dcache_ena 0x1; setenv core_iccm_1 0x7; setenv core_dccm_1 0x8; setenv non_volatile_limit 0xE; -hsdk_hs38x2=setenv core_mask 0x3; setenv icache_ena 0x1; setenv dcache_ena 0x1; setenv core_iccm_0 0x10; setenv core_dccm_0 0x10; setenv non_volatile_limit 0xE; setenv core_iccm_1 0x6; setenv core_dccm_1 0x6; -hsdk_hs38x3=setenv core_mask 0x7; setenv icache_ena 0x1; setenv dcache_ena 0x1; setenv core_iccm_0 0x10; setenv core_dccm_0 0x10; setenv non_volatile_limit 0xE; setenv core_iccm_1 0x6; setenv core_dccm_1 0x6; setenv core_iccm_2 0x10; setenv core_dccm_2 0x10; -hsdk_hs38x4=setenv core_mask 0xF; setenv icache_ena 0x1; setenv dcache_ena 0x1; setenv core_iccm_0 0x10; setenv core_dccm_0 0x10; setenv non_volatile_limit 0xE; setenv core_iccm_1 0x6; setenv core_dccm_1 0x6; setenv core_iccm_2 0x10; setenv core_dccm_2 0x10; setenv core_iccm_3 0x6; setenv core_dccm_3 0x6; diff --git a/target/linux/archs38/patches-4.14/700-stmmac-Disable-frame-filtering-completely.patch b/target/linux/archs38/patches-4.14/700-stmmac-Disable-frame-filtering-completely.patch deleted file mode 100644 index e63c2e934b..0000000000 --- a/target/linux/archs38/patches-4.14/700-stmmac-Disable-frame-filtering-completely.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0031b9011cb2b2b1de4dbb4f9620303aec760db4 Mon Sep 17 00:00:00 2001 -From: Alexey Brodkin -Date: Wed, 27 Jul 2016 11:33:14 +0300 -Subject: [PATCH] stmmac: Disable frame filtering completely - -For some [still unknown] reason in ARC SDP boards -DW GMAC doesn't enter promiscuous mode if eth0 gets -added to the br-lan interface before Ethernet PHY finishes -autonegotiation (PHY gets reset on DW GMAC start). - -As a work-around we completely disable frame filtering -in GMAC hardware which gives us working bridge that consists -of eth0 and wlan0 (USB Wi-Fi dongle). I.e. we finally have -working "Dumb AP" setup made of ARC AXS10x boards. - -Signed-off-by: Alexey Brodkin ---- - drivers/net/ethernet/stmicro/stmmac/common.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/net/ethernet/stmicro/stmmac/common.h -+++ b/drivers/net/ethernet/stmicro/stmmac/common.h -@@ -46,7 +46,7 @@ - #define STMMAC_GET_ENTRY(x, size) ((x + 1) & (size - 1)) - - #undef FRAME_FILTER_DEBUG --/* #define FRAME_FILTER_DEBUG */ -+#define FRAME_FILTER_DEBUG - - /* Extra statistic and debug information exposed by ethtool */ - struct stmmac_extra_stats { From 8d9ab9fe0d6d6dbc4382d5907eb2aa1bbb6290cb Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Tue, 14 Sep 2021 03:26:28 +0800 Subject: [PATCH 11/38] ar71xx: hardcode VERSION_DIST for mkdapimg2 Signed-off-by: Tianling Shen --- target/linux/ar71xx/image/generic.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk index 881c83260f..7c431a9c9e 100644 --- a/target/linux/ar71xx/image/generic.mk +++ b/target/linux/ar71xx/image/generic.mk @@ -28,7 +28,7 @@ define Build/mkdapimg2 $(STAGING_DIR_HOST)/bin/mkdapimg2 \ -i $@ -o $@.new \ -s $(DAP_SIGNATURE) \ - -v $(VERSION_DIST)-$(firstword $(subst +, ,$(firstword $(subst -, ,$(REVISION))))) \ + -v EMORTAL-$(firstword $(subst +, ,$(firstword $(subst -, ,$(REVISION))))) \ -r Default \ $(if $(1),-k $(1)) mv $@.new $@ From 9aeff4524079eb0215626685e53f8f9d5e8c8e07 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Tue, 14 Sep 2021 03:32:22 +0800 Subject: [PATCH 12/38] uboot-zynq: fix build by adding comparabilities for old dtc The patch is taken from commit 367ee3274d00fe7224e04ae73fb5d876ec45f58a. Signed-off-by: Tianling Shen --- .../patches/221-compatible-old-dtc.patch | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 package/boot/uboot-zynq/patches/221-compatible-old-dtc.patch diff --git a/package/boot/uboot-zynq/patches/221-compatible-old-dtc.patch b/package/boot/uboot-zynq/patches/221-compatible-old-dtc.patch new file mode 100644 index 0000000000..c1c78f9e96 --- /dev/null +++ b/package/boot/uboot-zynq/patches/221-compatible-old-dtc.patch @@ -0,0 +1,56 @@ +Revert the commit c0e032e0090d65 ("scripts/dtc: Update to upstream +version v1.4.3") +OpenWrt uses the dtc from the kernel also in u-boot, but when we compile +against kernel 4.9 we run into some errors because it is too old now. +Add the options only when they are supported to make it compatible with +dtc from kernel 4.9. + +--- a/scripts/Kbuild.include ++++ b/scripts/Kbuild.include +@@ -173,6 +173,11 @@ ld-version = $(shell $(LD) --version | $ + # Usage: $(call ld-ifversion, -ge, 22252, y) + ld-ifversion = $(shell [ $(ld-version) $(1) $(2) ] && echo $(3) || echo $(4)) + ++# dtc-option ++# Usage: DTC_FLAGS += $(call dtc-option,-Wno-unit_address_vs_reg) ++dtc-option = $(call try-run,\ ++ echo '/dts-v1/; / {};' | $(DTC) $(1),$(1),$(2)) ++ + ###### + + ### +--- a/scripts/Makefile.extrawarn ++++ b/scripts/Makefile.extrawarn +@@ -56,8 +56,8 @@ endif + + KBUILD_CFLAGS += $(warning) + +-dtc-warning-2 += -Wnode_name_chars_strict +-dtc-warning-2 += -Wproperty_name_chars_strict ++dtc-warning-2 += $(call dtc-option,-Wnode_name_chars_strict) ++dtc-warning-2 += $(call dtc-option,-Wproperty_name_chars_strict) + + dtc-warning := $(dtc-warning-$(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) + dtc-warning += $(dtc-warning-$(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) +@@ -68,13 +68,13 @@ DTC_FLAGS += $(dtc-warning) + else + + # Disable noisy checks by default +-DTC_FLAGS += -Wno-unit_address_vs_reg +-DTC_FLAGS += -Wno-simple_bus_reg +-DTC_FLAGS += -Wno-unit_address_format +-DTC_FLAGS += -Wno-pci_bridge +-DTC_FLAGS += -Wno-pci_device_bus_num +-DTC_FLAGS += -Wno-pci_device_reg +-DTC_FLAGS += -Wno-avoid_unnecessary_addr_size +-DTC_FLAGS += -Wno-alias_paths ++DTC_FLAGS += $(call dtc-option,-Wno-unit_address_vs_reg) ++DTC_FLAGS += $(call dtc-option,-Wno-simple_bus_reg) ++DTC_FLAGS += $(call dtc-option,-Wno-unit_address_format) ++DTC_FLAGS += $(call dtc-option,-Wno-pci_bridge) ++DTC_FLAGS += $(call dtc-option,-Wno-pci_device_bus_num) ++DTC_FLAGS += $(call dtc-option,-Wno-pci_device_reg) ++DTC_FLAGS += $(call dtc-option,-Wno-avoid_unnecessary_addr_size) ++DTC_FLAGS += $(call dtc-option,-Wno-alias_paths) + + endif From 6882bcb4879552fc3ec2b440ba864e9b72d139cf Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Tue, 14 Sep 2021 03:34:47 +0800 Subject: [PATCH 13/38] uboot-omap: fix build by adding comparabilities for old dtc The patch is taken from commit 367ee3274d00fe7224e04ae73fb5d876ec45f58a. Signed-off-by: Tianling Shen --- .../patches/221-compatible-old-dtc.patch | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 package/boot/uboot-omap/patches/221-compatible-old-dtc.patch diff --git a/package/boot/uboot-omap/patches/221-compatible-old-dtc.patch b/package/boot/uboot-omap/patches/221-compatible-old-dtc.patch new file mode 100644 index 0000000000..c1c78f9e96 --- /dev/null +++ b/package/boot/uboot-omap/patches/221-compatible-old-dtc.patch @@ -0,0 +1,56 @@ +Revert the commit c0e032e0090d65 ("scripts/dtc: Update to upstream +version v1.4.3") +OpenWrt uses the dtc from the kernel also in u-boot, but when we compile +against kernel 4.9 we run into some errors because it is too old now. +Add the options only when they are supported to make it compatible with +dtc from kernel 4.9. + +--- a/scripts/Kbuild.include ++++ b/scripts/Kbuild.include +@@ -173,6 +173,11 @@ ld-version = $(shell $(LD) --version | $ + # Usage: $(call ld-ifversion, -ge, 22252, y) + ld-ifversion = $(shell [ $(ld-version) $(1) $(2) ] && echo $(3) || echo $(4)) + ++# dtc-option ++# Usage: DTC_FLAGS += $(call dtc-option,-Wno-unit_address_vs_reg) ++dtc-option = $(call try-run,\ ++ echo '/dts-v1/; / {};' | $(DTC) $(1),$(1),$(2)) ++ + ###### + + ### +--- a/scripts/Makefile.extrawarn ++++ b/scripts/Makefile.extrawarn +@@ -56,8 +56,8 @@ endif + + KBUILD_CFLAGS += $(warning) + +-dtc-warning-2 += -Wnode_name_chars_strict +-dtc-warning-2 += -Wproperty_name_chars_strict ++dtc-warning-2 += $(call dtc-option,-Wnode_name_chars_strict) ++dtc-warning-2 += $(call dtc-option,-Wproperty_name_chars_strict) + + dtc-warning := $(dtc-warning-$(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) + dtc-warning += $(dtc-warning-$(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) +@@ -68,13 +68,13 @@ DTC_FLAGS += $(dtc-warning) + else + + # Disable noisy checks by default +-DTC_FLAGS += -Wno-unit_address_vs_reg +-DTC_FLAGS += -Wno-simple_bus_reg +-DTC_FLAGS += -Wno-unit_address_format +-DTC_FLAGS += -Wno-pci_bridge +-DTC_FLAGS += -Wno-pci_device_bus_num +-DTC_FLAGS += -Wno-pci_device_reg +-DTC_FLAGS += -Wno-avoid_unnecessary_addr_size +-DTC_FLAGS += -Wno-alias_paths ++DTC_FLAGS += $(call dtc-option,-Wno-unit_address_vs_reg) ++DTC_FLAGS += $(call dtc-option,-Wno-simple_bus_reg) ++DTC_FLAGS += $(call dtc-option,-Wno-unit_address_format) ++DTC_FLAGS += $(call dtc-option,-Wno-pci_bridge) ++DTC_FLAGS += $(call dtc-option,-Wno-pci_device_bus_num) ++DTC_FLAGS += $(call dtc-option,-Wno-pci_device_reg) ++DTC_FLAGS += $(call dtc-option,-Wno-avoid_unnecessary_addr_size) ++DTC_FLAGS += $(call dtc-option,-Wno-alias_paths) + + endif From 98e8ea7c840685d8b72264907838169d576b3d62 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Sat, 11 Sep 2021 08:33:30 +0200 Subject: [PATCH 14/38] ipq40xx: Select correct board-2.bin for EnGenius EMD1 The board data file for the EnGenius EMD1 is not part of the default board-2.bin which is shipped by ath10k-board-qca4019. As result, the wrong calibration information will be loaded into the wifi chip. Fixes: 51f303597839 ("ipq40xx: add support for EnGenius EMD1") Signed-off-by: Sven Eckelmann --- target/linux/ipq40xx/image/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile index a1cad6f842..51750100c7 100644 --- a/target/linux/ipq40xx/image/Makefile +++ b/target/linux/ipq40xx/image/Makefile @@ -426,6 +426,7 @@ define Device/engenius_emd1 IMAGES += factory.bin IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size + DEVICE_PACKAGES := ipq-wifi-engenius_emd1 endef TARGET_DEVICES += engenius_emd1 From 3211091e6209344ac29535d8af5640f09831acfa Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Sat, 11 Sep 2021 08:33:30 +0200 Subject: [PATCH 15/38] ipq40xx: Select correct board-2.bin for EnGenius EMR3500 The board data file for the EnGenius EMR3500 is not part of the default board-2.bin which is shipped by ath10k-board-qca4019. As result, the wrong calibration information will be loaded into the wifi chip. Fixes: 3f61e5e1b97e ("ipq40xx: add support for EnGenius EMR3500") Signed-off-by: Sven Eckelmann --- target/linux/ipq40xx/image/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile index 51750100c7..910d197114 100644 --- a/target/linux/ipq40xx/image/Makefile +++ b/target/linux/ipq40xx/image/Makefile @@ -441,6 +441,7 @@ define Device/engenius_emr3500 IMAGES += factory.bin IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size + DEVICE_PACKAGES := ipq-wifi-engenius_emr3500 endef TARGET_DEVICES += engenius_emr3500 From 5d1c2547eff8ae2f49b51ada4a5a79f4e70b3901 Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Thu, 9 Sep 2021 05:42:33 +0000 Subject: [PATCH 16/38] dnsmasq: Update to version 2.86 Summary of upstream CHANGELOG: * Handle DHCPREBIND requests in the DHCPv6 server code. * Fix bug which caused dnsmasq to lose track of processes forked. * Major rewrite of the DNS server and domain handling code. * Revise resource handling for number of concurrent DNS queries. * Improve efficiency of DNSSEC. * Connection track mark based DNS query filtering. * Allow smaller than 64 prefix lengths in synth-domain. * Make domains generated by --synth-domain appear in replies when in authoritative mode. * Ensure CAP_NET_ADMIN capability is available when conntrack is configured. * When --dhcp-hostsfile --dhcp-optsfile and --addn-hosts are given a directory as argument, define the order in which files within that directory are read. * Support some wildcard matching of input tags to --tag-if. Signed-off-by: Etan Kissling --- package/network/services/dnsmasq/Makefile | 4 ++-- .../patches/100-remove-old-runtime-kernel-support.patch | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index b1d41fe86a..f3bc7f2654 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq -PKG_VERSION:=2.85 +PKG_VERSION:=2.86 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq -PKG_HASH:=ad98d3803df687e5b938080f3d25c628fe41c878752d03fbc6199787fee312fa +PKG_HASH:=28d52cfc9e2004ac4f85274f52b32e1647b4dbc9761b82e7de1e41c49907eb08 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING diff --git a/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch b/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch index b601bce1a9..4f8fe4ecbe 100644 --- a/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch +++ b/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch @@ -26,7 +26,7 @@ Signed-off-by: Kevin Darbyshire-Bryant --- a/src/dnsmasq.h +++ b/src/dnsmasq.h -@@ -1144,7 +1144,7 @@ extern struct daemon { +@@ -1201,7 +1201,7 @@ extern struct daemon { int inotifyfd; #endif #if defined(HAVE_LINUX_NETWORK) @@ -35,7 +35,7 @@ Signed-off-by: Kevin Darbyshire-Bryant #elif defined(HAVE_BSD_NETWORK) int dhcp_raw_fd, dhcp_icmp_fd, routefd; #endif -@@ -1326,9 +1326,6 @@ int read_write(int fd, unsigned char *pa +@@ -1388,9 +1388,6 @@ int read_write(int fd, unsigned char *pa void close_fds(long max_fd, int spare1, int spare2, int spare3); int wildcard_match(const char* wildcard, const char* match); int wildcard_matchn(const char* wildcard, const char* match, int num); @@ -140,7 +140,7 @@ Signed-off-by: Kevin Darbyshire-Bryant my_syslog(LOG_ERR, _("failed to update ipset %s: %s"), setname, strerror(errno)); --- a/src/util.c +++ b/src/util.c -@@ -786,22 +786,3 @@ int wildcard_matchn(const char* wildcard +@@ -796,22 +796,3 @@ int wildcard_matchn(const char* wildcard return (!num) || (*wildcard == *match); } From f72ec2ce6514969b5cea7567af513c007b3c673c Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Thu, 9 Sep 2021 05:43:31 +0000 Subject: [PATCH 17/38] dnsmasq: add config option for connmark DNS filtering This adds uci support to configure connmark based DNS filtering. Signed-off-by: Etan Kissling (imported from upstream mailing list https://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2021q2/015151.html) Signed-off-by: Etan Kissling --- package/network/services/dnsmasq/files/dnsmasq.init | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index d178072e61..8b6cf00a5d 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -173,6 +173,10 @@ append_ipset() { xappend "--ipset=$1" } +append_connmark_allowlist() { + xappend "--connmark-allowlist=$1" +} + append_interface() { network_get_device ifname "$1" || ifname="$1" xappend "--interface=$ifname" @@ -942,6 +946,14 @@ dnsmasq_start() config_list_foreach "$cfg" "rev_server" append_rev_server config_list_foreach "$cfg" "address" append_address config_list_foreach "$cfg" "ipset" append_ipset + + local connmark_allowlist_enable + config_get connmark_allowlist_enable "$cfg" connmark_allowlist_enable 0 + [ "$connmark_allowlist_enable" -gt 0 ] && { + append_parm "$cfg" "connmark_allowlist_enable" "--connmark-allowlist-enable" + config_list_foreach "$cfg" "connmark_allowlist" append_connmark_allowlist + } + [ -n "$BOOT" ] || { config_list_foreach "$cfg" "interface" append_interface config_list_foreach "$cfg" "notinterface" append_notinterface From 32d4a71c3c90ebe63871297a648533ed5e720c84 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Sat, 4 Sep 2021 12:09:15 +0800 Subject: [PATCH 18/38] dnsmasq/2.86: refresh patches --- .../dnsmasq/patches/910-mini-ttl.patch | 94 +++++++++---------- .../patches/911-dnsmasq-filter-aaaa.patch | 38 ++++---- 2 files changed, 66 insertions(+), 66 deletions(-) diff --git a/package/network/services/dnsmasq/patches/910-mini-ttl.patch b/package/network/services/dnsmasq/patches/910-mini-ttl.patch index 88e7bbe383..ac7d17ad06 100644 --- a/package/network/services/dnsmasq/patches/910-mini-ttl.patch +++ b/package/network/services/dnsmasq/patches/910-mini-ttl.patch @@ -1,25 +1,25 @@ --- a/src/dnsmasq.h +++ b/src/dnsmasq.h -@@ -1059,7 +1059,7 @@ extern struct daemon { +@@ -1116,7 +1116,7 @@ extern struct daemon { int max_logs; /* queue limit */ int cachesize, ftabsize; int port, query_port, min_port, max_port; - unsigned long local_ttl, neg_ttl, max_ttl, min_cache_ttl, max_cache_ttl, auth_ttl, dhcp_ttl, use_dhcp_ttl; + unsigned long local_ttl, neg_ttl, min_ttl, max_ttl, min_cache_ttl, max_cache_ttl, auth_ttl, dhcp_ttl, use_dhcp_ttl; char *dns_client_id; - struct hostsfile *addn_hosts; - struct dhcp_context *dhcp, *dhcp6; + u32 umbrella_org; + u32 umbrella_asset; --- a/src/option.c +++ b/src/option.c -@@ -170,6 +170,7 @@ struct myoption { - #define LOPT_PXE_VENDOR 361 - #define LOPT_DYNHOST 362 - #define LOPT_LOG_DEBUG 363 -+#define LOPT_MINTTL 364 +@@ -174,6 +174,7 @@ struct myoption { + #define LOPT_CMARK_ALST_EN 365 + #define LOPT_CMARK_ALST 366 + #define LOPT_QUIET_TFTP 367 ++#define LOPT_MINTTL 368 #ifdef HAVE_GETOPT_LONG static const struct option opts[] = -@@ -288,6 +289,7 @@ static const struct myoption opts[] = +@@ -292,6 +293,7 @@ static const struct myoption opts[] = { "dhcp-name-match", 1, 0, LOPT_NAME_MATCH }, { "dhcp-broadcast", 2, 0, LOPT_BROADCAST }, { "neg-ttl", 1, 0, LOPT_NEGTTL }, @@ -27,7 +27,7 @@ { "max-ttl", 1, 0, LOPT_MAXTTL }, { "min-cache-ttl", 1, 0, LOPT_MINCTTL }, { "max-cache-ttl", 1, 0, LOPT_MAXCTTL }, -@@ -417,6 +419,7 @@ static struct { +@@ -425,6 +427,7 @@ static struct { { 't', ARG_ONE, "", gettext_noop("Specify default target in an MX record."), NULL }, { 'T', ARG_ONE, "", gettext_noop("Specify time-to-live in seconds for replies from /etc/hosts."), NULL }, { LOPT_NEGTTL, ARG_ONE, "", gettext_noop("Specify time-to-live in seconds for negative caching."), NULL }, @@ -35,7 +35,7 @@ { LOPT_MAXTTL, ARG_ONE, "", gettext_noop("Specify time-to-live in seconds for maximum TTL to send to clients."), NULL }, { LOPT_MAXCTTL, ARG_ONE, "", gettext_noop("Specify time-to-live ceiling for cache."), NULL }, { LOPT_MINCTTL, ARG_ONE, "", gettext_noop("Specify time-to-live floor for cache."), NULL }, -@@ -2835,6 +2838,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma +@@ -3047,6 +3050,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma case 'T': /* --local-ttl */ case LOPT_NEGTTL: /* --neg-ttl */ @@ -43,7 +43,7 @@ case LOPT_MAXTTL: /* --max-ttl */ case LOPT_MINCTTL: /* --min-cache-ttl */ case LOPT_MAXCTTL: /* --max-cache-ttl */ -@@ -2846,6 +2850,8 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma +@@ -3058,6 +3062,8 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma ret_err(gen_err); else if (option == LOPT_NEGTTL) daemon->neg_ttl = (unsigned long)ttl; @@ -54,49 +54,49 @@ else if (option == LOPT_MINCTTL) --- a/src/rfc1035.c +++ b/src/rfc1035.c -@@ -606,6 +606,7 @@ int extract_addresses(struct dns_header *header, size_t qlen, char *name, time_t - for (j = 0; j < ntohs(header->ancount); j++) - { - int secflag = 0; -+ unsigned long mttl = 0; - unsigned char *tmp = namep; - /* the loop body overwrites the original name, so get it back here. */ - if (!extract_name(header, qlen, &tmp, name, 1, 0) || -@@ -616,6 +617,14 @@ int extract_addresses(struct dns_header *header, size_t qlen, char *name, time_t - GETSHORT(aqclass, p1); - GETLONG(attl, p1); - if ((daemon->max_ttl != 0) && (attl > daemon->max_ttl) && !is_sign) -+ { -+ mttl = daemon->max_ttl; -+ } -+ if ((daemon->min_ttl != 0) && (attl < daemon->min_ttl) && !is_sign) -+ { -+ mttl = daemon->min_ttl; -+ } -+ if (mttl != 0) - { - (p1) -= 4; - PUTLONG(daemon->max_ttl, p1); -@@ -704,6 +713,7 @@ int extract_addresses(struct dns_header *header, size_t qlen, char *name, time_t +@@ -607,6 +607,7 @@ int extract_addresses(struct dns_header *header, size_t qlen, char *name, time_t for (j = 0; j < ntohs(header->ancount); j++) { int secflag = 0; + unsigned long mttl = 0; - if (!(res = extract_name(header, qlen, &p1, name, 0, 10))) return 0; /* bad packet */ -@@ -712,6 +722,14 @@ int extract_addresses(struct dns_header *header, size_t qlen, char *name, time_t - GETSHORT(aqclass, p1); + +@@ -615,6 +616,14 @@ int extract_addresses(struct dns_header *header, size_t qlen, char *name, time_t GETLONG(attl, p1); + if ((daemon->max_ttl != 0) && (attl > daemon->max_ttl) && !is_sign) -+ { -+ mttl = daemon->max_ttl; -+ } -+ if ((daemon->min_ttl != 0) && (attl < daemon->min_ttl) && !is_sign) -+ { -+ mttl = daemon->min_ttl; -+ } -+ if (mttl != 0) ++ { ++ mttl = daemon->max_ttl; ++ } ++ if ((daemon->min_ttl != 0) && (attl < daemon->min_ttl) && !is_sign) ++ { ++ mttl = daemon->min_ttl; ++ } ++ if (mttl != 0) { (p1) -= 4; PUTLONG(daemon->max_ttl, p1); +@@ -722,6 +731,7 @@ int extract_addresses(struct dns_header *header, size_t qlen, char *name, time_t + for (j = 0; j < ntohs(header->ancount); j++) + { + int secflag = 0; ++ unsigned long mttl = 0; + + if (!(res = extract_name(header, qlen, &p1, name, 0, 10))) + return 0; /* bad packet */ +@@ -730,6 +740,14 @@ int extract_addresses(struct dns_header *header, size_t qlen, char *name, time_t + GETSHORT(aqclass, p1); + GETLONG(attl, p1); + if ((daemon->max_ttl != 0) && (attl > daemon->max_ttl) && !is_sign) ++ { ++ mttl = daemon->max_ttl; ++ } ++ if ((daemon->min_ttl != 0) && (attl < daemon->min_ttl) && !is_sign) ++ { ++ mttl = daemon->min_ttl; ++ } ++ if (mttl != 0) + { + (p1) -= 4; + PUTLONG(daemon->max_ttl, p1); diff --git a/package/network/services/dnsmasq/patches/911-dnsmasq-filter-aaaa.patch b/package/network/services/dnsmasq/patches/911-dnsmasq-filter-aaaa.patch index 42f69957bb..82ba913d9f 100644 --- a/package/network/services/dnsmasq/patches/911-dnsmasq-filter-aaaa.patch +++ b/package/network/services/dnsmasq/patches/911-dnsmasq-filter-aaaa.patch @@ -11,45 +11,45 @@ Subject: [PATCH] add filter-aaaa option --- a/src/dnsmasq.h +++ b/src/dnsmasq.h -@@ -270,7 +270,8 @@ struct event_desc { - #define OPT_SINGLE_PORT 60 - #define OPT_LEASE_RENEW 61 - #define OPT_LOG_DEBUG 62 --#define OPT_LAST 63 -+#define OPT_FILTER_AAAA 63 -+#define OPT_LAST 64 +@@ -275,7 +275,8 @@ struct event_desc { + #define OPT_UMBRELLA_DEVID 64 + #define OPT_CMARK_ALST_EN 65 + #define OPT_QUIET_TFTP 66 +-#define OPT_LAST 67 ++#define OPT_FILTER_AAAA 67 ++#define OPT_LAST 68 #define OPTION_BITS (sizeof(unsigned int)*8) #define OPTION_SIZE ( (OPT_LAST/OPTION_BITS)+((OPT_LAST%OPTION_BITS)!=0) ) --- a/src/option.c +++ b/src/option.c -@@ -171,6 +171,7 @@ struct myoption { - #define LOPT_DYNHOST 362 - #define LOPT_LOG_DEBUG 363 - #define LOPT_MINTTL 364 -+#define LOPT_FILTER_AAAA 365 +@@ -175,6 +175,7 @@ struct myoption { + #define LOPT_CMARK_ALST 366 + #define LOPT_QUIET_TFTP 367 + #define LOPT_MINTTL 368 ++#define LOPT_FILTER_AAAA 369 #ifdef HAVE_GETOPT_LONG static const struct option opts[] = -@@ -347,6 +348,7 @@ static const struct myoption opts[] = - { "dhcp-ignore-clid", 0, 0, LOPT_IGNORE_CLID }, - { "dynamic-host", 1, 0, LOPT_DYNHOST }, +@@ -355,6 +356,7 @@ static const struct myoption opts[] = { "log-debug", 0, 0, LOPT_LOG_DEBUG }, + { "umbrella", 2, 0, LOPT_UMBRELLA }, + { "quiet-tftp", 0, 0, LOPT_QUIET_TFTP }, + { "filter-aaaa", 0, 0, LOPT_FILTER_AAAA }, { NULL, 0, 0, 0 } }; -@@ -530,6 +532,7 @@ static struct { - { LOPT_DUMPFILE, ARG_ONE, "", gettext_noop("Path to debug packet dump file"), NULL }, - { LOPT_DUMPMASK, ARG_ONE, "", gettext_noop("Mask which packets to dump"), NULL }, +@@ -542,6 +544,7 @@ static struct { { LOPT_SCRIPT_TIME, OPT_LEASE_RENEW, NULL, gettext_noop("Call dhcp-script when lease expiry changes."), NULL }, + { LOPT_UMBRELLA, ARG_ONE, "[=]", gettext_noop("Send Cisco Umbrella identifiers including remote IP."), NULL }, + { LOPT_QUIET_TFTP, OPT_QUIET_TFTP, NULL, gettext_noop("Do not log routine TFTP."), NULL }, + { LOPT_FILTER_AAAA, OPT_FILTER_AAAA, NULL, gettext_noop("Filter all AAAA requests."), NULL }, { 0, 0, NULL, NULL, NULL } }; --- a/src/rfc1035.c +++ b/src/rfc1035.c -@@ -1913,6 +1913,16 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen, +@@ -2005,6 +2005,16 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen, } } From 7984a95946077359d702c4779bdecd6c00ee0c80 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Mon, 22 Feb 2021 15:55:43 +0100 Subject: [PATCH 19/38] treewide: rename IMAGE_PREFIX/IMAGE_NAME to DEVICE_IMG_* We so far had two variables IMG_PREFIX and IMAGE_PREFIX with different content. Since these names are obviously quite confusing, this patch renames the latter to DEVICE_IMG_PREFIX, as it's a device-dependent variable, while IMG_PREFIX is only (sub)target-dependent. For consistency, also rename IMAGE_NAME to DEVICE_IMG_NAME, as that's a device-dependent variable as well. Cc: Paul Spooren Signed-off-by: Adrian Schmutzler (cherry picked from commit ef2cb8572b48f1e1964b4d1d014d16cb721b5175) --- include/image.mk | 42 +++++++++++++------------- scripts/json_add_image_info.py | 6 ++-- target/linux/ath25/image/Makefile | 2 +- target/linux/bcm53xx/image/Makefile | 2 +- target/linux/brcm47xx/image/Makefile | 2 +- target/linux/brcm63xx/image/bcm63xx.mk | 2 +- target/linux/imx6/image/Makefile | 8 ++--- target/linux/ipq40xx/image/Makefile | 2 +- target/linux/ipq806x/image/Makefile | 2 +- target/linux/mvebu/image/Makefile | 4 +-- target/linux/mvebu/image/cortex-a53.mk | 2 +- target/linux/mvebu/image/cortex-a9.mk | 8 ++--- target/linux/zynq/image/Makefile | 2 +- 13 files changed, 42 insertions(+), 42 deletions(-) diff --git a/include/image.mk b/include/image.mk index af020f9d56..697652430d 100644 --- a/include/image.mk +++ b/include/image.mk @@ -400,14 +400,14 @@ define Device/Init IMAGES := ARTIFACTS := - IMAGE_PREFIX := $(IMG_PREFIX)-$(1) - IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1)-$$(2) + DEVICE_IMG_PREFIX := $(IMG_PREFIX)-$(1) + DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1)-$$(2) IMAGE_SIZE := - KERNEL_PREFIX = $$(IMAGE_PREFIX) + KERNEL_PREFIX = $$(DEVICE_IMG_PREFIX) KERNEL_SUFFIX := -kernel.bin KERNEL_INITRAMFS_SUFFIX = $$(KERNEL_SUFFIX) KERNEL_IMAGE = $$(KERNEL_PREFIX)$$(KERNEL_SUFFIX) - KERNEL_INITRAMFS_PREFIX = $$(IMAGE_PREFIX)-initramfs + KERNEL_INITRAMFS_PREFIX = $$(DEVICE_IMG_PREFIX)-initramfs KERNEL_INITRAMFS_IMAGE = $$(KERNEL_INITRAMFS_PREFIX)$$(KERNEL_INITRAMFS_SUFFIX) KERNEL_INITRAMFS_NAME = $$(KERNEL_NAME)-initramfs KERNEL_INSTALL := @@ -520,10 +520,10 @@ define Device/Build/initramfs DEVICE_ID="$(1)" \ BIN_DIR="$(BIN_DIR)" \ SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) \ - IMAGE_NAME="$$(notdir $$^)" \ + DEVICE_IMG_NAME="$$(notdir $$^)" \ IMAGE_TYPE="kernel" \ IMAGE_FILESYSTEM="initramfs" \ - IMAGE_PREFIX="$$(IMAGE_PREFIX)" \ + DEVICE_IMG_PREFIX="$$(DEVICE_IMG_PREFIX)" \ DEVICE_VENDOR="$$(DEVICE_VENDOR)" \ DEVICE_MODEL="$$(DEVICE_MODEL)" \ DEVICE_VARIANT="$$(DEVICE_VARIANT)" \ @@ -595,9 +595,9 @@ endef define Device/Build/image GZ_SUFFIX := $(if $(filter %dtb %gz,$(2)),,$(if $(and $(findstring ext4,$(1)),$(CONFIG_TARGET_IMAGES_GZIP)),.gz)) $$(_TARGET): $(if $(CONFIG_JSON_OVERVIEW_IMAGE_INFO), \ - $(BUILD_DIR)/json_info_files/$(call IMAGE_NAME,$(1),$(2)).json, \ - $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2))$$(GZ_SUFFIX)) - $(eval $(call Device/Export,$(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2)),$(1))) + $(BUILD_DIR)/json_info_files/$(call DEVICE_IMG_NAME,$(1),$(2)).json, \ + $(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2))$$(GZ_SUFFIX)) + $(eval $(call Device/Export,$(KDIR)/tmp/$(call DEVICE_IMG_NAME,$(1),$(2)),$(1))) ROOTFS/$(1)/$(3) := \ $(KDIR)/root.$(1)$$(strip \ @@ -608,28 +608,28 @@ define Device/Build/image ifndef IB $$(ROOTFS/$(1)/$(3)): $(if $(TARGET_PER_DEVICE_ROOTFS),target-dir-$$(ROOTFS_ID/$(3))) endif - $(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2)): $$(KDIR_KERNEL_IMAGE) $$(ROOTFS/$(1)/$(3)) + $(KDIR)/tmp/$(call DEVICE_IMG_NAME,$(1),$(2)): $$(KDIR_KERNEL_IMAGE) $$(ROOTFS/$(1)/$(3)) @rm -f $$@ [ -f $$(word 1,$$^) -a -f $$(word 2,$$^) ] $$(call concat_cmd,$(if $(IMAGE/$(2)/$(1)),$(IMAGE/$(2)/$(1)),$(IMAGE/$(2)))) - .IGNORE: $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2)) + .IGNORE: $(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2)) - $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2)).gz: $(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2)) + $(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2)).gz: $(KDIR)/tmp/$(call DEVICE_IMG_NAME,$(1),$(2)) gzip -c -9n $$^ > $$@ - $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2)): $(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2)) + $(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2)): $(KDIR)/tmp/$(call DEVICE_IMG_NAME,$(1),$(2)) cp $$^ $$@ - $(BUILD_DIR)/json_info_files/$(call IMAGE_NAME,$(1),$(2)).json: $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2))$$(GZ_SUFFIX) + $(BUILD_DIR)/json_info_files/$(call DEVICE_IMG_NAME,$(1),$(2)).json: $(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2))$$(GZ_SUFFIX) @mkdir -p $$(shell dirname $$@) DEVICE_ID="$(DEVICE_NAME)" \ BIN_DIR="$(BIN_DIR)" \ SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) \ - IMAGE_NAME="$(IMAGE_NAME)" \ + DEVICE_IMG_NAME="$(DEVICE_IMG_NAME)" \ IMAGE_TYPE=$(word 1,$(subst ., ,$(2))) \ IMAGE_FILESYSTEM="$(1)" \ - IMAGE_PREFIX="$(IMAGE_PREFIX)" \ + DEVICE_IMG_PREFIX="$(DEVICE_IMG_PREFIX)" \ DEVICE_VENDOR="$(DEVICE_VENDOR)" \ DEVICE_MODEL="$(DEVICE_MODEL)" \ DEVICE_VARIANT="$(DEVICE_VARIANT)" \ @@ -654,15 +654,15 @@ define Device/Build/image endef define Device/Build/artifact - $$(_TARGET): $(BIN_DIR)/$(IMAGE_PREFIX)-$(1) - $(eval $(call Device/Export,$(KDIR)/tmp/$(IMAGE_PREFIX)-$(1))) - $(KDIR)/tmp/$(IMAGE_PREFIX)-$(1): $$(KDIR_KERNEL_IMAGE) + $$(_TARGET): $(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1) + $(eval $(call Device/Export,$(KDIR)/tmp/$(DEVICE_IMG_PREFIX)-$(1))) + $(KDIR)/tmp/$(DEVICE_IMG_PREFIX)-$(1): $$(KDIR_KERNEL_IMAGE) @rm -f $$@ $$(call concat_cmd,$(ARTIFACT/$(1))) - .IGNORE: $(BIN_DIR)/$(IMAGE_PREFIX)-$(1) + .IGNORE: $(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1) - $(BIN_DIR)/$(IMAGE_PREFIX)-$(1): $(KDIR)/tmp/$(IMAGE_PREFIX)-$(1) + $(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1): $(KDIR)/tmp/$(DEVICE_IMG_PREFIX)-$(1) cp $$^ $$@ endef diff --git a/scripts/json_add_image_info.py b/scripts/json_add_image_info.py index d394cf4d1f..38cd3c487d 100755 --- a/scripts/json_add_image_info.py +++ b/scripts/json_add_image_info.py @@ -12,7 +12,7 @@ if len(argv) != 2: json_path = Path(argv[1]) bin_dir = Path(getenv("BIN_DIR")) -image_file = bin_dir / getenv("IMAGE_NAME") +image_file = bin_dir / getenv("DEVICE_IMG_NAME") if not image_file.is_file(): print("Skip JSON creation for non existing image ", image_file) @@ -47,12 +47,12 @@ image_info = { "source_date_epoch": getenv("SOURCE_DATE_EPOCH"), "profiles": { device_id: { - "image_prefix": getenv("IMAGE_PREFIX"), + "image_prefix": getenv("DEVICE_IMG_PREFIX"), "images": [ { "type": getenv("IMAGE_TYPE"), "filesystem": getenv("IMAGE_FILESYSTEM"), - "name": getenv("IMAGE_NAME"), + "name": getenv("DEVICE_IMG_NAME"), "sha256": image_hash, } ], diff --git a/target/linux/ath25/image/Makefile b/target/linux/ath25/image/Makefile index 5a20bdb644..8fd3b554e1 100644 --- a/target/linux/ath25/image/Makefile +++ b/target/linux/ath25/image/Makefile @@ -68,7 +68,7 @@ define Device/generic IMAGE/kernel.lzma := elf-kernel | lzma-kernel IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | combined-image - IMAGE_NAME = $$(IMAGE_PREFIX)-$$(if $$(findstring kernel,$$(2)),,$$(1)-)$$(2) + DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(if $$(findstring kernel,$$(2)),,$$(1)-)$$(2) endef TARGET_DEVICES += generic diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile index e9a6bd2a77..bf146a0966 100644 --- a/target/linux/bcm53xx/image/Makefile +++ b/target/linux/bcm53xx/image/Makefile @@ -122,7 +122,7 @@ define Device/Default KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma-d16 | trx FILESYSTEMS := squashfs KERNEL_NAME := zImage - IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1).$$(2) + DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1).$$(2) IMAGES := trx BLOCKSIZE := 128k PAGESIZE := 2048 diff --git a/target/linux/brcm47xx/image/Makefile b/target/linux/brcm47xx/image/Makefile index 47f031b8b4..162cc5ca34 100644 --- a/target/linux/brcm47xx/image/Makefile +++ b/target/linux/brcm47xx/image/Makefile @@ -139,7 +139,7 @@ DEVICE_VARS += BIN_TAIL define Device/Default KERNEL := kernel-bin - IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1).$$(2) + DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1).$$(2) KERNEL_NAME = vmlinux.lzma KERNEL_INITRAMFS_NAME = vmlinux-initramfs.lzma FILESYSTEMS := $(FS_64K) diff --git a/target/linux/brcm63xx/image/bcm63xx.mk b/target/linux/brcm63xx/image/bcm63xx.mk index 2c8ac3e169..693d8c7f8a 100644 --- a/target/linux/brcm63xx/image/bcm63xx.mk +++ b/target/linux/brcm63xx/image/bcm63xx.mk @@ -50,7 +50,7 @@ define Device/bcm63xx_redboot KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-lzma elf IMAGES := redboot.bin IMAGE/redboot.bin := redboot-bin - REDBOOT_PREFIX := $$(IMAGE_PREFIX) + REDBOOT_PREFIX := $$(DEVICE_IMG_PREFIX) endef DEVICE_VARS += REDBOOT_PREFIX diff --git a/target/linux/imx6/image/Makefile b/target/linux/imx6/image/Makefile index 85d6823021..868930b42d 100644 --- a/target/linux/imx6/image/Makefile +++ b/target/linux/imx6/image/Makefile @@ -125,7 +125,7 @@ define Device/Default KERNEL_INSTALL := 1 KERNEL_SUFFIX := -uImage KERNEL_NAME := zImage - KERNEL_PREFIX := $$(IMAGE_PREFIX) + KERNEL_PREFIX := $$(DEVICE_IMG_PREFIX) KERNEL := kernel-bin | uImage none IMAGES := endef @@ -157,12 +157,12 @@ define Device/ventana kobs-ng KERNEL += | boot-overlay IMAGES := nand.ubi bootfs.tar.gz - IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1).$$(2) + DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1).$$(2) UBINIZE_PARTS = boot=$$(KDIR_KERNEL_IMAGE).boot.ubifs=15 BOOT_SCRIPT := bootscript-ventana IMAGE/nand.ubi := append-ubi IMAGE/bootfs.tar.gz := bootfs.tar.gz | install-dtb - IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1)-$$(2) + DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1)-$$(2) PAGESIZE := 2048 BLOCKSIZE := 128k MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB @@ -215,7 +215,7 @@ define Device/apalis UBOOT := apalis_imx6 FILESYSTEMS := squashfs IMAGES := combined.bin sysupgrade.bin - IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1).$$(2) + DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1).$$(2) IMAGE/combined.bin := append-rootfs | pad-extra 128k | apalis-emmc IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata ARTIFACTS := recovery.scr diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile index 910d197114..8eb68880db 100644 --- a/target/linux/ipq40xx/image/Makefile +++ b/target/linux/ipq40xx/image/Makefile @@ -9,7 +9,7 @@ define Device/Default PROFILES := Default KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts) KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs - KERNEL_PREFIX := $$(IMAGE_PREFIX) + KERNEL_PREFIX := $$(DEVICE_IMG_PREFIX) KERNEL_LOADADDR := 0x80208000 IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index 4943627c48..7f76a5f332 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -14,7 +14,7 @@ define Device/Default PROFILES := Default KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts) KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs - KERNEL_PREFIX := $$(IMAGE_PREFIX) + KERNEL_PREFIX := $$(DEVICE_IMG_PREFIX) KERNEL_LOADADDR = 0x42208000 IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata IMAGE/sysupgrade.bin/squashfs := diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile index cd2c58f562..20a0a220d0 100644 --- a/target/linux/mvebu/image/Makefile +++ b/target/linux/mvebu/image/Makefile @@ -70,11 +70,11 @@ endef define Build/uDPU-firmware (rm -fR $@-fw; mkdir -p $@-fw) - $(CP) $(BIN_DIR)/$(IMAGE_PREFIX)-initramfs.itb $@-fw/recovery.itb + $(CP) $(BIN_DIR)/$(DEVICE_IMG_PREFIX)-initramfs.itb $@-fw/recovery.itb $(CP) $@-boot.scr $@-fw/boot.scr (cd $(TARGET_DIR); $(TAR) -cvzf $@-fw/rootfs.tgz .) (cd $@.boot; $(TAR) -cvzf $@-fw/boot.tgz .) - (cd $@-fw; $(TAR) -cvzf $(KDIR_TMP)/$(IMAGE_PREFIX)-firmware.tgz .) + (cd $@-fw; $(TAR) -cvzf $(KDIR_TMP)/$(DEVICE_IMG_PREFIX)-firmware.tgz .) endef define Device/Default diff --git a/target/linux/mvebu/image/cortex-a53.mk b/target/linux/mvebu/image/cortex-a53.mk index e0b2b5e186..fe879931b1 100644 --- a/target/linux/mvebu/image/cortex-a53.mk +++ b/target/linux/mvebu/image/cortex-a53.mk @@ -45,7 +45,7 @@ define Device/methode_udpu DEVICE_PACKAGES := f2fs-tools e2fsprogs fdisk ethtool kmod-usb2 kmod-usb3 \ kmod-e100 kmod-e1000 kmod-e1000e kmod-igb kmod-ixgbevf \ kmod-mdio-gpio kmod-switch-mvsw61xx kmod-i2c-pxa - IMAGE_NAME = $$(IMAGE_PREFIX)-$$(2) + DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(2) IMAGES := firmware.tgz IMAGE/firmware.tgz := boot-scr | boot-img-ext4 | uDPU-firmware | append-metadata BOOT_SCRIPT := udpu diff --git a/target/linux/mvebu/image/cortex-a9.mk b/target/linux/mvebu/image/cortex-a9.mk index 17d950d595..2107c55f02 100644 --- a/target/linux/mvebu/image/cortex-a9.mk +++ b/target/linux/mvebu/image/cortex-a9.mk @@ -174,10 +174,10 @@ define Device/cznic_turris-omnia mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \ wpad-basic kmod-ath9k kmod-ath10k-ct ath10k-firmware-qca988x-ct \ partx-utils kmod-i2c-core kmod-i2c-mux kmod-i2c-mux-pca954x - IMAGES := $$(IMAGE_PREFIX)-sysupgrade.img.gz omnia-medkit-$$(IMAGE_PREFIX)-initramfs.tar.gz - IMAGE/$$(IMAGE_PREFIX)-sysupgrade.img.gz := boot-img | sdcard-img | gzip | append-metadata - IMAGE/omnia-medkit-$$(IMAGE_PREFIX)-initramfs.tar.gz := omnia-medkit-initramfs | gzip - IMAGE_NAME = $$(2) + IMAGES := $$(DEVICE_IMG_PREFIX)-sysupgrade.img.gz omnia-medkit-$$(DEVICE_IMG_PREFIX)-initramfs.tar.gz + IMAGE/$$(DEVICE_IMG_PREFIX)-sysupgrade.img.gz := boot-img | sdcard-img | gzip | append-metadata + IMAGE/omnia-medkit-$$(DEVICE_IMG_PREFIX)-initramfs.tar.gz := omnia-medkit-initramfs | gzip + DEVICE_IMG_NAME = $$(2) DEVICE_DTS := armada-385-turris-omnia SUPPORTED_DEVICES += armada-385-turris-omnia endef diff --git a/target/linux/zynq/image/Makefile b/target/linux/zynq/image/Makefile index aac9953b45..b296055658 100644 --- a/target/linux/zynq/image/Makefile +++ b/target/linux/zynq/image/Makefile @@ -33,7 +33,7 @@ define Device/Default PROFILES := Default KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts) KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs - KERNEL_PREFIX := $$(IMAGE_PREFIX) + KERNEL_PREFIX := $$(DEVICE_IMG_PREFIX) KERNEL_LOADADDR := 0x8000 IMAGES := sdcard.img.gz IMAGE/sdcard.img.gz := zynq-sdcard | gzip From e9cb0a77534f4cd05549d6545d15579ca50728b2 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Sun, 12 Sep 2021 23:44:04 -1000 Subject: [PATCH 20/38] build: store artifacts in JSON Multiple profiles create artifacts, these should be stored in the JSON file as well, allowing downstream tooling to show those files, too. Artifacts don't have specific filesystems so only the fields `name`, `type` and `sha256` are available. Rename env variable names from IMAGE_ to FILE_ prefixes to reflect that images, kernels and artifacts are added with the same command. Signed-off-by: Paul Spooren (cherry picked from commit 5ef4608c02ef6db9698c8d10011b9c14a8ca073b) --- include/image.mk | 45 ++++++++++++++++++++++++++++------ scripts/json_add_image_info.py | 24 ++++++++++-------- 2 files changed, 52 insertions(+), 17 deletions(-) diff --git a/include/image.mk b/include/image.mk index 697652430d..c9143b1931 100644 --- a/include/image.mk +++ b/include/image.mk @@ -520,9 +520,9 @@ define Device/Build/initramfs DEVICE_ID="$(1)" \ BIN_DIR="$(BIN_DIR)" \ SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) \ - DEVICE_IMG_NAME="$$(notdir $$^)" \ - IMAGE_TYPE="kernel" \ - IMAGE_FILESYSTEM="initramfs" \ + FILE_NAME="$$(notdir $$^)" \ + FILE_TYPE="kernel" \ + FILE_FILESYSTEM="initramfs" \ DEVICE_IMG_PREFIX="$$(DEVICE_IMG_PREFIX)" \ DEVICE_VENDOR="$$(DEVICE_VENDOR)" \ DEVICE_MODEL="$$(DEVICE_MODEL)" \ @@ -626,9 +626,9 @@ define Device/Build/image DEVICE_ID="$(DEVICE_NAME)" \ BIN_DIR="$(BIN_DIR)" \ SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) \ - DEVICE_IMG_NAME="$(DEVICE_IMG_NAME)" \ - IMAGE_TYPE=$(word 1,$(subst ., ,$(2))) \ - IMAGE_FILESYSTEM="$(1)" \ + FILE_NAME="$(DEVICE_IMG_NAME)" \ + FILE_TYPE=$(word 1,$(subst ., ,$(2))) \ + FILE_FILESYSTEM="$(1)" \ DEVICE_IMG_PREFIX="$(DEVICE_IMG_PREFIX)" \ DEVICE_VENDOR="$(DEVICE_VENDOR)" \ DEVICE_MODEL="$(DEVICE_MODEL)" \ @@ -654,7 +654,9 @@ define Device/Build/image endef define Device/Build/artifact - $$(_TARGET): $(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1) + $$(_TARGET): $(if $(CONFIG_JSON_OVERVIEW_IMAGE_INFO), \ + $(BUILD_DIR)/json_info_files/$(DEVICE_IMG_PREFIX)-$(1).json, \ + $(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1)) $(eval $(call Device/Export,$(KDIR)/tmp/$(DEVICE_IMG_PREFIX)-$(1))) $(KDIR)/tmp/$(DEVICE_IMG_PREFIX)-$(1): $$(KDIR_KERNEL_IMAGE) @rm -f $$@ @@ -665,6 +667,35 @@ define Device/Build/artifact $(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1): $(KDIR)/tmp/$(DEVICE_IMG_PREFIX)-$(1) cp $$^ $$@ + $(BUILD_DIR)/json_info_files/$(DEVICE_IMG_PREFIX)-$(1).json: $(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1) + @mkdir -p $$(shell dirname $$@) + DEVICE_ID="$(DEVICE_NAME)" \ + BIN_DIR="$(BIN_DIR)" \ + SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) \ + FILE_NAME="$(DEVICE_IMG_PREFIX)-$(1)" \ + FILE_TYPE="$(1)" \ + DEVICE_IMG_PREFIX="$(DEVICE_IMG_PREFIX)" \ + DEVICE_VENDOR="$(DEVICE_VENDOR)" \ + DEVICE_MODEL="$(DEVICE_MODEL)" \ + DEVICE_VARIANT="$(DEVICE_VARIANT)" \ + DEVICE_ALT0_VENDOR="$(DEVICE_ALT0_VENDOR)" \ + DEVICE_ALT0_MODEL="$(DEVICE_ALT0_MODEL)" \ + DEVICE_ALT0_VARIANT="$(DEVICE_ALT0_VARIANT)" \ + DEVICE_ALT1_VENDOR="$(DEVICE_ALT1_VENDOR)" \ + DEVICE_ALT1_MODEL="$(DEVICE_ALT1_MODEL)" \ + DEVICE_ALT1_VARIANT="$(DEVICE_ALT1_VARIANT)" \ + DEVICE_ALT2_VENDOR="$(DEVICE_ALT2_VENDOR)" \ + DEVICE_ALT2_MODEL="$(DEVICE_ALT2_MODEL)" \ + DEVICE_ALT2_VARIANT="$(DEVICE_ALT2_VARIANT)" \ + DEVICE_TITLE="$(DEVICE_TITLE)" \ + DEVICE_PACKAGES="$(DEVICE_PACKAGES)" \ + TARGET="$(BOARD)" \ + SUBTARGET="$(if $(SUBTARGET),$(SUBTARGET),generic)" \ + VERSION_NUMBER="$(VERSION_NUMBER)" \ + VERSION_CODE="$(VERSION_CODE)" \ + SUPPORTED_DEVICES="$(SUPPORTED_DEVICES)" \ + $(TOPDIR)/scripts/json_add_image_info.py $$@ + endef define Device/Build diff --git a/scripts/json_add_image_info.py b/scripts/json_add_image_info.py index 38cd3c487d..23033f9fc4 100755 --- a/scripts/json_add_image_info.py +++ b/scripts/json_add_image_info.py @@ -12,10 +12,10 @@ if len(argv) != 2: json_path = Path(argv[1]) bin_dir = Path(getenv("BIN_DIR")) -image_file = bin_dir / getenv("DEVICE_IMG_NAME") +file_path = bin_dir / getenv("FILE_NAME") -if not image_file.is_file(): - print("Skip JSON creation for non existing image ", image_file) +if not file_path.is_file(): + print("Skip JSON creation for non existing file", file_path) exit(0) @@ -37,9 +37,9 @@ def get_titles(): device_id = getenv("DEVICE_ID") -image_hash = hashlib.sha256(image_file.read_bytes()).hexdigest() +file_hash = hashlib.sha256(file_path.read_bytes()).hexdigest() -image_info = { +file_info = { "metadata_version": 1, "target": "{}/{}".format(getenv("TARGET"), getenv("SUBTARGET")), "version_code": getenv("VERSION_CODE"), @@ -50,10 +50,9 @@ image_info = { "image_prefix": getenv("DEVICE_IMG_PREFIX"), "images": [ { - "type": getenv("IMAGE_TYPE"), - "filesystem": getenv("IMAGE_FILESYSTEM"), - "name": getenv("DEVICE_IMG_NAME"), - "sha256": image_hash, + "type": getenv("FILE_TYPE"), + "name": getenv("FILE_NAME"), + "sha256": file_hash, } ], "device_packages": getenv("DEVICE_PACKAGES").split(), @@ -63,4 +62,9 @@ image_info = { }, } -json_path.write_text(json.dumps(image_info, separators=(",", ":"))) +if getenv("FILE_FILESYSTEM"): + file_info["profiles"][device_id]["images"][0]["filesystem"] = getenv( + "FILE_FILESYSTEM" + ) + +json_path.write_text(json.dumps(file_info, separators=(",", ":"))) From f0dff7533c6a42b20b324e39190760d9ca6ba5bd Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 15 Sep 2021 22:27:43 -0700 Subject: [PATCH 21/38] tools/mm-macros: remove ccaaab1c048159611e93a181dde740f49fa12483 says that this is in the codebase because of libsigc++, which is not in the codebase anymore. Neither in base nor in packages. It doesn't seem to be needed by anything else either. GNOME packages have transitioned to using meson, which does not use m4 files. Tested local compile with CONFIG_ALL. No problems seen. Signed-off-by: Rosen Penev --- tools/Makefile | 3 +-- tools/mm-macros/Makefile | 33 --------------------------------- 2 files changed, 1 insertion(+), 35 deletions(-) delete mode 100644 tools/mm-macros/Makefile diff --git a/tools/Makefile b/tools/Makefile index c051396652..0e5c89a995 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -24,7 +24,7 @@ endif tools-y += autoconf autoconf-archive automake bc bison cmake cpio dosfstools tools-y += e2fsprogs fakeroot findutils firmware-utils flex gengetopt tools-y += libressl libtool lzma m4 make-ext4fs missing-macros mkimage -tools-y += mklibs mm-macros mtd-utils mtools ninja padjffs2 patch-image patchelf +tools-y += mklibs mtd-utils mtools ninja padjffs2 patch-image patchelf tools-y += pkg-config quilt squashfskit4 sstrip ucl upx xxd zip zlib zstd tools-$(BUILD_B43_TOOLS) += b43-tools tools-$(BUILD_ISL) += isl @@ -62,7 +62,6 @@ $(curdir)/make-ext4fs/compile := $(curdir)/zlib/compile $(curdir)/missing-macros/compile := $(curdir)/autoconf/compile $(curdir)/mkimage/compile += $(curdir)/libressl/compile $(curdir)/mklibs/compile := $(curdir)/libtool/compile -$(curdir)/mm-macros/compile := $(curdir)/libtool/compile $(curdir)/mpc/compile := $(curdir)/mpfr/compile $(curdir)/gmp/compile $(curdir)/mpfr/compile := $(curdir)/gmp/compile $(curdir)/mtd-utils/compile := $(curdir)/libtool/compile $(curdir)/e2fsprogs/compile $(curdir)/zlib/compile diff --git a/tools/mm-macros/Makefile b/tools/mm-macros/Makefile deleted file mode 100644 index 071563378f..0000000000 --- a/tools/mm-macros/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -# -# Copyright (C) 2010-2016 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=mm-macros -PKG_VERSION:=1.0.0 - -PKG_SOURCE_URL:=@GNOME/mm-common/1.0 -PKG_SOURCE:=mm-common-$(PKG_VERSION).tar.xz -PKG_HASH:=b97d9b041e5952486cab620b44ab09f6013a478f43b6699ae899b8a4da189cd4 - -HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/mm-common-$(PKG_VERSION) - -HOST_FIXUP:=autoreconf - -include $(INCLUDE_DIR)/host-build.mk - -define Host/Install - $(INSTALL_DIR) $(STAGING_DIR_HOST)/share/aclocal - $(INSTALL_DATA) $(HOST_BUILD_DIR)/macros/*.m4 $(STAGING_DIR_HOST)/share/aclocal/ -endef - -define Host/Clean - -$(MAKE) -C $(HOST_BUILD_DIR) uninstall - $(call Host/Clean/Default) -endef - -$(eval $(call HostBuild)) From e06ab0c6b3b19ddc68b1d69e42b7f85fa8d1f1c3 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 17 Jun 2021 14:21:44 -0700 Subject: [PATCH 22/38] tools: add meson meson is a next generation build system designed to have good defaults, simpler build files, and fast compilation. It is built upon python and uses ninja for compilation. The latter provides fast by default (parallel) and problem free compilation. There are over 40 packages already successfully using meson. The next commit will convert pkgconf to use meson compilation. Signed-off-by: Rosen Penev --- include/meson.mk | 143 ++++++++++++++++++++++++++ tools/Makefile | 3 +- tools/meson/Makefile | 32 ++++++ tools/meson/src/openwrt-cross.txt.in | 23 +++++ tools/meson/src/openwrt-native.txt.in | 13 +++ 5 files changed, 213 insertions(+), 1 deletion(-) create mode 100644 include/meson.mk create mode 100644 tools/meson/Makefile create mode 100644 tools/meson/src/openwrt-cross.txt.in create mode 100644 tools/meson/src/openwrt-native.txt.in diff --git a/include/meson.mk b/include/meson.mk new file mode 100644 index 0000000000..01d0ce0280 --- /dev/null +++ b/include/meson.mk @@ -0,0 +1,143 @@ +# To build your package using meson: +# +# include $(INCLUDE_DIR)/meson.mk +# MESON_ARGS+=-Dfoo -Dbar=baz +# +# To pass additional environment variables to meson: +# +# MESON_VARS+=FOO=bar +# +# Default configure/compile/install targets are provided, but can be +# overwritten if required: +# +# define Build/Configure +# $(call Build/Configure/Meson) +# ... +# endef +# +# same for Build/Compile and Build/Install +# +# Host packages are built in the same fashion, just use these vars instead: +# +# HOST_BUILD_DEPENDS:=meson/host +# MESON_HOST_ARGS+=-Dfoo -Dbar=baz +# MESON_HOST_VARS+=FOO=bar + +MESON_DIR:=$(STAGING_DIR_HOST)/lib/meson + +MESON_HOST_BUILD_DIR:=$(HOST_BUILD_DIR)/openwrt-build +MESON_HOST_VARS:= +MESON_HOST_ARGS:= + +MESON_BUILD_DIR:=$(PKG_BUILD_DIR)/openwrt-build +MESON_VARS:= +MESON_ARGS:= + +ifneq ($(findstring i386,$(CONFIG_ARCH)),) +MESON_ARCH:="x86" +else ifneq ($(findstring powerpc64,$(CONFIG_ARCH)),) +MESON_ARCH:="ppc64" +else ifneq ($(findstring powerpc,$(CONFIG_ARCH)),) +MESON_ARCH:="ppc" +else ifneq ($(findstring mips64el,$(CONFIG_ARCH)),) +MESON_ARCH:="mips64" +else ifneq ($(findstring mipsel,$(CONFIG_ARCH)),) +MESON_ARCH:="mips" +else ifneq ($(findstring armeb,$(CONFIG_ARCH)),) +MESON_ARCH:="arm" +else +MESON_ARCH:=$(CONFIG_ARCH) +endif + +# this is undefined for just x64_64 +ifeq ($(origin CPU_TYPE),undefined) +MESON_CPU:="generic" +else +MESON_CPU:="$(CPU_TYPE)$(if $(CPU_SUBTYPE),+$(CPU_SUBTYPE))" +endif + +define Meson + $(2) $(STAGING_DIR_HOST)/bin/$(PYTHON) $(MESON_DIR)/meson.py $(1) +endef + +define Meson/CreateNativeFile + $(STAGING_DIR_HOST)/bin/sed \ + -e "s|@CC@|$(foreach BIN,$(HOSTCC),'$(BIN)',)|" \ + -e "s|@CXX@|$(foreach BIN,$(HOSTCXX),'$(BIN)',)|" \ + -e "s|@PKGCONFIG@|$(PKG_CONFIG)|" \ + -e "s|@CFLAGS@|$(foreach FLAG,$(HOST_CFLAGS) $(HOST_CPPFLAGS),'$(FLAG)',)|" \ + -e "s|@CXXFLAGS@|$(foreach FLAG,$(HOST_CXXFLAGS) $(HOST_CPPFLAGS),'$(FLAG)',)|" \ + -e "s|@LDFLAGS@|$(foreach FLAG,$(HOST_LDFLAGS),'$(FLAG)',)|" \ + -e "s|@PREFIX@|$(HOST_BUILD_PREFIX)|" \ + < $(MESON_DIR)/openwrt-native.txt.in \ + > $(1) +endef + +define Meson/CreateCrossFile + $(STAGING_DIR_HOST)/bin/sed \ + -e "s|@CC@|$(foreach BIN,$(TARGET_CC),'$(BIN)',)|" \ + -e "s|@CXX@|$(foreach BIN,$(TARGET_CXX),'$(BIN)',)|" \ + -e "s|@AR@|$(TARGET_AR)|" \ + -e "s|@STRIP@|$(TARGET_CROSS)strip|" \ + -e "s|@NM@|$(TARGET_NM)|" \ + -e "s|@PKGCONFIG@|$(PKG_CONFIG)|" \ + -e "s|@CFLAGS@|$(foreach FLAG,$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS),'$(FLAG)',)|" \ + -e "s|@CXXFLAGS@|$(foreach FLAG,$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS),'$(FLAG)',)|" \ + -e "s|@LDFLAGS@|$(foreach FLAG,$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS),'$(FLAG)',)|" \ + -e "s|@ARCH@|$(MESON_ARCH)|" \ + -e "s|@CPU@|$(MESON_CPU)|" \ + -e "s|@ENDIAN@|$(if $(CONFIG_BIG_ENDIAN),big,little)|" \ + < $(MESON_DIR)/openwrt-cross.txt.in \ + > $(1) +endef + +define Host/Configure/Meson + $(call Meson/CreateNativeFile,$(HOST_BUILD_DIR)/openwrt-native.txt) + $(call Meson, \ + --native-file $(HOST_BUILD_DIR)/openwrt-native.txt \ + $(MESON_HOST_ARGS) \ + $(MESON_HOST_BUILD_DIR) \ + $(HOST_BUILD_DIR), \ + $(MESON_HOST_VARS)) +endef + +define Host/Compile/Meson + +$(NINJA) -C $(MESON_HOST_BUILD_DIR) $(1) +endef + +define Host/Install/Meson + +$(NINJA) -C $(MESON_HOST_BUILD_DIR) install +endef + +define Host/Uninstall/Meson + +$(NINJA) -C $(MESON_HOST_BUILD_DIR) uninstall || true +endef + +define Build/Configure/Meson + $(call Meson/CreateNativeFile,$(PKG_BUILD_DIR)/openwrt-native.txt) + $(call Meson/CreateCrossFile,$(PKG_BUILD_DIR)/openwrt-cross.txt) + $(call Meson, \ + --buildtype plain \ + --native-file $(PKG_BUILD_DIR)/openwrt-native.txt \ + --cross-file $(PKG_BUILD_DIR)/openwrt-cross.txt \ + $(MESON_ARGS) \ + $(MESON_BUILD_DIR) \ + $(MESON_BUILD_DIR)/.., \ + $(MESON_VARS)) +endef + +define Build/Compile/Meson + +$(NINJA) -C $(MESON_BUILD_DIR) $(1) +endef + +define Build/Install/Meson + +DESTDIR="$(PKG_INSTALL_DIR)" $(NINJA) -C $(MESON_BUILD_DIR) install +endef + +Host/Configure=$(call Host/Configure/Meson) +Host/Compile=$(call Host/Compile/Meson) +Host/Install=$(call Host/Install/Meson) +Host/Uninstall=$(call Host/Uninstall/Meson) +Build/Configure=$(call Build/Configure/Meson) +Build/Compile=$(call Build/Compile/Meson) +Build/Install=$(call Build/Install/Meson) diff --git a/tools/Makefile b/tools/Makefile index 0e5c89a995..a82c4bd333 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -23,7 +23,7 @@ endif tools-y += autoconf autoconf-archive automake bc bison cmake cpio dosfstools tools-y += e2fsprogs fakeroot findutils firmware-utils flex gengetopt -tools-y += libressl libtool lzma m4 make-ext4fs missing-macros mkimage +tools-y += libressl libtool lzma m4 make-ext4fs meson missing-macros mkimage tools-y += mklibs mtd-utils mtools ninja padjffs2 patch-image patchelf tools-y += pkg-config quilt squashfskit4 sstrip ucl upx xxd zip zlib zstd tools-$(BUILD_B43_TOOLS) += b43-tools @@ -59,6 +59,7 @@ $(curdir)/libressl/compile := $(curdir)/pkg-config/compile $(curdir)/libtool/compile := $(curdir)/m4/compile $(curdir)/autoconf/compile $(curdir)/automake/compile $(curdir)/missing-macros/compile $(curdir)/lzma-old/compile := $(curdir)/zlib/compile $(curdir)/make-ext4fs/compile := $(curdir)/zlib/compile +$(curdir)/meson/compile := $(curdir)/ninja/compile $(curdir)/missing-macros/compile := $(curdir)/autoconf/compile $(curdir)/mkimage/compile += $(curdir)/libressl/compile $(curdir)/mklibs/compile := $(curdir)/libtool/compile diff --git a/tools/meson/Makefile b/tools/meson/Makefile new file mode 100644 index 0000000000..bae89654a5 --- /dev/null +++ b/tools/meson/Makefile @@ -0,0 +1,32 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=meson +PKG_VERSION:=0.59.1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/mesonbuild/meson/releases/download/$(PKG_VERSION) +PKG_HASH:=db586a451650d46bbe10984a87b79d9bcdc1caebf38d8e189f8848f8d502356d + +PKG_MAINTAINER:=Andre Heider +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=COPYING + +include $(INCLUDE_DIR)/host-build.mk + +define Host/Configure +endef + +define Host/Compile +endef + +define Host/Install + $(INSTALL_DIR) $(STAGING_DIR_HOST)/lib/meson + $(CP) $(HOST_BUILD_DIR)/* $(STAGING_DIR_HOST)/lib/meson/ +endef + +define Host/Clean + $(call Host/Clean/Default) + rm -rf $(STAGING_DIR_HOST)/lib/meson +endef + +$(eval $(call HostBuild)) diff --git a/tools/meson/src/openwrt-cross.txt.in b/tools/meson/src/openwrt-cross.txt.in new file mode 100644 index 0000000000..30b4c116c4 --- /dev/null +++ b/tools/meson/src/openwrt-cross.txt.in @@ -0,0 +1,23 @@ +[binaries] +c = [@CC@] +cpp = [@CXX@] +ar = '@AR@' +strip = '@STRIP@' +nm = '@NM@' +pkgconfig = '@PKGCONFIG@' + +[built-in options] +c_args = [@CFLAGS@] +c_link_args = [@LDFLAGS@] +cpp_args = [@CXXFLAGS@] +cpp_link_args = [@LDFLAGS@] +prefix = '/usr' + +[host_machine] +system = 'linux' +cpu_family = '@ARCH@' +cpu = '@CPU@' +endian = '@ENDIAN@' + +[properties] +needs_exe_wrapper = true diff --git a/tools/meson/src/openwrt-native.txt.in b/tools/meson/src/openwrt-native.txt.in new file mode 100644 index 0000000000..50308ec8e4 --- /dev/null +++ b/tools/meson/src/openwrt-native.txt.in @@ -0,0 +1,13 @@ +[binaries] +c = [@CC@] +cpp = [@CXX@] +pkgconfig = '@PKGCONFIG@' + +[built-in options] +c_args = [@CFLAGS@] +c_link_args = [@LDFLAGS@] +cpp_args = [@CXXFLAGS@] +cpp_link_args = [@LDFLAGS@] +prefix = '@PREFIX@' +sbindir = 'bin' +libdir = 'lib' From 3246dc7f1597dd5aedd2891b02c1ff025c7d617f Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 28 Nov 2019 11:19:31 -0800 Subject: [PATCH 23/38] tools/pkg-config: Replace with pkgconf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pkgconf is a newer, actively maintained implementation of pkg-config that supports more aspects of the pkg-config file specification and provides a library interface that applications can use to incorporate intelligent handling of pkg-config files into themselves (such as build file generators, IDEs, and compilers). Through its pkg-config compatibility interface (activated when it is run as "pkg-config"), it also can completely replace the original implementation. It is also lighterweight and does not require glib2, as pkg-config does. On other distros, pkgconf is symlinked to pkg-config. For simplicity here, it is renamed to pkg-config.real, as in the original package. Initial results have been positive. As before, pkgconf works as long as the pkg-config files point to the proper paths. Signed-off-by: Rosen Penev [backported upstream fix for Meson] Signed-off-by: Petr Å tetiar --- tools/Makefile | 8 ++--- tools/{pkg-config => pkgconf}/Makefile | 22 ++++-------- .../{pkg-config => pkgconf}/files/pkg-config | 0 ...move-version-to-modversion-remapping.patch | 36 +++++++++++++++++++ 4 files changed, 47 insertions(+), 19 deletions(-) rename tools/{pkg-config => pkgconf}/Makefile (52%) rename tools/{pkg-config => pkgconf}/files/pkg-config (100%) create mode 100644 tools/pkgconf/patches/0001-cli-remove-version-to-modversion-remapping.patch diff --git a/tools/Makefile b/tools/Makefile index a82c4bd333..37c1eaf805 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -25,7 +25,7 @@ tools-y += autoconf autoconf-archive automake bc bison cmake cpio dosfstools tools-y += e2fsprogs fakeroot findutils firmware-utils flex gengetopt tools-y += libressl libtool lzma m4 make-ext4fs meson missing-macros mkimage tools-y += mklibs mtd-utils mtools ninja padjffs2 patch-image patchelf -tools-y += pkg-config quilt squashfskit4 sstrip ucl upx xxd zip zlib zstd +tools-y += pkgconf quilt squashfskit4 sstrip ucl upx xxd zip zlib zstd tools-$(BUILD_B43_TOOLS) += b43-tools tools-$(BUILD_ISL) += isl tools-$(BUILD_TOOLCHAIN) += expat gmp mpc mpfr @@ -40,7 +40,7 @@ tools-$(CONFIG_USE_SPARSE) += sparse # builddir dependencies $(curdir)/autoconf/compile := $(curdir)/m4/compile -$(curdir)/automake/compile := $(curdir)/m4/compile $(curdir)/autoconf/compile $(curdir)/pkg-config/compile $(curdir)/xz/compile +$(curdir)/automake/compile := $(curdir)/m4/compile $(curdir)/autoconf/compile $(curdir)/pkgconf/compile $(curdir)/xz/compile $(curdir)/b43-tools/compile := $(curdir)/bison/compile $(curdir)/bc/compile := $(curdir)/bison/compile $(curdir)/libtool/compile $(curdir)/bison/compile := $(curdir)/flex/compile @@ -55,7 +55,7 @@ $(curdir)/flex/compile := $(curdir)/libtool/compile $(curdir)/gengetopt/compile := $(curdir)/libtool/compile $(curdir)/gmp/compile := $(curdir)/libtool/compile $(curdir)/isl/compile := $(curdir)/gmp/compile -$(curdir)/libressl/compile := $(curdir)/pkg-config/compile +$(curdir)/libressl/compile := $(curdir)/pkgconf/compile $(curdir)/libtool/compile := $(curdir)/m4/compile $(curdir)/autoconf/compile $(curdir)/automake/compile $(curdir)/missing-macros/compile $(curdir)/lzma-old/compile := $(curdir)/zlib/compile $(curdir)/make-ext4fs/compile := $(curdir)/zlib/compile @@ -83,7 +83,7 @@ ifneq ($(HOST_OS),Linux) endif ifneq ($(CONFIG_CCACHE)$(CONFIG_SDK),) -$(foreach tool, $(filter-out xz zstd patch pkg-config libressl ninja cmake,$(tools-y)), $(eval $(curdir)/$(tool)/compile += $(curdir)/ccache/compile)) +$(foreach tool, $(filter-out xz zstd patch pkgconf libressl ninja cmake,$(tools-y)), $(eval $(curdir)/$(tool)/compile += $(curdir)/ccache/compile)) tools-y += ccache $(curdir)/ccache/compile := $(curdir)/zstd/compile endif diff --git a/tools/pkg-config/Makefile b/tools/pkgconf/Makefile similarity index 52% rename from tools/pkg-config/Makefile rename to tools/pkgconf/Makefile index e735b2382e..cefee1edf0 100644 --- a/tools/pkg-config/Makefile +++ b/tools/pkgconf/Makefile @@ -1,4 +1,4 @@ -# +# # Copyright (C) 2006-2016 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. @@ -6,12 +6,12 @@ # include $(TOPDIR)/rules.mk -PKG_NAME:=pkg-config -PKG_VERSION:=0.29.2 +PKG_NAME:=pkgconf +PKG_VERSION:=1.6.3 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://pkgconfig.freedesktop.org/releases/ -PKG_HASH:=6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=https://distfiles.dereferenced.org/pkgconf +PKG_HASH:=61f0b31b0d5ea0e862b454a80c170f57bad47879c0c42bd8de89200ff62ea210 HOST_BUILD_PARALLEL:=1 @@ -19,17 +19,9 @@ include $(INCLUDE_DIR)/host-build.mk unexport PKG_CONFIG -HOSTCC := $(HOSTCC_NOCACHE) - -HOST_CONFIGURE_ARGS += --with-internal-glib - -ifeq ($(HOST_OS),Darwin) -HOST_LDFLAGS += -framework CoreFoundation -framework Carbon -endif - define Host/Install $(MAKE) -C $(HOST_BUILD_DIR) install - mv $(STAGING_DIR_HOST)/bin/pkg-config $(STAGING_DIR_HOST)/bin/pkg-config.real + mv $(STAGING_DIR_HOST)/bin/pkgconf $(STAGING_DIR_HOST)/bin/pkg-config.real $(INSTALL_BIN) ./files/pkg-config $(STAGING_DIR_HOST)/bin/pkg-config endef diff --git a/tools/pkg-config/files/pkg-config b/tools/pkgconf/files/pkg-config similarity index 100% rename from tools/pkg-config/files/pkg-config rename to tools/pkgconf/files/pkg-config diff --git a/tools/pkgconf/patches/0001-cli-remove-version-to-modversion-remapping.patch b/tools/pkgconf/patches/0001-cli-remove-version-to-modversion-remapping.patch new file mode 100644 index 0000000000..b2c538d24e --- /dev/null +++ b/tools/pkgconf/patches/0001-cli-remove-version-to-modversion-remapping.patch @@ -0,0 +1,36 @@ +From 62bbd3b664d4b03011a4b382ed20353a91c30406 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Tue, 21 Jan 2020 10:32:36 -0600 +Subject: [PATCH] cli: remove --version to --modversion remapping + +This has been a source of frequent complaints, so we drop it. +Resolves: https://todo.sr.ht/~kaniini/pkgconf/6 +--- + cli/main.c | 14 ++------------ + 1 file changed, 2 insertions(+), 12 deletions(-) + +diff --git a/cli/main.c b/cli/main.c +index 563ec8f0cfcd..fc698a4f9191 100644 +--- a/cli/main.c ++++ b/cli/main.c +@@ -1005,18 +1005,8 @@ main(int argc, char *argv[]) + + if ((want_flags & PKG_VERSION) == PKG_VERSION) + { +- if (argc > 2) +- { +- fprintf(stderr, "%s: --version specified with other options or module names, assuming --modversion.\n", argv[0]); +- +- want_flags &= ~PKG_VERSION; +- want_flags |= PKG_MODVERSION; +- } +- else +- { +- version(); +- return EXIT_SUCCESS; +- } ++ version(); ++ return EXIT_SUCCESS; + } + + if ((want_flags & PKG_HELP) == PKG_HELP) From 0a3ac3cc021abc25ce0529ef1add353da75b0ff0 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 28 Nov 2019 11:19:32 -0800 Subject: [PATCH 24/38] tools/pkgconf: Run pkg-config wrapper through shellcheck Mainly quoting fixes. Separated parameters by \ for easier readability. Signed-off-by: Rosen Penev --- tools/pkgconf/files/pkg-config | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/pkgconf/files/pkg-config b/tools/pkgconf/files/pkg-config index 82cc74ffcb..fa1faccc6c 100755 --- a/tools/pkgconf/files/pkg-config +++ b/tools/pkgconf/files/pkg-config @@ -1,3 +1,6 @@ #!/bin/sh -pkg-config.real --define-variable=prefix=${STAGING_PREFIX} --define-variable=exec_prefix=${STAGING_PREFIX} --define-variable=bindir=${STAGING_PREFIX}/bin $@ +pkg-config.real \ +--define-variable=prefix="${STAGING_PREFIX}" \ +--define-variable=exec_prefix="${STAGING_PREFIX}" \ +--define-variable=bindir="${STAGING_PREFIX}/bin" "$@" From c2ff1d8c039384a369975fa0c16d337698c51c5b Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 13 Mar 2020 15:54:50 +0100 Subject: [PATCH 25/38] pkgconf: always retain -I and -L flags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pkgconf fork filters -I and -L flag values from .pc files which match pkgconf's builtin system directory value. During configure, pkgconf derives the default system include and library search path values from exec_prefix, which is set to staging_dir/host in the host tool build phase. Due to that, pkgconf will drop all -I and -L flags pointing to staging_dir/host/include or staging_dir/host/lib, unless invoked with --keep-system-cflags and --keep-system-libs respectively, breaking our kernel libelf discovery / stack validation workarounds. In order to inhibit the filtering, add --keep-system-cflags and --keep-system-libs to our pkg-config shell wrapper. Fixes: GH#2832 Fixes: 867298cf47 ("tools/pkg-config: Replace with pkgconf") Ref: https://lists.infradead.org/pipermail/openwrt-devel/2020-March/022182.html Ref: https://git.openwrt.org/fe43969336201f2cc7d103b68fd6e65989bee184 Signed-off-by: Jo-Philipp Wich Acked-by: Petr Å tetiar --- tools/pkgconf/files/pkg-config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/pkgconf/files/pkg-config b/tools/pkgconf/files/pkg-config index fa1faccc6c..2c6fd08b4a 100755 --- a/tools/pkgconf/files/pkg-config +++ b/tools/pkgconf/files/pkg-config @@ -1,6 +1,8 @@ #!/bin/sh pkg-config.real \ +--keep-system-cflags \ +--keep-system-libs \ --define-variable=prefix="${STAGING_PREFIX}" \ --define-variable=exec_prefix="${STAGING_PREFIX}" \ --define-variable=bindir="${STAGING_PREFIX}/bin" "$@" From 3d0dc072f1f636cbae3b8b885dbdc689361e7586 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 16 Dec 2020 23:33:55 -0800 Subject: [PATCH 26/38] tools/pkgconf: update to 1.7.3 Remove upstreamed patch. Signed-off-by: Rosen Penev --- tools/pkgconf/Makefile | 4 +-- ...move-version-to-modversion-remapping.patch | 36 ------------------- 2 files changed, 2 insertions(+), 38 deletions(-) delete mode 100644 tools/pkgconf/patches/0001-cli-remove-version-to-modversion-remapping.patch diff --git a/tools/pkgconf/Makefile b/tools/pkgconf/Makefile index cefee1edf0..7d785aae39 100644 --- a/tools/pkgconf/Makefile +++ b/tools/pkgconf/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pkgconf -PKG_VERSION:=1.6.3 +PKG_VERSION:=1.7.3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://distfiles.dereferenced.org/pkgconf -PKG_HASH:=61f0b31b0d5ea0e862b454a80c170f57bad47879c0c42bd8de89200ff62ea210 +PKG_HASH:=b846aea51cf696c3392a0ae58bef93e2e72f8e7073ca6ad1ed8b01c85871f9c0 HOST_BUILD_PARALLEL:=1 diff --git a/tools/pkgconf/patches/0001-cli-remove-version-to-modversion-remapping.patch b/tools/pkgconf/patches/0001-cli-remove-version-to-modversion-remapping.patch deleted file mode 100644 index b2c538d24e..0000000000 --- a/tools/pkgconf/patches/0001-cli-remove-version-to-modversion-remapping.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 62bbd3b664d4b03011a4b382ed20353a91c30406 Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Tue, 21 Jan 2020 10:32:36 -0600 -Subject: [PATCH] cli: remove --version to --modversion remapping - -This has been a source of frequent complaints, so we drop it. -Resolves: https://todo.sr.ht/~kaniini/pkgconf/6 ---- - cli/main.c | 14 ++------------ - 1 file changed, 2 insertions(+), 12 deletions(-) - -diff --git a/cli/main.c b/cli/main.c -index 563ec8f0cfcd..fc698a4f9191 100644 ---- a/cli/main.c -+++ b/cli/main.c -@@ -1005,18 +1005,8 @@ main(int argc, char *argv[]) - - if ((want_flags & PKG_VERSION) == PKG_VERSION) - { -- if (argc > 2) -- { -- fprintf(stderr, "%s: --version specified with other options or module names, assuming --modversion.\n", argv[0]); -- -- want_flags &= ~PKG_VERSION; -- want_flags |= PKG_MODVERSION; -- } -- else -- { -- version(); -- return EXIT_SUCCESS; -- } -+ version(); -+ return EXIT_SUCCESS; - } - - if ((want_flags & PKG_HELP) == PKG_HELP) From 41b0200487ced0aa02717141279b1d5d06ebd706 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 18 Jun 2021 19:53:17 -0700 Subject: [PATCH 27/38] tools/pkgconf: update to 1.8.0 Switch to compiling with meson for faster and more reliable compilation. Signed-off-by: Rosen Penev --- tools/Makefile | 3 ++- tools/pkgconf/Makefile | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/tools/Makefile b/tools/Makefile index 37c1eaf805..7d5ec9312d 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -68,6 +68,7 @@ $(curdir)/mpfr/compile := $(curdir)/gmp/compile $(curdir)/mtd-utils/compile := $(curdir)/libtool/compile $(curdir)/e2fsprogs/compile $(curdir)/zlib/compile $(curdir)/padjffs2/compile := $(curdir)/findutils/compile $(curdir)/patchelf/compile := $(curdir)/libtool/compile +$(curdir)/pkgconf/compile := $(curdir)/meson/compile $(curdir)/quilt/compile := $(curdir)/autoconf/compile $(curdir)/findutils/compile $(curdir)/sdcc/compile := $(curdir)/bison/compile $(curdir)/squashfs/compile := $(curdir)/lzma-old/compile @@ -83,7 +84,7 @@ ifneq ($(HOST_OS),Linux) endif ifneq ($(CONFIG_CCACHE)$(CONFIG_SDK),) -$(foreach tool, $(filter-out xz zstd patch pkgconf libressl ninja cmake,$(tools-y)), $(eval $(curdir)/$(tool)/compile += $(curdir)/ccache/compile)) +$(foreach tool, $(filter-out xz zstd pkgconf patch ninja meson libressl cmake,$(tools-y)), $(eval $(curdir)/$(tool)/compile += $(curdir)/ccache/compile)) tools-y += ccache $(curdir)/ccache/compile := $(curdir)/zstd/compile endif diff --git a/tools/pkgconf/Makefile b/tools/pkgconf/Makefile index 7d785aae39..d2f3252b12 100644 --- a/tools/pkgconf/Makefile +++ b/tools/pkgconf/Makefile @@ -7,27 +7,32 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pkgconf -PKG_VERSION:=1.7.3 +PKG_VERSION:=1.8.0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://distfiles.dereferenced.org/pkgconf -PKG_HASH:=b846aea51cf696c3392a0ae58bef93e2e72f8e7073ca6ad1ed8b01c85871f9c0 - -HOST_BUILD_PARALLEL:=1 +PKG_HASH:=ef9c7e61822b7cb8356e6e9e1dca58d9556f3200d78acab35e4347e9d4c2bbaf include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/meson.mk unexport PKG_CONFIG +HOSTCC := $(HOSTCC_NOCACHE) + +MESON_HOST_ARGS += \ + -Ddefault_library=static \ + -Dtests=false + define Host/Install - $(MAKE) -C $(HOST_BUILD_DIR) install + $(call Host/Install/Meson) mv $(STAGING_DIR_HOST)/bin/pkgconf $(STAGING_DIR_HOST)/bin/pkg-config.real $(INSTALL_BIN) ./files/pkg-config $(STAGING_DIR_HOST)/bin/pkg-config endef define Host/Clean - -$(MAKE) -C $(HOST_BUILD_DIR) uninstall - $(call Host/Clean/Default) + rm -f $(STAGING_DIR_HOST)/bin/pkg-config.real $(STAGING_DIR_HOST)/bin/pkg-config + $(call Host/Clean/Meson) endef $(eval $(call HostBuild)) From fe489301cfbbb8f1daf29eda2a31f3ebbc41c64a Mon Sep 17 00:00:00 2001 From: Ivan Pavlov Date: Sun, 5 Sep 2021 23:08:35 +0300 Subject: [PATCH 28/38] wolfssl: update to 4.8.1-stable Changes from 4.7.0: Fix one high (OCSP verification issue) and two low vulnerabilities Improve compatibility layer Other improvements and fixes For detailed changes refer to https://github.com/wolfSSL/wolfssl/releases Signed-off-by: Ivan Pavlov --- package/libs/wolfssl/Makefile | 6 +++--- ...m-change-asm-snippets-to-get-compiling.patch | 17 +++++------------ .../patches/100-disable-hardening-check.patch | 2 +- package/libs/wolfssl/patches/200-ecc-rng.patch | 4 ++-- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index 6921ae2268..1bbfea2daf 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wolfssl -PKG_VERSION:=4.7.0-stable -PKG_RELEASE:=2 +PKG_VERSION:=4.8.1-stable +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION) -PKG_HASH:=b0e740b31d4d877d540ad50cc539a8873fc41af02bd3091c4357b403f7106e31 +PKG_HASH:=50db45f348f47e00c93dd244c24108220120cb3cc9d01434789229c32937c444 PKG_FIXUP:=libtool PKG_INSTALL:=1 diff --git a/package/libs/wolfssl/patches/001-Maths-x86-asm-change-asm-snippets-to-get-compiling.patch b/package/libs/wolfssl/patches/001-Maths-x86-asm-change-asm-snippets-to-get-compiling.patch index 091b241285..763f9e8d06 100644 --- a/package/libs/wolfssl/patches/001-Maths-x86-asm-change-asm-snippets-to-get-compiling.patch +++ b/package/libs/wolfssl/patches/001-Maths-x86-asm-change-asm-snippets-to-get-compiling.patch @@ -13,8 +13,6 @@ SP_ASM_MUL_ADD2 and SP_ASM_SQR_ADD. wolfcrypt/src/sp_int.c | 6 +++--- 2 files changed, 23 insertions(+), 12 deletions(-) -diff --git a/wolfcrypt/src/asm.c b/wolfcrypt/src/asm.c -index b7f53d073..a37e75e02 100644 --- a/wolfcrypt/src/asm.c +++ b/wolfcrypt/src/asm.c @@ -698,33 +698,39 @@ __asm__( \ @@ -64,7 +62,7 @@ index b7f53d073..a37e75e02 100644 #define SQRADDAC(i, j) \ __asm__( \ -@@ -733,7 +739,9 @@ __asm__( \ +@@ -733,7 +739,9 @@ __asm__( "addl %%eax,%0 \n\t" \ "adcl %%edx,%1 \n\t" \ "adcl $0,%2 \n\t" \ @@ -75,7 +73,7 @@ index b7f53d073..a37e75e02 100644 #define SQRADDDB \ __asm__( \ -@@ -743,7 +751,10 @@ __asm__( \ +@@ -743,7 +751,10 @@ __asm__( "addl %6,%0 \n\t" \ "adcl %7,%1 \n\t" \ "adcl %8,%2 \n\t" \ @@ -87,11 +85,9 @@ index b7f53d073..a37e75e02 100644 #elif defined(TFM_X86_64) /* x86-64 optimized */ -diff --git a/wolfcrypt/src/sp_int.c b/wolfcrypt/src/sp_int.c -index 6070faaa9..d26702e47 100644 --- a/wolfcrypt/src/sp_int.c +++ b/wolfcrypt/src/sp_int.c -@@ -477,7 +477,7 @@ static WC_INLINE sp_int_digit sp_div_word(sp_int_digit hi, sp_int_digit lo, +@@ -476,7 +476,7 @@ static WC_INLINE sp_int_digit sp_div_wor "addl %%eax, %[l] \n\t" \ "adcl %%edx, %[h] \n\t" \ "adcl $0 , %[o] \n\t" \ @@ -100,7 +96,7 @@ index 6070faaa9..d26702e47 100644 : [a] "r" (va), [b] "r" (vb) \ : "eax", "edx", "cc" \ ) -@@ -503,7 +503,7 @@ static WC_INLINE sp_int_digit sp_div_word(sp_int_digit hi, sp_int_digit lo, +@@ -502,7 +502,7 @@ static WC_INLINE sp_int_digit sp_div_wor "addl %%eax, %[l] \n\t" \ "adcl %%edx, %[h] \n\t" \ "adcl $0 , %[o] \n\t" \ @@ -109,7 +105,7 @@ index 6070faaa9..d26702e47 100644 : [a] "r" (va), [b] "r" (vb) \ : "eax", "edx", "cc" \ ) -@@ -542,7 +542,7 @@ static WC_INLINE sp_int_digit sp_div_word(sp_int_digit hi, sp_int_digit lo, +@@ -541,7 +541,7 @@ static WC_INLINE sp_int_digit sp_div_wor "addl %%eax, %[l] \n\t" \ "adcl %%edx, %[h] \n\t" \ "adcl $0 , %[o] \n\t" \ @@ -118,6 +114,3 @@ index 6070faaa9..d26702e47 100644 : [a] "m" (va) \ : "eax", "edx", "cc" \ ) --- -2.31.1 - diff --git a/package/libs/wolfssl/patches/100-disable-hardening-check.patch b/package/libs/wolfssl/patches/100-disable-hardening-check.patch index c89ff1be9d..4141e28750 100644 --- a/package/libs/wolfssl/patches/100-disable-hardening-check.patch +++ b/package/libs/wolfssl/patches/100-disable-hardening-check.patch @@ -1,6 +1,6 @@ --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h -@@ -2255,7 +2255,7 @@ extern void uITRON4_free(void *p) ; +@@ -2274,7 +2274,7 @@ extern void uITRON4_free(void *p) ; #endif /* warning for not using harden build options (default with ./configure) */ diff --git a/package/libs/wolfssl/patches/200-ecc-rng.patch b/package/libs/wolfssl/patches/200-ecc-rng.patch index 2d33c06209..d8581be7eb 100644 --- a/package/libs/wolfssl/patches/200-ecc-rng.patch +++ b/package/libs/wolfssl/patches/200-ecc-rng.patch @@ -11,7 +11,7 @@ RNG regardless of the built settings for wolfssl. --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c -@@ -10293,21 +10293,21 @@ void wc_ecc_fp_free(void) +@@ -10938,21 +10938,21 @@ void wc_ecc_fp_free(void) #endif /* FP_ECC */ @@ -37,7 +37,7 @@ RNG regardless of the built settings for wolfssl. --- a/wolfssl/wolfcrypt/ecc.h +++ b/wolfssl/wolfcrypt/ecc.h -@@ -584,10 +584,8 @@ WOLFSSL_API +@@ -616,10 +616,8 @@ WOLFSSL_API void wc_ecc_fp_free(void); WOLFSSL_LOCAL void wc_ecc_fp_init(void); From 7005a508f35f1dc7cec7b3720161c76d90d7cd63 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Sat, 11 Sep 2021 21:17:39 +0200 Subject: [PATCH 29/38] iproute2: update to 5.14 Update iproute2 to latest stable 5.14; for the changes see https://lwn.net/Articles/867940/ Refresh patches Signed-off-by: Hans Dedecker --- package/network/utils/iproute2/Makefile | 4 ++-- .../utils/iproute2/patches/100-configure.patch | 2 +- .../iproute2/patches/140-keep_libmnl_optional.patch | 2 +- .../iproute2/patches/145-keep_libelf_optional.patch | 2 +- .../iproute2/patches/150-keep_libcap_optional.patch | 2 +- .../network/utils/iproute2/patches/170-ip_tiny.patch | 12 ++++++------ .../iproute2/patches/180-drop_FAILED_POLICY.patch | 2 +- .../iproute2/patches/190-fix-nls-rpath-link.patch | 4 ++-- .../patches/200-drop_libbsd_dependency.patch | 2 +- .../iproute2/patches/300-selinux-configurable.patch | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile index cb590c4ef7..039360511e 100644 --- a/package/network/utils/iproute2/Makefile +++ b/package/network/utils/iproute2/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iproute2 -PKG_VERSION:=5.13.0 +PKG_VERSION:=5.14.0 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2 -PKG_HASH:=72a2e53774cac9e65f7b617deebb2059f87e8960d6e9713e4d788cea966f1b36 +PKG_HASH:=210fa785a52f3763c4287fd5ae63e246f6311bfaa48c424baab6d383bb7591d4 PKG_BUILD_PARALLEL:=1 PKG_BUILD_DEPENDS:=iptables PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/iproute2/patches/100-configure.patch b/package/network/utils/iproute2/patches/100-configure.patch index f70b7199b6..0c19b2086a 100644 --- a/package/network/utils/iproute2/patches/100-configure.patch +++ b/package/network/utils/iproute2/patches/100-configure.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -39,7 +39,8 @@ int main(int argc, char **argv) { +@@ -34,7 +34,8 @@ int main(int argc, char **argv) { } EOF diff --git a/package/network/utils/iproute2/patches/140-keep_libmnl_optional.patch b/package/network/utils/iproute2/patches/140-keep_libmnl_optional.patch index a11a2a3fab..ff7e9ca4e5 100644 --- a/package/network/utils/iproute2/patches/140-keep_libmnl_optional.patch +++ b/package/network/utils/iproute2/patches/140-keep_libmnl_optional.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -367,7 +367,7 @@ check_selinux() +@@ -387,7 +387,7 @@ check_selinux() check_mnl() { diff --git a/package/network/utils/iproute2/patches/145-keep_libelf_optional.patch b/package/network/utils/iproute2/patches/145-keep_libelf_optional.patch index c780022d1a..079ca0512e 100644 --- a/package/network/utils/iproute2/patches/145-keep_libelf_optional.patch +++ b/package/network/utils/iproute2/patches/145-keep_libelf_optional.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -235,7 +235,7 @@ EOF +@@ -255,7 +255,7 @@ EOF check_elf() { diff --git a/package/network/utils/iproute2/patches/150-keep_libcap_optional.patch b/package/network/utils/iproute2/patches/150-keep_libcap_optional.patch index 8cd4e4ae6a..68e1624166 100644 --- a/package/network/utils/iproute2/patches/150-keep_libcap_optional.patch +++ b/package/network/utils/iproute2/patches/150-keep_libcap_optional.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -425,7 +425,7 @@ EOF +@@ -445,7 +445,7 @@ EOF check_cap() { diff --git a/package/network/utils/iproute2/patches/170-ip_tiny.patch b/package/network/utils/iproute2/patches/170-ip_tiny.patch index a0dde748c7..2c1ec1dcb3 100644 --- a/package/network/utils/iproute2/patches/170-ip_tiny.patch +++ b/package/network/utils/iproute2/patches/170-ip_tiny.patch @@ -30,11 +30,11 @@ "Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n" " ip [ -force ] -batch filename\n" +#ifndef IPROUTE2_TINY - "where OBJECT := { address | addrlabel | fou | help | ila | l2tp | link |\n" - " macsec | maddress | monitor | mptcp | mroute | mrule |\n" - " neighbor | neighbour | netconf | netns | nexthop | ntable |\n" - " ntbl | route | rule | sr | tap | tcpmetrics |\n" - " token | tunnel | tuntap | vrf | xfrm }\n" + "where OBJECT := { address | addrlabel | fou | help | ila | l2tp | link |\n" + " macsec | maddress | monitor | mptcp | mroute | mrule |\n" + " neighbor | neighbour | netconf | netns | nexthop | ntable |\n" + " ntbl | route | rule | sr | tap | tcpmetrics |\n" + " token | tunnel | tuntap | vrf | xfrm }\n" +#else + "where OBJECT := { address | ila | link | macsec | maddress | monitor |\n" + " mroute | mrule | neighbor | neighbour | netns | route |\n" @@ -43,7 +43,7 @@ " OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n" " -h[uman-readable] | -iec | -j[son] | -p[retty] |\n" " -f[amily] { inet | inet6 | mpls | bridge | link } |\n" -@@ -90,36 +96,50 @@ static const struct cmd { +@@ -91,36 +97,50 @@ static const struct cmd { int (*func)(int argc, char **argv); } cmds[] = { { "address", do_ipaddr }, diff --git a/package/network/utils/iproute2/patches/180-drop_FAILED_POLICY.patch b/package/network/utils/iproute2/patches/180-drop_FAILED_POLICY.patch index 95b37ae442..07d5230a6e 100644 --- a/package/network/utils/iproute2/patches/180-drop_FAILED_POLICY.patch +++ b/package/network/utils/iproute2/patches/180-drop_FAILED_POLICY.patch @@ -31,7 +31,7 @@ Subject: [PATCH] add support for dropping with FAILED_POLICY if (!end || end == arg || *end || res > 255) --- a/include/uapi/linux/rtnetlink.h +++ b/include/uapi/linux/rtnetlink.h -@@ -249,6 +249,7 @@ enum { +@@ -256,6 +256,7 @@ enum { RTN_THROW, /* Not in this table */ RTN_NAT, /* Translate this address */ RTN_XRESOLVE, /* Use external resolver */ diff --git a/package/network/utils/iproute2/patches/190-fix-nls-rpath-link.patch b/package/network/utils/iproute2/patches/190-fix-nls-rpath-link.patch index d0f8cec633..92d02b9a4e 100644 --- a/package/network/utils/iproute2/patches/190-fix-nls-rpath-link.patch +++ b/package/network/utils/iproute2/patches/190-fix-nls-rpath-link.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -259,7 +259,7 @@ int main(int argc, char **argv) { +@@ -279,7 +279,7 @@ int main(int argc, char **argv) { } EOF @@ -9,7 +9,7 @@ local ret=$? rm -f $TMPDIR/libbpf_test.c $TMPDIR/libbpf_test -@@ -277,7 +277,7 @@ int main(int argc, char **argv) { +@@ -297,7 +297,7 @@ int main(int argc, char **argv) { } EOF diff --git a/package/network/utils/iproute2/patches/200-drop_libbsd_dependency.patch b/package/network/utils/iproute2/patches/200-drop_libbsd_dependency.patch index bf335e0800..12a1ccfa33 100644 --- a/package/network/utils/iproute2/patches/200-drop_libbsd_dependency.patch +++ b/package/network/utils/iproute2/patches/200-drop_libbsd_dependency.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -411,14 +411,8 @@ EOF +@@ -431,14 +431,8 @@ EOF if $CC -I$INCLUDE -o $TMPDIR/strtest $TMPDIR/strtest.c >/dev/null 2>&1; then echo "no" else diff --git a/package/network/utils/iproute2/patches/300-selinux-configurable.patch b/package/network/utils/iproute2/patches/300-selinux-configurable.patch index 33c5279aec..b7e61fd3bd 100644 --- a/package/network/utils/iproute2/patches/300-selinux-configurable.patch +++ b/package/network/utils/iproute2/patches/300-selinux-configurable.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -354,7 +354,7 @@ check_libbpf() +@@ -374,7 +374,7 @@ check_libbpf() check_selinux() # SELinux is a compile time option in the ss utility { From 49eb757386f8393552ac7dd884d3d00079cb5d93 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Mon, 13 Sep 2021 18:08:55 -0300 Subject: [PATCH 30/38] libtool: bump to 2.4.6 This updates libtool to its current release, from 2015. Current patches were renumbered and given a description text. The fix in 160-passthrough-ssp.patch is no longer needed. A patch to speed up build was cherry-picked, and another openwrt specific patch was needed to not use quotes in $(SHELL), to acommodate our "SHELL=/usr/bin/env bash" usage. The already present call to ./bootstrap ensures that generated files are refreshed, so the patches are applied only to their sources. Also, that bootstrap call was adjusted to run at the appropriate time when QUILT=1. Signed-off-by: Eneas U de Queiroz --- tools/libtool/Makefile | 11 +- tools/libtool/patches/000-relocatable.patch | 108 ++------- tools/libtool/patches/100-libdir-fixes.patch | 97 +++----- ...10-dont-use-target-dir-for-relinking.patch | 51 ++-- .../120-strip-unsafe-dirs-for-relinking.patch | 36 +-- ...ingslash.patch => 130-trailingslash.patch} | 33 +-- ...140-don-t-quote-SHELL-in-Makefile.am.patch | 72 ++++++ ...itigate-the-sed_quote_subst-slowdown.patch | 224 ++++++++++++++++++ .../libtool/patches/160-passthrough-ssp.patch | 12 - .../patches/200-openwrt-branding.patch | 134 ++--------- 10 files changed, 444 insertions(+), 334 deletions(-) rename tools/libtool/patches/{150-trailingslash.patch => 130-trailingslash.patch} (57%) create mode 100644 tools/libtool/patches/140-don-t-quote-SHELL-in-Makefile.am.patch create mode 100644 tools/libtool/patches/150-libtool-mitigate-the-sed_quote_subst-slowdown.patch delete mode 100644 tools/libtool/patches/160-passthrough-ssp.patch diff --git a/tools/libtool/Makefile b/tools/libtool/Makefile index 2bc9db7d0d..b237884b64 100644 --- a/tools/libtool/Makefile +++ b/tools/libtool/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libtool PKG_CPE_ID:=cpe:/a:gnu:libtool -PKG_VERSION:=2.4.2 +PKG_VERSION:=2.4.6 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/$(PKG_NAME) -PKG_HASH:=1d7b6862c1ed162e327f083a6f78f40eae29218f0db8c38393d61dab764c4407 +PKG_HASH:=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f HOST_BUILD_PARALLEL:=1 @@ -24,7 +24,12 @@ HOST_CONFIGURE_VARS += \ define Host/Prepare $(call Host/Prepare/Default) (cd $(STAGING_DIR_HOST)/share/aclocal/ && rm -f libtool.m4 ltdl.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4) - (cd $(HOST_BUILD_DIR); $(AM_TOOL_PATHS) ./bootstrap) + $(if $(QUILT),,(cd $(HOST_BUILD_DIR); touch README-release; $(AM_TOOL_PATHS) ./bootstrap --skip-git --skip-po --force)) +endef + +define Host/Configure + $(if $(QUILT),(cd $(HOST_BUILD_DIR); touch README-release; $(AM_TOOL_PATHS) ./bootstrap --skip-git --skip-po --force)) + $(call Host/Configure/Default) endef define Host/Install diff --git a/tools/libtool/patches/000-relocatable.patch b/tools/libtool/patches/000-relocatable.patch index 6d1651be31..88d1eaed02 100644 --- a/tools/libtool/patches/000-relocatable.patch +++ b/tools/libtool/patches/000-relocatable.patch @@ -1,46 +1,24 @@ ---- a/libltdl/config/general.m4sh -+++ b/libltdl/config/general.m4sh -@@ -45,15 +45,22 @@ progpath="$0" - M4SH_VERBATIM([[ - : ${CP="cp -f"} - test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} --: ${EGREP="@EGREP@"} --: ${FGREP="@FGREP@"} --: ${GREP="@GREP@"} - : ${LN_S="@LN_S@"} - : ${MAKE="make"} - : ${MKDIR="mkdir"} - : ${MV="mv -f"} - : ${RM="rm -f"} --: ${SED="@SED@"} -+if test -n "$STAGING_DIR"; then -+ : ${EGREP="$STAGING_DIR/../host/bin/grep -E"} -+ : ${FGREP="$STAGING_DIR/../host/bin/grep -F"} -+ : ${GREP="$STAGING_DIR/../host/bin/grep"} -+ : ${SED="$STAGING_DIR/../host/bin/sed"} -+else -+ : ${EGREP="@EGREP@"} -+ : ${FGREP="@FGREP@"} -+ : ${GREP="@GREP@"} -+ : ${SED="@SED@"} -+fi - : ${SHELL="${CONFIG_SHELL-/bin/sh}"} - : ${Xsed="$SED -e 1s/^X//"} - +From ca10caa502f971f90d8c041aa2476de54ef0ce2b Mon Sep 17 00:00:00 2001 +From: Eneas U de Queiroz +Date: Tue, 20 Jul 2021 16:41:11 -0300 +Subject: openwrt: make relocatable, search resources relative to STAGING_DIR + +This was originally commited to openwrt by Jo-Philipp Wich +. + +(adjusted to v2.4.6) +Signed-off-by: Eneas U de Queiroz + --- a/libtoolize.in +++ b/libtoolize.in -@@ -334,15 +334,22 @@ as_unset=as_fn_unset +@@ -40,11 +40,18 @@ - : ${CP="cp -f"} - test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} + : ${AUTOCONF="autoconf"} + : ${AUTOMAKE="automake"} -: ${EGREP="@EGREP@"} -: ${FGREP="@FGREP@"} -: ${GREP="@GREP@"} : ${LN_S="@LN_S@"} - : ${MAKE="make"} - : ${MKDIR="mkdir"} - : ${MV="mv -f"} - : ${RM="rm -f"} -: ${SED="@SED@"} +if test -n "$STAGING_DIR"; then + : ${EGREP="$STAGING_DIR/../host/bin/grep -E"} @@ -53,58 +31,12 @@ + : ${GREP="@GREP@"} + : ${SED="@SED@"} +fi - : ${SHELL="${CONFIG_SHELL-/bin/sh}"} - : ${Xsed="$SED -e 1s/^X//"} -@@ -2487,10 +2494,17 @@ func_check_macros () - # Locations for important files: - prefix=@prefix@ -- datadir=@datadir@ -- pkgdatadir=@pkgdatadir@ -- pkgltdldir=@pkgdatadir@ -- aclocaldir=@aclocaldir@ -+ if test -n "$STAGING_DIR"; then -+ datadir="$STAGING_DIR/../host/share" -+ pkgdatadir="$STAGING_DIR/../host/share/libtool" -+ pkgltdldir="$STAGING_DIR/../host/share/libtool" -+ aclocaldir="$STAGING_DIR/../host/share/aclocal" -+ else -+ datadir=@datadir@ -+ pkgdatadir=@pkgdatadir@ -+ pkgltdldir=@pkgdatadir@ -+ aclocaldir=@aclocaldir@ -+ fi - auxdir= - macrodir= - configure_ac=configure.in ---- a/libtoolize.m4sh -+++ b/libtoolize.m4sh -@@ -1453,10 +1453,17 @@ func_check_macros () - - # Locations for important files: - prefix=@prefix@ -- datadir=@datadir@ -- pkgdatadir=@pkgdatadir@ -- pkgltdldir=@pkgdatadir@ -- aclocaldir=@aclocaldir@ -+ if test -n "$STAGING_DIR"; then -+ datadir="$STAGING_DIR/../host/share" -+ pkgdatadir="$STAGING_DIR/../host/share/libtool" -+ pkgltdldir="$STAGING_DIR/../host/share/libtool" -+ aclocaldir="$STAGING_DIR/../host/share/aclocal" -+ else -+ datadir=@datadir@ -+ pkgdatadir=@pkgdatadir@ -+ pkgltdldir=@pkgdatadir@ -+ aclocaldir=@aclocaldir@ -+ fi - auxdir= - macrodir= - configure_ac=configure.in ---- a/libltdl/m4/libtool.m4 -+++ b/libltdl/m4/libtool.m4 -@@ -907,9 +907,8 @@ dnl AC_DEFUN([AC_LIBTOOL_RC], []) + ## -------------------------- ## +--- a/m4/libtool.m4 ++++ b/m4/libtool.m4 +@@ -929,9 +929,8 @@ dnl AC_DEFUN([AC_LIBTOOL_RC], []) # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl @@ -115,7 +47,7 @@ _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl -@@ -7660,9 +7659,9 @@ m4_defun([_LT_DECL_EGREP], +@@ -8160,9 +8159,9 @@ m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep @@ -128,7 +60,7 @@ dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) -@@ -7695,9 +7694,8 @@ AC_SUBST([DLLTOOL]) +@@ -8195,9 +8194,8 @@ AC_SUBST([DLLTOOL]) # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED diff --git a/tools/libtool/patches/100-libdir-fixes.patch b/tools/libtool/patches/100-libdir-fixes.patch index 3df2b14b60..dd17dd97e5 100644 --- a/tools/libtool/patches/100-libdir-fixes.patch +++ b/tools/libtool/patches/100-libdir-fixes.patch @@ -1,83 +1,56 @@ ---- a/libltdl/config/ltmain.m4sh -+++ b/libltdl/config/ltmain.m4sh -@@ -5731,8 +5731,14 @@ func_mode_link () - absdir="$abs_ladir" - libdir="$abs_ladir" +From 67ffe8e8582a7ba1f1d1307a419098e6dd88bdaf Mon Sep 17 00:00:00 2001 +From: Eneas U de Queiroz +Date: Tue, 20 Jul 2021 16:41:11 -0300 +Subject: openwrt: cross-compilation path adjustments + +Comments from the patch: + +Adding 'libdir' from the .la file to our library search paths +breaks crosscompilation horribly. We cheat here and don't add +it, instead adding the path where we found the .la. -CL + +OE sets installed=no in staging. We need to look in $objdir and $absdir, +preferring $objdir. RP 31/04/2008 + +This was originally commited to openwrt by Jo-Philipp Wich +. + +(adjusted to v2.4.6) +Signed-off-by: Eneas U de Queiroz + +--- a/build-aux/ltmain.in ++++ b/build-aux/ltmain.in +@@ -6049,8 +6049,14 @@ func_mode_link () + absdir=$abs_ladir + libdir=$abs_ladir else -- dir="$lt_sysroot$libdir" -- absdir="$lt_sysroot$libdir" +- dir=$lt_sysroot$libdir +- absdir=$lt_sysroot$libdir + # Adding 'libdir' from the .la file to our library search paths + # breaks crosscompilation horribly. We cheat here and don't add + # it, instead adding the path where we found the .la. -CL + dir="$lt_sysroot$abs_ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" -+ #dir="$libdir" -+ #absdir="$lt_sysroot$libdir" ++ #dir=$lt_sysroot$libdir ++ #absdir=$lt_sysroot$libdir fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + test yes = "$hardcode_automatic" && avoidtemprpath=yes else -@@ -6130,8 +6136,6 @@ func_mode_link () - add="$libdir/$linklib" +@@ -6448,8 +6454,6 @@ func_mode_link () + add=$libdir/$linklib fi else - # We cannot seem to hardcode it, guess we'll fake it. -- add_dir="-L$libdir" +- add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in -@@ -6286,7 +6290,17 @@ func_mode_link () +@@ -6604,7 +6608,17 @@ func_mode_link () fi ;; *) -- path="-L$absdir/$objdir" -+ # OE sets installed=no in staging. We need to look in $objdir and $absdir, -+ # preferring $objdir. RP 31/04/2008 -+ if test -f "$absdir/$objdir/$depdepl" ; then -+ depdepl="$absdir/$objdir/$depdepl" -+ path="-L$absdir/$objdir" -+ elif test -f "$absdir/$depdepl" ; then -+ depdepl="$absdir/$depdepl" -+ path="-L$absdir" -+ else -+ path="-L$absdir/$objdir" -+ fi - ;; - esac - else ---- a/libltdl/config/ltmain.sh -+++ b/libltdl/config/ltmain.sh -@@ -6518,8 +6518,14 @@ func_mode_link () - absdir="$abs_ladir" - libdir="$abs_ladir" - else -- dir="$lt_sysroot$libdir" -- absdir="$lt_sysroot$libdir" -+ # Adding 'libdir' from the .la file to our library search paths -+ # breaks crosscompilation horribly. We cheat here and don't add -+ # it, instead adding the path where we found the .la. -CL -+ dir="$lt_sysroot$abs_ladir" -+ absdir="$abs_ladir" -+ libdir="$abs_ladir" -+ #dir="$libdir" -+ #absdir="$lt_sysroot$libdir" - fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes - else -@@ -6917,8 +6923,6 @@ func_mode_link () - add="$libdir/$linklib" - fi - else -- # We cannot seem to hardcode it, guess we'll fake it. -- add_dir="-L$libdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in -@@ -7073,7 +7077,17 @@ func_mode_link () - fi - ;; - *) -- path="-L$absdir/$objdir" +- path=-L$absdir/$objdir + # OE sets installed=no in staging. We need to look in $objdir and $absdir, + # preferring $objdir. RP 31/04/2008 + if test -f "$absdir/$objdir/$depdepl" ; then diff --git a/tools/libtool/patches/110-dont-use-target-dir-for-relinking.patch b/tools/libtool/patches/110-dont-use-target-dir-for-relinking.patch index bbfd125003..d613440167 100644 --- a/tools/libtool/patches/110-dont-use-target-dir-for-relinking.patch +++ b/tools/libtool/patches/110-dont-use-target-dir-for-relinking.patch @@ -1,20 +1,33 @@ ---- a/libltdl/config/ltmain.m4sh -+++ b/libltdl/config/ltmain.m4sh -@@ -6120,7 +6120,6 @@ func_mode_link () - test "$hardcode_direct_absolute" = no; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then -- add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in ---- a/libltdl/config/ltmain.sh -+++ b/libltdl/config/ltmain.sh -@@ -6907,7 +6907,6 @@ func_mode_link () - test "$hardcode_direct_absolute" = no; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then -- add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then +From 375833af93999f8b0a747c8a1dfa3ec8d347743d Mon Sep 17 00:00:00 2001 +From: Eneas U de Queiroz +Date: Tue, 20 Jul 2021 16:52:37 -0300 +Subject: openwrt: don't use target dir for relinking + +This was originally commited to openwrt by Jo-Philipp Wich +. + +(adjusted to v2.4.6) +Signed-off-by: Eneas U de Queiroz + +--- a/build-aux/ltmain.in ++++ b/build-aux/ltmain.in +@@ -6434,13 +6434,13 @@ func_mode_link () + add_dir= + add= + # Finalize command for both is simple: just hardcode it. +- if test yes = "$hardcode_direct" && +- test no = "$hardcode_direct_absolute"; then +- add=$libdir/$linklib +- elif test yes = "$hardcode_minus_L"; then ++ if test "$hardcode_direct" = yes && ++ test "$hardcode_direct_absolute" = no; then ++ add="$libdir/$linklib" ++ elif test "$hardcode_minus_L" = yes; then + add_dir=-L$libdir +- add=-l$name +- elif test yes = "$hardcode_shlibpath_var"; then ++ add="-l$name" ++ elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; diff --git a/tools/libtool/patches/120-strip-unsafe-dirs-for-relinking.patch b/tools/libtool/patches/120-strip-unsafe-dirs-for-relinking.patch index 8840ee0569..715c254999 100644 --- a/tools/libtool/patches/120-strip-unsafe-dirs-for-relinking.patch +++ b/tools/libtool/patches/120-strip-unsafe-dirs-for-relinking.patch @@ -1,24 +1,26 @@ ---- a/libltdl/config/ltmain.m4sh -+++ b/libltdl/config/ltmain.m4sh -@@ -2183,6 +2183,9 @@ func_mode_install () +From 7f2b8a1ab4fa1475eeeddfb84eb5b92594bfce43 Mon Sep 17 00:00:00 2001 +From: Eneas U de Queiroz +Date: Tue, 20 Jul 2021 16:54:12 -0300 +Subject: openwrt: strip unsave directories from relink command + +strip unsave directories from relink command, nuke every -L that looks +like /usr/lib or /lib + +This was originally commited to openwrt by Jo-Philipp Wich +. + +(adjusted to v2.4.6) +Signed-off-by: Eneas U de Queiroz + +--- a/build-aux/ltmain.in ++++ b/build-aux/ltmain.in +@@ -2382,6 +2382,9 @@ func_mode_install () relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi + relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/lib[^[:space:]]*%%"` + relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/usr/lib[^[:space:]]*%%"` + - func_warning "relinking \`$file'" + func_warning "relinking '$file'" func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' ---- a/libltdl/config/ltmain.sh -+++ b/libltdl/config/ltmain.sh -@@ -2973,6 +2973,9 @@ func_mode_install () - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` - fi - -+ relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/lib[^[:space:]]*%%"` -+ relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/usr/lib[^[:space:]]*%%"` -+ - func_warning "relinking \`$file'" - func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' diff --git a/tools/libtool/patches/150-trailingslash.patch b/tools/libtool/patches/130-trailingslash.patch similarity index 57% rename from tools/libtool/patches/150-trailingslash.patch rename to tools/libtool/patches/130-trailingslash.patch index 423911cf4b..fc28027a05 100644 --- a/tools/libtool/patches/150-trailingslash.patch +++ b/tools/libtool/patches/130-trailingslash.patch @@ -1,3 +1,8 @@ +From 1b45c3c0d6682be7f4876b620780ee246a5acbaa Mon Sep 17 00:00:00 2001 +From: Eneas U de Queiroz +Date: Tue, 20 Jul 2021 16:56:16 -0300 +Subject: openwrt: remove trailing slash in install destdir + A command like /bin/sh ../../i586-poky-linux-libtool --mode=install /usr/bin/install -c gck-roots-store-standalone.la '/media/data1/builds/poky1/tmp/work/core2-poky-linux/gnome-keyring-2.26.1-r1/image/usr/lib/gnome-keyring/standalone/' fails (e.g. gnome-keyring or pulseaudio) This is because libdir has a trailing slash which breaks the comparision. @@ -9,28 +14,12 @@ Merged a patch received from Gary Thomas Date: 2010/07/12 Nitin A Kamble ---- a/libltdl/config/ltmain.m4sh -+++ b/libltdl/config/ltmain.m4sh -@@ -2167,8 +2167,15 @@ func_mode_install () - func_append dir "$objdir" - - if test -n "$relink_command"; then -+ # Strip any trailing slash from the destination. -+ func_stripname '' '/' "$libdir" -+ destlibdir=$func_stripname_result -+ -+ func_stripname '' '/' "$destdir" -+ s_destdir=$func_stripname_result -+ - # Determine the prefix the user has applied to our future dir. -- inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` -+ inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that ---- a/libltdl/config/ltmain.sh -+++ b/libltdl/config/ltmain.sh -@@ -2954,8 +2954,15 @@ func_mode_install () +(adjusted to v2.4.6) +Signed-off-by: Eneas U de Queiroz + +--- a/build-aux/ltmain.in ++++ b/build-aux/ltmain.in +@@ -2363,8 +2363,15 @@ func_mode_install () func_append dir "$objdir" if test -n "$relink_command"; then diff --git a/tools/libtool/patches/140-don-t-quote-SHELL-in-Makefile.am.patch b/tools/libtool/patches/140-don-t-quote-SHELL-in-Makefile.am.patch new file mode 100644 index 0000000000..513b521834 --- /dev/null +++ b/tools/libtool/patches/140-don-t-quote-SHELL-in-Makefile.am.patch @@ -0,0 +1,72 @@ +From 879578d3f4dc9bc42aa433b1fb6b584564f83617 Mon Sep 17 00:00:00 2001 +From: Eneas U de Queiroz +Date: Wed, 21 Jul 2021 13:38:24 -0300 +Subject: openwrt: don't quote $(SHELL) in Makefile.am + +This allows to use SHELL="env bash" to get a controlled enviroment. + +Signed-off-by: Eneas U de Queiroz + +--- a/Makefile.am ++++ b/Makefile.am +@@ -46,7 +46,7 @@ EXTRA_LTLIBRARIES = + # Using 'cd' in backquotes may print the directory name, use this instead: + lt__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd + +-git_version_gen = '$(SHELL)' '$(aux_dir)/git-version-gen' '--fallback' '$(VERSION)' '.tarball-version' ++git_version_gen = $(SHELL) '$(aux_dir)/git-version-gen' '--fallback' '$(VERSION)' '.tarball-version' + rebuild = rebuild=:; revision=`$(lt__cd) $(srcdir) && $(git_version_gen) | $(SED) 's|-.*$$||'` + + +@@ -301,7 +301,7 @@ libtool: $(ltmain_sh) $(config_status) $ + if test 0 = '$(AM_DEFAULT_VERBOSITY)' && test 1 != '$(V)'; \ + then echo " GEN " $@; \ + else echo '$(SHELL) $(top_builddir)/config.status "$@"'; fi; \ +- cd '$(top_builddir)' && '$(SHELL)' ./config.status '$@'; \ ++ cd '$(top_builddir)' && $(SHELL) ./config.status '$@'; \ + fi + + +@@ -788,13 +788,13 @@ testsuite_deps_uninstalled = $(testsuite + # Hook the test suite into the check rule + check-local: $(testsuite_deps_uninstalled) + $(AM_V_at)$(CD_TESTDIR); \ +- CONFIG_SHELL='$(SHELL)' '$(SHELL)' "$$abs_srcdir/$(TESTSUITE)" \ ++ CONFIG_SHELL=$(SHELL) $(SHELL) "$$abs_srcdir/$(TESTSUITE)" \ + $(TESTS_ENVIRONMENT) $(BUILDCHECK_ENVIRONMENT) $(TESTSUITEFLAGS) + + # Run the test suite on the *installed* tree. + installcheck-local: $(testsuite_deps) + $(AM_V_at)$(CD_TESTDIR); \ +- CONFIG_SHELL='$(SHELL)' '$(SHELL)' "$$abs_srcdir/$(TESTSUITE)" \ ++ CONFIG_SHELL=$(SHELL) $(SHELL) "$$abs_srcdir/$(TESTSUITE)" \ + $(TESTS_ENVIRONMENT) $(INSTALLCHECK_ENVIRONMENT) $(TESTSUITEFLAGS) \ + AUTOTEST_PATH='$(exec_prefix)/bin' + +@@ -806,7 +806,7 @@ check-noninteractive-old: + .PHONY: check-noninteractive-new + check-noninteractive-new: $(testsuite_deps_uninstalled) + $(AM_V_at)$(CD_TESTDIR); \ +- CONFIG_SHELL='$(SHELL)' '$(SHELL)' "$$abs_srcdir/$(TESTSUITE)" \ ++ CONFIG_SHELL=$(SHELL) $(SHELL) "$$abs_srcdir/$(TESTSUITE)" \ + $(TESTS_ENVIRONMENT) $(BUILDCHECK_ENVIRONMENT) \ + -k '!interactive' INNER_TESTSUITEFLAGS=',!interactive' \ + $(TESTSUITEFLAGS) +@@ -815,7 +815,7 @@ check-noninteractive-new: $(testsuite_de + .PHONY: check-interactive + check-interactive: $(testsuite_deps_uninstalled) + $(AM_V_at)$(CD_TESTDIR); \ +- CONFIG_SHELL='$(SHELL)' '$(SHELL)' "$$abs_srcdir/$(TESTSUITE)" \ ++ CONFIG_SHELL=$(SHELL) $(SHELL) "$$abs_srcdir/$(TESTSUITE)" \ + $(TESTS_ENVIRONMENT) $(BUILDCHECK_ENVIRONMENT) \ + -k interactive -k recursive INNER_TESTSUITEFLAGS=',interactive' \ + $(TESTSUITEFLAGS) +@@ -827,7 +827,7 @@ check-noninteractive: check-noninteracti + clean-local: + -$(CD_TESTDIR); \ + test -f "$$abs_srcdir/$(TESTSUITE)" && \ +- '$(SHELL)' "$$abs_srcdir/$(TESTSUITE)" --clean ++ $(SHELL) "$$abs_srcdir/$(TESTSUITE)" --clean + + ## An empty target to depend on when a rule needs to always run + ## whenever it is visited. diff --git a/tools/libtool/patches/150-libtool-mitigate-the-sed_quote_subst-slowdown.patch b/tools/libtool/patches/150-libtool-mitigate-the-sed_quote_subst-slowdown.patch new file mode 100644 index 0000000000..27ea6a1d53 --- /dev/null +++ b/tools/libtool/patches/150-libtool-mitigate-the-sed_quote_subst-slowdown.patch @@ -0,0 +1,224 @@ +From 3adadb568fbf15d952bd25a005b6a9afb7e59dc7 Mon Sep 17 00:00:00 2001 +From: Pavel Raiskup +Date: Sun, 4 Oct 2015 21:55:03 +0200 +Subject: libtool: mitigate the $sed_quote_subst slowdown + +When it is reasonably possible, use shell implementation for +quoting. + +References: +http://lists.gnu.org/archive/html/libtool/2015-03/msg00005.html +http://lists.gnu.org/archive/html/libtool/2015-02/msg00000.html +https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20006 + +* gl/build-aux/funclib.sh (func_quote): New function that can be +used as substitution for '$SED $sed_quote_subst' call. +* build-aux/ltmain.in (func_emit_wrapper): Use func_quote instead +of '$SED $sed_quote_subst'. +(func_mode_link): Likewise. +* NEWS: Document. +* bootstrap: Sync with funclib.sh. + +(cherry picked from commit 32f0df9835ac15ac17e04be57c368172c3ad1d19) +(skipping NEWS change) +Signed-off-by: Eneas U de Queiroz + +--- a/bootstrap ++++ b/bootstrap +@@ -230,7 +230,7 @@ vc_ignore= + + # Source required external libraries: + # Set a version string for this script. +-scriptversion=2015-01-20.17; # UTC ++scriptversion=2015-10-04.22; # UTC + + # General shell script boiler plate, and helper functions. + # Written by Gary V. Vaughan, 2004 +@@ -1257,6 +1257,57 @@ func_relative_path () + } + + ++# func_quote ARG ++# -------------- ++# Aesthetically quote one ARG, store the result into $func_quote_result. Note ++# that we keep attention to performance here (so far O(N) complexity as long as ++# func_append is O(1)). ++func_quote () ++{ ++ $debug_cmd ++ ++ func_quote_result=$1 ++ ++ case $func_quote_result in ++ *[\\\`\"\$]*) ++ case $func_quote_result in ++ *'*'*|*'['*) ++ func_quote_result=`$ECHO "$func_quote_result" | $SED "$sed_quote_subst"` ++ return 0 ++ ;; ++ esac ++ ++ func_quote_old_IFS=$IFS ++ for _G_char in '\' '`' '"' '$' ++ do ++ # STATE($1) PREV($2) SEPARATOR($3) ++ set start "" "" ++ func_quote_result=dummy"$_G_char$func_quote_result$_G_char"dummy ++ IFS=$_G_char ++ for _G_part in $func_quote_result ++ do ++ case $1 in ++ quote) ++ func_append func_quote_result "$3$2" ++ set quote "$_G_part" "\\$_G_char" ++ ;; ++ start) ++ set first "" "" ++ func_quote_result= ++ ;; ++ first) ++ set quote "$_G_part" "" ++ ;; ++ esac ++ done ++ IFS=$func_quote_old_IFS ++ done ++ ;; ++ *) ;; ++ esac ++} ++ ++ + # func_quote_for_eval ARG... + # -------------------------- + # Aesthetically quote ARGs to be evaled later. +@@ -1273,12 +1324,8 @@ func_quote_for_eval () + func_quote_for_eval_unquoted_result= + func_quote_for_eval_result= + while test 0 -lt $#; do +- case $1 in +- *[\\\`\"\$]*) +- _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; +- *) +- _G_unquoted_arg=$1 ;; +- esac ++ func_quote "$1" ++ _G_unquoted_arg=$func_quote_result + if test -n "$func_quote_for_eval_unquoted_result"; then + func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" + else +--- a/build-aux/ltmain.in ++++ b/build-aux/ltmain.in +@@ -3356,7 +3356,8 @@ else + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + +- qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` ++ func_quote "$ECHO" ++ qECHO=$func_quote_result + $ECHO "\ + + # A function that is used when there is no print builtin or printf. +@@ -8618,8 +8619,8 @@ EOF + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done +- relink_command="(cd `pwd`; $relink_command)" +- relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` ++ func_quote "(cd `pwd`; $relink_command)" ++ relink_command=$func_quote_result + fi + + # Only actually do things if not in dry run mode. +@@ -8865,7 +8866,8 @@ EOF + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" +- relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` ++ func_quote "$relink_command" ++ relink_command=$func_quote_result + if test yes = "$hardcode_automatic"; then + relink_command= + fi +--- a/build-aux/funclib.sh ++++ b/build-aux/funclib.sh +@@ -1,5 +1,5 @@ + # Set a version string for this script. +-scriptversion=2015-01-20.17; # UTC ++scriptversion=2015-10-04.22; # UTC + + # General shell script boiler plate, and helper functions. + # Written by Gary V. Vaughan, 2004 +@@ -1026,6 +1026,57 @@ func_relative_path () + } + + ++# func_quote ARG ++# -------------- ++# Aesthetically quote one ARG, store the result into $func_quote_result. Note ++# that we keep attention to performance here (so far O(N) complexity as long as ++# func_append is O(1)). ++func_quote () ++{ ++ $debug_cmd ++ ++ func_quote_result=$1 ++ ++ case $func_quote_result in ++ *[\\\`\"\$]*) ++ case $func_quote_result in ++ *[\[\*\?]*) ++ func_quote_result=`$ECHO "$func_quote_result" | $SED "$sed_quote_subst"` ++ return 0 ++ ;; ++ esac ++ ++ func_quote_old_IFS=$IFS ++ for _G_char in '\' '`' '"' '$' ++ do ++ # STATE($1) PREV($2) SEPARATOR($3) ++ set start "" "" ++ func_quote_result=dummy"$_G_char$func_quote_result$_G_char"dummy ++ IFS=$_G_char ++ for _G_part in $func_quote_result ++ do ++ case $1 in ++ quote) ++ func_append func_quote_result "$3$2" ++ set quote "$_G_part" "\\$_G_char" ++ ;; ++ start) ++ set first "" "" ++ func_quote_result= ++ ;; ++ first) ++ set quote "$_G_part" "" ++ ;; ++ esac ++ done ++ IFS=$func_quote_old_IFS ++ done ++ ;; ++ *) ;; ++ esac ++} ++ ++ + # func_quote_for_eval ARG... + # -------------------------- + # Aesthetically quote ARGs to be evaled later. +@@ -1042,12 +1093,8 @@ func_quote_for_eval () + func_quote_for_eval_unquoted_result= + func_quote_for_eval_result= + while test 0 -lt $#; do +- case $1 in +- *[\\\`\"\$]*) +- _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; +- *) +- _G_unquoted_arg=$1 ;; +- esac ++ func_quote "$1" ++ _G_unquoted_arg=$func_quote_result + if test -n "$func_quote_for_eval_unquoted_result"; then + func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" + else diff --git a/tools/libtool/patches/160-passthrough-ssp.patch b/tools/libtool/patches/160-passthrough-ssp.patch deleted file mode 100644 index da44c614e3..0000000000 --- a/tools/libtool/patches/160-passthrough-ssp.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur libtool-2.4.orig/libltdl/config/ltmain.m4sh libtool-2.4/libltdl/config/ltmain.m4sh ---- libtool-2.4.orig/libltdl/config/ltmain.m4sh 2015-06-18 10:46:15.499996979 +0200 -+++ libtool-2.4/libltdl/config/ltmain.m4sh 2015-06-18 10:48:24.686882213 +0200 -@@ -5076,7 +5076,7 @@ - # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -- -O*|-flto*|-fwhopr*|-fuse-linker-plugin) -+ -O*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - func_append compile_command " $arg" diff --git a/tools/libtool/patches/200-openwrt-branding.patch b/tools/libtool/patches/200-openwrt-branding.patch index 3fc0afb866..95fa8c0f37 100644 --- a/tools/libtool/patches/200-openwrt-branding.patch +++ b/tools/libtool/patches/200-openwrt-branding.patch @@ -1,112 +1,24 @@ ---- a/libltdl/config/general.m4sh -+++ b/libltdl/config/general.m4sh -@@ -359,7 +359,7 @@ opt_warning=: - # name if it has been set yet. - func_echo () - { -- $ECHO "$progname: ${opt_mode+$opt_mode: }$*" -+ $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }$*" +From 90707200efadc8e230635c7c204c9c272cbc8631 Mon Sep 17 00:00:00 2001 +From: Eneas U de Queiroz +Date: Tue, 20 Jul 2021 17:01:03 -0300 +Subject: openwrt: add openwrt branding + +This prepends program name with "OpenWrt-". + +This was originally commited to openwrt by Jo-Philipp Wich +. + +(adjusted to v2.4.6) +Signed-off-by: Eneas U de Queiroz + +--- a/build-aux/ltmain.in ++++ b/build-aux/ltmain.in +@@ -82,7 +82,7 @@ func_echo () + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS +- $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" ++ $ECHO "OpenWrt-$progname${opt_mode+: $opt_mode}: $_G_line" + done + IFS=$func_echo_IFS } - - # func_verbose arg... -@@ -385,14 +385,14 @@ func_echo_all () - # Echo program name prefixed message to standard error. - func_error () - { -- $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 -+ $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 - } - - # func_warning arg... - # Echo program name prefixed warning message to standard error. - func_warning () - { -- $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 -+ $opt_warning && $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 - - # bash bug again: - : ---- a/libltdl/config/ltmain.sh -+++ b/libltdl/config/ltmain.sh -@@ -439,7 +439,7 @@ opt_warning=: - # name if it has been set yet. - func_echo () - { -- $ECHO "$progname: ${opt_mode+$opt_mode: }$*" -+ $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }$*" - } - - # func_verbose arg... -@@ -465,14 +465,14 @@ func_echo_all () - # Echo program name prefixed message to standard error. - func_error () - { -- $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 -+ $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 - } - - # func_warning arg... - # Echo program name prefixed warning message to standard error. - func_warning () - { -- $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 -+ $opt_warning && $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 - - # bash bug again: - : ---- a/libtoolize.in -+++ b/libtoolize.in -@@ -648,7 +648,7 @@ opt_warning=: - # name if it has been set yet. - func_echo () - { -- $ECHO "$progname: ${opt_mode+$opt_mode: }$*" -+ $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }$*" - } - - # func_verbose arg... -@@ -674,14 +674,14 @@ func_echo_all () - # Echo program name prefixed message to standard error. - func_error () - { -- $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 -+ $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 - } - - # func_warning arg... - # Echo program name prefixed warning message to standard error. - func_warning () - { -- $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 -+ $opt_warning && $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 - - # bash bug again: - : ---- a/tests/defs.in -+++ b/tests/defs.in -@@ -596,7 +596,7 @@ opt_warning=: - # name if it has been set yet. - func_echo () - { -- $ECHO "$progname: ${opt_mode+$opt_mode: }$*" -+ $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }$*" - } - - # func_verbose arg... -@@ -622,14 +622,14 @@ func_echo_all () - # Echo program name prefixed message to standard error. - func_error () - { -- $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 -+ $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 - } - - # func_warning arg... - # Echo program name prefixed warning message to standard error. - func_warning () - { -- $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 -+ $opt_warning && $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 - - # bash bug again: - : From 40614a630c81150709589dc5da62b46f9f5fbdcd Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 18 Sep 2021 00:10:56 -0700 Subject: [PATCH 31/38] tools/bison: update to 3.8.1 Remove upstreamed patch. Signed-off-by: Rosen Penev --- tools/bison/Makefile | 4 ++-- tools/bison/patches/100-fix-gets-removal.patch | 17 ----------------- 2 files changed, 2 insertions(+), 19 deletions(-) delete mode 100644 tools/bison/patches/100-fix-gets-removal.patch diff --git a/tools/bison/Makefile b/tools/bison/Makefile index f46894c71b..ba3dd946ec 100644 --- a/tools/bison/Makefile +++ b/tools/bison/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bison -PKG_VERSION:=3.7.6 +PKG_VERSION:=3.8.1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/$(PKG_NAME) -PKG_HASH:=67d68ce1e22192050525643fc0a7a22297576682bef6a5c51446903f5aeef3cf +PKG_HASH:=31fc602488aad6bdecf0ccc556e0fc72fc57cdc595cf92398f020e0cf4980f15 HOST_BUILD_PARALLEL:=1 diff --git a/tools/bison/patches/100-fix-gets-removal.patch b/tools/bison/patches/100-fix-gets-removal.patch deleted file mode 100644 index 534713f180..0000000000 --- a/tools/bison/patches/100-fix-gets-removal.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- a/lib/stdio.in.h -+++ b/lib/stdio.in.h -@@ -835,14 +835,6 @@ _GL_WARN_ON_USE (getline, "getline is un - # endif - #endif - --/* It is very rare that the developer ever has full control of stdin, -- so any use of gets warrants an unconditional warning; besides, C11 -- removed it. */ --#undef gets --#if HAVE_RAW_DECL_GETS && !defined __cplusplus --_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); --#endif -- - #if defined _WIN32 && !defined __CYGWIN__ - # undef getw - # define getw _getw From 164b915c2c52d12141a0914d2b0a8145a3588b72 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 18 Sep 2021 00:20:45 -0700 Subject: [PATCH 32/38] tools/fakeroot: update to 1.26 Remove upstreamed patches. Refresh other. Signed-off-by: Rosen Penev --- tools/fakeroot/Makefile | 4 +- tools/fakeroot/patches/100-portability.patch | 138 ----------------- .../300-glibc-2.33-compatibility.patch | 145 ------------------ .../patches/301-glibc-2.33-compat-fixes.patch | 42 ----- .../patches/400-alpine-libc.musl-fix.patch | 2 +- 5 files changed, 3 insertions(+), 328 deletions(-) delete mode 100644 tools/fakeroot/patches/100-portability.patch delete mode 100644 tools/fakeroot/patches/300-glibc-2.33-compatibility.patch delete mode 100644 tools/fakeroot/patches/301-glibc-2.33-compat-fixes.patch diff --git a/tools/fakeroot/Makefile b/tools/fakeroot/Makefile index 61bc27b90e..5c5f25e226 100644 --- a/tools/fakeroot/Makefile +++ b/tools/fakeroot/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fakeroot -PKG_VERSION:=1.25.3 +PKG_VERSION:=1.26 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz PKG_SOURCE_URL:=@DEBIAN/pool/main/f/fakeroot -PKG_HASH:=8e903683357f7f5bcc31b879fd743391ad47691d4be33d24a76be3b6c21e956c +PKG_HASH:=480a578ffdc5592e73df4c086950d321b4adc78dbdaec56c82e4fe1fb68de8e9 PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=COPYING PKG_FIXUP:=autoreconf diff --git a/tools/fakeroot/patches/100-portability.patch b/tools/fakeroot/patches/100-portability.patch deleted file mode 100644 index 7ba12996be..0000000000 --- a/tools/fakeroot/patches/100-portability.patch +++ /dev/null @@ -1,138 +0,0 @@ ---- a/libfakeroot.c -+++ b/libfakeroot.c -@@ -112,8 +112,16 @@ - #define INT_SEND_STAT(a,b) SEND_STAT(a,b,_STAT_VER) - #define INT_SEND_GET_XATTR(a,b) SEND_GET_XATTR(a,b,_STAT_VER) - #define INT_SEND_GET_STAT(a,b) SEND_GET_STAT(a,b) -+ -+/* 10.10 uses id_t in getpriority/setpriority calls, so pretend -+ id_t is used everywhere, just happens to be int on some OSes */ -+#ifndef _ID_T -+#define _ID_T -+typedef int id_t; -+#endif - #endif - -+#include - #include - #include - #include -@@ -125,7 +133,6 @@ - #include - #include - #include --#include - #ifdef HAVE_SYS_ACL_H - #include - #endif /* HAVE_SYS_ACL_H */ -@@ -188,6 +195,15 @@ extern int unsetenv (const char *name); - #undef __lxstat64 - #undef _FILE_OFFSET_BITS - -+ -+#ifndef AT_EMPTY_PATH -+#define AT_EMPTY_PATH 0 -+#endif -+ -+#ifndef AT_NO_AUTOMOUNT -+#define AT_NO_AUTOMOUNT 0 -+#endif -+ - /* - // next_wrap_st: - // this structure is used in next_wrap, which is defined in -@@ -1911,7 +1927,7 @@ ssize_t fremovexattr(int fd, const char - } - #endif /* HAVE_FREMOVEXATTR */ - --int setpriority(int which, int who, int prio){ -+int setpriority(int which, id_t who, int prio){ - if (fakeroot_disabled) - return next_setpriority(which, who, prio); - next_setpriority(which, who, prio); -@@ -2520,3 +2536,19 @@ int sysinfo(int command, char *buf, long - } - } - #endif -+ -+#ifdef HAVE_OPENAT -+int openat(int dir_fd, const char *pathname, int flags, ...) -+{ -+ mode_t mode; -+ -+ if (flags & O_CREAT) { -+ va_list args; -+ va_start(args, flags); -+ mode = va_arg(args, int); -+ va_end(args); -+ } -+ -+ return next_openat(dir_fd, pathname, flags, mode); -+} -+#endif ---- a/wrapfunc.inp -+++ b/wrapfunc.inp -@@ -146,7 +146,7 @@ setfsgid;gid_t;(gid_t fsgid);(fsgid) - initgroups;int;(const char *user, INITGROUPS_SECOND_ARG group);(user, group) - getgroups;int;(int size, gid_t list[]);(size, list) - setgroups;int;(SETGROUPS_SIZE_TYPE size, const gid_t *list);(size, list) --setpriority;int;(int which, int who, int prio);(which, who, prio) -+setpriority;int;(int which, id_t who, int prio);(which, who, prio) - #ifdef HAVE_CAPSET - capset;int;(cap_user_header_t hdrp, const cap_user_data_t datap);(hdrp, datap) - #endif /* HAVE_CAPSET */ -@@ -198,7 +198,7 @@ fchownat;int;(int dir_fd, const char *pa - mkdirat;int;(int dir_fd, const char *pathname, mode_t mode);(dir_fd, pathname, mode) - #endif /* HAVE_MKDIRAT */ - #ifdef HAVE_OPENAT --openat;int;(int dir_fd, const char *pathname, int flags);(dir_fd, pathname, flags) -+openat;int;(int dir_fd, const char *pathname, int flags, mode_t mode);(dir_fd, pathname, flags, mode);;(int dir_fd, const char *pathname, int flags, ...) - #endif /* HAVE_OPENAT */ - #ifdef HAVE_RENAMEAT - renameat;int;(int olddir_fd, const char *oldpath, int newdir_fd, const char *newpath);(olddir_fd, oldpath, newdir_fd, newpath) ---- a/wrapawk_macosx -+++ b/wrapawk_macosx -@@ -46,26 +46,30 @@ BEGIN{ - argtype=$3; - argname=$4; - MACRO=$5; -+ argtype_def=$6 -+ if(!argtype_def) { -+ argtype_def = argtype -+ } - if(MACRO){ - print "extern " ret " MY_DEF(" name ")" argtype " __attribute__((visibility(\"hidden\")));" > headerfile; - print "INTERPOSE(MY_DEF(" name "_RAW)," name "_RAW);" > structfile; - print "#undef " name > deffile - print "#define " name " MY_DEF(" name "_RAW)" > deffile - -- print "extern " ret, name, argtype ";" > tmpffile; -+ print "extern " ret, name, argtype_def ";" > tmpffile; - print "static __inline__ " ret " NEXT_" MACRO "_NOARG " argtype " __attribute__((always_inline));" > tmpffile; - print "static __inline__ " ret " NEXT_" MACRO "_NOARG " argtype " {" > tmpffile; - print " return " name, argname ";" > tmpffile; - print "}" > tmpffile; - print "" > tmpffile; - } else { -- print "extern " ret " my_" name, argtype " __attribute__((visibility(\"hidden\")));" > headerfile; -+ print "extern " ret " my_" name, argtype_def " __attribute__((visibility(\"hidden\")));" > headerfile; - print "#undef " name > structfile; - print "INTERPOSE(my_" name "," name ");" > structfile; - print "#define " name " my_" name > structfile - print "#define " name " my_" name > deffile - -- print "extern " ret, name, argtype ";" > tmpffile; -+ print "extern " ret, name, argtype_def ";" > tmpffile; - if(argname){ - print "static __inline__ " ret " next_" name, argtype " __attribute__((always_inline));" > tmpffile; - print "static __inline__ " ret " next_" name, argtype " {" > tmpffile; ---- a/configure.ac -+++ b/configure.ac -@@ -146,6 +146,7 @@ for first in size_t int; do - #include - #endif - #include -+#include - #ifdef HAVE_GRP_H - #include - #endif diff --git a/tools/fakeroot/patches/300-glibc-2.33-compatibility.patch b/tools/fakeroot/patches/300-glibc-2.33-compatibility.patch deleted file mode 100644 index a460cace0c..0000000000 --- a/tools/fakeroot/patches/300-glibc-2.33-compatibility.patch +++ /dev/null @@ -1,145 +0,0 @@ ---- a/libfakeroot.c -+++ b/libfakeroot.c -@@ -90,6 +90,16 @@ - #define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b) - #endif - -+#ifndef _STAT_VER -+ #if defined (__aarch64__) -+ #define _STAT_VER 0 -+ #elif defined (__x86_64__) -+ #define _STAT_VER 1 -+ #else -+ #define _STAT_VER 3 -+ #endif -+#endif -+ - /* - These INT_* (which stands for internal) macros should always be used when - the fakeroot library owns the storage of the stat variable. -@@ -1358,6 +1368,54 @@ int renameat(int olddir_fd, const char * - #endif /* HAVE_FSTATAT */ - - -+#if defined(__GLIBC__) && __GLIBC_PREREQ(2,33) -+/* Glibc 2.33 exports symbols for these functions in the shared lib */ -+ int lstat(const char *file_name, struct stat *statbuf) { -+ return WRAP_LSTAT LSTAT_ARG(_STAT_VER, file_name, statbuf); -+ } -+ int stat(const char *file_name, struct stat *st) { -+ return WRAP_STAT STAT_ARG(_STAT_VER, file_name, st); -+ } -+ int fstat(int fd, struct stat *st) { -+ return WRAP_FSTAT FSTAT_ARG(_STAT_VER, fd, st); -+ } -+ -+ #ifdef HAVE_FSTATAT -+ int fstatat(int dir_fd, const char *path, struct stat *st, int flags) { -+ return WRAP_FSTATAT FSTATAT_ARG(_STAT_VER, dir_fd, path, st, flags); -+ } -+ #endif -+ -+ #ifdef STAT64_SUPPORT -+ int lstat64(const char *file_name, struct stat64 *st) { -+ return WRAP_LSTAT64 LSTAT64_ARG(_STAT_VER, file_name, st); -+ } -+ int stat64(const char *file_name, struct stat64 *st) { -+ return WRAP_STAT64 STAT64_ARG(_STAT_VER, file_name, st); -+ } -+ int fstat64(int fd, struct stat64 *st) { -+ return WRAP_FSTAT64 FSTAT64_ARG(_STAT_VER, fd, st); -+ } -+ -+ #ifdef HAVE_FSTATAT -+ int fstatat64(int dir_fd, const char *path, struct stat64 *st, int flags) { -+ return WRAP_FSTATAT64 FSTATAT64_ARG(_STAT_VER, dir_fd, path, st, flags); -+ } -+ #endif -+ #endif -+ -+ int mknod(const char *pathname, mode_t mode, dev_t dev) { -+ return WRAP_MKNOD MKNOD_ARG(_STAT_VER, pathname, mode, &dev); -+ } -+ -+ #if defined(HAVE_FSTATAT) && defined(HAVE_MKNODAT) -+ int mknodat(int dir_fd, const char *pathname, mode_t mode, dev_t dev) { -+ return WRAP_MKNODAT MKNODAT_ARG(_STAT_VER, dir_fd, pathname, mode, &dev); -+ } -+ #endif -+#endif /* GLIBC_PREREQ */ -+ -+ - #ifdef FAKEROOT_FAKENET - pid_t fork(void) - { -@@ -2024,11 +2082,7 @@ FTSENT *fts_read(FTS *ftsp) { - || r->fts_info == FTS_NS || r->fts_info == FTS_NSOK)) - r->fts_statp = NULL; /* Otherwise fts_statp may be a random pointer */ - if(r && r->fts_statp) { /* Should we bother checking fts_info here? */ --# if defined(STAT64_SUPPORT) && !defined(__APPLE__) -- SEND_GET_STAT64(r->fts_statp, _STAT_VER); --# else - SEND_GET_STAT(r->fts_statp, _STAT_VER); --# endif - } - - return r; -@@ -2047,11 +2101,7 @@ FTSENT *fts_children(FTS *ftsp, int opti - first=next_fts_children(ftsp, options); - for(r = first; r; r = r->fts_link) { - if(r && r->fts_statp) { /* Should we bother checking fts_info here? */ --# if defined(STAT64_SUPPORT) && !defined(__APPLE__) -- SEND_GET_STAT64(r->fts_statp, _STAT_VER); --# else - SEND_GET_STAT(r->fts_statp, _STAT_VER); --# endif - } - } - -@@ -2483,7 +2533,7 @@ int statx (int dirfd, const char *path, - - #ifdef LIBFAKEROOT_DEBUGGING - if (fakeroot_debug) { -- fprintf(stderr, "statx fd %d\n", fd); -+ fprintf(stderr, "statx fd %d\n", dirfd); - } - #endif /* LIBFAKEROOT_DEBUGGING */ - r=INT_NEXT_FSTATAT(dirfd, path, &st, flags); ---- a/configure.ac -+++ b/configure.ac -@@ -184,13 +184,13 @@ AC_MSG_CHECKING([for type of arg of __xm - ]], [[ - int __xmknod ( int ver, - const char *pathname , -- mode_t mode , dev_t dev); -+ mode_t mode , dev_t *dev); - ]])],[ -- AC_DEFINE(XMKNOD_FRTH_ARG,) -- AC_MSG_RESULT([no extra *]) -- ],[ - AC_DEFINE(XMKNOD_FRTH_ARG,[*]) - AC_MSG_RESULT([needs *]) -+ ],[ -+ AC_DEFINE(XMKNOD_FRTH_ARG,) -+ AC_MSG_RESULT([no extra *]) - - ]) - -@@ -211,13 +211,13 @@ AC_MSG_CHECKING([for type of arg of __xm - int __xmknodat ( int ver, - int dirfd, - const char *pathname , -- mode_t mode , dev_t dev); -+ mode_t mode , dev_t *dev); - ]])],[ -- AC_DEFINE(XMKNODAT_FIFTH_ARG,) -- AC_MSG_RESULT([no extra *]) -- ],[ - AC_DEFINE(XMKNODAT_FIFTH_ARG,[*]) - AC_MSG_RESULT([needs *]) -+ ],[ -+ AC_DEFINE(XMKNODAT_FIFTH_ARG,) -+ AC_MSG_RESULT([no extra *]) - - ]) - diff --git a/tools/fakeroot/patches/301-glibc-2.33-compat-fixes.patch b/tools/fakeroot/patches/301-glibc-2.33-compat-fixes.patch deleted file mode 100644 index 0b91d65edb..0000000000 --- a/tools/fakeroot/patches/301-glibc-2.33-compat-fixes.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- a/libfakeroot.c -+++ b/libfakeroot.c -@@ -1368,7 +1368,8 @@ int renameat(int olddir_fd, const char * - #endif /* HAVE_FSTATAT */ - - --#if defined(__GLIBC__) && __GLIBC_PREREQ(2,33) -+#if defined(__GLIBC__) -+#if __GLIBC_PREREQ(2,33) - /* Glibc 2.33 exports symbols for these functions in the shared lib */ - int lstat(const char *file_name, struct stat *statbuf) { - return WRAP_LSTAT LSTAT_ARG(_STAT_VER, file_name, statbuf); -@@ -1413,6 +1414,7 @@ int renameat(int olddir_fd, const char * - return WRAP_MKNODAT MKNODAT_ARG(_STAT_VER, dir_fd, pathname, mode, &dev); - } - #endif -+#endif /* __GLIBC__ */ - #endif /* GLIBC_PREREQ */ - - ---- a/configure.ac -+++ b/configure.ac -@@ -182,6 +182,9 @@ AC_MSG_CHECKING([for type of arg of __xm - #include - #include - ]], [[ -+#ifndef __GLIBC__ -+#error no extra * -+#endif - int __xmknod ( int ver, - const char *pathname , - mode_t mode , dev_t *dev); -@@ -208,6 +211,9 @@ AC_MSG_CHECKING([for type of arg of __xm - #include - #include - ]], [[ -+#ifndef __GLIBC__ -+#error no extra * -+#endif - int __xmknodat ( int ver, - int dirfd, - const char *pathname , diff --git a/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch b/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch index 619b092ca9..c37282af5d 100644 --- a/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch +++ b/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch @@ -21,7 +21,7 @@ Error relocating openwrt/staging_dir/host/lib/libfakeroot.so: SEND_GET_XATTR: sy #define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b) #endif -@@ -125,8 +127,9 @@ +@@ -131,8 +133,9 @@ /* 10.10 uses id_t in getpriority/setpriority calls, so pretend id_t is used everywhere, just happens to be int on some OSes */ From a62ae81c66138927a1b3ab308a90c3068c2e9f99 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 3 Mar 2021 18:00:26 -0800 Subject: [PATCH 33/38] tools/m4: update to 1.4.19 Remove upstreamed patches. Signed-off-by: Rosen Penev --- tools/m4/Makefile | 4 +- .../m4/patches/001-fix-macos-vasnprintf.patch | 25 ---- .../010-glibc-change-work-around.patch | 118 ------------------ 3 files changed, 2 insertions(+), 145 deletions(-) delete mode 100644 tools/m4/patches/001-fix-macos-vasnprintf.patch delete mode 100644 tools/m4/patches/010-glibc-change-work-around.patch diff --git a/tools/m4/Makefile b/tools/m4/Makefile index a6d931b0fd..0a358c35f1 100644 --- a/tools/m4/Makefile +++ b/tools/m4/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=m4 PKG_CPE_ID:=cpe:/a:gnu:m4 -PKG_VERSION:=1.4.18 +PKG_VERSION:=1.4.19 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/$(PKG_NAME) -PKG_HASH:=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07 +PKG_HASH:=63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96 PKG_CAT:=xzcat HOST_BUILD_PARALLEL:=1 diff --git a/tools/m4/patches/001-fix-macos-vasnprintf.patch b/tools/m4/patches/001-fix-macos-vasnprintf.patch deleted file mode 100644 index e41315d34e..0000000000 --- a/tools/m4/patches/001-fix-macos-vasnprintf.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- a/lib/vasnprintf.c -+++ b/lib/vasnprintf.c -@@ -4858,7 +4858,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t * - #endif - *fbp = dp->conversion; - #if USE_SNPRINTF --# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) -+# if ! (((__GLIBC__ > 2 \ -+ || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) \ -+ && !defined __UCLIBC__) \ -+ || (defined __APPLE__ && defined __MACH__) \ -+ || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) - fbp[1] = '%'; - fbp[2] = 'n'; - fbp[3] = '\0'; -@@ -4872,6 +4876,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t * - in format strings in writable memory may crash the program - (if compiled with _FORTIFY_SOURCE=2), so we should avoid it - in this situation. */ -+ /* macOS 10.13 High Sierra behaves like glibc with -+ _FORTIFY_SOURCE=2, and older macOS releases -+ presumably do not need %n. */ - /* On native Windows systems (such as mingw), we can avoid using - %n because: - - Although the gl_SNPRINTF_TRUNCATION_C99 test fails, diff --git a/tools/m4/patches/010-glibc-change-work-around.patch b/tools/m4/patches/010-glibc-change-work-around.patch deleted file mode 100644 index 0ef6216965..0000000000 --- a/tools/m4/patches/010-glibc-change-work-around.patch +++ /dev/null @@ -1,118 +0,0 @@ -Subject: Workaround change in glibc - -Temporary workaround to compile with glibc 2.28, which -deprecated some constants - -Taken from the rpms/m4 Fedora repository, commit 814d5921 -(Work around change in glibc) - -Original filename: m4-1.4.18-glibc-change-work-around.patch - ---- a/lib/stdio-impl.h -+++ b/lib/stdio-impl.h -@@ -18,6 +18,12 @@ - the same implementation of stdio extension API, except that some fields - have different naming conventions, or their access requires some casts. */ - -+/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this -+ problem by defining it ourselves. FIXME: Do not rely on glibc -+ internals. */ -+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN -+# define _IO_IN_BACKUP 0x100 -+#endif - - /* BSD stdio derived implementations. */ - ---- a/lib/fflush.c -+++ b/lib/fflush.c -@@ -33,7 +33,7 @@ - #undef fflush - - --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - - /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */ - static void -@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp) - - #endif - --#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) -+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) - - # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT - /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ -@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream) - if (stream == NULL || ! freading (stream)) - return fflush (stream); - --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - - clear_ungetc_buffer_preserving_position (stream); - ---- a/lib/fpending.c -+++ b/lib/fpending.c -@@ -32,7 +32,7 @@ __fpending (FILE *fp) - /* Most systems provide FILE as a struct and the necessary bitmask in - , because they need it for implementing getc() and putc() as - fast macros. */ --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - return fp->_IO_write_ptr - fp->_IO_write_base; - #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ - /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ ---- a/lib/fpurge.c -+++ b/lib/fpurge.c -@@ -62,7 +62,7 @@ fpurge (FILE *fp) - /* Most systems provide FILE as a struct and the necessary bitmask in - , because they need it for implementing getc() and putc() as - fast macros. */ --# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - fp->_IO_read_end = fp->_IO_read_ptr; - fp->_IO_write_ptr = fp->_IO_write_base; - /* Avoid memory leak when there is an active ungetc buffer. */ ---- a/lib/freadahead.c -+++ b/lib/freadahead.c -@@ -25,7 +25,7 @@ - size_t - freadahead (FILE *fp) - { --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - if (fp->_IO_write_ptr > fp->_IO_write_base) - return 0; - return (fp->_IO_read_end - fp->_IO_read_ptr) ---- a/lib/freading.c -+++ b/lib/freading.c -@@ -31,7 +31,7 @@ freading (FILE *fp) - /* Most systems provide FILE as a struct and the necessary bitmask in - , because they need it for implementing getc() and putc() as - fast macros. */ --# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - return ((fp->_flags & _IO_NO_WRITES) != 0 - || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0 - && fp->_IO_read_base != NULL)); ---- a/lib/fseeko.c -+++ b/lib/fseeko.c -@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int when - #endif - - /* These tests are based on fpurge.c. */ --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - if (fp->_IO_read_end == fp->_IO_read_ptr - && fp->_IO_write_ptr == fp->_IO_write_base - && fp->_IO_save_base == NULL) -@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int when - return -1; - } - --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - fp->_flags &= ~_IO_EOF_SEEN; - fp->_offset = pos; - #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ From f2b0893fc0e4f0a3535f4417c410211a5f2a2886 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 18 Sep 2021 00:40:41 -0700 Subject: [PATCH 34/38] tools/mtools: update to 4.0.35 Signed-off-by: Rosen Penev --- tools/mtools/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mtools/Makefile b/tools/mtools/Makefile index b7fdcb388d..5e3c950ba3 100644 --- a/tools/mtools/Makefile +++ b/tools/mtools/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mtools -PKG_VERSION:=4.0.24 +PKG_VERSION:=4.0.35 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@GNU/$(PKG_NAME) -PKG_HASH:=24f4a2da9219f98498eb1b340cd96db7ef9b684c067d1bdeb6e85efdd13b2fb9 +PKG_HASH:=34769e173751d2f0d891a08c76c80427e929b8ee43438019b8666cc3d7a44749 HOST_BUILD_PARALLEL:=1 From f20796d63155cc9071c8cf9e98133b8464a03bde Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 18 Sep 2021 00:42:03 -0700 Subject: [PATCH 35/38] tools/sparse: update to 0.6.4 Signed-off-by: Rosen Penev --- tools/sparse/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/sparse/Makefile b/tools/sparse/Makefile index 7c93b5446c..549ec3a3cc 100644 --- a/tools/sparse/Makefile +++ b/tools/sparse/Makefile @@ -6,8 +6,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sparse -PKG_VERSION:=0.6.3 -PKG_HASH:=d4f6dbad8409e8e20a19f164b2c16f1edf76438ff77cf291935fde081b61a899 +PKG_VERSION:=0.6.4 +PKG_HASH:=6ab28b4991bc6aedbd73550291360aa6ab3df41f59206a9bde9690208a6e387c PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz From 00b400024b957167b4d5b42ee3248f2ea971944b Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 18 Sep 2021 00:57:24 -0700 Subject: [PATCH 36/38] tools/sstrip: update to 3.2 Signed-off-by: Rosen Penev --- tools/sstrip/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/sstrip/Makefile b/tools/sstrip/Makefile index b41c46d95c..55a7fa7446 100644 --- a/tools/sstrip/Makefile +++ b/tools/sstrip/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sstrip -PKG_VERSION:=3.1a +PKG_VERSION:=3.2 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/ELFkickers-$(PKG_VERSION) PKG_SOURCE_URL:=https://www.muppetlabs.com/~breadbox/pub/software PKG_SOURCE:=ELFkickers-$(PKG_VERSION).tar.gz -PKG_HASH:=06430880aaf4919c5f99fc629da7000347421668c2cf32bced2d401aac276508 +PKG_HASH:=9b81e6c53e0c94fc198d9882eb737156f36d565152dc32118897c77b06a2687c PKG_RELEASE:=1 From 7457d9bc2b18f83e67ec17dc1389ce0d1abde2ac Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 18 Sep 2021 01:02:51 -0700 Subject: [PATCH 37/38] tools/autoconf-archive: update to 2021.02.19 Signed-off-by: Rosen Penev --- tools/autoconf-archive/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/autoconf-archive/Makefile b/tools/autoconf-archive/Makefile index b3d729f41d..228a27cf60 100644 --- a/tools/autoconf-archive/Makefile +++ b/tools/autoconf-archive/Makefile @@ -1,11 +1,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=autoconf-archive -PKG_VERSION:=2019.01.06 +PKG_VERSION:=2021.02.19 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/autoconf-archive -PKG_HASH:=17195c833098da79de5778ee90948f4c5d90ed1a0cf8391b4ab348e2ec511e3f +PKG_HASH:=e8a6eb9d28ddcba8ffef3fa211653239e9bf239aba6a01a6b7cfc7ceaec69cbd include $(INCLUDE_DIR)/host-build.mk From 85bdd87fc4dc43d1ac431a39e851004f609edfa1 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 18 Sep 2021 01:09:29 -0700 Subject: [PATCH 38/38] tools/e2fsprogs: update to 1.46.4 Refresh patches. Signed-off-by: Rosen Penev --- tools/e2fsprogs/Makefile | 4 ++-- tools/e2fsprogs/patches/001-exit_0_on_corrected_errors.patch | 2 +- tools/e2fsprogs/patches/002-dont-build-e4defrag.patch | 2 +- tools/e2fsprogs/patches/003-no-crond.patch | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/e2fsprogs/Makefile b/tools/e2fsprogs/Makefile index 408097f740..f8ca482224 100644 --- a/tools/e2fsprogs/Makefile +++ b/tools/e2fsprogs/Makefile @@ -9,8 +9,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=e2fsprogs PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs -PKG_VERSION:=1.46.2 -PKG_HASH:=23aa093295c94e71ef1be490c4004871c5b01d216a8cb4d111fa6c0aac354168 +PKG_VERSION:=1.46.4 +PKG_HASH:=b11042533c1b1dcf17512f0da48e05b0c573dada1dd8b762864d10f4dc399713 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz diff --git a/tools/e2fsprogs/patches/001-exit_0_on_corrected_errors.patch b/tools/e2fsprogs/patches/001-exit_0_on_corrected_errors.patch index 67a30f610b..9b9b06d540 100644 --- a/tools/e2fsprogs/patches/001-exit_0_on_corrected_errors.patch +++ b/tools/e2fsprogs/patches/001-exit_0_on_corrected_errors.patch @@ -1,6 +1,6 @@ --- a/e2fsck/e2fsck.h +++ b/e2fsck/e2fsck.h -@@ -73,7 +73,7 @@ +@@ -74,7 +74,7 @@ * Exit codes used by fsck-type programs */ #define FSCK_OK 0 /* No errors */ diff --git a/tools/e2fsprogs/patches/002-dont-build-e4defrag.patch b/tools/e2fsprogs/patches/002-dont-build-e4defrag.patch index 2a7842f655..f59cd317a1 100644 --- a/tools/e2fsprogs/patches/002-dont-build-e4defrag.patch +++ b/tools/e2fsprogs/patches/002-dont-build-e4defrag.patch @@ -1,6 +1,6 @@ --- a/misc/Makefile.in +++ b/misc/Makefile.in -@@ -11,7 +11,7 @@ INSTALL = @INSTALL@ +@@ -12,7 +12,7 @@ MKDIR_P = @MKDIR_P@ @MCONFIG@ diff --git a/tools/e2fsprogs/patches/003-no-crond.patch b/tools/e2fsprogs/patches/003-no-crond.patch index 87b50bff2b..a7ea52b1ac 100644 --- a/tools/e2fsprogs/patches/003-no-crond.patch +++ b/tools/e2fsprogs/patches/003-no-crond.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -14525,7 +14525,7 @@ $as_echo_n "checking for system crontab +@@ -12538,7 +12538,7 @@ $as_echo_n "checking for system crontab { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${crond_dir}" >&5 $as_echo "${crond_dir}" >&6; }