Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WireGuard #13

Closed
dvv opened this issue Feb 27, 2021 · 8 comments
Closed

WireGuard #13

dvv opened this issue Feb 27, 2021 · 8 comments

Comments

@dvv
Copy link

dvv commented Feb 27, 2021

Can not manage to start wireguard:

$ logread -f
...
Sat Feb 27 16:54:37 2021 daemon.err modprobe: 1 module could not be probed
Sat Feb 27 16:54:37 2021 daemon.err modprobe: - wireguard
Sat Feb 27 16:54:37 2021 kern.warn kernel: [15463.933661] wireguard: Unknown symbol dst_cache_set_ip4 (err 0)
Sat Feb 27 16:54:37 2021 kern.warn kernel: [15463.933976] wireguard: Unknown symbol dst_cache_destroy (err 0)
Sat Feb 27 16:54:37 2021 kern.warn kernel: [15463.934128] wireguard: Unknown symbol dst_cache_init (err 0)
Sat Feb 27 16:54:37 2021 kern.warn kernel: [15463.934777] wireguard: Unknown symbol dst_cache_get_ip6 (err 0)
Sat Feb 27 16:54:37 2021 kern.warn kernel: [15463.934884] wireguard: Unknown symbol dst_cache_get_ip4 (err 0)
Sat Feb 27 16:54:37 2021 kern.warn kernel: [15463.935012] wireguard: Unknown symbol dst_cache_set_ip6 (err 0)
Sat Feb 27 16:54:37 2021 daemon.notice netifd: wg0 (15885): Unable to modify interface: Protocol not supported
...
$ cat /etc/openwrt_release 
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='19.07.7'
DISTRIB_REVISION='r11306-c4a6851c72'
DISTRIB_TARGET='imx6/generic'
DISTRIB_ARCH='arm_cortex-a9_neon'
DISTRIB_DESCRIPTION='OpenWrt 19.07.7 r11306-c4a6851c72'
DISTRIB_TAINTS='no-all'
$ uname -a
Linux mihome 4.14.221 #0 SMP Mon Feb 15 15:22:37 2021 armv7l GNU/Linux
$ lsmod | egrep '(wire|tunnel)'
ip6_udp_tunnel         16384  0 
udp_tunnel             16384  0
@devbis
Copy link
Member

devbis commented Feb 27, 2021

You have to compile OpenWrt by yourself and enable the required kernel modules in the firmware.
Otherwise, some kernel modules may cause issues.

Sources for the OpenWrt 19.07 are located here: https://github.com/openlumi/openwrt/tree/lumi-19.07

@devbis devbis closed this as completed Feb 27, 2021
@dvv
Copy link
Author

dvv commented Feb 27, 2021

On my router:

$ uname -a
Linux home 4.14.167 #0 SMP Wed Jan 29 16:05:35 2020 mips GNU/Linux

gives

$ lsmod | egrep '(wire|tunnel)'
ip6_udp_tunnel          1600  1 wireguard
udp_tunnel              2432  1 wireguard
wireguard              90560  0

so all the required kernel modules already do exist in this firmware.

It's a matter of some missing kernel feature. I believe select DST_CACHE should go ( mentioned https://lore.kernel.org/patchwork/patch/880428/ )

I can not afford building the world. May some be interested.

@devbis
Copy link
Member

devbis commented Feb 27, 2021

The modules that exist in firmware depends on the config for building.
It may include some modules, may not.
We tried to keep the image small and did not include most of the kernel modules that are not required for basic gateway usage.
Here is the config I used for the build: https://github.com/openlumi/openwrt/blob/lumi-19.07/config_xiaomi_lumi

@dvv
Copy link
Author

dvv commented Feb 27, 2021

I see.

Look at what we've got:

$ modinfo wireguard
module:         /lib/modules/4.14.221/wireguard.ko
intree:         Y
alias:          net-pf-16-proto-16-family-wireguard
alias:          rtnl-link-wireguard
license:        GPL v2
depends:        udp_tunnel,ip6_udp_tunnel

$ modinfo udp_tunnel
module:         /lib/modules/4.14.221/udp_tunnel.ko
license:        GPL
depends:

$ modinfo ip6_udp_tunnel
module:         /lib/modules/4.14.221/ip6_udp_tunnel.ko
license:        GPL
depends:

So I conclude that the missing symbols are to be in the shipped kernel per se.

@dvv
Copy link
Author

dvv commented Feb 27, 2021

@devbis Am I right that the following will give me exact config that you have?

git clone --depth 1 -b lumi-19.07 https://github.com/openlumi/openwrt
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a
cp config_xiaomi_lumi .config
ln -s files_xiaomi_lumi files
make menuconfig

@dvv
Copy link
Author

dvv commented Feb 28, 2021

Built, sysupgrade-d, got a brick... )
Suspecting WiFi drivers

@devbis
Copy link
Member

devbis commented Feb 28, 2021

Oh, you've missed one essential step.

files_xiaomi_lumi should be renamed to files or make a symlink with files name.

You could try to restore availability by copying the content to /lib/* files through serial console.

@dvv
Copy link
Author

dvv commented Mar 5, 2021

Thank you. Revived. That comment ^^^ should go to readme imho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants