[BPI-R64] debian buster with new bootchain and linux 5.10

Hi,

i’ve created a new sdcard-image (currently for testing only) with new Bootchain (new Preloader/ATF/uboot-fip), GPT and linux 5.10 (including sdcard-fix)

i guess it’s not complete and maybe it is too big for emmc (have not tested), i used a fixed value of 8000MB (truncate breaks image, maybe my calculation does not work for gpt :thinking: )

https://drive.google.com/drive/folders/1wpBrJEstSPb90HE7R17NncQ9MsXHzWcx?usp=sharing

  • r64_buster_newatf_5.10.img.gz
  • r64_buster_newatf_5.10.img.gz.md5

login

  • user: root
  • password: bananapi

regards Frank

1 Like

What login and password?

root/bananapi as in my other images :slight_smile:

btw. my truncate-calculation is at follows (don’t wanted to add this to first post):

myimage=myimage.img
size=$(fdisk -l $myimage | tail -1 | awk '{print $3}')
truncate --size=$[($size+1)*512] $myimage

so basicly use end-sector ($3) of last partition (tail -1), add 1 (sector counts from 0) and multiply with sector-size (512bytes). maybe i need to add 2 because GPT stores backup of main data in last sector, so image needs to be 1 sector larger than mapped to partitions

edit: i do not know how much the backup-gpt is, but it is at the end of disk. so if doing a truncate to last partition end + x sectors the backup gpt needs to be rewritten…this can be done via

warning: gparted breaks bootloader when fixing backup-gpt, don’t know why

gparted /dev/loopX

(or using the sdcard-device) and gparted asks for repair.

I know this is offtop but someone know how adjust internet and ssl acses to debian. Because I can get access to serial interface only.

openssh should be configured to ip 192.168.0.18 on port lan0, root-access enabled (should be disabled if other users are created)

change /etc/network/interfaces to different ip setting

https://wiki.fw-web.de/doku.php?id=en/bpi-r2/network/start

for bridging you need to install bridge-utils first and then add this to interfaces file (example for lan1+lan2)

auto lan1
iface lan1 inet manual
auto lan2
iface lan2 inet manual

auto br0
iface br0 inet static
    address 192.168.40.1
    netmask 255.255.255.0
    bridge_ports lan1 lan2
    bridge_fd 5
    bridge_stp no

and run (better from serial console, because ssh will be dropped)

service networking restart

you need to change dns (in image 192.168.0.10) in /etc/resolv.conf and default gateway (in interfaces file too) before you can install anything. so just change lan0-ip to one in your subnet and gateway in interfaces + nameserver in resolv.conf first

i see wan-port is configured as dhcp-client, but have not tested it, because i use fixed ip’s here

Hi Frank,

I’ve got both the R64 and R2 running with Ubuntu 20.04 and Kernel 5.4. Can you please point me in the right direction to get the kernel version to 5.8? I need both JIT eBPF and native support for Intel AX200 2723, which does not work with the backports. For the life of me I cannot find the BPI process to update the uBoot’s to 5.8. Mainline works with 5.8 for both arm7 and arm64 so it should be a fairly simple upgrade(I hope).

Thanks, Werner

As 5.8 is no lts you should use 5.10. You can get it from my repo and install the known way.

  • change build.conf to r64
  • build.sh importconfig
  • build.sh config # to add your driver
  • build.sh # compile and use install option to install to sdcard (install fit)
  • add entry fit=yourfilename to uenv.txt
1 Like

Thanks Frank. This is great news. Will update

Just wanted to shout out a huge thank you for the above Frank. Compiled right through with the second attempt. Full XDP and the Intel 200A X is working a treat on the R64. Compiling the R2 code now.

