[BPI-R2] build custom u-boot-mtk.bin

I need to build custom boot sequence for u-boot. I work with this:

As I understood it can be done modifying uEnv.txt file. But I did not find this file here. How I can customize u-boot configuration?

I have separated r64 uboot in my repo

If you look through my commits you see how i have changed environment. I also load BPI-BOOT/uenv.txt after uboot is loaded (before menu is displayed)

@frank-w, thank you! Did you manage to load all necessary files to the board to start custom uboot without sd-card? If ‘yes’ could you describe the sequence?

I tried to understand working emmc image containing all components, this:

but did not understand what are ‘tee1’, ‘lk’, ‘nvram’ and ‘rf’

revyakin@lenovo:~/Downloads/openwrt$ sudo losetup -P -f /var/lib/tftpboot/emmc_singleimage.img 
losetup: /var/lib/tftpboot/emmc_singleimage.img: Warning: file does not fit into a 512-byte sector; the end of the file will be ignored.
revyakin@lenovo:~/Downloads/openwrt$ sudo gdisk /dev/loop0 
GPT fdisk (gdisk) version 1.0.1

The protective MBR's 0xEE partition is oversized! Auto-repairing.

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/loop0: 25600 sectors, 12.5 MiB
Logical sector size: 512 bytes
Disk identifier (GUID): 9C040E2D-2415-47A1-9193-CB5BD2C34E82
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 14609966
Partitions will be aligned on 512-sector boundaries
Total free space is 14565901 sectors (6.9 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            1024            1535   256.0 KiB   8300  tee1
   2            1536            2559   512.0 KiB   8300  lk
   3            2560            3583   512.0 KiB   8300  nvram
   4            3584            4095   256.0 KiB   8300  rf
   5            4096           45055   20.0 MiB    8300  boot

Command (? for help): q
revyakin@lenovo:~/Downloads/openwrt$ binwalk /var/lib/tftpboot/emmc_singleimage.img 

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
565988        0x8A2E4         Unix path: /mt7622/drivers/uart/uart.c
956960        0xE9A20         CRC32 polynomial table, little endian
2097384       0x2000E8        LZMA compressed data, properties: 0x6D, dictionary size: 8388608 bytes, uncompressed size: 7601264 bytes
4718592       0x480000        Squashfs filesystem, little endian, version 4.0, compression:xz, size: 8315032 bytes, 1530 inodes, blocksize: 262144 bytes, created: 2019-08-02 11:40:08

I have not managed to load system/kernel from emmc because partition table on emmc was not recognized by uboot

Does it mean you boot now from the sd-card only and do not use emmc at all?

I can completely boot from sd-card,but emmc only till uboot

1 Like