diff --git a/include/kernel-6.1 b/include/kernel-6.1 index 1f97e8f301..dcdebfc6cb 100644 --- a/include/kernel-6.1 +++ b/include/kernel-6.1 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.1 = .98 -LINUX_KERNEL_HASH-6.1.98 = 97cdc9127c7700556ea0891267a0c24cf372f4b81636fb8203a914f3a69f3406 +LINUX_VERSION-6.1 = .99 +LINUX_KERNEL_HASH-6.1.99 = c086ee9ce2b1eeba6e085d569bc97ae764a5d15f6322847f0ebc9f787ae34dd3 diff --git a/include/target.mk b/include/target.mk index d2464a68b7..4bb91fe3a7 100644 --- a/include/target.mk +++ b/include/target.mk @@ -6,25 +6,6 @@ ifneq ($(__target_inc),1) __target_inc=1 -ifneq ($(DUMP),) - # Parse generic config that might be set before a .config is generated to modify the - # default package configuration - # Keep DYNAMIC_DEF_PKG_CONF in sync with toplevel.mk to reflect the same configs - DYNAMIC_DEF_PKG_CONF := CONFIG_USE_APK CONFIG_SELINUX CONFIG_SMALL_FLASH CONFIG_SECCOMP - ifneq ($(wildcard $(TOPDIR)/.config),) - $(foreach config, $(DYNAMIC_DEF_PKG_CONF), \ - $(eval $(config) := $(shell grep "$(config)=y" $(TOPDIR)/.config 2>/dev/null)) \ - ) - # Init config that are enabled by default. Dependency are checked matching the one in - # the config. - else - ifeq ($(filter $(BOARD), uml),) - ifneq ($(filter $(ARCH), aarch64 arm armeb mips mipsel mips64 mips64el i386 powerpc x86_64),) - CONFIG_SECCOMP := y - endif - endif - endif -endif # default device type DEVICE_TYPE?=router @@ -46,28 +27,6 @@ DEFAULT_PACKAGES:=\ urandom-seed \ urngd -ifneq ($(CONFIG_USE_APK),) -DEFAULT_PACKAGES+=apk-openssl -else -DEFAULT_PACKAGES+=opkg -endif - -ifneq ($(CONFIG_SELINUX),) -DEFAULT_PACKAGES+=busybox-selinux procd-selinux -else -DEFAULT_PACKAGES+=busybox procd -endif - -# include ujail on systems with enough storage -ifeq ($(CONFIG_SMALL_FLASH),) -DEFAULT_PACKAGES+=procd-ujail -endif - -# include seccomp ld-preload hooks if kernel supports it -ifneq ($(CONFIG_SECCOMP),) -DEFAULT_PACKAGES+=procd-seccomp -endif - # For the basic set DEFAULT_PACKAGES.basic:= # For nas targets @@ -130,12 +89,53 @@ else endif endif -# Add tweaked packages -# DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.tweak) +ifneq ($(DUMP),) + # Parse generic config that might be set before a .config is generated to modify the + # default package configuration + # Keep DYNAMIC_DEF_PKG_CONF in sync with toplevel.mk to reflect the same configs + DYNAMIC_DEF_PKG_CONF := CONFIG_USE_APK CONFIG_SELINUX CONFIG_SMALL_FLASH CONFIG_SECCOMP + $(foreach config, $(DYNAMIC_DEF_PKG_CONF), \ + $(eval $(config) := $(shell grep "$(config)=y" $(TOPDIR)/.config 2>/dev/null)) \ + ) + # The config options that are enabled by default and where other default + # packages depends on needs to be set if they are missing in the .config. + ifeq ($(shell grep "CONFIG_SECCOMP" $(TOPDIR)/.config 2>/dev/null),) + ifeq ($(filter $(BOARD), uml),) + ifneq ($(filter $(ARCH), aarch64 arm armeb mips mipsel mips64 mips64el i386 powerpc x86_64),) + CONFIG_SECCOMP := y + endif + endif + endif +endif + +ifneq ($(CONFIG_USE_APK),) +DEFAULT_PACKAGES+=apk-openssl +else +DEFAULT_PACKAGES+=opkg +endif + +ifneq ($(CONFIG_SELINUX),) +DEFAULT_PACKAGES+=busybox-selinux procd-selinux +else +DEFAULT_PACKAGES+=busybox procd +endif + +# include ujail on systems with enough storage +ifeq ($(CONFIG_SMALL_FLASH),) +DEFAULT_PACKAGES+=procd-ujail +endif + +# include seccomp ld-preload hooks if kernel supports it +ifneq ($(CONFIG_SECCOMP),) +DEFAULT_PACKAGES+=procd-seccomp +endif # Add device specific packages (here below to allow device type set from subtarget) DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.$(DEVICE_TYPE)) +# Add tweaked packages +# DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.tweak) + filter_packages = $(filter-out -% $(patsubst -%,%,$(filter -%,$(1))),$(1)) extra_packages = $(if $(filter wpad wpad-% nas,$(1)),iwinfo) diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index ef8d01e168..718907a711 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -165,23 +165,6 @@ part_magic_fat() { [ "$magic" = "FAT" ] || [ "$magic_fat32" = "FAT32" ] } -fitblk_get_bootdev() { - [ -e /sys/firmware/devicetree/base/chosen/rootdisk ] || return - - local rootdisk="$(cat /sys/firmware/devicetree/base/chosen/rootdisk)" - local handle bootdev - for handle in /sys/class/block/*/of_node/phandle /sys/class/block/*/device/of_node/phandle; do - [ ! -e "$handle" ] && continue - if [ "$rootdisk" = "$(cat $handle)" ]; then - bootdev="${handle%/of_node/phandle}" - bootdev="${bootdev%/device}" - bootdev="${bootdev#/sys/class/block/}" - echo "$bootdev" - break - fi - done -} - export_bootdevice() { local cmdline uuid blockdev uevent line class local MAJOR MINOR DEVNAME DEVTYPE diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic index a58e8ce227..940b63a0ae 100644 --- a/package/boot/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-envtools/files/mediatek_filogic @@ -58,17 +58,17 @@ bananapi,bpi-r4|\ bananapi,bpi-r4-poe|\ cmcc,rax3000m|\ jdcloud,re-cp-03) - . /lib/upgrade/common.sh - - bootdev="$(fitblk_get_bootdev)" - case "$bootdev" in - ubi*) + . /lib/upgrade/fit.sh + export_fitblk_bootdev + case "$CI_METHOD" in + ubi) ubootenv_add_ubi_default ;; - mmc*) - ubootenv_add_mmc_default "${bootdev%%p[0-9]*}" + emmc) + bootdev=${EMMC_KERN_DEV%%p[0-9]*} + ubootenv_add_mmc_default "${bootdev#/dev/}" ;; - mtd*) + default) ubootenv_add_nor_default ;; esac diff --git a/package/boot/uboot-envtools/files/mediatek_mt7622 b/package/boot/uboot-envtools/files/mediatek_mt7622 index 6698e06ee3..ae173fad61 100644 --- a/package/boot/uboot-envtools/files/mediatek_mt7622 +++ b/package/boot/uboot-envtools/files/mediatek_mt7622 @@ -31,17 +31,16 @@ dlink,eagle-pro-ai-m32-a1|\ dlink,eagle-pro-ai-r32-a1) ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x2000" "0x2000" ;; +bananapi,bpi-r64|\ linksys,e8450-ubi) - ubootenv_add_ubi_default - ;; -bananapi,bpi-r64) - . /lib/upgrade/common.sh - bootdev="$(fitblk_get_bootdev)" - case "$bootdev" in - mmc*) - ubootenv_add_mmc_default "${bootdev%p[0-9]*}" + . /lib/upgrade/fit.sh + export_fitblk_bootdev + case "$CI_METHOD" in + emmc) + bootdev=${EMMC_KERN_DEV%%p[0-9]*} + ubootenv_add_mmc_default "${bootdev#/dev/}" ;; - ubi*) + ubi) ubootenv_add_ubi_default ;; esac diff --git a/package/utils/fitblk/Makefile b/package/utils/fitblk/Makefile index 4da4dc46f1..8fb6e14c7e 100644 --- a/package/utils/fitblk/Makefile +++ b/package/utils/fitblk/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fitblk -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_LICENSE:=GPL-2.0-only PKG_MAINTAINER:=Daniel Golle @@ -36,6 +36,8 @@ endef define Package/fitblk/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/fitblk $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/lib/upgrade + $(INSTALL_DATA) ./files/fit.sh $(1)/lib/upgrade endef $(eval $(call BuildPackage,fitblk)) diff --git a/package/utils/fitblk/files/fit.sh b/package/utils/fitblk/files/fit.sh new file mode 100644 index 0000000000..b715a15ddf --- /dev/null +++ b/package/utils/fitblk/files/fit.sh @@ -0,0 +1,63 @@ +export_fitblk_bootdev() { + [ -e /sys/firmware/devicetree/base/chosen/rootdisk ] || return + + local rootdisk="$(cat /sys/firmware/devicetree/base/chosen/rootdisk)" + local handle bootdev + + for handle in /sys/class/mtd/mtd*/of_node/volumes/*/phandle; do + [ ! -e "$handle" ] && continue + if [ "$rootdisk" = "$(cat "$handle")" ]; then + if [ -e "${handle%/phandle}/volname" ]; then + export CI_KERNPART="$(cat "${handle%/phandle}/volname")" + elif [ -e "${handle%/phandle}/volid" ]; then + export CI_KERNVOLID="$(cat "${handle%/phandle}/volid")" + else + return + fi + export CI_UBIPART="$(cat "${handle%%/of_node*}/name")" + export CI_METHOD="ubi" + return + fi + done + + for handle in /sys/class/mtd/mtd*/of_node/phandle; do + [ ! -e "$handle" ] && continue + if [ "$rootdisk" = "$(cat $handle)" ]; then + bootdev="${handle%/of_node/phandle}" + bootdev="${bootdev#/sys/class/mtd/}" + export PART_NAME="/dev/$bootdev" + export CI_METHOD="default" + return + fi + done + + for handle in /sys/class/block/*/of_node/phandle; do + [ ! -e "$handle" ] && continue + if [ "$rootdisk" = "$(cat $handle)" ]; then + bootdev="${handle%/of_node/phandle}" + bootdev="${bootdev#/sys/class/block/}" + export EMMC_KERN_DEV="/dev/$bootdev" + export CI_METHOD="emmc" + return + fi + done +} + +fit_do_upgrade() { + export_fitblk_bootdev + [ -n "$CI_METHOD" ] || return 1 + [ -e /dev/fit0 ] && fitblk /dev/fit0 + [ -e /dev/fitrw ] && fitblk /dev/fitrw + + case "$CI_METHOD" in + emmc) + emmc_do_upgrade "$1" + ;; + default) + default_do_upgrade "$1" + ;; + ubi) + nand_do_upgrade "$1" + ;; + esac +} diff --git a/target/imagebuilder/Makefile b/target/imagebuilder/Makefile index 7fd2aa0920..7127df5ebc 100644 --- a/target/imagebuilder/Makefile +++ b/target/imagebuilder/Makefile @@ -112,6 +112,9 @@ endif -cp $(LINUX_DIR)/.config $(IB_LDIR)/ rm -f $(IB_KDIR)/root.* rm -f $(IB_KDIR)/vmlinux.debug + # remove any file for initramfs and Per Device Rootfs initramfs files + rm -f $(IB_KDIR)/vmlinux-initramfs* + rm -f $(IB_KDIR)/Image-initramfs* if [ -x $(LINUX_DIR)/scripts/dtc/dtc ]; then \ $(INSTALL_DIR) $(IB_LDIR)/scripts/dtc; \ $(INSTALL_BIN) $(LINUX_DIR)/scripts/dtc/dtc $(IB_LDIR)/scripts/dtc/dtc; \ diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index d4545037f3..3fbe9649b5 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -65,16 +65,21 @@ platform_do_upgrade() { case "$board" in abt,asr3000|\ + bananapi,bpi-r3|\ + bananapi,bpi-r3-mini|\ + bananapi,bpi-r4|\ + bananapi,bpi-r4-poe|\ + cmcc,rax3000m|\ + jdcloud,re-cp-03|\ + mediatek,mt7988a-rfb|\ nokia,ea0326gmp|\ + openwrt,one|\ tplink,tl-xdr4288|\ tplink,tl-xdr6086|\ tplink,tl-xdr6088|\ tplink,tl-xtr8488|\ xiaomi,redmi-router-ax6000-ubootmod) - [ -e /dev/fit0 ] && fitblk /dev/fit0 - [ -e /dev/fitrw ] && fitblk /dev/fitrw - CI_KERNPART="fit" - nand_do_upgrade "$1" + fit_do_upgrade "$1" ;; acer,predator-w6|\ smartrg,sdg-8612|\ @@ -94,32 +99,6 @@ platform_do_upgrade() { CI_KERNPART="linux" nand_do_upgrade "$1" ;; - bananapi,bpi-r3|\ - bananapi,bpi-r3-mini|\ - bananapi,bpi-r4|\ - bananapi,bpi-r4-poe|\ - cmcc,rax3000m|\ - jdcloud,re-cp-03|\ - mediatek,mt7988a-rfb|\ - openwrt,one) - [ -e /dev/fit0 ] && fitblk /dev/fit0 - [ -e /dev/fitrw ] && fitblk /dev/fitrw - bootdev="$(fitblk_get_bootdev)" - case "$bootdev" in - mmcblk*) - EMMC_KERN_DEV="/dev/$bootdev" - emmc_do_upgrade "$1" - ;; - mtdblock*) - PART_NAME="/dev/mtd${bootdev:8}" - default_do_upgrade "$1" - ;; - ubiblock*) - CI_KERNPART="fit" - nand_do_upgrade "$1" - ;; - esac - ;; cudy,re3000-v1|\ cudy,wr3000-v1|\ yuncore,ax835) @@ -239,11 +218,9 @@ platform_copy_config() { bananapi,bpi-r4|\ bananapi,bpi-r4-poe|\ cmcc,rax3000m) - case "$(fitblk_get_bootdev)" in - mmcblk*) + if [ "$CI_METHOD" = "emmc" ]; then emmc_copy_config - ;; - esac + fi ;; esac } diff --git a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh index 59375ccd9b..61025fb380 100755 --- a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh @@ -12,25 +12,8 @@ platform_do_upgrade() { ubnt,unifi-6-lr-v2-ubootmod|\ ubnt,unifi-6-lr-v3-ubootmod|\ xiaomi,redmi-router-ax6s) - [ -e /dev/fit0 ] && fitblk /dev/fit0 - [ -e /dev/fitrw ] && fitblk /dev/fitrw - bootdev="$(fitblk_get_bootdev)" - case "$bootdev" in - mmcblk*) - EMMC_KERN_DEV="/dev/$bootdev" - emmc_do_upgrade "$1" - ;; - mtdblock*) - PART_NAME="/dev/mtd${bootdev:8}" - default_do_upgrade "$1" - ;; - ubiblock*) - CI_KERNPART="fit" - nand_do_upgrade "$1" - ;; - esac + fit_do_upgrade "$1" ;; - buffalo,wsr-2533dhp2|\ buffalo,wsr-3200ax4s) local magic="$(get_magic_long "$1")" @@ -103,7 +86,7 @@ platform_check_image() { platform_copy_config() { case "$(board_name)" in bananapi,bpi-r64) - if fitblk_get_bootdev | grep -q mmc; then + if [ "$CI_METHOD" = "emmc" ]; then emmc_copy_config fi ;; diff --git a/target/linux/omap/Makefile b/target/linux/omap/Makefile index fc0842d056..a3c61efc9a 100644 --- a/target/linux/omap/Makefile +++ b/target/linux/omap/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk ARCH:=arm BOARD:=omap BOARDNAME:=TI OMAP3/4/AM33xx -FEATURES:=usb usbgadget ext4 targz fpu audio display nand rootfs-part squashfs source-only +FEATURES:=usb usbgadget ext4 targz fpu audio display nand rootfs-part squashfs CPU_TYPE:=cortex-a8 CPU_SUBTYPE:=vfpv3 SUBTARGETS:=generic diff --git a/target/linux/omap/patches/900-use-cpsw-ethernet-driver.patch b/target/linux/omap/patches/900-use-cpsw-ethernet-driver.patch new file mode 100644 index 0000000000..17c07fbdfb --- /dev/null +++ b/target/linux/omap/patches/900-use-cpsw-ethernet-driver.patch @@ -0,0 +1,93 @@ +From: Jan Hoffmann +Date: Sat, 27 Apr 2024 20:41:43 +0200 +Subject: ARM: dts: Use cpsw ethernet driver for some am335x devices + +The new cpsw-switch driver requires a vid for every port which is +reserved for internal usage (defaulting to 1 and 2). As a result, some +network configurations are impossible, such as a bridge with +default_pvid of 1 (even if it is not vlan aware). + +As a simple workaround, the ti,dual-emac-pvid property could be changed +to another value, but that would just shift the problem. Instead, switch +some devices back to the older cpsw ethernet driver. + +(This patch is not suitable for upstreaming, it just makes the affected +devices in OpenWrt usable again with the default network config.) + +Signed-off-by: Jan Hoffmann +--- + +--- a/arch/arm/boot/dts/am335x-bone-common.dtsi ++++ b/arch/arm/boot/dts/am335x-bone-common.dtsi +@@ -353,27 +353,24 @@ + }; + }; + +-&cpsw_port1 { ++&cpsw_emac0 { + phy-handle = <ðphy0>; + phy-mode = "mii"; +- ti,dual-emac-pvid = <1>; + }; + +-&cpsw_port2 { +- status = "disabled"; +-}; +- +-&mac_sw { ++&mac { ++ slaves = <1>; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&cpsw_default>; + pinctrl-1 = <&cpsw_sleep>; + status = "okay"; + }; + +-&davinci_mdio_sw { ++&davinci_mdio { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&davinci_mdio_default>; + pinctrl-1 = <&davinci_mdio_sleep>; ++ status = "okay"; + + ethphy0: ethernet-phy@0 { + reg = <0>; +--- a/arch/arm/boot/dts/am335x-evm.dts ++++ b/arch/arm/boot/dts/am335x-evm.dts +@@ -682,31 +682,28 @@ + }; + }; + +-&mac_sw { ++&mac { ++ slaves = <1>; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&cpsw_default>; + pinctrl-1 = <&cpsw_sleep>; + status = "okay"; + }; + +-&davinci_mdio_sw { ++&davinci_mdio { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&davinci_mdio_default>; + pinctrl-1 = <&davinci_mdio_sleep>; ++ status = "okay"; + + ethphy0: ethernet-phy@0 { + reg = <0>; + }; + }; + +-&cpsw_port1 { ++&cpsw_emac0 { + phy-handle = <ðphy0>; + phy-mode = "rgmii-id"; +- ti,dual-emac-pvid = <1>; +-}; +- +-&cpsw_port2 { +- status = "disabled"; + }; + + &tscadc {