[BPI-R3] ubuntu 22.04 Image

Hi,

i have created a basic ubuntu 22.04 image with kernel 6.1.12/uboot 2023.01

made not much tests with it, but it boots up and applies network-setting i copied from my debian-image (192.168.0.19 on wan-port, 192.168.1.1 on lan-ports). So it can be a base for further configuration.

https://drive.google.com/drive/folders/1fxDR-uL3DIO-8ebgqOJd5MoWORQTTm7Z

login: root:bananapi

also added service-files for rc.local and hostapd

have not figured out how to set regdomain as it stays always 00, maybe this is the only way:

https://github.com/raspberrypi/rpi-imager/issues/511 tried way with cmdline too…not working ;( currently have no idea how to set the regulatory domain

2 Likes

got wifi working…

  • cfg80211 needs to be compiled as module to load regulatory.db from rootfs (installed via package wireless-regdb or downloaded from kernel.org regulatory.db + regulatory.db.p7s)
  • CONFIG_CFG80211_WEXT=y is needed else you get error “nl80211 not found” when using iw
  • wifi-module ist not loaded at system bootup. create a file /etc/modules-load.d/mt7915.conf with content “mt7915e” and reboot, then both hostapd came up at bootime

i got a error in uboot that partition 5 was not found after mutliple boots, this is how i solved it:

sudo sgdisk --backup=bpi-r3_sgdisk.gpt /dev/sdb
sudo sgdisk --load-backup=bpi-r3_sgdisk.gpt /dev/sdb

i guess problem is that partition table at beginning of card does not match the backup gpt at the end (which is not overridden by image)

1 Like

Hey how’s it going? I can’t upload the Wi-Fi module in debian, see the information:

root@bpi-r3:~# uname -a

Linux bpi-r3 6.1.20-bpi-r3-main #7 SMP Sat Mar 18 22:35:22 UTC 2023 aarch64 GNU/Linux

root@bpi-r3:~# zgrep -i ‘cfg80211’ /proc/config.gz

CONFIG_CFG80211=m CONFIG_CFG80211_REQUIRE_SIGNED_REGDB=y CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS=y CONFIG_CFG80211_DEFAULT_PS=y CONFIG_CFG80211_CRDA_SUPPORT=y CONFIG_CFG80211_WEXT=y

root@bpi-r3:~# dmesg | grep 80211

[ 5.257581] cfg80211: Loading compiled-in X.509 certificates for regulatory database

[ 5.268134] cfg80211: Loaded X.509 cert ‘sforshee: 00b28ddf47aef9cea7’

[ 5.330993] cfg80211: loaded regulatory.db is malformed or signature is missing/invalid

I tried to install via:

apt install wireless-regdb crda

reboot

then I tried:

wget wget https://mirrors.edge.kernel.org/pub/.../wireless-regdb-2023.05.03.tar.gz

tar xvf wireless-regdb-2023.05.03.tar.gz

cd wireless-regdb-2023.05.03

make

make install

reboot

PS: I also tried with kernel 6.1.22

And still without success.

Have you loaded mt7915e module? What does dmesg say about this?

Dear,

Could the error in regulatory.db prevent the module from loading?

See dmesg:

[ 13.265177] cfg80211: Loaded X.509 cert ‘sforshee: 00b28ddf47aef9cea7’

[ 13.296083] EXT4-fs (mmcblk0p6): re-mounted. Quota mode: disabled.

[ 13.342079] cfg80211: loaded regulatory.db is malformed or signature is missing/invalid

[ 13.692003] systemd-journald[1107]: Received client request to flush runtime journal.

[ 13.712646] systemd-journald[1107]: File /var/log/journal/f223b6b9f19a4af09caff671d8e9d1c1/system.journal corrupted or uncleanly shut down, renaming and replacing.

[ 13.965786] mt7986-wmac 18000000.wifi: HW/SW Version: 0x8a108a10, Build Time: 20221012174743a

[ 14.132772] mt7986-wmac 18000000.wifi: WM Firmware Version: ____000000, Build Time: 20221012174805

[ 14.204623] mt7986-wmac 18000000.wifi: WA Firmware Version: DEV_000000, Build Time: 20221012174937

[ 34.405019] mt7986-wmac 18000000.wifi: Message 00000002 (seq 9) timeout

[ 34.411641] mt7986-wmac 18000000.wifi: Failed to start WA firmware

[ 34.418089] mt7986-wmac: probe of 18000000.wifi failed with error -110

No, regdb is not needed for driver to load…it is only needed to start Accesspoint in 5ghz and above

What kind of usb2serial adapter do you use? Only ftdi are known to work without issues. Most others prevent wifi fronent to start with a error similar to this

I’m using this model, I already ordered an FTDI and I’m waiting for it to arrive.

Unfortunately all the kernels and tests performed were with this USB2SERIAL connected to the BPI-R3 :frowning:

14 22

As soon as it arrives I will carry out new tests with the FTDI

Thanks in advance for your attention.

You could configure your network and users with the adapter,booting up without it and then work through ssh to check if this is the rootcause

I used FTDI and turned on the BPI-R3 and the Wi-Fi went up.

I never imagined that the incorrect USB2SERIAL could bring so many problems.

LOL :slight_smile:

Thank you very much!

Hi @frank-w ,

Thanks for your Kernel repo and CI releases, they are quite helpful. I am trying to get Wireguard working on BPI-R3, and from a quick look Release CI-BUILD-6.1-main-6.1.60-2023-10-26_1511 · frank-w/BPI-Router-Linux · GitHub should work? So, I have installed the debian packages to do the kernel upgrade and they got installed, but I don’t know how to choose the kernel version in u-boot, it still boots the old one that I had installed using a single image.

