meta-freescale.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
* Re: Wireguard recipe
@ 2021-02-26 14:27 Zunzunegui Abad, Mario-Sergio
  0 siblings, 0 replies; 5+ messages in thread
From: Zunzunegui Abad, Mario-Sergio @ 2021-02-26 14:27 UTC (permalink / raw)
  To: Bas Mevissen; +Cc: Mario Sergio Zunzunegui Abad, meta-freescale

Airbus Amber
Yes, that also looks good to me, but when I start configuring wireguard, creating /etc/wireguard/wg0.conf, then I try to start the server with "wg-quick up wg0"
And then the system raises an error
RTNETLINK answers: Operation not supported

That is why I have included kernel-devsrc in IMAGE_INSTALL_append.

My assumption is that wireguard-tools is properly installed in the system, but wireguard-module is nor present.

All Ideas are welcomed.
Thank you very much.

-----Mensaje original-----
De: meta-freescale@lists.yoctoproject.org [mailto:meta-freescale@lists.yoctoproject.org] En nombre de Bas Mevissen Enviado el: viernes, 26 de febrero de 2021 15:14
Para: Zunzunegui Abad, Mario-Sergio
CC: Mario Sergio Zunzunegui Abad; meta-freescale@lists.yoctoproject.org
Asunto: Re: [meta-freescale] Wireguard recipe

On 2021-02-26 15:06, Zunzunegui Abad, Mario-Sergio wrote:
> Airbus Amber
> Hello Bas.
> The result is the same.
> I have added to my
> sources/meta-freescale/recipes-fsl/images/fsl-image-core.bb the 
> following IMAGE_INSTALL_append = " \
>     kernel-devsrc \
>     wireguard-tools \
>     wireguard-module \
> "
> 

That looks OK to me.

> kernel-devsrc is for adding kernel headers.
> 
> Exactly the same, I can generate private and public keys with command 
> "wg genkey . .. ."
> But when I run "modprobe wireguard" the result is
> modprobe: FATAL: Module wireguard not found.
> 

Please check that the package wireguard-module  (in your Yocto build) indeed contains a valid kmod for the kernel you actually run.
If so, check that this kmod is on the target for the kernel you actually run. If not, install the package manually.

Maybe it is good to share what you are actually using. Yocto version, kernel version, board type etc.

Regards,

Bas.

> 
> I think I am not adding the module properly.
> Any other Idea?
> Thank you very much
> 
> 
> 
> -----Mensaje original-----
> De: Bas Mevissen [mailto:abuse@basmevissen.nl] Enviado el: jueves, 25 
> de febrero de 2021 15:18
> Para: Mario Sergio Zunzunegui Abad
> CC: Zunzunegui Abad, Mario-Sergio;
> meta-freescale@lists.yoctoproject.org
> Asunto: Re: [meta-freescale] Wireguard recipe
> 
> On 2021-02-25 15:12, Mario Sergio Zunzunegui Abad wrote:
> 
>> Hello Bas.
>> I am afraid I havent realised I had to do that action.
>> Could you please tell me how to include this module kmod-wireguard?
>> Thank you very much
>> 
> 
> Sorry, got the name wrong. That is how it is called in OpenWRT. :-) 
> What you need is "wireguard-module" and you can add it to 
> IMAGE_INSTALL_append like wireguard-tools.
> 
> Bas.
> 
>> El jue., 25 feb. 2021 15:09, Bas Mevissen <abuse@basmevissen.nl>
>> escribió:
>> 
>>> On 2021-02-22 16:28, Zunzunegui Abad, Mario-Sergio wrote:
>>> 
>>>> [Edited Message Follows]
>>>> 
>>>> Hello.
>>>> 
>>>> I am trying to install WireGuard in Yocto.
>>>> 
>>>> I have included the code and recipe and compiled all with bitbake 
>>>> and generated an image.
>>>> 
>>>> I have added the code provided by NXP in folder 
>>>> sources/meta-openembedded/meta-networking/recipes-kernel.
>>>> 
>>>> Also added  "wireguard-tools" in IMAGE_INSTALL_append in 
>>>> meta-freescale/recipes-fsl/images/fsl-image-core.bb, then run 
>>>> "bitbake fsl-image-core"
>>>> 
>>>> I can generate public and private keys with wg command.
>>>> 
>>>> But when I try to configure WireGuard, it seems that it is not 
>>>> loaded the module.
>>>> 
>>>> root@vpx3-152:~# modprobe wireguard
>>>> 
>>>> modprobe: FATAL: Module wireguard not found.
>>>> 
>>>> root@vpx3-152:~#
>>>> 
>>>> What I am doing wrong?
>>>> 
>>> 
>>> Aren't you missing the kmod-wireguard package in your image?
>>> 
>>>> Regards.
>>>> 
>>>> #Yocto-wireguard
>>>> 
>>>> 
>>> 
>>> 
> The information in this e-mail is confidential. The contents may not 
> be disclosed or used by anyone other than the addressee. Access to 
> this e-mail by anyone else is unauthorised.
> If you are not the intended recipient, please notify Airbus 
> immediately and delete this e-mail.
> Airbus cannot accept any responsibility for the accuracy or 
> completeness of this e-mail as it has been sent over public networks.
> If you have any concerns over the content of this message or its 
> Accuracy or Integrity, please contact Airbus immediately.
> All outgoing e-mails from Airbus are checked using regularly updated 
> virus scanning software but you should take whatever measures you deem 
> to be appropriate to ensure that this message and any attachments are 
> virus free.
The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Wireguard recipe
@ 2021-02-26 14:20 Zunzunegui Abad, Mario-Sergio
  0 siblings, 0 replies; 5+ messages in thread
