balena-os / balena-beaglebone

Balena support for Beaglebone boards
https://www.balena.io/os/
Apache License 2.0
20 stars 18 forks source link

BBAI64: Add support for the correct resin partitions. #656

Closed perezmeyer closed 5 months ago

perezmeyer commented 6 months ago

It is worth to note that, using the current meta-ti version in this repository,u-boot-ti-staging seems to be using j721e_evm_a72_defconfig instead of the j721e_beagleboneai64_a72.config file.

This works, but an update of meta-ti and the subsequent fixes should be considered.

Changed-by: Lisandro Pérez Meyer lpmeyer@ics.com Changelog-Entry: bbai64: use the correct resin partitions when booting

resin-jenkins commented 6 months ago

Can one of the admins verify this patch?

floion commented 6 months ago

Where is the env stored? You should have CONFIG_ENV_IS_NOWHERE set in to u-boot so that it only uses the build-in env

floion commented 6 months ago

@alexgg should we add that by default in meta-balena?

diff --git a/meta-balena-common/recipes-bsp/u-boot/files/balenaos_uboot.cfg b/meta-balena-common/recipes-bsp/u-boot/files/balenaos_uboot.cfg
index 31db0438..06e81b86 100644
--- a/meta-balena-common/recipes-bsp/u-boot/files/balenaos_uboot.cfg
+++ b/meta-balena-common/recipes-bsp/u-boot/files/balenaos_uboot.cfg
@@ -6,3 +6,4 @@ CONFIG_CMD_IMPORTENV=y
 CONFIG_FAT_WRITE=y
 CONFIG_CMD_SAVEENV=n
 CONFIG_CMD_HASH=y
+CONFIG_ENV_IS_NOWHERE=y
alexgg commented 6 months ago

should we add that by default in meta-balena?

I think so @floion. Let's check that we also document that the environment is not stored in media and only the default U-Boot environment is used.

Forcing this in meta-balena with clear things up for integrators too.

perezmeyer commented 6 months ago

Where is the env stored? You should have CONFIG_ENV_IS_NOWHERE set in to u-boot so that it only uses the build-in env

I remember checking that last year. But double checking will not hurt

perezmeyer commented 6 months ago

Where is the env stored? You should have CONFIG_ENV_IS_NOWHERE set in to u-boot so that it only uses the build-in env

I remember checking that last year. But double checking will not hurt

[...]/1_2023.04+gitAUTOINC+d74d0993e2-r0/build(fix_proper_root)$ grep  CONFIG_ENV_IS_NOWHERE .config
CONFIG_ENV_IS_NOWHERE=y
floion commented 6 months ago

@perezmeyer is this PR ready for review?

perezmeyer commented 6 months ago

@floion yes, Ryan needs to run the tests as we still lack support for the eMMC

floion commented 6 months ago

@perezmeyer if we lack eMMC support then I think we cannot have this in production until that is fixed

perezmeyer commented 6 months ago

@floion it is a fix for what it is already there. Up to you if you want to have it or not. The eMMC issue is due to the bootloader support.

acostach commented 6 months ago

@perezmeyer @floion these are the tests results I got while testing locally with the extracted non-flasher image from this PR, while booting from the sd-card:

root@688e9a0:~# cat /proc/cmdline
console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 root=UUID=ba1eadef-9bcb-4389-b65f-d0bc94dcdd29
root@688e9a0:~# uname -r
5.10.162+
root@688e9a0:~# ls -l /dev/disk/by-state/
total 0
lrwxrwxrwx 1 root root 15 Apr 28 18:00 active -> ../../mmcblk1p2
lrwxrwxrwx 1 root root 15 Apr 28 18:00 inactive -> ../../mmcblk1p3
lrwxrwxrwx 1 root root 15 Apr 28 18:00 resin-boot -> ../../mmcblk1p1
lrwxrwxrwx 1 root root 15 Apr 28 18:00 resin-data -> ../../mmcblk1p6
lrwxrwxrwx 1 root root 15 Apr 28 18:00 resin-rootA -> ../../mmcblk1p2
lrwxrwxrwx 1 root root 15 Apr 28 18:00 resin-rootB -> ../../mmcblk1p3
lrwxrwxrwx 1 root root 15 Apr 28 18:00 resin-state -> ../../mmcblk1p5
root@688e9a0:~# systemctl | grep fail
root@688e9a0:~# cat /proc/cmdline
console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 root=UUID=ba1eadef-9bcb-4389-b65f-d0bc94dcdd29
root@688e9a0:~# ls -l /mnt/sysroot/inactive/
total 16
drwx------ 2 root root 16384 Mar  8  2024 lost+found

Jenkins does not have u-boot logs enabled but it seems to be working as expected in the current format, so it can be ported to the final version of u-boot which has eMMC boot support.

floion commented 5 months ago

@perezmeyer I guess this PR can be closed?

perezmeyer commented 5 months ago

yes we can close it.