Build package for raspberry pi 4 aarch64

Hi, I’m trying to build an aarch64 package for raspberry pi’s.

I initialized lxd according to these instructions: https://flutter.dev/docs/deployment/linux

When I try to build the package I got this error:

snapcraft --use-lxd
Launching a container.
Build environment is in unknown state, cleaning first.
Stopped
An error occurred with the instance when trying to start with 'LXD': Failed preparing container for start: Failed to start device "eth0": Failed to create the veth interfaces veth0d294928 and veth35076f31: Failed to run: ip link add veth0d294928 type veth peer name veth35076f31: Error: Unknown device type..
Ensure that 'LXD' is setup correctly and try again.
uname -a
Linux dotup-pi006 5.13.0-1008-raspi #9-Ubuntu SMP PREEMPT Wed Sep 29 08:27:44 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
cat /etc/os-release
PRETTY_NAME="Ubuntu 21.10"
NAME="Ubuntu"
VERSION_ID="21.10"
VERSION="21.10 (Impish Indri)"
VERSION_CODENAME=impish
ID=ubuntu
ID_LIKE=debian

What’s the best/easiest way to build a package for aarch64?

Thanks!

did you add your user to the lxd group ? and did you log out and back in again to make the new group actually take effect ?

Yes, with logout and reboot. I tried vscode remote, vscode local and terminal.

uid=1000(pullrich) gid=1000(pullrich) groups=1000(pullrich),4(adm),24(cdrom),27(sudo),30(dip),33(www-data),46(plugdev),122(lpadmin),133(lxd),134(sambashare),136(docker)

hmm, i wonder if something in the 21.10 kernel is missing … does sudo lxd.check-kernelreveal anything ?

/snap/lxd/21623/bin/lxc-checkconfig: 69: lxc-start: not found
LXC version 
Kernel configuration not found at /proc/config.gz; searching...
Kernel configuration found at /boot/config-5.13.0-1008-raspi
--- Namespaces ---
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
newuidmap is not installed
newgidmap is not installed
Network namespace: enabled

--- Control groups ---
Cgroups: enabled
Cgroup namespace: enabled

Cgroup v1 mount points: 


Cgroup v2 mount points: 
/sys/fs/cgroup

Cgroup v1 systemd controller: missing
Cgroup v1 freezer controller: missing
Cgroup ns_cgroup: required
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: enabled
Cgroup cpuset: enabled

--- Misc ---
Veth pair device: enabled, not loaded
Macvlan: enabled, not loaded
Vlan: enabled, not loaded
Bridges: enabled, loaded
Advanced netfilter: enabled, loaded
CONFIG_NF_NAT_IPV4: missing
CONFIG_NF_NAT_IPV6: missing
CONFIG_IP_NF_TARGET_MASQUERADE: enabled, not loaded
CONFIG_IP6_NF_TARGET_MASQUERADE: enabled, not loaded
CONFIG_NETFILTER_XT_TARGET_CHECKSUM: enabled, loaded
CONFIG_NETFILTER_XT_MATCH_COMMENT: enabled, loaded
FUSE (for use with lxcfs): enabled, not loaded

--- Checkpoint/Restore ---
checkpoint restore: enabled
CONFIG_FHANDLE: enabled
CONFIG_EVENTFD: enabled
CONFIG_EPOLL: enabled
CONFIG_UNIX_DIAG: enabled
CONFIG_INET_DIAG: enabled
CONFIG_PACKET_DIAG: enabled
CONFIG_NETLINK_DIAG: enabled
File capabilities: 

Note : Before booting a new kernel, you can check its configuration
usage : CONFIG=/path/to/config /snap/lxd/21623/bin/lxc-checkconfig

that looks all good … if you have only installed lxd for snap building i’d snap remove --purge lxd, re-install it and run sudo lxd init --auto again to make sure it is not anything with the initial setup. if you still can not get it working then and are not particularly tied to the classic (deb based) install on this Pi, you could try what i describe here:

1 Like

Unfortunately, the reinstallation did not help. I’ll read your link tomorrow. Thank you!

I got some problems today with the Docker network.

https://forum.radxa.com/t/running-docker-on-ubuntu-server-image/6455

https://askubuntu.com/questions/1274221/veth-ko-missing

could that CONFIG_VETH be the problem with lxd?

Well it is not missing in 18.04 and 20.04, if it is missing that would be a regression in 21.10

the lxd.check-kernel output indicates it is there though

sudo modprobe veth
modprobe: FATAL: Module veth not found in directory /lib/modules/5.13.0-1008-raspi
cd /lib/modules && find . -type f -name "*veth*" -exec echo {} \;
./5.11.0-1019-raspi/kernel/drivers/net/veth.ko
/lib/modules$ lsmod | grep veth | wc -l
0
/lib/modules$ sudo insmod /lib/modules/5.11.0-1019-raspi/kernel/drivers/net/veth.ko 
insmod: ERROR: could not insert module /lib/modules/5.11.0-1019-raspi/kernel/drivers/net/veth.ko: Invalid module format
/lib/modules$ uname -a
Linux dotup-pi006 5.13.0-1008-raspi #9-Ubuntu SMP PREEMPT Wed Sep 29 08:27:44 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

That should be the problem. The veth module for my kernel is not installed.

I installed all of this packages, because I didn’t know where the veth module is included.

sudo apt install linux-tools-raspi linux-source-5.13.0 linux-tools-5.13.0-1008-raspi linux-raspi-tools-5.13.0-1008 linux-raspi-headers-5.13.0-1008 linux-modules-extra-raspi linux-modules-extra-5.13.0-1008-raspi linux-modules-5.13.0-1008-raspi

Docker is working now. Maybe someone can tell which package is needed.

Thanks again!

my guess would be linux-modules-extra-raspi

1 Like