From: Zunzunegui Abad, Mario-Sergio @ 2021-02-26 14:20 UTC (permalink / raw)
  To: Christian Betz; +Cc: meta-freescale

[-- Attachment #1: Type: text/plain, Size: 6435 bytes --]

Airbus Amber
Hello Chistian, Thank you for your support but this is not working for me.

I am going to explain what I have done:

I got from NXP a module wireguard.tar.gz
This contains:
wireguard.inc
wireguard-module_1.0.20200401.bb
wireguard-tools_1.0.20200319.bb

this files have been stored in:
in sources/meta-openembedded/meta-networking/recipes-kernel

I have modifies the file
sources/meta-freescale/recipes-fsl/images/fsl-image-core.bb
in order to include the modules "wireguard-tools wireguard-module and kernel-devsrc
adding it to in IMAGE_INSTALL_append

Then I run "bitbake fsl-image-core"
And bitbake generates the image.
I flash it into a disk and then run it in the computer.

When I execute "modprobe wireguard" it doesn´t find it.
Returning:
modprobe: FATAL: Module wireguard not found.

But I can generate the private and public keys with command "wg keygen ..."
My assumption is that the wireguard-tools are correctly installed but wireguard-module is not present in the system.

I have followed your steps except step 4 assuming this is for a wireless connection that I don't have.

I think your instructions are accurated, but I think I am modifying the files in the wrong place.

Could you please clarify the paths since the folder "sources" please.

Thank you again for your help.
I am a little struck with this topic.
Best Regards.




De: Christian Betz [mailto:christian.betz@gmail.com]
Enviado el: viernes, 26 de febrero de 2021 1:55
Para: Zunzunegui Abad, Mario-Sergio
CC: meta-freescale@lists.yoctoproject.org
Asunto: Re: [meta-freescale] Wireguard recipe

Hello,

From my experience there are a number of steps; let me try and save you some trouble!

(1) create patch for wireguard in your layer. i needed this for linux-fslc kernel on yocto dunfell as of linux kernel version 5.4.83. (i haven't tried later versions or merged  dunfell branch since december, you may not need this patch right now)

filename: ./recipes-wireguard/wireguard/files/wireguard-compat.patch
-------snip------
diff --git a/src/compat/compat-asm.h b/src/compat/compat-asm.h
index 53b33d4..1240bc3 100644
--- a/src/compat/compat-asm.h
+++ b/src/compat/compat-asm.h
@@ -41,8 +41,10 @@
 #endif

 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0)
+/*
 #define SYM_FUNC_START ENTRY
 #define SYM_FUNC_END ENDPROC
+*/
 #endif

 #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0)
-------snip------

(2) create bbappend in your layer to apply patch

filename: ./recipes-wireguard/wireguard/wireguard-module_%.bbappend
-------snip------
# Patch to make wireguard compile on Yocto
SRC_URI_append_yourboardname = " file://wireguard-compat.patch;striplevel=2"
-------snip------

(3) fix bug with systemd location in recipe (if you are using systemd)

filename: ./recipes-wireguard/wireguard/wireguard-tools_%.bbappend
-------snip------
# Fix bug with systemd unit in wrong location
# TODO: check if this is fixed upstream
do_install () {
    oe_runmake DESTDIR="${D}" PREFIX="${prefix}" SYSCONFDIR="${sysconfdir}" \
        SYSTEMDUNITDIR="${systemd_unitdir}/system" \
        WITH_SYSTEMDUNITS=${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'yes', '', d)} \
        WITH_BASHCOMPLETION=yes \
        WITH_WGQUICK=yes \
        install
}
-------snip------

