[BPI-R4] SD Debian Bookworm/Bullseye images on kernel 6.8.0-dango


I built Debian images for BPI-R4 - there are no Debian images for this anywhere so this might be useful for some of you. Test anything you can and provide information so things can be fixed

Frank w’s images are considered unofficial and this is unofficial version of unofficial images - rootfs is very basic so you can check it. You can build it yourself as well.

Basic credentials are root:bananapi

What does work in this?

  • Sierra Wireless EM7455 worked properly on this after adding MBIM support to kernel. Recommending Network Manager, Modem Manager, firewalld and MBIMCLI.
  • USB drives work as they should.
  • NVMe drives were detected and showed proper size.
  • Can fully emulate desktop sessions with XFCE4 & XRDP (performance better than expected).
  • Webmin works properly.

What does not work?

  • Can’t get WiringPi to work as it’s not supported for R4 i think - /sys/class/gpio works properly.
  • RAM is limited to 3G.
  • Cannot get One Wire to work(cannot detect device on bus).

Link to my Nextcloud directory with images and md5’s:

Best regards,


Image is booting fine.

Confirm only 3G RAM visible, would you know the reason for that ?

Would you be able to share the command line you used for building the kernel ?


it is not builtin the kernel, only passed to cmdline

there were some problems with 4G ram, so maybe i added cmdline “mem=3G” to uboot or /boot/uEnv.txt


Changed the boot options and it does boot with the ~4G of RAM available.

1 Like

Would you be able to provide the exact command line you used to build the Kernel and the Image ? It’s a long time since I’ve played with kernel building and I need a refresher …

just use build.sh of my kernel-repo in the branch you want…it does all for you :wink:

see README.md for usage (importconfig, config and then without parameter)

build.sh for r4 in default results in nokernel - could 6.8 be added as basic kernel for this?

The image builder expects prebuilt kernels on releases page on my kernel-repo…it does not compile it.

I’m experimenting with ci in the image builder repo and maybe add kernel for r4 on my gdrive to be downloaded from there. But i need to think about a concept to get the latest kernel from it.

check&download kernel by build salt?

I will provide a guide to doing this yourself in a work week. Huehue. R&D rocks.

you can also try image from here: automatic-images - Google Drive

for r4 i used the 6.8-dango2 tree

1 Like

My machine: Plain Ubuntu 20.04 Desktop in PVE enviroment

Image building guide:

If some part breaks because of missing packages - just install them and redo.

Part 1 - Kernel:

  1. git clone -b 6.8-dango https://github.com/frank-w/BPI-Router-Linux.git
  2. cd BPI-Router-Linux
  3. ./build.sh importconfig
  4. ./build.sh config (add or include modules into kernel, configure cpu schedulers, etc. - if you don’t know what to do here use https://www.kernelconfig.io/config_hwmon?q=&kernelversion=6.8&arch=arm64 - this is very plain and basic. If you choose an option(not a menu of options) and press ? you’ll get config name and info - copy and paste it into above kernelconfig.io and it will explain everything you need. If you don’t need to change anything just save and exit.)
  5. ./build.sh
  6. At stage “choice” pick option 1 - Pack

Directory “SD” next to “BPI-Router-Linux” should be created. Inside of it should contain a file named “bpi-r4_6.8.0-rc3-dango.tar.gz” which is your compiled kernel with modules that are not built into kernel but as modules in /lib/modules.

Part 2 - Image

  1. git clone https://github.com/frank-w/BPI-Router-Images
  2. sudo apt-get install python3 parted qemu-user-static debootstrap binfmt-support -y
  3. cd BPI-Router-Images
  4. Copy your kernelfile (bpi-r4_6.8.0-rc3-dango.tar.gz) from SD directory of Part 1 into BPI-Router-Images directory
  5. nano sourcefiles_bpi-r4.conf
  6. Paste this into nano:
  1. sudo ./buildimg.sh bpi-r4 bookworm
  2. Image should be built and packed into BPI-Router-Images directory. It should be named “bpi-r4_bookworm_6.8.0-rc3-dango.img.gz” with md5 checksum file “bpi-r4_bookworm_6.8.0-rc3-dango.img.gz.md5”.
  3. Write it on a SD card using gunzip -c bpi-r4_bookworm_6.8.0-rc3-dango.img.gz | sudo dd bs=1M status=progress conv=notrunc,fsync of=/dev/sdX or Balena Etcher on Windows

Thx for summary except that buildimg.sh does not need to be called as root…sudo is called where root is needed (e.g. for losetup,partprobe,chroot).

Btw. The images on my gdrive are already created by github actions,but this is not yet perfect.

1 Like

Thanks ! Doing that gives a perfectly fine image that works when writen on a SD card. If I do the same on the dango_2 branch, it fails as desribed in my other post. kernel image is much larger: 88M for dango 113M for dango_2 (maybe because I added some more modules)

Anyway, I have something I can play with now !

1 Like

Yes i think too it is because you add additional options (builtin,not modules),firmware or initrd so itb increases to much for the range i defined…here you can set loadaddr in uEnv.txt (root of BPI-BOOT partition,create it if not exist) to override uboot builtin environment.

113M for the itb? Or the tar.gz also containing the modules?

Only itb size (kernel without modules) matters for the error above…if all additional is built as module it should be fine. I guess you do not use initrd (which may grow too very fast and may overwrite other content).

edit: added the pci2 fix from daniel to 6.8-dango_2 branch and build image(s) with it and fixed some bugs in the ci-pipeline…now kernel-version is included in the images filename for r4

This could be a good addition to your README of Router-Images as it’s two lined “examples” are not explaining logic you’ve put work into.

113M for the itb? Or the tar.gz also containing the modules?

For the tar.gz I’ll checlk later what was the size of the .itb

Trying to follow the tutorial (Part 2- Image) but getting message:

umounting tmpfs...
ls: cannot access 'bpi-r4_sdmmc.img.gz': No such file or directory
bootloader file missing

The same message I got on windows Ubuntu and also on different virtual machine. What can be the reason?

Seems like download of uboot file was not successful,but it is there in releases…lokk if there is a download error above the posted error

Thank you. I checked above, for downloadsfiles.py requests were not loaded. I installed them and now is fine. When I downloaded manually script was also finishing. WSL did not finish, there were some errors with partitions, but virtual machine generated image file.