No description
Find a file
Frank Wunderlich 29cea02c87 downloadfiles: bl2 not needed for nand-image (UBI needs to be used)
fails for r4lite variant where only the ubi version is built
2025-12-19 11:42:45 +01:00
.github/workflows ci: add basic nand workflow for r4 2025-12-19 11:18:36 +01:00
conf conf: rename hostapd-files and drop service files 2025-10-28 16:20:50 +01:00
.gitignore gitignore: add basic ignore-file 2023-06-28 14:42:35 +02:00
buildchroot.sh buildchroot: add debian trixie 2025-08-09 22:28:18 +02:00
buildimg.sh buildimg: reduce /proc warnings 2025-12-18 19:13:30 +01:00
config.sh config.sh: try to fix default image for bpi-r3mini 2025-07-27 17:58:05 +02:00
downloadfiles.py downloadfiles: bl2 not needed for nand-image (UBI needs to be used) 2025-12-19 11:42:45 +01:00
getfirmware.sh getfirmware.sh: update to update folder and more vendors 2025-07-19 09:53:55 +02:00
image.sh image.sh: add helper script for mounting/umounting bpi-images 2025-06-17 17:13:07 +02:00
README.md readme: explain hostapd drop-in a bit 2025-10-28 16:28:58 +01:00
ubifs.sh ubifs: allow passing kernel version 2025-12-19 10:17:27 +01:00

BPI-Router-Images

examples:

./buildimg.sh bpi-r3 bookworm
./buildimg.sh bpi-r4 jammy

#use kernel 6.12 for r2 (normally 5.15 is used because of internal wifi support)
./buildimg.sh bpi-r2 bookworm 6.12

use own uboot/kernel files

for boards not yet supported by my u-boot/kernel pipeline or for emmc it may be needed to use own compiled packages.

the buildimg.sh reads a configfile named sourcefiles_board.conf where 'board' is the supplied board name (e.g. "bpi-r4").

to use your own compiled uboot base-image (created by "build.sh createimg" in my uboot repo) use this setting:

skipubootdownload=1
imgfile=bpi-r4_sdmmc.img.gz

for own kernel-package (created by "build.sh pack" in my kernel repo) use this:

skipkerneldownload=1
kernelfile=bpi-r4_6.5.0-rc1.tar.gz

both configs can be used together to not download anything from my github releases.

replace BL2

at least for BPI-R4 8G variant it is possible to replace bl2 from my u-boot-repo.

This is possible with adding these lines to sourcefiles_bpi-r4.conf (file must exist)

replacebl2=1
bl2file=bpi-r4_sdmmc_8GB_bl2.img

how to build nand-image

To use specifc files you can set them in the sourcefiles_bpi-r*.conf. If they are not defined, script tries to download the latest files.

if using r4-2g5, r4pro or r4lite board you should set the variant variable.

variant=bpi-r4-lite
skipubootdownload=1
fipfile=bpi-r4lite_spim-nand_ubi_fip.bin
skipkerneldownload=1
kernelfile=bpi-r4_6.17.0-rc1-r4lite.tar.gz
skipinitrddownload=1
initrd=rootfs_arm64.cpio.zst

finally run build process

./ubifs.sh bpi-r4

how add packages

add this option in the sourcefiles_board.conf

userpackages="ethtool iperf3 tcpdump"

how to write image

sd/emmc

flash from linux host

gunzip -c bpi-r3_sdmmc.img.gz | sudo dd bs=1M status=progress conv=notrunc,fsync of=/dev/sdX

nand

how to write bl2 and ubinized image to nand in uboot for R4

# erase full nand or only bl2 section
mtd erase spi-nand0
mtd erase spi-nand0 0x0 0x200000
# load bl2 and flash it
fatload usb 0:1 $loadaddr bpi-r4pro_spim-nand_ubi_bl2.img
mtd write spi-nand0 $loadaddr 0x0 $filesize
# erase ubi mtd partition (if not done full erase)
mtd erase spi-nand0 0x200000
# load and flash ubinized image
fatload usb 0:1 $loadaddr bpi-r4-pro_nand.img
mtd write spi-nand0 $loadaddr 0x200000 $filesize

make sure size of ubi partition in devicetree matches your nand size on first linux boot to correctly resize the ubifs, else EC errors occour when booting from nand.

first bootup

login

user: root password: bananapi

ssh root-login enabled (should be disabled after other users are created)

/etc/ssh/sshd_config (open e.g. with nano): add # before PermitRootLogin=yes and restart ssh daemon

systemctl restart ssh

ssh host keys should be regenerated

/bin/rm -v /etc/ssh/ssh_host_*
dpkg-reconfigure openssh-server
systemctl restart ssh

hostapd

i recently switched to drop-in hostapd configs

start for wlan1

systemctl start hostapd@wlan1
systemctl status hostapd@wlan1
systemctl enable hostapd@wlan1

on r4 the configs are named 2g4, 5g and 6g instead of wlan0/wlan1