frank-w / u-boot

U-Boot-Bootloader for BananaPI-R2/R64/R2Pro/R3
52 stars 20 forks source link

Missing `saveenv` command #18

Open matoro opened 1 month ago

matoro commented 1 month ago

Hi, I just wrote this to the eMMC on my R4 and while it works, I noticed it is missing the saveenv command, so I cannot make changes persistent. I see that it creates a partition labeled u-boot-env so presumably there is space on the eMMC which is used for storing the environment. Could this be enabled please?

frank-w commented 1 month ago

The partition-sheme has such partition yes,but activating saveenv alone is not enough. You have to set at least the offset and size for it and afair it is different for nand/nor. My current way is using the uEnv.txt on BPI-boot partition which can be easily written on linux userspace which is loaded before menu is shown and overriding/extending builtin env. So i have not needed the saveenv command...but it you need it you can test it and if it is working for all devices i can add missing options

matoro commented 1 month ago

The partition-sheme has such partition yes,but activating saveenv alone is not enough. You have to set at least the offset and size for it and afair it is different for nand/nor. My current way is using the uEnv.txt on BPI-boot partition which can be easily written on linux userspace which is loaded before menu is shown and overriding/extending builtin env. So i have not needed the saveenv command...but it you need it you can test it and if it is working for all devices i can add missing options

Hi, I did see the options to read uEnv.txt. However, it seems that they assume a particular partition layout: mainly, they assume that it's located on the MMC, that it's on partition 5, and that it's FAT-formatted. I'm trying to set up an install which is ext4-formatted on an NVMe, so that won't work. Besides, I think providing the saveenv command improves flexibility in general, without requiring booting into a live environment to edit a file on the eMMC.

I only have R4 hardware to test, but I'm happy to test any pull requests!

frank-w commented 1 month ago

Uboot can only started from mmc (where the default partition sheme has a p5 for kernel) and spi (loads also from mmc).

If you can get saveenv working i can add it :)