(4) make sure you have a kernel cfg for everything wireguard needs:

stock linux-fslc seems to be missing some things wireguard needs.

filename: ./recipes-bsp/linux-fslc/files/wireguard-extra-kernel-options.cfg
-------snip------
CONFIG_SKB_EXTENSIONS=y
CONFIG_XFRM=y
CONFIG_NET_IPIP=y
CONFIG_NET_UDP_TUNNEL=y
CONFIG_NET_FOU=y
CONFIG_IPV6_FOU=y
CONFIG_NF_CONNTRACK=y
CONFIG_NF_CONNTRACK_PROCFS=y
CONFIG_NF_CT_PROTO_DCCP=y
CONFIG_NF_CT_PROTO_SCTP=y
CONFIG_NF_CT_PROTO_UDPLITE=y
CONFIG_NETFILTER_XTABLES=y
CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=y
CONFIG_NF_DEFRAG_IPV4=y
CONFIG_NF_DEFRAG_IPV6=y
CONFIG_LIBCRC32C=y
-------snip------

(5) add the kernel config in a bbappend for linux-fslc.

filename: grep wireguard recipes-bsp/linux-fslc/linux-fslc_%.bbappend
-------snip------
# Add custom kernel options for wireguard, wireless PCI
# Enable wireguard module
SRC_URI += "file://wireguard-extra-kernel-options.cfg"
-------snip------

(6) add "wireguard-tools kernel-module-wireguard" to your image, i.e.:

filename: recipes-mycompany/images/myproduct-image.bb<http://myproduct-image.bb>
-------snip------
...
IMAGE_INSTALL_append = " wireguard-tools kernel-module-wireguard"
...
-------snip------

On Thu, Feb 25, 2021 at 8:36 AM Zunzunegui Abad, Mario-Sergio <mario.zunzunegui@airbus.com<mailto:mario.zunzunegui@airbus.com>> wrote:

[Edited Message Follows]
Airbus Amber
Hello.
I am trying to install WireGuard in Yocto.
I have included the code and recipe and compiled all with bitbake and generated an image.


I have added the code provided by NXP in folder sources/meta-openembedded/meta-networking/recipes-kernel.



Also added  "wireguard-tools" in IMAGE_INSTALL_append in meta-freescale/recipes-fsl/images/fsl-image-core.bb<http://fsl-image-core.bb>, then run "bitbake fsl-image-core"


I can generate public and private keys with wg command.


But when I try to configure WireGuard, it seems that it is not loaded the module.

root@vpx3-152:~# modprobe wireguard
modprobe: FATAL: Module wireguard not found.
root@vpx3-152:~#

What I am doing wrong?
Regards.

#Yocto-wireguard




--
"the new garbage collector will be an arena-based, quad-color incremental, generational, non-copying, high-speed, cache-optimized garbage collector" -- LuaJIT Roadmap
The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.

