Debian/Ubuntu image creation

Good news :tada:

First is no error,just ignore it :slight_smile: Second depends on root-var defined in ubootā€¦you can change it in uEnv.txt. as mmcblk1 is sd and you have removed sd it stops here.

create a uEnv.txt in boot-partition (bananapi/bpi-r64/linux/) and set root like it is done in builtin environment but with mmcblk0p2

Do not forget /etc/fstab on emmc when booting sdcard again

Thank You Frank !!!

i have wrote only one string )

and can boot root from sata :partying_face:

root@bpi-r64:/# cat /boot/bananapi/bpi-r64/linux/uEnv.txt                    
#
## uEnv.txt
#
root=/dev/sda1 rootfstype=ext4 rootwait

root@bpi-r64:/# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        30G  957M   27G   4% /
tmpfs           496M     0  496M   0% /dev/shm
tmpfs           199M  644K  198M   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/mmcblk0p4  100M   21M   80M  21% /boot
/dev/sda2        88G   16G   68G  19% /shara
tmpfs           100M     0  100M   0% /run/user/0
tmpfs           100M     0  100M   0% /run/user/1000
root@bpi-r64:/# 

final question:

how can i add a driver module to the kernel ?

i need an additional usb wifi-5g card

You can clone my kernel repo, switch to branch you want (x.y-main),change board in build.conf to bpi-r64,and run the build.sh steps described in readme to add your driver to menuconfig,build and pack

thanks Frank, iā€™ll try )

After building/packing you get a tar.gz file where you have 2 folders BPI-BOOT (kernel) and BPI-ROOT (modules) which contain content you need to unpack to the right partition

In my uboot-repo readme i described how you can do this

Beware that r64 uses subfolder bananapi/bpi-r64/linux for itb and uEnv.txt,rest is same

Hello Frank

i have assemble kernel 6.6.14, but there is no sata driver

can you tell me which driver module needs to be enabled?

[    2.546775] Waiting for root device /dev/sda1...

you had 6.1 before and there it was working? defconfig for r64 is same in both branchesā€¦

CONFIG_AHCI_MTK=y

and it is set in 6.6-main tooā€¦

i missed a patch in 6.6 (asm-sel is different and sata nodes were disabled) due to missing time, sorry

added it and pushed current stateā€¦please pull the changes and compile again

Hi Frank

i managed to install everything well, Thank you !

may i advise you to add the option to the kernel

(Networking support > Networking options > Network packet filtering framework (Netfilter) >REDIRECT target support)

image

a router must still be able to redirect packets )

I guess there are more options missing (like iptables,nftables) for r64 as i have never configured as router.

Wouldnā€™t it be easier to maintain 1 kernel config for all bpi mediatek routers? The difference in kernel Image size is not so much.

Iā€™m not sure if i can combine defconfigs for r64,r3 and r4 (and the right options were taken based on dts). Already thought about similar system as openwrt (using a device specific defconfig and adding general options on top, yes,openwrt has generic as base and adds specific ). But some specific drivers are not used on other boards so i left it by separate defconfigs

Works fine hereā€¦ Just need to remember that some options in R4 kernel are not available in other kernels. That makes saving the defconfig a bit tricky.

Gentlemens

the vendor declares all three products as routers and if you have masquerading enabled in the kernel, it should be also the option redirect ) there are no conflicts in all three products with this option

i only listed 3 productsā€¦my kernel supports now R2,R3,R4,R3Mini and R2Pro :stuck_out_tongue:

for a router a bunch of options make sense which may not enabled at the momentā€¦i guess for r64 i also miss some iptables/nftables options, thats why iā€™m thinking of defining a device-specific defconfig and one for ā€œrouter optionsā€ which are merged before import, but this is much more work and i have limited time :stuck_out_tongue:

i tried to enable only options needed to make kernels as small as possible to save time for compiling (also in CI) and space on my cards for testing (where i need to have multiple kernels installed when testing e.g. wifi which needs modules installed so cannot use tftp here)ā€¦for some tests i needs to reinstall kernels very often which harms my cards with (in first place) unused stuff. of course i can enable the redirect and some others in first step, but target should be maintaing these options only once and in a way i can disable these for testing (when not used)ā€¦this needs a good concept to not break any usecase :slight_smile:

Have anyone succedded with Debian for BPI-R4? I get stuck at:

