All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zunzunegui Abad, Mario-Sergio" <mario.zunzunegui@airbus.com>
To: Christian Betz <christian.betz@gmail.com>
Cc: "meta-freescale@lists.yoctoproject.org"
	<meta-freescale@lists.yoctoproject.org>
Subject: Re: Wireguard recipe
Date: Fri, 26 Feb 2021 14:20:42 +0000	[thread overview]
Message-ID: <b5f0936330824596ad9bee672d74064b@CD1-4DDAG04-P02.cdmail.common.airbusds.corp> (raw)

[-- 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 --]

             reply	other threads:[~2021-02-26 14:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-26 14:20 Zunzunegui Abad, Mario-Sergio [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-02-26 14:27 Wireguard recipe 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b5f0936330824596ad9bee672d74064b@CD1-4DDAG04-P02.cdmail.common.airbusds.corp \
    --to=mario.zunzunegui@airbus.com \
    --cc=christian.betz@gmail.com \
    --cc=meta-freescale@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.