Boot code
#8
The environment docs cover several of the variables like the ram addresses for kernel, ramdisk and devicetree. For the others you'll have to check for a separate environment variable file, or check the source for the default values for those variables.
https://u-boot.readthedocs.io/en/latest/...nment.html
It's a fair guess that ${devtype} and ${devnum} are the type and number of the device uboot started from, but they might be in an environment file. If you wanted to use the uboot on the emmc to load from a partition on the uSD, or a different partition on the same device, you could specify different values here. tow-boot will be doing something similar to boot from different devices based on button presses.

The 'part' command doesn't seem to be fully documented - it's in an example on the page about partitions, but its operation isn't explained. From the context I suspect it is being used to read the uuid of the boot and root partitions and set the variables uuid_boot and uuid_root respectively. These are then used in setting the bootargs that will be sent to the kernel when it gets booted later. It's curious that the boot partition is hardcoded as 1 here rather than using ${distro_bootpart} which we'll see used a bit later.
https://u-boot.readthedocs.io/en/latest/...tions.html

I hope the kernel bootargs don't need explaining here - they're fairly normal, apart from perhaps the console and earlycon bit.

Now we get to the nested ifs which are about trying to load in turn the kernel, the devicetree and the initramfs. If the kernel load fails then there's nothing more to do, and you 'll be stuck with a red light and a vibrating phone. If the kernel load succeeds then the vibration stops and the devicetree load is attempted. If that succeeds then we're at the previous explanation, but if it fails we're stuck as both the kernel and the devicetree are needed to boot.
  Reply


Messages In This Thread
Boot code - by Emilio - 03-14-2022, 11:07 AM
RE: Boot code - by wibble - 03-17-2022, 03:12 AM
RE: Boot code - by Emilio - 03-17-2022, 10:44 AM
RE: Boot code - by wibble - 03-17-2022, 11:45 AM
RE: Boot code - by Emilio - 03-18-2022, 10:51 AM
RE: Boot code - by wibble - 03-19-2022, 05:14 AM
RE: Boot code - by Emilio - 03-19-2022, 06:40 AM
RE: Boot code - by wibble - 03-20-2022, 07:40 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Tow-Boot, a new U-Boot option for Pinephone Pro and other devices Ulfnic 60 45,627 02-13-2024, 02:54 PM
Last Post: fxc
Brick Recovery without Tow Boot b34ux 10 1,464 02-02-2024, 07:07 PM
Last Post: reky
  What to do if your PinePhone Pro does not boot fxc 19 19,625 09-10-2023, 03:19 AM
Last Post: fxc
  Pine Phone won't boot into recovery mode ninjapig26@gmail.com 3 1,822 02-18-2023, 06:14 PM
Last Post: fxc
  tow-boot installation problem techariah 2 1,533 02-16-2023, 02:50 PM
Last Post: techariah
  create tow boot .img fox95 6 3,102 10-21-2022, 11:40 AM
Last Post: fox95
  No display on early boot after Manjaro update robocone 0 865 07-07-2022, 05:47 AM
Last Post: robocone
  Latest Manjaro-Phosh and Arch-Phosh won't boot grinzie 6 3,900 07-01-2022, 02:01 PM
Last Post: Chief
  Manjaro update, no boot, just noise. wilmarcdw 2 1,696 05-09-2022, 07:24 AM
Last Post: wilmarcdw
  Can't boot from a microSD card WhyNotHugo 5 3,177 04-10-2022, 09:15 AM
Last Post: WhyNotHugo

Forum Jump:


Users browsing this thread: 1 Guest(s)