'[    7.173076] iwlwifi 0000:01:00.0: loaded firmware version 46.3cfab8da.0 cc-a0-46.ucode op_mode iwlmvm
[    7.344003] iwlwifi 0000:01:00.0: Detected Intel(R) Wi-Fi 6 AX200 160MHz, REV=0x340
[    7.513981] iwlwifi 0000:01:00.0: base HW address: 34:13:e8:c7:9f:a7
[    7.589387] iwlwifi 0000:01:00.0 wlp1s0: renamed from wlan0
ISTRIB_DESCRIPTION="Ubuntu 18.04.5 LTS"
Linux bpi-r64 5.10.25-bpi-r64-main #1 SMP PREEMPT Tue Apr 6 20:15:39 SAST 2021 aarch64 aarch64 aarch64 GNU/Linux
Plus KVM:
[root@bpi-r64 ~]# kvm-ok 
INFO: /dev/kvm exists
KVM acceleration can be used'

All support in 18.04 for what is needed. Will post some results of performance on XDP on the AX. Tonight it is all LXC with WRT to control that card.

Thanks a stack

Is the same sdcard-image planned for R2?

No atf is only for arm64

for eMMC usage you need following steps (currently untested)

  • on first emmc-setup configure partition config (mmc partconf in uboot, see readme on my BPI-R64-ATF repo)
  • flash bl2 to boot0
  • flash image to user-partition (/dev/mmcblk0)
  • change root in your BPI_BOOT/bananapi/bpi-r64/linux/uEnv.txt (partition for reading this file should be detected by my script)
  • flash emmc-header and fip (or bpi-r64_emmc.img)
  • change BPI-ROOT/etc/fstab to match your emmc (/dev/mmcblk0pX instead of /dev/mmcblk1pX)

files for flashing can be found/compiled here: https://github.com/frank-w/BPI-R64-ATF/releases

1 Like

I successfully installed on emmc, but I have problem with running any docker image. Can someone help me with setting it up? I already tried multiple docker versions.

server@bpi-r64:~$ sudo docker run hello-world
docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting 
container process caused: process_linux.go:402: getting the final child's pid from pipe caused: EOF: unknown.
ERRO[0005] error waiting for container: context canceled

journalctl:

