From 833c7c75a32c00fb1164f9a472c5f1ee700ae846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Daleck=C3=BD?= Date: Tue, 19 May 2026 08:17:43 +0200 Subject: [PATCH] mvebu: fix squashfs boot for Turris Mox MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bootscript had several issues that prevented squashfs from booting: - bootpath was set to "/" causing double slashes in load paths (e.g. "//Image"); changed to "" so "${bootpath}/Image" resolves to "/Image" - rootflags was set to "commit=5" (a btrfs-specific mount option) for the ext4/squashfs case; cleared to empty string - rootfstype was missing in the non-btrfs branch; added "auto" to let the kernel detect the filesystem; the btrfs branch now sets "btrfs" explicitly - bootargs incorrectly referenced ${bootfstype} (the distroboot input variable) instead of the locally constructed ${rootfstype} - has_dtb assignment used shell-style "has_dtb=1" but was cleared with "setenv has_dtb 0"; unified both to use setenv - DTB load failure message now includes the attempted file path - Fixed Image.lzma error echo that still used a stale "${subvol}/boot/" prefix; now consistently uses ${bootpath} - Removed undefined variable "rootpart" from env delete Signed-off-by: Štěpán Dalecký Link: https://github.com/openwrt/openwrt/pull/23421 Signed-off-by: Hauke Mehrtens --- .../linux/mvebu/image/turris-mox.bootscript | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/target/linux/mvebu/image/turris-mox.bootscript b/target/linux/mvebu/image/turris-mox.bootscript index 8cef275ade6..29d16964af0 100644 --- a/target/linux/mvebu/image/turris-mox.bootscript +++ b/target/linux/mvebu/image/turris-mox.bootscript @@ -1,22 +1,24 @@ if part uuid ${devtype} ${devnum}:${distro_bootpart} bootuuid; then if test "${bootfstype}" = "btrfs"; then - # Original BTRFS partition layout + # BTRFS: root and boot share the same partition via subvolumes rootdev="PARTUUID=${bootuuid}" + rootfstype="btrfs" rootflags="commit=5,subvol=@" bootpath="/@/boot" else - # OpenWrt default ext4 bootpart + rootpart layout + # ext4 or squashfs: boot on p1, root on p2 rootdev="/dev/mmcblk0p2" - rootflags="commit=5" - bootpath="/" + rootfstype="auto" + rootflags="" + bootpath="" fi load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${bootpath}/armada-3720-turris-mox.dtb if test "$filesize" != "0"; then - has_dtb=1 + setenv has_dtb 1 else setenv has_dtb 0 - echo "Cannot find device tree binary!" + echo "Cannot find device tree binary: ${bootpath}/armada-3720-turris-mox.dtb" fi if test $has_dtb -eq 1; then @@ -34,11 +36,11 @@ if part uuid ${devtype} ${devnum}:${distro_bootpart} bootuuid; then filesize=0 fi else - echo "Failed to load ${subvol}/boot/Image.lzma" + echo "Failed to load ${bootpath}/Image.lzma" fi fi if test "$filesize" != "0"; then - setenv bootargs "earlyprintk console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000 rootfstype=${bootfstype} root=${rootdev} rootflags=${rootflags} rootwait ${contract} rw cfg80211.freg=${regdomain} ${quirks}" + setenv bootargs "earlyprintk console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000 rootfstype=${rootfstype} root=${rootdev} rootflags=${rootflags} rootwait ${contract} rw cfg80211.freg=${regdomain} ${quirks}" booti ${kernel_addr_r} - ${fdt_addr_r} echo "Booting Image failed" else @@ -46,5 +48,5 @@ if part uuid ${devtype} ${devnum}:${distro_bootpart} bootuuid; then fi fi - env delete bootuuid rootpart + env delete bootuuid fi