openwrt/target/linux
Roland Reinl d92fc99360 mediatek: Fix U-Boot variables handling for D-Link M30 A1
I think I implemented the U-Boot handling incorrectly on M30 (saw the issue while porting M60 to OpenWrt). Maybe someone with more U-Boot experience can have a look at it.
What I understood until now:

Before flashing, `sw_tryactive` must be set to 0 because OpenWrt runs on partition 0

During reset after flashing, U-Boot executes the following line:
`boot_rd_auto_sw_img=if itest.s ${sw_tryactive} == 2; then run boot_by_part; else run boot_by_tryactive; fi`

As `sw_tryactive` was set to 0 before flashing, `boot_by_tryactive` will be executed:
`boot_by_tryactive=if itest.s ${sw_tryactive} == 0; then setenv sw_tryactive 2; setenv sw_active 1; saveenv; run ub0; else setenv sw_tryactive 2; setenv sw_active 2; saveenv; run ub1; fi`

As `sw_tryactive` was set to 0 before flashing, `sw_active` will be set to 1 and `ub0` will be executed:
`ub0=setenv bootpart 0; mtkboardboot; run ub0to1; uip main; reset`

If the OpenWrt boot is successful, `ub0to1` and `uip` main will never be executed. Only in case OpenWrt cannot be loaded, `mtkboardboot` will return and the fallback `ub0to1` is executed.

Conclusion: It's sufficient to set `sw_tryacitve` to 0 before flashing, the added code in `target/linux/mediatek/filogic/base-files/etc/init.d/bootcount` is useless.
In the worst case (/proc/cmdline doesn't contain `bootpart=ubi0` as expected), the bootpart variable would be set to 1 and causes starting the firmware from the second partition instead of the one on the first partition.

Signed-off-by: Roland Reinl <reinlroland+github@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17298
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 70610a5240)
2025-01-04 22:34:37 +01:00
..
airoha kernel: bump 6.6 to 6.6.66 2024-12-19 11:22:12 +01:00
apm821xx kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
archs38 kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
armsr armsr: don't limit kmods to armsr armv8 subtarget 2024-10-29 00:07:55 +01:00
at91 kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
ath79 ath79: Push MV88E6060 DSA switch into package 2025-01-04 19:27:11 +01:00
bcm27xx bcm27xx: remove duplicated kmod-rp1-pio package 2025-01-04 19:17:39 +01:00
bcm47xx kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
bcm53xx kernel: bump 6.6 to 6.6.66 2024-12-19 11:22:12 +01:00
bcm4908 kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
bmips bmips: pinctrl-bcm63268: add gpio function 2024-12-28 18:07:41 +01:00
d1 build: d1: add SUPPORTED_DEVICES 2024-12-22 16:34:59 +01:00
gemini kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
generic generic: 6.6: backport upstream r8169 patches 2025-01-04 09:12:53 +01:00
imx kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
ipq40xx ipq40xx: fix label MAC address for FritzBox 7520/7530 2025-01-03 15:49:06 +01:00
ipq806x kernel: bump 6.6 to 6.6.64 2024-12-15 01:43:39 +01:00
ixp4xx ixp4xx: Break out mv88e6060 DSA switch to package 2025-01-04 19:27:05 +01:00
kirkwood kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
lantiq lantiq: xrx200: add support for lan3 and lan4 on AVM 5490/5491 2025-01-04 19:25:34 +01:00
layerscape kernel: bump 6.6 to 6.6.64 2024-12-15 01:43:39 +01:00
loongarch64 kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
malta kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
mediatek mediatek: Fix U-Boot variables handling for D-Link M30 A1 2025-01-04 22:34:37 +01:00
mpc85xx kernel: bump 6.6 to 6.6.64 2024-12-15 01:43:39 +01:00
mvebu mvebu: fix Linksys power LED 2024-12-27 16:09:20 +01:00
mxs mxs: run kernel_oldconfig 2024-11-28 18:48:55 +00:00
octeon octeon: add kmod-usb-dwc3-octeon to DEFAULT_PACKAGES 2024-12-28 10:38:11 +01:00
omap kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
pistachio kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
qoriq kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
qualcommax qualcommax: ipq807x: add Netgear DEVICE_VARS 2024-12-08 09:59:16 +01:00
ramips ramips: mtk-mmc: remove nt76x8 pinctrl hack 2025-01-04 19:25:34 +01:00
realtek realtek: trim default package selection 2025-01-04 20:40:02 +01:00
rockchip rockchip: enable USB3 port on NanoPC T6 2025-01-04 17:15:14 +01:00
sifiveu kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
siflower kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
starfive kernel: bump 6.6 to 6.6.68 2024-12-30 20:21:40 +01:00
stm32 stm32: Remove unnecessary kernel options 2024-11-28 18:49:23 +00:00
sunxi kernel: bump 6.6 to 6.6.61 2024-11-24 22:46:21 +01:00
tegra kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
uml uml: fix glibc-static check with GCC14 2024-06-22 22:06:06 +02:00
x86 x86: Deactivate kernel options with extra overhead 2024-11-28 18:49:17 +00:00
zynq kernel: filter out compiler opts from config 2024-11-28 18:47:54 +00:00
Makefile linux: fix missing default packages in profiles.json 2025-01-03 11:14:12 +01:00