May 29 20:33:44 bpi-r64 systemd[1]: Starting Docker Application Container Engine...
May 29 20:33:46 bpi-r64 dockerd[307]: time="2021-05-29T20:33:46.305069018+02:00" level=info msg="Starting up"
May 29 20:33:46 bpi-r64 dockerd[307]: time="2021-05-29T20:33:46.322750298+02:00" level=info msg="parsed scheme: \"unix\"" module=grpc
May 29 20:33:46 bpi-r64 dockerd[307]: time="2021-05-29T20:33:46.324040858+02:00" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
May 29 20:33:46 bpi-r64 dockerd[307]: time="2021-05-29T20:33:46.324370698+02:00" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}" module=grpc
May 29 20:33:46 bpi-r64 dockerd[307]: time="2021-05-29T20:33:46.324604618+02:00" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
May 29 20:33:46 bpi-r64 dockerd[307]: time="2021-05-29T20:33:46.366778058+02:00" level=info msg="parsed scheme: \"unix\"" module=grpc
May 29 20:33:46 bpi-r64 dockerd[307]: time="2021-05-29T20:33:46.366968378+02:00" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
May 29 20:33:46 bpi-r64 dockerd[307]: time="2021-05-29T20:33:46.367137578+02:00" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}" module=grpc
May 29 20:33:46 bpi-r64 dockerd[307]: time="2021-05-29T20:33:46.367262618+02:00" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
May 29 20:33:46 bpi-r64 dockerd[307]: time="2021-05-29T20:33:46.476874938+02:00" level=info msg="[graphdriver] using prior storage driver: overlay2"
May 29 20:33:46 bpi-r64 dockerd[307]: time="2021-05-29T20:33:46.560622458+02:00" level=warning msg="Your kernel does not support swap memory limit"
May 29 20:33:46 bpi-r64 dockerd[307]: time="2021-05-29T20:33:46.560807098+02:00" level=warning msg="Your kernel does not support cgroup blkio weight"
May 29 20:33:46 bpi-r64 dockerd[307]: time="2021-05-29T20:33:46.560895178+02:00" level=warning msg="Your kernel does not support cgroup blkio weight_device"
May 29 20:33:46 bpi-r64 dockerd[307]: time="2021-05-29T20:33:46.560993978+02:00" level=warning msg="Your kernel does not support cgroup blkio throttle.read_bps_device"
May 29 20:33:46 bpi-r64 dockerd[307]: time="2021-05-29T20:33:46.561113578+02:00" level=warning msg="Your kernel does not support cgroup blkio throttle.write_bps_device"
May 29 20:33:46 bpi-r64 dockerd[307]: time="2021-05-29T20:33:46.561204618+02:00" level=warning msg="Your kernel does not support cgroup blkio throttle.read_iops_device"
May 29 20:33:46 bpi-r64 dockerd[307]: time="2021-05-29T20:33:46.561299178+02:00" level=warning msg="Your kernel does not support cgroup blkio throttle.write_iops_device"
May 29 20:33:46 bpi-r64 dockerd[307]: time="2021-05-29T20:33:46.566458378+02:00" level=info msg="Loading containers: start."
May 29 20:33:46 bpi-r64 dockerd[307]: time="2021-05-29T20:33:46.759824458+02:00" level=warning msg="Running modprobe bridge br_netfilter failed with message: modprobe: WARNING: Module br_netfilter not found in directory /lib/modules/5.10.0-bpi-r64-main\n, error: exit status 1"
May 29 20:33:48 bpi-r64 dockerd[307]: time="2021-05-29T20:33:48.017557178+02:00" level=warning msg="Could not load necessary modules for IPSEC rules: protocol not supported"
May 29 20:33:49 bpi-r64 dockerd[307]: time="2021-05-29T20:33:49.975214698+02:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address"
May 29 20:33:53 bpi-r64 dockerd[307]: time="2021-05-29T20:33:53.200958938+02:00" level=info msg="Loading containers: done."
May 29 20:33:54 bpi-r64 dockerd[307]: time="2021-05-29T20:33:54.458077658+02:00" level=info msg="Docker daemon" commit=8728dd2 graphdriver(s)=overlay2 version=20.10.6
May 29 20:33:54 bpi-r64 dockerd[307]: time="2021-05-29T20:33:54.463381018+02:00" level=info msg="Daemon has completed initialization"
May 29 20:33:55 bpi-r64 systemd[1]: Started Docker Application Container Engine.
May 29 20:33:56 bpi-r64 dockerd[307]: time="2021-05-29T20:33:56.048123098+02:00" level=info msg="API listen on /var/run/docker.sock"
May 29 20:41:01 bpi-r64 dockerd[307]: time="2021-05-29T20:41:01.028699682+02:00" level=error msg="stream copy error: reading from a closed fifo"
May 29 20:41:01 bpi-r64 dockerd[307]: time="2021-05-29T20:41:01.031343271+02:00" level=error msg="stream copy error: reading from a closed fifo"
May 29 20:41:01 bpi-r64 dockerd[307]: time="2021-05-29T20:41:01.578196168+02:00" level=error msg="be0a8cb145e9035fb9ef64c1dbfb11a2fd9928ca5afdaa3e0872dada74a6e721 cleanup: failed to delete container from containerd: no such container"
May 29 20:41:01 bpi-r64 dockerd[307]: time="2021-05-29T20:41:01.590674279+02:00" level=error msg="Handler for POST /v1.41/containers/be0a8cb145e9035fb9ef64c1dbfb11a2fd9928ca5afdaa3e0872dada74a6e721/start returned error: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:402: getting the final child's pid from pipe caused: EOF: unknown"

check-config.sh:

server@bpi-r64:~$ ./check-config.sh
info: reading kernel config from /proc/config.gz ...

