meta-freescale.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
* Re: [meta-freescale] Wireguard recipe
       [not found] <Groupsio.2.9e195d21fc264317be075273f03cba3a@CD1-4DDAG04-P02.cdmail.common.airbusds.corp>
@ 2021-02-25 14:08 ` Bas Mevissen
  2021-02-25 14:12   ` szunzunegui
  0 siblings, 1 reply; 4+ messages in thread
From: Bas Mevissen @ 2021-02-25 14:08 UTC (permalink / raw)
  To: Zunzunegui Abad, Mario-Sergio; +Cc: meta-freescale

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



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

* Re: [meta-freescale] Wireguard recipe
  2021-02-25 14:08 ` [meta-freescale] Wireguard recipe Bas Mevissen
@ 2021-02-25 14:12   ` szunzunegui
  2021-02-25 14:18     ` Bas Mevissen
  0 siblings, 1 reply; 4+ messages in thread
From: szunzunegui @ 2021-02-25 14:12 UTC (permalink / raw)
  To: Bas Mevissen; +Cc: Zunzunegui Abad, Mario-Sergio, meta-freescale

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

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

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

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

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

* Re: [meta-freescale] Wireguard recipe
  2021-02-25 14:12   ` szunzunegui
@ 2021-02-25 14:18     ` Bas Mevissen
  0 siblings, 0 replies; 4+ messages in thread
From: Bas Mevissen @ 2021-02-25 14:18 UTC (permalink / raw)
  To: Mario Sergio Zunzunegui Abad
  Cc: Zunzunegui Abad, Mario-Sergio, meta-freescale

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

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

* Re: [meta-freescale] Wireguard recipe
       [not found] <Groupsio.1.9e195d21fc264317be075273f03cba3a@CD1-4DDAG04-P02.cdmail.common.airbusds.corp>
@ 2021-02-26  0:54 ` Christian Betz
  0 siblings, 0 replies; 4+ messages in thread
From: Christian Betz @ 2021-02-26  0:54 UTC (permalink / raw)
  To: Zunzunegui Abad, Mario-Sergio; +Cc: meta-freescale

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

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
-------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> 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, 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

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

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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <Groupsio.2.9e195d21fc264317be075273f03cba3a@CD1-4DDAG04-P02.cdmail.common.airbusds.corp>
2021-02-25 14:08 ` [meta-freescale] Wireguard recipe Bas Mevissen
2021-02-25 14:12   ` szunzunegui
2021-02-25 14:18     ` Bas Mevissen
     [not found] <Groupsio.1.9e195d21fc264317be075273f03cba3a@CD1-4DDAG04-P02.cdmail.common.airbusds.corp>
2021-02-26  0:54 ` Christian Betz

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).