Do you think I need to add the custom kernel build into buildimg.sh? Is there anything special that happens there that would provide support for the kernel change? I did add a bunch of stuff to the kernel I made.
Build.sh only uses precompiled kernel either kernelfile when skipkerneldownload=1 or download latest 6.12 from my repos releases. First way is how you add your own kernel package.
But if you already have sdcard with the flashed image you can also install new kernel with kernel repos build.sh after building. You do not need to create new image.
Hi @frank-w things are working out well. Thanks again for all your help. I have one more question. What make/model 2.5Gbe SFP is supported for this build? Should be plug-n-play right? Which has best results in your opinion?
BPI-R4L> run newboot
## Error: "initrd" not defined
EXT_CSD[179], PARTITION_CONFIG:
BOOT_ACK: 0x1
BOOT_PARTITION_ENABLE: 0x1 (boot0)
PARTITION_ACCESS: 0x0 (user)
emmc available
SF: Detected w25q256 with page size 256 Bytes, erase size 4 KiB, total 32 MiB
NOR available
bootconf=#conf-base-r4lite#ov-lite-emmc#ov-lite-nor
fit=bpi-r4.itb
10045884 bytes read in 228 ms (42 MiB/s)
No UBIFS volume mounted!
## Loading kernel (any) from FIT Image at 46000000 ...
Using 'conf-base-r4lite' configuration
Trying 'kernel-1' kernel subimage
Description: Linux Kernel 6.17.0-main
Type: Kernel Image
Compression: gzip compressed
Data Start: 0x460000e8
Data Size: 9860553 Bytes = 9.4 MiB
Architecture: AArch64
OS: Linux
Load Address: 0x44000000
Entry Point: 0x44000000
Hash algo: sha1
Hash value: 220d1ec5c6d8dad9b606cbcadc6ac700d1ae0300
Verifying Hash Integrity ... sha1+ OK
## Loading fdt (any) from FIT Image at 46000000 ...
Using 'conf-base-r4lite' configuration
Trying 'fdt-base-lite' fdt subimage
Description: Flattened Device Tree blob BPI-R4 Lite
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x4698a440
Data Size: 31042 Bytes = 30.3 KiB
Architecture: AArch64
Load Address: 0x47000000
Hash algo: sha1
Hash value: 464f5c52fc7e8c532568afea9963cbe072ea6b9c
Verifying Hash Integrity ... sha1+ OK
Loading fdt from 0x4698a440 to 0x47000000
Loading Device Tree to 00000000be7ed000, end 00000000be7f7fff ... OK
Working FDT set to be7ed000
## Loading fdt (any) from FIT Image at 46000000 ...
Using 'ov-lite-emmc' configuration
Trying 'fdt-ov-lite-emmc' fdt subimage
Description: Flattened Device Tree blob
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x469929ec
Data Size: 878 Bytes = 878 Bytes
Architecture: Unknown Architecture
Verifying Hash Integrity ... OK
## Loading fdt (any) from FIT Image at 46000000 ...
Using 'ov-lite-nor' configuration
Trying 'fdt-ov-lite-nor' fdt subimage
Description: Flattened Device Tree blob
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x46993318
Data Size: 919 Bytes = 919 Bytes
Architecture: Unknown Architecture
Verifying Hash Integrity ... OK
Booting using the fdt blob at 0xbe7ed000
Working FDT set to be7ed000
Uncompressing Kernel Image to 44000000
Loading Device Tree to 00000000be7e2000, end 00000000be7eccce ... OK
Working FDT set to be7e2000
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 6.17.0-bpi-r4-main (ubuntu@c40702609f18) (aarch64-linux-gnu-gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0, GNU ld (GNU Binutils for Ubuntu) 2.42) #1 SMP Wed Oct 15 11:40:22 CST 2025
[ 0.000000] Machine model: Bananapi BPI-R4-LITE
[ 0.000000] earlycon: uart8250 at MMIO32 0x0000000011000000 (options '')
...
...
...
root@bpi-r4:~# uname -a
Linux bpi-r4 6.17.0-bpi-r4-main #1 SMP Wed Oct 15 11:40:22 CST 2025 aarch64 aarch64 aarch64 GNU/Linux
root@bpi-r4:~#
root@bpi-r4:~# cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.3 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo
root@bpi-r4:~#
Possibly i created image a day before 6.18 was officially out,so tagging is still 6.17-rcX…will recreate image soon.thanks for reporting. You can also install actual kernwl in the flashed system by simply unpacking the folder content in the tar.gz to the right foldr or when building yourself with install option after build
I have already used the u-boot (2016.01) and kernel (6.18-main) images that I built for r4lite instead of yours. However, it booted in kernel 6.17-main logged as above.
Last week I ran “useusb” before “newboot” so the system may fetched “fit=bpi-r4.itb” which was kernel 6.17-main I built and stored in the USB drive:
BPI-R4L> run useusb
USB is stopped. Please issue 'usb start' first.
starting USB...
xhci-mtk xhci@11200000: hcd: 0x0000000011200000, ippc: 0x0000000011203e00
xhci-mtk xhci@11200000: ports disabled mask: u3p-0x1, u2p-0x0
xhci-mtk xhci@11200000: u2p:1, u3p:1
Starting the controller
USB XHCI 1.20
Bus xhci@11200000: 3 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
System Volume Information/
16546559 rootfs_arm64.cpio.zst
200072 bl2_emmc.img
249432 bl2_emmc-r4.img
9518220 bpi-r3.itb
99284725 bpi-r3_6.12.47-main.tar.gz
200793 bpi-r3_emmc_bl2.img
281953 bpi-r3_emmc_fip.bin
846386199 bpi-r3_noble_6.12.47-main_sdmmc.img.gz
209616 bpi-r3_spim-nand_bl2.img
279581 bpi-r3_spim-nand_fip.bin
10045884 bpi-r4.itb
105967381 bpi-r4_6.12.47-main.tar.gz
111991587 bpi-r4_6.17.0-main.tar.gz
250190 bpi-r4_emmc_bl2.img
382661 bpi-r4_emmc_fip.bin
836406326 bpi-r4_noble_6.12.47-main_sdmmc.img.gz
857623777 bpi-r4_noble_6.17.0-main_sdmmc.img.gz
254821 bpi-r4_spim-nand_bl2.img
373037 bpi-r4_spim-nand_fip.bin
17408 gpt_emmc_100m6g.img
69584284 mtk-bpi-r3-EMMC-WAN1-RJ45-20220720-single-image.img
38666240 mtk-bpi-r3-NAND-WAN1-RJ45-20220720-single-image.bin
27956672 mtk-bpi-r3-NOR-WAN1-RJ45-20220720-single-image.bin
107114041 mtk-bpi-r4-EMMC-20240620.img
77725696 mtk-bpi-r4-NAND-20240620.img
107114041 mtk-bpi-r4-SD-20240620.img
9699328 openwrt-mediatek-filogic-bananapi_bpi-r3-initramfs-recovery.itb
55967744 mtk-bpi-r4-NAND.img
124146 r8125-9.016.01.tar.bz2
114332214 bpi-r4lite_6.18.0-main.tar.gz
250288 bpi-r4lite_emmc_bl2.img
365572 bpi-r4lite_emmc_fip.bin
888990647 bpi-r4lite_noble_6.18.0-main_sdmmc.img.gz
33 file(s), 1 dir(s)
BPI-R4L> run newboot
## Error: "initrd" not defined
EXT_CSD[179], PARTITION_CONFIG:
BOOT_ACK: 0x1
BOOT_PARTITION_ENABLE: 0x1 (boot0)
PARTITION_ACCESS: 0x0 (user)
emmc available
SF: Detected w25q256 with page size 256 Bytes, erase size 4 KiB, total 32 MiB
NOR available
bootconf=#conf-base-r4lite#ov-lite-emmc#ov-lite-nor
fit=bpi-r4.itb
10045884 bytes read in 228 ms (42 MiB/s)
No UBIFS volume mounted!
## Loading kernel (any) from FIT Image at 46000000 ...
Using 'conf-base-r4lite' configuration
Trying 'kernel-1' kernel subimage
Description: Linux Kernel 6.17.0-main
Type: Kernel Image
Compression: gzip compressed
Data Start: 0x460000e8
Data Size: 9860553 Bytes = 9.4 MiB
Architecture: AArch64
OS: Linux
Load Address: 0x44000000
Entry Point: 0x44000000
Hash algo: sha1
Hash value: 220d1ec5c6d8dad9b606cbcadc6ac700d1ae0300
Verifying Hash Integrity ... sha1+ OK
## Loading fdt (any) from FIT Image at 46000000 ...
Using 'conf-base-r4lite' configuration
Trying 'fdt-base-lite' fdt subimage
Description: Flattened Device Tree blob BPI-R4 Lite
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x4698a440
Data Size: 31042 Bytes = 30.3 KiB
Architecture: AArch64
Load Address: 0x47000000
Hash algo: sha1
Hash value: 464f5c52fc7e8c532568afea9963cbe072ea6b9c
Verifying Hash Integrity ... sha1+ OK
Loading fdt from 0x4698a440 to 0x47000000
Loading Device Tree to 00000000be7ed000, end 00000000be7f7fff ... OK
Working FDT set to be7ed000
## Loading fdt (any) from FIT Image at 46000000 ...
Using 'ov-lite-emmc' configuration
Trying 'fdt-ov-lite-emmc' fdt subimage
Description: Flattened Device Tree blob
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x469929ec
Data Size: 878 Bytes = 878 Bytes
Architecture: Unknown Architecture
Verifying Hash Integrity ... OK
## Loading fdt (any) from FIT Image at 46000000 ...
Using 'ov-lite-nor' configuration
Trying 'fdt-ov-lite-nor' fdt subimage
Description: Flattened Device Tree blob
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x46993318
Data Size: 919 Bytes = 919 Bytes
Architecture: Unknown Architecture
Verifying Hash Integrity ... OK
Booting using the fdt blob at 0xbe7ed000
Working FDT set to be7ed000
Uncompressing Kernel Image to 44000000
Loading Device Tree to 00000000be7e2000, end 00000000be7eccce ... OK
Working FDT set to be7e2000
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 6.17.0-bpi-r4-main (ubuntu@c40702609f18) (aarch64-linux-gnu-gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0, GNU ld (GNU Binutils for Ubuntu) 2.42) #1 SMP Wed Oct 15 11:40:22 CST 2025
[ 0.000000] Machine model: Bananapi BPI-R4-LITE
Once I do nothing and just let the system boots, it comes up correctly in 6.18-main:
Hit any key to stop autoboot: 0
33 bytes read in 0 ms
*** U-Boot Boot Menu ***
1. Enter kernel-name to boot from SD/EMMC.
2. Boot kernel from TFTP.
3. Boot from SD/EMMC.
4. Boot kernel from NVME.
5. Boot kernel from UBI.
0. Exit
Press UP/DOWN to move, ENTER to select, ESC to quit
## Error: "initrd" not defined
EXT_CSD[179], PARTITION_CONFIG:
BOOT_ACK: 0x1
BOOT_PARTITION_ENABLE: 0x1 (boot0)
PARTITION_ACCESS: 0x0 (user)
emmc available
SF: Detected w25q256 with page size 256 Bytes, erase size 4 KiB, total 32 MiB
NOR available
bootconf=#conf-base-r4lite#ov-lite-emmc#ov-lite-nor
fit=bpi-r4.itb
10338416 bytes read in 767 ms (12.9 MiB/s)
No UBIFS volume mounted!
## Loading kernel (any) from FIT Image at 46000000 ...
Using 'conf-base-r4lite' configuration
Trying 'kernel-1' kernel subimage
Description: Linux Kernel 6.18.0-main
Type: Kernel Image
Compression: gzip compressed
Data Start: 0x460000e8
Data Size: 10154190 Bytes = 9.7 MiB
Architecture: AArch64
OS: Linux
Load Address: 0x44000000
Entry Point: 0x44000000
Hash algo: sha1
Hash value: 642943a4b95a6819d7623913236aa512afe2f67d
Verifying Hash Integrity ... sha1+ OK
## Loading fdt (any) from FIT Image at 46000000 ...
Using 'conf-base-r4lite' configuration
Trying 'fdt-base-lite' fdt subimage
Description: Flattened Device Tree blob BPI-R4 Lite
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x469d124c
Data Size: 31002 Bytes = 30.3 KiB
Architecture: AArch64
Load Address: 0x47000000
Hash algo: sha1
Hash value: 394f22549ac95838afcf11fe12630463893b3a13
Verifying Hash Integrity ... sha1+ OK
Loading fdt from 0x469d124c to 0x47000000
Loading Device Tree to 00000000be7ed000, end 00000000be7f7fff ... OK
Working FDT set to be7ed000
## Loading fdt (any) from FIT Image at 46000000 ...
Using 'ov-lite-emmc' configuration
Trying 'fdt-ov-lite-emmc' fdt subimage
Description: Flattened Device Tree blob
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x469d97ec
Data Size: 878 Bytes = 878 Bytes
Architecture: Unknown Architecture
Verifying Hash Integrity ... OK
## Loading fdt (any) from FIT Image at 46000000 ...
Using 'ov-lite-nor' configuration
Trying 'fdt-ov-lite-nor' fdt subimage
Description: Flattened Device Tree blob
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x469da118
Data Size: 919 Bytes = 919 Bytes
Architecture: Unknown Architecture
Verifying Hash Integrity ... OK
Booting using the fdt blob at 0xbe7ed000
Working FDT set to be7ed000
Uncompressing Kernel Image to 44000000
Loading Device Tree to 00000000be7e2000, end 00000000be7ecca6 ... OK
Working FDT set to be7e2000
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 6.18.0-bpi-r4-main (ubuntu@c40702609f18) (aarch64-linux-gnu-gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0, GNU ld (GNU Binutils for Ubuntu) 2.42) #1 SMP Fri Jan 2 16:17:22 CST 2026
[ 0.000000] Machine model: Bananapi BPI-R4-LITE
BPI-R4L> setenv abc 123
BPI-R4L> saveenv
Unknown command 'saveenv' - try 'help'
BPI-R4L> save
save - save file to a filesystem
Usage:
save <interface> <dev[:part]> <addr> <filename> bytes [pos]
- Save binary file 'filename' to partition 'part' on device
type 'interface' instance 'dev' from addr 'addr' in memory.
'bytes' gives the size to save in bytes and is mandatory.
'pos' gives the file byte position to start writing to.
If 'pos' is 0 or omitted, the file is written from the start.
BPI-R4L> mmc part
Partition Map for mmc device 0 -- Partition Type: EFI
Part Start LBA End LBA Name
Attributes
Type GUID
Partition GUID
1 0x00000022 0x00001fff "bl2"
attrs: 0x0000000000000004
type: 0fc63daf-8483-4772-8e79-3d69d8477de4
(linux)
guid: a95a2d79-9396-4c29-99fd-bb8287a5933b
2 0x00002000 0x000023ff "u-boot-env"
attrs: 0x8000000000000000
type: 0fc63daf-8483-4772-8e79-3d69d8477de4
(linux)
guid: 072e8ae9-5886-438e-b01f-b0c2069c59ac
3 0x00002400 0x000033ff "factory"
attrs: 0x8000000000000000
type: 0fc63daf-8483-4772-8e79-3d69d8477de4
(linux)
guid: 2d4b5754-eb1c-4a63-88dc-bac607bd0747
4 0x00003400 0x000043ff "fip"
attrs: 0x8000000000000000
type: 0fc63daf-8483-4772-8e79-3d69d8477de4
(linux)
guid: a03952c9-6242-43d9-b650-6cf7eee026e7
5 0x00004400 0x000363ff "boot"
attrs: 0x0000000000000000
type: 0fc63daf-8483-4772-8e79-3d69d8477de4
(linux)
guid: 74cd60ec-4934-46c4-a15a-1200b90f976b
6 0x00036400 0x00d1a400 "rootfs"
attrs: 0x0000000000000000
type: 0fc63daf-8483-4772-8e79-3d69d8477de4
(linux)
guid: de35fe6a-d354-43de-b9a5-922cede44946
BPI-R4L>
Btw, my USB stick often not detectable in r4lite u-boot, but kernel.
BPI-R4L> run useusb
USB is stopped. Please issue 'usb start' first.
starting USB...
xhci-mtk xhci@11200000: hcd: 0x0000000011200000, ippc: 0x0000000011203e00
xhci-mtk xhci@11200000: ports disabled mask: u3p-0x1, u2p-0x0
xhci-mtk xhci@11200000: u2p:1, u3p:1
Starting the controller
USB XHCI 1.20
Bus xhci@11200000: 2 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
** Bad device specification usb 0 **
Couldn't find partition usb 0:1
BPI-R4L>
root@bpi-r4:~# fdisk -l | tail
Disk /dev/sda: 117.19 GiB, 125829120000 bytes, 245760000 sectors
Disk model: USB DISK 3.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x074409f4
Device Boot Start End Sectors Size Id Type
/dev/sda1 292480 245759999 245467520 117G c W95 FAT32 (LBA)
root@bpi-r4:~#
For uboot variables you can use uEnv.txt on BPI-BOOT partition. Have not configured saveenv yet (which could use a mmc or ubi partition which are prepared in layout).
At least for R4 variants there should be one existing to set the variant
I see uEnv_r4.txt and I used to set the pre-build custom variables there. As I want to save something in runtime, do you have the exact command to do so or just wait for “saveenv” support?
on your card, not in source not sure if i implement saveenv completely for all boards, as i find it more useful to set variables via textfile to modify externally (on card) or from linux. i know that there is fw_setenv binary for linux, but also this needs to be configured for the specific system and bootdevice (mmc/spi).
It is possible that command is enabled,but maybe with wrong config (used default from sdk or openwrt).
It is a textfile so either change it from host pc or linux,not way from inside uboot.
Afair i have not tested pcie on r4lite in uboot yet,only the mpcie for wifi in linux. Seems that mt7987 has only 2 pcie which are routed to mpcie slots. Second lane is routed over a pcie switch to either route to first mcpie or second slot…wonder where pcie connection is done for m.2 key-e (but i guess this is a leftover/alternate design as this is missing in block schematic and titled as reserved)