Generally Necessary:
- cgroup hierarchy: properly mounted [/sys/fs/cgroup]
- CONFIG_NAMESPACES: enabled
- CONFIG_NET_NS: enabled
- CONFIG_PID_NS: enabled
- CONFIG_IPC_NS: enabled
- CONFIG_UTS_NS: missing
- CONFIG_CGROUPS: enabled
- CONFIG_CGROUP_CPUACCT: enabled
- CONFIG_CGROUP_DEVICE: enabled
- CONFIG_CGROUP_FREEZER: enabled
- CONFIG_CGROUP_SCHED: enabled
- CONFIG_CPUSETS: enabled
- CONFIG_MEMCG: enabled
- CONFIG_KEYS: enabled
- CONFIG_VETH: enabled (as module)
- CONFIG_BRIDGE: enabled
- CONFIG_BRIDGE_NETFILTER: missing
- CONFIG_IP_NF_FILTER: enabled (as module)
- CONFIG_IP_NF_TARGET_MASQUERADE: enabled (as module)
- CONFIG_NETFILTER_XT_MATCH_ADDRTYPE: enabled (as module)
- CONFIG_NETFILTER_XT_MATCH_CONNTRACK: enabled (as module)
- CONFIG_NETFILTER_XT_MATCH_IPVS: enabled (as module)
- CONFIG_NETFILTER_XT_MARK: enabled (as module)
- CONFIG_IP_NF_NAT: enabled (as module)
- CONFIG_NF_NAT: enabled (as module)
- CONFIG_POSIX_MQUEUE: enabled

Optional Features:
- CONFIG_USER_NS: enabled
- CONFIG_SECCOMP: enabled
- CONFIG_SECCOMP_FILTER: enabled
- CONFIG_CGROUP_PIDS: enabled
- CONFIG_MEMCG_SWAP: missing
    (cgroup swap accounting is currently enabled)
- CONFIG_BLK_CGROUP: enabled
- CONFIG_BLK_DEV_THROTTLING: missing
- CONFIG_CGROUP_PERF: enabled
- CONFIG_CGROUP_HUGETLB: missing
- CONFIG_NET_CLS_CGROUP: missing
- CONFIG_CGROUP_NET_PRIO: enabled
- CONFIG_CFS_BANDWIDTH: enabled
- CONFIG_FAIR_GROUP_SCHED: enabled
- CONFIG_RT_GROUP_SCHED: enabled
- CONFIG_IP_NF_TARGET_REDIRECT: enabled (as module)
- CONFIG_IP_VS: enabled (as module)
- CONFIG_IP_VS_NFCT: missing
- CONFIG_IP_VS_PROTO_TCP: missing
- CONFIG_IP_VS_PROTO_UDP: missing
- CONFIG_IP_VS_RR: missing
- CONFIG_SECURITY_SELINUX: missing
- CONFIG_SECURITY_APPARMOR: missing
- CONFIG_EXT4_FS: enabled
- CONFIG_EXT4_FS_POSIX_ACL: missing
- CONFIG_EXT4_FS_SECURITY: missing
    enable these ext4 configs if you are using ext3 or ext4 as backing filesystem
- Network Drivers:
  - "overlay":
    - CONFIG_VXLAN: missing
    - CONFIG_BRIDGE_VLAN_FILTERING: missing
      Optional (for encrypted networks):
      - CONFIG_CRYPTO: enabled
      - CONFIG_CRYPTO_AEAD: enabled
      - CONFIG_CRYPTO_GCM: enabled (as module)
      - CONFIG_CRYPTO_SEQIV: enabled (as module)
      - CONFIG_CRYPTO_GHASH: enabled (as module)
      - CONFIG_XFRM: enabled
      - CONFIG_XFRM_USER: missing
      - CONFIG_XFRM_ALGO: enabled (as module)
      - CONFIG_INET_ESP: missing
  - "ipvlan":
    - CONFIG_IPVLAN: missing
  - "macvlan":
    - CONFIG_MACVLAN: missing
    - CONFIG_DUMMY: enabled (as module)
  - "ftp,tftp client in container":
    - CONFIG_NF_NAT_FTP: enabled (as module)
    - CONFIG_NF_CONNTRACK_FTP: enabled (as module)
    - CONFIG_NF_NAT_TFTP: missing
    - CONFIG_NF_CONNTRACK_TFTP: missing