Do you have a corresponding single .img file for above github release? Something similar to bpi-r3 - Google Drive

TIA.

There is no img for newer kernel,but you can create one with my bpi-router images repo.

But you can also point to the new kernel with uEnv.txt (in root of bpi-boot partition)…adding the Filename to it like this

fit=6.1.60.itb

Ah, excellent. I will try first switching to the new kernel, if not I will try to generate a single img and flash. Thanks for the prompt reply.

I just checked, the file is part of the Kernel, for the single image that I had flashed: /boot/bananapi/bpi-r3/linux-5.15/uEnv.txt but installing the debian packages created a new folder that only has below contents:

# ls -l /boot/bananapi/bpi-r3/linux/
total 44752
-rwxr-xr-x 1 root root  8551672 Oct 26 17:13 bpi-r3-6.1.60-bpi-r3-main.itb
drwxr-xr-x 2 root root     4096 Dec 17 19:51 dtb
-rwxr-xr-x 1 root root 14025500 Dec 17 19:51 initrd.img-6.1.60-bpi-r3-main
-rwxr-xr-x 1 root root 23237184 Oct 26 17:13 uImage_nodt-6.1.60-bpi-r3-main

So, I still don’t know how to upgrade and switch to new kernel just by installing debian packages as we do in Desktop Ubuntu. I will try building a single image.

Thanks.

Oh,seems i missed packing itb into the deb…but if you compiled it by yourselb you can copy it manually from bpi-r3.itb in root of source dir to bpi-boot root

I have build the single image using your script from GitHub - frank-w/BPI-Router-Images to build 6.1-main and it worked, but Wireguard still doesn’t work, I should probably re-compile with CONFIG_WIREGUARD=m, I see the statement https://github.com/frank-w/BPI-Router-Images/blob/main/buildimg.sh#L19, can I just use 6.6-wireless-next to get both wireguard and Wi-Fi working?

The link points to kernel 5.15 for bpi-r2 overriding default 6.1

You can compile kernel by yourself and install it to the flashed card or pack kernel and point to the tar.gz file before creating the image (using skipkerneldownload=1 and kernelfile=… In sourcefiles_‘+board+’.conf’)

You should only use the main branches (or for bpi-r4 special ones)

Hi @frank-w ,

I was able to build the kernel with custom config, and created a image and flashed to SD card. It boots my kernel fine, but its stuck waiting for root device: Waiting for root device /dev/mmcblk0p6... any ideas? Inspecting the BPI-ROOT partition, it seems fine i.e., the filesystem it present.

[Update: Actually the modules are not installed to the SD because of disparity in INSTALL_MOD_PATH pointing to mod but also looking for SD/BPI-ROOT]

[Update2: Sorry, above update is wrong: I am getting this error BPI-Router-Linux/Makefile:741: include/config/auto.conf: No such file or directory causing the modules install to fail]

Have you loaded the right config from fit image? On r3 the sd overlay has to be loaded.

You can define a initrd by adding

initrd=rootfs.cpio.gz

To uEnv.txt

If you have such file you can get a system without depency to sdcard (ram only) to check if devicetree and drivers are right. Imho i have such on my gdrive.

In the bpi-r3.its file the ramdisk is commented out. And I am using conf-sd configuration, it does boot my custom kernel fine.

Another mystery is, I don’t have uEnvtxt in BPI-BOOT, I am just doing ./build.sh install, but it only installs itb.

BTW, still trying to figure out below error, not directly related to waiting on root, but I am sure next it will complain about missing modules:

$ ./build.sh pack
6.6.0
Pack Kernel to Archive
generate branch vars...
getting git branch: 
* 6.6_main
kernbranch:6.6_main,gitbranch:_main
cleanup...
copy...
INSTALL_MOD_PATH: ../SD/BPI-ROOT/
make[1]: Entering directory '/build'

  ERROR: Kernel configuration is invalid.
         include/generated/autoconf.h or include/config/auto.conf are missing.
         Run 'make oldconfig && make prepare' on kernel src to fix it.

/BPI-Router-Linux/Makefile:741: include/config/auto.conf: No such file or directory
make[2]: *** [/BPI-Router-Linux/Makefile:806: include/config/auto.conf] Error 1
make[1]: *** [/BPI-Router-Linux/Makefile:234: __sub-make] Error 2
make[1]: Leaving directory '/build'
make: *** [Makefile:234: __sub-make] Error 2
find: ‘../SD/BPI-ROOT/lib/modules/*’: No such file or directory
pack...
-rw-rw-r-- 1   21M Dec 21 02:02 /SD/bpi-r2_6.6.0_main.tar.gz

By default kernel is built in ramdisk,so lost after reboot.

You have to start with importconfig to mount builddir or disable it in build.conf

./build.sh importconfig
./build.sh config
./build.sh
./build.sh pack

I made defconfig the way it should have all necessary (except wifi) builtin to have a clean start also when booting fit via tftp

Yes in fit the initrd is commented out,but my uboot can have an initrd too to not have it in the fit (which blow up fit)…so i have the initrd only once on card

Ok,if the conf-sd is correctly loaded,then dt should not be the problem…mmc driver should be builtin

uEnv.txt is not created by image-script as it is initially empty (using my u-boot builtin environment). uEnv.txt allows to override this but it has to be created.