U-boot sartup sequence and files usage

Hello,

I’m trying to port a Linux distribution to the VIM3 Pro, using the linux-amlogic-5.7-rc5 kernel. The distribution will run Live from a µSD card
I cross compiled uImage, uInitrd, made the boot and rootfs partitions.
Everything’s ok so far.

My first question is about the BOOT partition. as it to be “W95 Fat32”, because I made it “Ext3”.
I’ve read some u-boot docs indicating Ext3 and Ext4 is right, but I’m not sure about that.

But it’s with the U-boot I’m totally lost. I’m a neophyte to u-boot and all the documentations is confusing !

I tried to inspire myself from the boot partitions from Armbian, Ubuntu and LibreElec to guess the boot sequence but they seem to use different methods.
I couldn’t find any uEnv.ini file anywhere. Is that normal ?
when should extlinux.conf used ? When is it useless ?
When do we use autoscripts ?

Some of those files seems to have the same goal, so how u-boot determines which one will be used ?

Hello, I don’t have the answer, anything here helpful?

1 Like

hi, what OS are your priority?

I think uboot can handle ext3 and ext4 as long as you enabled it in uboot config. But it is recommended to use fat32.

There are 2 ways to get it to boot.

  1. Use emmc android uboot and just add boot scripts to sd cards boot partition, need to activate multiboot for this and it will always depend on vendors Android uboot on emmc. Can cause green screen issue if you use latest android uboot, to fix it you will need the chainloader ext file from armbian image. This method is used by Armbian, Libreelec (box) image and Manjaro Arm.
  2. Use mainline uboot from the link provided by @RDFTKV and flash it to the start of the external media, but this might need a blank emmc. Even I have to test this method as vim1 and vim2 can boot without the need of erasing emmc uboot. This method is used by LibreElec Device specific images, and I think krescue uses the same method.

extconfig is needed in the second method while uenv.ini is used in the first method.

Hope this gives you a better understanding on ways to boot your linux os.
Which distribution are you working on?

Good luck.

1 Like

I tried the VIM3(VIM3.u-boot.sd.bin) mainline version on an SD card, had Android on eMMC, following the instructions, using the serial tool to interrupt the boot, I loaded the mainline uboot from SD card into DDR. It confirmed it was running. I imagine after that it could be copied to eMMC or even SPI flash.
Now, I am less than a novice at this stuff, and I don’t know if any of that means anything, just wanted to mention it. :grin:

Ultimately, it would be nice if the VIM3 or Edge could boot from NVMe. Am I mistaken in thinking that the new mainline could help accomplish that?

@Spikerguy, I’m hoping that you and others will find a way to do this on Manjaro and other distros. Am I insane to hope for such a thing? :laughing:

It is fine for advance users as you did it right now. For other soc manufacturer like Allwinner and Rockchip we use same uboot for emmc, sd and usb and it have always worked fine. Amlogic is an exception case.

Yes we can do this but users will have to remove everything from the emmc first which is not a good ask for normal users.

That is the reason I mentioned that Vim1 and Vim2 can boot with emmc having vendor uboot so I might give those devices a try with mainline uboot :smiley:

Also thanks for the test and confirmation.

1 Like

yes ! for Edge its will be possible soon becouse Pcie + Nvme already in mainline uboot but only for Rockhip not for Amlogic

2 Likes

Thanks for those guidelines,
The operating system is a live debian-based system.
From what I understand from Spikerguy, the way I choose is the first one.

  • I enter in multiboot mode
  • The u-boot which is present in emmc will execute “boot.scr” found in the SD Card.
    (I know how to generate or write these files with mkimage. :wink: ).
  • boot.scr uses the uEnv.ini (or uEnv.txt) which seems to be passed as parameter in the following command: “load ${devtype} ${devnum} ${loadaddr} uEnv.txt”
  • And the uEnv.xxx file contains the mandatory LINUX, INITRD, FDT and APPEND variables.

Don’t hesitate to correct me if I’m wrong. :wink:

Once I’ll have this boot process completely clarified and operational, I will be back in my comfort zones (Kernel and User space).