Unbelievable, really, then the first two boards must be defective.
Is there ever going to be an updated version directly from openwrt? For 8gb of ram??
its same, u dont need special build for 8g
For 8gb he needs to replace the bl2 to use the 8gb.but basicly 4gb image is usable on 8g board.
Hello, i’m new to the forum and also new to flashing mediatek boards… it 2 days i try to flash for the 8gb and noting work for me probable missunderstantding …
what i try to do: install the ubuntu 24 server image from Banana Pi BPI-R4 | BananaPi Docs
and have the correct b2 file to have ma 8Gb ram usable.
unfortuntly i don t understant preboot, uboot ( i think is like the bios and the grub in x86 architecture so i have a nvme 256Gb installer and if i follow the logic i need to keep the boot part inside the nand and then install ubuntu on the nvme i’m wrong or not ?
install from the SD card so i’m a bit lost may you help me to understand and guide me . I will really apreciate ![]()
I have 0 skill to buil an image as frank github explain. this kind of level is 2 steps high for me…
U-boot is similar to grub which loads linux-kernel and point this to the rootfs.
Bl2 is more like software only bios and mbr bootsector. X86 has bios hw chips.
On ARM mostly a ready image is used flashed to bootable storage like sdmmc),not installer. Starting linux kernel and rootfs from nvme is much more manual work. If you have not much experience start with sdmmc only and as next step nand to access emmc and install there.
So just unpack the image and flash to sdmmc. If it boots up you can try replacing bl2 which has to be flashed into first partition,not offset 0 on sdmmc.
Hello Frank thanks you so much for your quick answeri really apreciate the opensource community and phylosophy. I’m a old windows NT IT. and i’m updating my skils .that for my background.
i follow tjis idea:
- SPI-NAND Flash: ~400MB, used for bootloader/kernel, max throughput around 50–100 MB/s.
- eMMC: 8GB (on-board), eMMC 5.1 standard (theoretical up to 400 MB/s, effective real-world 150–250 MB/s).
- MicroSD slot: up to 2TB supported (SD 3.0/UHS-I/UHS-II, speed varies by card type, max 104 MB/s for UHS-I and up to about 250 MB/s for UHS-II).
- NVMe SSD slot (M.2 Key-M, PCIe 3.0 x1): supports 2280 SSDs, practical transfer speeds up to 700–900 MB/s.
- USB 3.2 port: max 400 MB/s typical for external storage.
Each type is used for specific boot or storage purposes: SPI-NAND for bootloader, eMMC for OS or core apps, NVMe for fast system/data storage, and MicroSD for recovery or alternate OS.
so tell me if i’m wong with this logic. the boot loader and “bios” where i need to see my 8Gb are on the NAND because the just used for boot so the speed is not mandatory:
and using the OS i beter in the nvme as the Sd port. ?
what i can do copy the ubuntu image to SD, then boot, then copy all to nand. then flashing the bl2 as you suggest ! at this point i don’t understant how to rempace just this file… booting again for sd before and doing somes command lines?U boot console ?)
and after i maybe have a ubuntu 8gb on NAND then copy all to emmc from de boot menu tools.
maybe this can be a first good step ? ok keep it into NAND and the install the img to the nvme and change the parameter in to the u boot to point the rootfs ??
what do you thins is the tight method ?
Like Frank said, if you are not so skilled (yet), I also recommend using only the sd-card for now. It is also how I started on the R64.
If you break your setup in a manner that it is stuck at boot, while everything runs from emmc or nvme, it is much more difficult to repair your system. While on sdcard, you can simple remove it, insert in your laptop and do the repairing… For instance using chroot, or rewriting bl2/u-boot/fip/fit.
When you feel familiar enough and when you are satisfied with how your linux os is setup, move everything on the emmc/nvme. The only real advantage here is speed and reliability through wear.
ok thanks eric , I allready try the basic beginer way to burn the image on a SD and voila just use it for my first test(. like with raspbery pi prebuld images.) . but now just at the point where i’m learning how to go 1 step more
i’m trying to buid the image with BPI-Router-Images/.github/workflows/ubuntu.yml at main · frank-w/BPI-Router-Images · GitHub
i clone the repo, modify the sourcefiles_bpi-r4.conf
adding the line (below)
imgfile=bpi-r4_sdmmc.img.gz
kernelfile=bpi-r4_6.12.51-main.tar.gz
bl2file=bpi-r4_sdmmc_8GB_bl2.img
userpackages=“qemu-system-aarch64 libvirt-daemon-system virtinst bridge-utils wireguard docker.io docker-compose cockpit network-manager apparmor apparmor-utils”
and the run the script with argument ./buildimg.sh bpi-r4 noble
( run in WSL win11 ubunut) i had failure at the build:
"-rw-r–r-- 1 myrko myrko 7.7M Oct 17 12:07 bpi-r4_sdmmc.img.gz -rw-r–r-- 1 root root 303M Oct 17 11:53 noble_arm64.tar.gz unpack imgfile (bpi-r4_noble_6.12.51-main_sdmmc.img.gz)… setting up imgfile to loopdev… mounting loopdev… Error: Partition(s) 1, 2, 3, 4, 5, 6 on /dev/loop0 have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes. partprobe failed "
now i trying directly with my kubuntu laptop and i i will tell you if it work
Yes wsl seems to have problems…imho there is no real kernel running only some kind of vietualization layer not supporting enumerating partitions on demand with partprobe
yes
ps did i modify your sourcefile_bpi-r4.conf correctly ?
i mean defining the 8Gb bl2 file ?
You could simply overwrite the bl2 on the existing (4gb version) sd-card.
I think it seems not going to work by adding “bl2file=xxxxx” in sourcefile_bpi-r4.conf. Searching for “config.get” from the downloadfiles.py, it cannot find “bl2file” things else. Since I’m using 4GB version of BPI-R4, I have not tried this out.
But if I have to work with 8GB version, I’ll build the images manually (for emmc):
- Build u-boot (for DDR4 8GB)
-
Source code from GitHub - frank-w/u-boot at 2025-10-bpi with upstream branch 2025-10-bpi
-
This has to be built in a native Linux distro system (in case I build it in Debian/Ubuntu/LinuxMint while failed in WSL2/Docker) to generate a final u-boot pack - bpi-r4_emmc.img.gz. It would be used to build a final Debian/Ubuntu image.
Install packages in the build system:
sudo apt install -y \
xxd gdisk dosfstools \
gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu libc6-armhf-cross u-boot-tools make gcc swig python-dev-is-python3 python3-pyelftools \
gcc-aarch64-linux-gnu u-boot-tools bc make gcc ccache libc6-dev libncurses5-dev libssl-dev bison flex
Example build commands:
git checkout -f 2025-10-bpi
echo -e "board=bpi-r4\ndevice=emmc" > build.conf
./build.sh importconfig
./build.sh config
./build.sh
./build.sh rename
git checkout -f mtk-atf-2025
echo -e "board=bpi-r4\ndevice=emmc" > build.conf
echo -e "extraflags=DDR4_4BG_MODE=1" >> build.conf
./build.sh
./build.sh rename
./build.sh createimg non-interactive
rm build.conf
- Build Linux kernel
-
Source code from GitHub - frank-w/BPI-Router-Linux at 6.17-main with upstream branch 6.17-main
-
This can be built in Docker container on WSL2. This is what I am working. To start with, follow the docker setup instructions from Frank’s Linux repo (above link) to create an Ubuntu 24.04 environment in container. After that, I have also created my own docker image onto the Docker Hub for building this.
-
The final kernel pack is bpi-r4_6.17.0-main.tar.gz. It would be used to build a final Debian/Ubuntu image.
No need to install packages in the build system since Frank’s Dockerfile did it for us.
Example build commands:
echo "board=bpi-r4" > build.conf
./build.sh importconfig
./build.sh config
./build.sh build
./build.sh pack
- Build Debian/Ubuntu
-
Source code from frank-w/BPI-Router-Images with upstream branch main
-
This has to be built in a native Linux distro system which is the same workplace as I mentioned above to build the u-boot. Also it would build fail in WSL2/Docker environment.
-
It requires the pre-built u-boot bpi-r4_emmc.img.gz and Linux bpi-r4_6.17.0-main.tar.gz
-
In case I build it for Ubuntu Noble (24.04), the final image would be bpi-r4_noble_6.17.0-main_sdmmc.img.gz
Install packages:
sudo apt install python3 python3-requests parted qemu-user-static debootstrap binfmt-support udev
Create sourcefiles_bpi-r4.conf:
ubuntu@afe0fd51a26a:~/BPI-Router-Images$ cat sourcefiles_bpi-r4.conf
skipubootdownload=1
skipkerneldownload=1
imgfile=bpi-r4_emmc.img.gz
kernelfile=bpi-r4_6.17.0-main.tar.gz
userpackages="ethtool iperf3 tcpdump" # append more packages from what the "apt install" supported
ubuntu@afe0fd51a26a:~/BPI-Router-Images$
Example build commands:
./buildimg.sh bpi-r4 noble
After all, I copy the required files to USB drive, insert it, boot the device from initrd, and flash the eMMC like this:
mount -t vfat /dev/sda1 /mnt
cd /mnt
echo 0 > /sys/block/mmcblk0boot0/force_ro
dd if=bpi-r4_emmc_bl2.img of=/dev/mmcblk0boot0
gunzip -c bpi-r4_noble_6.17.0-main_sdmmc.img.gz | dd bs=512 conv=notrunc,fsync of=/dev/mmcblk0
mmc bootpart enable 1 1 /dev/mmcblk0
If done, power cycle the device and boot from eMMC directly.
Get started with the above commands.
About initrd image, it would probably be used in cases like the kernel keeps crashing or you need to (re-)flash device.
It is a concept like booting from RAM instead of the flash. Some SDKs may build out initramfs (not initrd), e.g. Openwrt, more info could be found online as I’m not familiar with this.
To highlight that, in BPI-R4 Ubuntu Noble, flashing the /dev/mmcblk0 from eMMC boot that would lead the kernel crash in the later boot-up. But BPI-R3 Ubuntu Noble is okay for doing this. That’s why I decide to re-flash the eMMC from initrd instead. (To flash the eMMC from NAND boot is also accepted)
-
Download the rootfs_arm64.cpio.zst from Releases · frank-w/buildroot
-
Grab the bpi-r4.itb from the Linux outputs you built
-
Copy the files to USB drive and power on the board with USB inserted
-
Stop in u-boot, run:
run useusb
setenv fit bpi-r4.itb
setenv initrd rootfs_arm64.cpio.zst
run newboot
Right,i have no replacing the bl2 in code at the moment. Somehow i had this var in my mind,but it is only used in nand tree,but only downloading it.
You flash mmcblk0 after booting from it?
If not how does the crash look (exact log)?
@Myrko do you use wsl 1 or 2
Wsl2 seems to run also a linux kernel so maybe it works there. If not another option would ve installing real ubuntu in virtualbox.
have now added option to replace bl2 when creating image. but file must be downloaded manually at the moment.
replacebl2=1
bl2file=bpi-r4_sdmmc_8GB_bl2.img
in sourcefiles_bpi-r4.conf
Hi many tanks for your messages @frank-w @ericwoud @brucerry
now I’m using a Tuxedo linux laptop (Kubuntu) for building. ( my first try with wsl2 was with my win11 laptop because it was connectec with TTL dongle to the bpi in my main room wired to the ISP router… )
the bruce procedur is verry complet and you help me to understand the fundamental of building a image from scratch. now is more clear in a theorical point of view. i build the uboot for emmc for the image builder but i stop at the step building the kernel. and chose a less complex way by using the frank image builder at this point
frank thansk so much to improuve your image biulder script so i’m tyring now. i have modifi the sourcefiles_bpi-r4.conf
imgfile=bpi-r4_emmc.img.gz
kernelfile=bpi-r4_6.17.0-main.tar.gz
replacebl2=1
bl2file=bpi-r4_emmc_8GB_bl2.img
userpackages="docker.io docker-compose cockpit network-manager wireguard qemu-system-aarch64 libvirt-daemon-system virtinst bridge-utils apparmor apparmor-utils"
but whe i launch the ./buildimg.sh bpi-r4 noble
i realise the conf file is modified with the script with this values
imgfile=bpi-r4_sdmmc.img.gz kernelfile=bpi-r4_6.12.51-main.tar.gz userpackages= “docker.io docker-compose cockpit network-manager wireguard qemu-system-aarch64 libvirt-daemon-system virtinst bridge-utils apparmor apparmor-utils”
so the image is crated with the wrong config… do i need to use skipubootdownload=1 in the conf file? do i need to compile de kernel as bruce mentionned? and also use skipkerneldownload=1 ?
thanks guys for your help ans for teaching me ![]()
here i sen the las 20 lines out from the terminal :
/proc/ is not mounted. This is not a supported mode of operation. Please fix
your invocation environment to mount /proc/ and /sys/ properly. Proceeding anyway.
Your mileage may vary.
Created symlink /etc/systemd/system/multi-user.target.wants/virtlogd.service → /usr/lib/systemd/system/virtlo
gd.service.
/proc/ is not mounted. This is not a supported mode of operation. Please fix
your invocation environment to mount /proc/ and /sys/ properly. Proceeding anyway.
Your mileage may vary.
Setting up libvirt-daemon dnsmasq configuration.
Setting up cockpit-networkmanager (314-1) …
Setting up packagekit-tools (1.2.8-2ubuntu1.2) …
Setting up cockpit-packagekit (314-1) …
Processing triggers for libgdk-pixbuf-2.0-0:arm64 (2.42.10+dfsg-3ubuntu3.2) …
Processing triggers for libc-bin (2.39-0ubuntu8.6) …
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
systemd-resolved is already the newest version (255.4-1ubuntu8.11).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
/proc/ is not mounted. This is not a supported mode of operation. Please fix
your invocation environment to mount /proc/ and /sys/ properly. Proceeding anyway.
Your mileage may vary.
packing bpi-r4_noble_6.12.51-main_sdmmc.img.gz
install it this way:
gunzip -c bpi-r4_noble_6.12.51-main_sdmmc.img.gz | sudo dd bs=1M status=progress conv=notrunc,fsync of=/dev/s
dX
PS: why i’m doing all of this . the bpi r4 8gn is enouth strong to host a router and home assistant (without wisper and piper voic assist)on the same hardware. to have a stable and easy to maintain basic services for a smart home .
i have 2 option one is openwrt with home assistant in a docker edition. but i loose the on ckick webinterface upadte and plugin of HAOS second option install ubuntu server as the router and use kvm to host HAOS in a VM that gime me more easy update prodess with HAOS.
ubuntu because the qemu is supported on the arm mediateck and not in openwrt
A VM is not the only option.
Archwiki describes a simple method of installing it without VM. Although archlinuxarm is my preferred system, I’m sure on Ubuntu it is not much different.
https://wiki.archlinux.org/title/Home_Assistant_Supervised
PS: this is getting offtopic, so if continued, should be in another topic.
PPS: would need to add CONFIG_SECURITY_APPARMOR to the kernel
imgfile is overwritten when skipubootfile is not set,same for kernelfile when skipkerneldownload. Both do not affect the replacebl2 and bl2file as far as i tested.
Have you updated your source? I added some changes an hour ago.