[    2.513532] Waiting for root device /dev/mmcblk0p6...
[    2.669144] usb 3-1: new high-speed USB device number 2 using xhci-mtk
[    2.851965] hub 3-1:1.0: USB hub found
[    2.855879] hub 3-1:1.0: 5 ports detected
[    2.999368] usb 4-1: new SuperSpeed USB device number 2 using xhci-mtk
[    3.031894] hub 4-1:1.0: USB hub found
[    3.035794] hub 4-1:1.0: 4 ports detected
[    3.110310] mtk_soc_eth 15100000.ethernet: generated random MAC address ae:30:06:12:e3:4a
[    3.250293] mtk_soc_eth 15100000.ethernet: generated random MAC address ae:e9:0b:38:09:5e
[    3.549141] usb 3-1.5: new high-speed USB device number 3 using xhci-mtk
[    3.810301] mtk_soc_eth 15100000.ethernet: generated random MAC address aa:ca:ed:bc:2b:28
[   12.689562] mtk_usxgmii: probe of 10080000.pcs failed with error -1
[   12.696054] mtk_usxgmii: probe of 10081000.pcs failed with error -1
[   12.830297] mtk_soc_eth 15100000.ethernet: generated random MAC address 16:80:20:0c:08:31
[   12.838642] platform sfp1-wan: deferred probe pending
[   12.843690] platform sfp2-lan: deferred probe pending
[   12.848727] platform 15020000.switch: deferred probe pending
[   12.854377] platform 15100000.ethernet: deferred probe pending

mmc 0:6 correctly visible in U-boot

BPI-R4> ls mmc 0:6
<DIR>       4096 .
<DIR>       4096 ..
<DIR>      16384 lost+found
<DIR>       4096 media
<DIR>       4096 opt
<DIR>       4096 srv
<DIR>       4096 mnt
<DIR>       4096 tmp
<DIR>       4096 sys
<DIR>       4096 run
<DIR>       4096 root
<DIR>       4096 proc
<DIR>       4096 home
<DIR>       4096 dev
<DIR>       4096 boot
<DIR>       4096 etc
<SYM>          7 lib
<SYM>          8 sbin
<DIR>       4096 usr
<SYM>          7 bin
<DIR>       4096 var

/dev/mmcblk0p6 in fstab as well.

# <file system>         <dir>   <type>  <options>               <dump>  <pass>
/dev/mmcblk0p5          /boot   vfat    errors=remount-ro       0       1
/dev/mmcblk0p6          /       ext4    defaults                0       0

Boot on itā€™s place(p5).

crudo@bpi-imagebuilder:/media$ ls
bpi-r4.dtb  bpi-r4.itb  uEnv.txt  uImage_nodt
crudo@bpi-imagebuilder:/media$ cat uEnv.txt
crudo@bpi-imagebuilder:/media$

Am i missing drivers?

crudo@bpi-imagebuilder:/mnt/lib/modules/6.6.0-bpi-r4-r4$ ls
build   modules.alias      modules.builtin            modules.builtin.bin      modules.dep      modules.devname  modules.softdep  modules.symbols.bin
kernel  modules.alias.bin  modules.builtin.alias.bin  modules.builtin.modinfo  modules.dep.bin  modules.order    modules.symbols

Sandisk SD card 32GB.

How have you created the image? One thing i wonder is that /lib is a dir and no symlinkā€¦but your bootlog says you have on recognition of root partition so maybe your p6 is not the expected filesystem or there is an error in mmc driverā€¦maybe the sdcard overlay is not loaded? Please show bootlog from uboot where kernel is loaded and which bootconf

[Edit] Got rid of codeblocks so dis readable

As normal Bpi-Router-Image didnā€™t work i started with:

  1. git clone -b 6.6-r4 GitHub - frank-w/BPI-Router-Linux: Linux kernel 4.14+ for BPI-R2, 5.4+ for R64, 6.1+ for R2Pro and R3
  2. ./build.sh importconfig
  3. ./build.sh config ā†’ I only want for CPU scheduler to be in performance mode all the time so do that & save
  4. ./build.sh ā†’ pack(option no 1)

then with builded kernel n uboot w debian :

  1. git clone GitHub - frank-w/BPI-Router-Images
  2. edit sourcefiles to be:
crudo@bpi-imagebuilder:~/BPI-Router-Images$ cat sourcefiles_bpi-r4.conf
imgfile=bpi-r4_sdmmc.img.gz
skipkerneldownload=1
kernelfile=bpi-r4_6.6.0-r4.tar.gz

(kernel file is the one iā€™ve built and cpā€™d)

  1. sudo ./buildimg.sh bpi-r4 (bookworm/bullseye[as both end up in the same state])

  2. pastebin.com of buildimg.sh bpi-r4

  3. unzip the archive with 7zip on win and flash .img using win32diskimg

  4. pastebin.com of boot on serial

This looks like Debian was just not starting.

bootconf=#conf-sd

Is that what could mean ā€œsd-card overlayā€ not enabled? & how to enable?

Could you try 6.8 dango tree? Iā€™m not sure 6.6-r4 is for actual board version.

Bootconf should be selected automaticly by my uboot based on emmc check (mmc partconf returning error).

But here the bootlog from uboot (copy it from your terminal) is needed to see if the right overlay is loaded.

If point no 6 from my last post ā€œ. pastebin.com of boot on serialā€ is not a bootlog from uboot then what should i display, where and how? /var/log/boot.log from /root of image that Iā€™ve tried to run?

BTW trying 6.8 rn