[-- Attachment #2: Type: text/html, Size: 21465 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: Wireguard recipe
  2021-02-26 14:06 Zunzunegui Abad, Mario-Sergio
@ 2021-02-26 14:13 ` Bas Mevissen
  0 siblings, 0 replies; 5+ messages in thread
From: Bas Mevissen @ 2021-02-26 14:13 UTC (permalink / raw)
  To: Zunzunegui Abad, Mario-Sergio
  Cc: Mario Sergio Zunzunegui Abad, meta-freescale

On 2021-02-26 15:06, Zunzunegui Abad, Mario-Sergio wrote:
> Airbus Amber
> Hello Bas.
> The result is the same.
> I have added to my
> sources/meta-freescale/recipes-fsl/images/fsl-image-core.bb the
> following IMAGE_INSTALL_append = " \
>     kernel-devsrc \
>     wireguard-tools \
>     wireguard-module \
> "
> 

That looks OK to me.

> kernel-devsrc is for adding kernel headers.
> 
> Exactly the same, I can generate private and public keys with command
> "wg genkey . .. ."
> But when I run "modprobe wireguard" the result is
> modprobe: FATAL: Module wireguard not found.
> 

Please check that the package wireguard-module  (in your Yocto build) 
indeed contains a valid kmod for the kernel you actually run.
If so, check that this kmod is on the target for the kernel you actually 
run. If not, install the package manually.

Maybe it is good to share what you are actually using. Yocto version, 
kernel version, board type etc.

Regards,

Bas.

> 
> I think I am not adding the module properly.
> Any other Idea?
> Thank you very much
> 
> 
> 
> -----Mensaje original-----
> De: Bas Mevissen [mailto:abuse@basmevissen.nl] Enviado el: jueves, 25
> de febrero de 2021 15:18
> Para: Mario Sergio Zunzunegui Abad
> CC: Zunzunegui Abad, Mario-Sergio; 
> meta-freescale@lists.yoctoproject.org
> Asunto: Re: [meta-freescale] Wireguard recipe
> 
> On 2021-02-25 15:12, Mario Sergio Zunzunegui Abad wrote:
> 
>> Hello Bas.
>> I am afraid I havent realised I had to do that action.
>> Could you please tell me how to include this module kmod-wireguard?
>> Thank you very much
>> 
> 
> Sorry, got the name wrong. That is how it is called in OpenWRT. :-)
> What you need is "wireguard-module" and you can add it to
> IMAGE_INSTALL_append like wireguard-tools.
> 
> Bas.
> 
>> El jue., 25 feb. 2021 15:09, Bas Mevissen <abuse@basmevissen.nl>
>> escribió:
>> 
>>> On 2021-02-22 16:28, Zunzunegui Abad, Mario-Sergio wrote:
>>> 
>>>> [Edited Message Follows]
>>>> 
>>>> Hello.
>>>> 
>>>> I am trying to install WireGuard in Yocto.
>>>> 
>>>> I have included the code and recipe and compiled all with bitbake
>>>> and generated an image.
>>>> 
>>>> I have added the code provided by NXP in folder
>>>> sources/meta-openembedded/meta-networking/recipes-kernel.
>>>> 
>>>> Also added  "wireguard-tools" in IMAGE_INSTALL_append in
>>>> meta-freescale/recipes-fsl/images/fsl-image-core.bb, then run
>>>> "bitbake fsl-image-core"
>>>> 
>>>> I can generate public and private keys with wg command.
>>>> 
>>>> But when I try to configure WireGuard, it seems that it is not
>>>> loaded the module.
>>>> 
>>>> root@vpx3-152:~# modprobe wireguard
>>>> 
>>>> modprobe: FATAL: Module wireguard not found.
>>>> 
>>>> root@vpx3-152:~#
>>>> 
>>>> What I am doing wrong?
>>>> 
>>> 
>>> Aren't you missing the kmod-wireguard package in your image?
>>> 
>>>> Regards.
>>>> 
>>>> #Yocto-wireguard
>>>> 
>>>> 
>>> 
>>> 
> The information in this e-mail is confidential. The contents may not
> be disclosed or used by anyone other than the addressee. Access to
> this e-mail by anyone else is unauthorised.
> If you are not the intended recipient, please notify Airbus
> immediately and delete this e-mail.
> Airbus cannot accept any responsibility for the accuracy or
> completeness of this e-mail as it has been sent over public networks.
> If you have any concerns over the content of this message or its
> Accuracy or Integrity, please contact Airbus immediately.
> All outgoing e-mails from Airbus are checked using regularly updated
> virus scanning software but you should take whatever measures you deem
> to be appropriate to ensure that this message and any attachments are
> virus free.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Wireguard recipe
@ 2021-02-26 14:06 Zunzunegui Abad, Mario-Sergio
  2021-02-26 14:13 ` Bas Mevissen
  0 siblings, 1 reply; 5+ messages in thread
From: Zunzunegui Abad, Mario-Sergio @ 2021-02-26 14:06 UTC (permalink / raw)
  To: Bas Mevissen, Mario Sergio Zunzunegui Abad; +Cc: meta-freescale

Airbus Amber
Hello Bas.
The result is the same.
I have added to my sources/meta-freescale/recipes-fsl/images/fsl-image-core.bb the following IMAGE_INSTALL_append = " \
    kernel-devsrc \
    wireguard-tools \
    wireguard-module \
"

kernel-devsrc is for adding kernel headers.

Exactly the same, I can generate private and public keys with command "wg genkey . .. ."
But when I run "modprobe wireguard" the result is
modprobe: FATAL: Module wireguard not found.


I think I am not adding the module properly.
Any other Idea?
Thank you very much



-----Mensaje original-----
De: Bas Mevissen [mailto:abuse@basmevissen.nl] Enviado el: jueves, 25 de febrero de 2021 15:18
Para: Mario Sergio Zunzunegui Abad
CC: Zunzunegui Abad, Mario-Sergio; meta-freescale@lists.yoctoproject.org
Asunto: Re: [meta-freescale] Wireguard recipe

On 2021-02-25 15:12, Mario Sergio Zunzunegui Abad wrote:

> Hello Bas.
> I am afraid I havent realised I had to do that action.
> Could you please tell me how to include this module kmod-wireguard?
> Thank you very much
> 

Sorry, got the name wrong. That is how it is called in OpenWRT. :-) What you need is "wireguard-module" and you can add it to IMAGE_INSTALL_append like wireguard-tools.