- Storage Drivers:
  - "aufs":
    - CONFIG_AUFS_FS: missing
  - "btrfs":
    - CONFIG_BTRFS_FS: missing
    - CONFIG_BTRFS_FS_POSIX_ACL: missing
  - "devicemapper":
    - CONFIG_BLK_DEV_DM: missing
    - CONFIG_DM_THIN_PROVISIONING: missing
  - "overlay":
    - CONFIG_OVERLAY_FS: enabled
  - "zfs":
    - /dev/zfs: missing
    - zfs command: missing
    - zpool command: missing

Limits:
- /proc/sys/kernel/keys/root_maxkeys: 1000000

I guess you need to compile own kernel with at least necessary options (see which are missing) added.

- CONFIG_UTS_NS: missing
- CONFIG_BRIDGE_NETFILTER: missing

Change board in build.conf and run

  • ./build.sh importconfig
  • ./build.sh config
  • ./build.sh

Install fit to sdcard in last step and update uenv.txt

I wondered if there’s a way without compiling a kernel. Buuut I did it for the first time and it wasn’t as “bad” as i thought (it was really easy to do). It works now, thank you.

my build.sh makes it a bit easier :slight_smile:

Which options have you added? Maybe i add them to defconfig

I added UTS_NS, BRIDGE_NETFILTER, EXT4_FS_POSIX_ACL, EXT4_FS_SECURITY, SECURITY_APPARMOR and fuse

I don’t know why, but look at this. I can’t change scaling_max_freq to anything other than 30MHz.

root@bpi-r64:/sys/devices/system/cpu/cpu1# cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to [email protected], please.
analyzing CPU 0:
  driver: mtk-cpufreq
  CPUs which run at the same hardware frequency: 0 1
  CPUs which need to have their frequency coordinated by software: 0 1
  maximum transition latency: 4294.55 ms.
  hardware limits: 30.0 MHz - 1.35 GHz
  available frequency steps: 30.0 MHz, 438 MHz, 600 MHz, 813 MHz, 1.03 GHz, 1.14 GHz, 1.26 GHz, 1.35 GHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
  current policy: frequency should be within 30.0 MHz and 30.0 MHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 120 MHz (asserted by call to hardware).
  cpufreq stats: 30.0 MHz:99.68%, 438 MHz:0.10%, 600 MHz:0.08%, 813 MHz:0.06%, 1.03 GHz:0.02%, 1.14 GHz:0.02%, 1.26 GHz:0.04%, 1.35 GHz:0.00%  (7)
analyzing CPU 1:
  driver: mtk-cpufreq
  CPUs which run at the same hardware frequency: 0 1
  CPUs which need to have their frequency coordinated by software: 0 1
  maximum transition latency: 4294.55 ms.
  hardware limits: 30.0 MHz - 1.35 GHz
  available frequency steps: 30.0 MHz, 438 MHz, 600 MHz, 813 MHz, 1.03 GHz, 1.14 GHz, 1.26 GHz, 1.35 GHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
  current policy: frequency should be within 30.0 MHz and 30.0 MHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 120 MHz (asserted by call to hardware).
  cpufreq stats: 30.0 MHz:99.68%, 438 MHz:0.10%, 600 MHz:0.08%, 813 MHz:0.06%, 1.03 GHz:0.02%, 1.14 GHz:0.02%, 1.26 GHz:0.04%, 1.35 GHz:0.00%  (7)

I guess problem is the cpu step down due to wrong temperature handling

Try the patch posted here

1 Like

Yeah, it works now, thanks.