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

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:
imgfile=bpi-r4_sdmmc.img.gz
skipkerneldownload=1
kernelfile=bpi-r4_6.8.0-rc3-dango.tar.gz 
  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
4 Likes

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:

PermitRootLogin=yes
bpi
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.

Hi. I tried automatic-image and building one myself but I still have a problem that “lspci” command returns nothing. What could be wrong?

R4 and pci2 (m.2 modem slot)? If your modem is really pci (not usb) it should be visible with automatic built image

Btw. My 6.9-rc tree does not support r4 yet

KEY-M slot, I’m trying to see my NVME SSD for now

Maybe it is related to your ssd. There were some which needed an additional reset in pcie driver which was rejected in mainline…this patch is not part of the current r4 base

Okay, my bad - this SSD is SATA interface so I guess it won’t work. Still, shouldn’t lspci show anything at all? Looking through wiki I guess I should see at least:

root@R4CN:/# lspci 0002:00:00.0 PCI bridge: MEDIATEK Corp. Device 7988 (rev 01) 0004:00:00.0 Unclassified device [0002]: MEDIATEK Corp. Device 7981

?

I have M2 to 5x SATA adapter. I tried it in both slots. In M slot, lspci is empty. In B slot board is not booting (I made the change form the thread “How to activate key B”). According to wiki, I should see:

root@R4CN:/# lspci 0002:00:00.0 PCI bridge: MEDIATEK Corp. Device 7988 (rev 01) 0002:01:00.0 SATA controller: JMicron Technology Corp. JMB58x AHCI SATA controller 0004:00:00.0 Unclassified device [0002]: MEDIATEK Corp. Device 7981

but there is nothing.

Msata is a different datalanes on pci connector not connected on bpi boards. So it will not shown on pci controller.

For sata adapters there also some only multipliying the sata and some like the one i have in my wiki which uses a chip to transform pci to sata (jmbXXX). The sata multiplier will not work because of same as above (no sata lanes).