Bas.

> El jue., 25 feb. 2021 15:09, Bas Mevissen <abuse@basmevissen.nl>
> escribió:
> 
>> On 2021-02-22 16:28, Zunzunegui Abad, Mario-Sergio wrote:
>> 
>>> [Edited Message Follows]
>>> 
>>> Hello.
>>> 
>>> I am trying to install WireGuard in Yocto.
>>> 
>>> I have included the code and recipe and compiled all with bitbake 
>>> and generated an image.
>>> 
>>> I have added the code provided by NXP in folder 
>>> sources/meta-openembedded/meta-networking/recipes-kernel.
>>> 
>>> Also added  "wireguard-tools" in IMAGE_INSTALL_append in 
>>> meta-freescale/recipes-fsl/images/fsl-image-core.bb, then run 
>>> "bitbake fsl-image-core"
>>> 
>>> I can generate public and private keys with wg command.
>>> 
>>> But when I try to configure WireGuard, it seems that it is not 
>>> loaded the module.
>>> 
>>> root@vpx3-152:~# modprobe wireguard
>>> 
>>> modprobe: FATAL: Module wireguard not found.
>>> 
>>> root@vpx3-152:~#
>>> 
>>> What I am doing wrong?
>>> 
>> 
>> Aren't you missing the kmod-wireguard package in your image?
>> 
>>> Regards.
>>> 
>>> #Yocto-wireguard
>>> 
>>> 
>> 
>> 
The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Wireguard recipe
@ 2021-02-22 15:28 Zunzunegui Abad, Mario-Sergio
  0 siblings, 0 replies; 5+ messages in thread
From: Zunzunegui Abad, Mario-Sergio @ 2021-02-22 15:28 UTC (permalink / raw)
  To: meta-freescale

[-- Attachment #1: Type: text/plain, Size: 713 bytes --]

Hello.

I am trying to install WireGuard in Yocto.

I have included the code and recipe and compiled all with bitbake and generated an image.

I have added the code provided by NXP in folder sources/meta-openembedded/meta-networking/recipes-kernel.

Also added  "wireguard-tools" in IMAGE_INSTALL_append in meta-freescale/recipes-fsl/images/fsl-image-core.bb, then run "bitbake fsl-image-core"

I can generate public and private keys with wg command.

But when I try to configure WireGuard, it seems that it is not loaded the module.

root@vpx3-152:~# modprobe wireguard

modprobe: FATAL: Module wireguard not found.

root@vpx3-152:~#

What I am doing wrong?

Regards.

#Yocto-wireguard

[-- Attachment #2: Type: text/html, Size: 1832 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-26 14:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-26 14:27 Wireguard recipe Zunzunegui Abad, Mario-Sergio
  -- strict thread matches above, loose matches on Subject: below --
2021-02-26 14:20 Zunzunegui Abad, Mario-Sergio
2021-02-26 14:06 Zunzunegui Abad, Mario-Sergio
2021-02-26 14:13 ` Bas Mevissen
2021-02-22 15:28 Zunzunegui Abad, Mario-Sergio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).