Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
meta-rtlabs Yocto layer
=======================

This Yocto layer contains a recipe to build p-net.

The p-net stack is an open-source Profinet IO-device stack developed by
Expand All @@ -9,9 +10,9 @@ license, please contact [email protected]
* p-net: [https://github.com/rtlabs-com/p-net](https://github.com/rtlabs-com/p-net)
* rt-labs: [https://rt-labs.com](https://rt-labs.com)


Versions
========
--------

This layer is tested with Yocto version 2.4 ("rocko"), but should work with
other Yocto versions.

Expand All @@ -26,9 +27,9 @@ recent enough. Nowever this layer contains a recipe for updated cmake-native
so it also can be used with older Yocto releases. In the future when we only
support Yocto 2.7 or later, that recipe will be removed.


Dependencies
============
------------

This layer depends on:

URI: git://git.openembedded.org/bitbake
Expand All @@ -38,9 +39,9 @@ This layer depends on:
layers: meta
branch: master


Adding the rtlabs layer to your build
=====================================
-------------------------------------

In order to use this layer, you need to make the build system aware of
it.

Expand All @@ -58,5 +59,20 @@ other layers needed. e.g.:

In order to use the recipes, add this to your image:

* *p-net* Adds libprofinet
* *p-net-demo* Adds libprofinet and the sample app
* *p-net* Adds libpnet
* *p-net-samples* Adds libpnet and the sample app

Variants
--------

Two variants of the p-net recipe is added by this layer:

* `Evaluation` (p-net-evaluation)
* `Production` (p-net-production)

The `Evaluation` version uses publicly available precompiled binaries for the library
compiled in evaluation mode.

The `Production` variant depends on a locally provided zip of the p-net sources. The
source package can be placed in the `recipes-connectivity/p-net/files` folder, or
a `bbappend` file can be used to provide the path to the source package.
5 changes: 5 additions & 0 deletions conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
BBFILE_COLLECTIONS += "rtlabs"
BBFILE_PATTERN_rtlabs = "^${LAYERDIR}/"
BBFILE_PRIORITY_rtlabs = "6"

PREFERRED_PROVIDER_p-net = "p-net-evaluation"

LICENSE_PATH += "${LAYERDIR}/licenses"
SPDXLICENSEMAP[LicenseRef-RT-Labs-Deployment-1.0] = "RT-Labs-Deployment-1.0"
14 changes: 14 additions & 0 deletions licenses/LicenseRef-RT-Labs-Deployment-1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
RT-Labs Deployment License 1.0
==============================

Deployment licenses grants you the right to produce up to a certain number of
units per year that includes one network stack from RT-Labs. A deployment
license can only be purchased if you have an ongoing or previously owned an
Essentials, Standard or Enterprise development plan for a communication stack.

Deployment Licenses are purchased on a yearly basis and grants you the right to
produce up to the purchased license level during that year. If you produce more
units than your license grants, the cost will be added to the following year.

RT-Labs will each year help you coordinate and balance the deployment license
level for the upcoming year.
1 change: 1 addition & 0 deletions recipes-connectivity/p-net/files/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
p-net-sources-1.0.2.zip
4 changes: 4 additions & 0 deletions recipes-connectivity/p-net/files/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# P-Net Yocto Files

Place source code of p-net in `p-net-sources.zip` here
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the zip file name to correspond to the recipe.

to build from a source dump.
28 changes: 28 additions & 0 deletions recipes-connectivity/p-net/p-net-commercial_1.0.2.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
SUMMARY = "P-Net Profinet communication stack"
LICENSE = "LicenseRef-RT-Labs-Deployment-1.0"
LICENSE_FLAGS = "commercial"
LIC_FILES_CHKSUM = "file://CMakeLists.txt;beginline=1;endline=14;md5=aa7e6f963fad674b02c35dc8e9aa5519"
SECTION = "libs"
PROVIDES = "p-net"

SRC_URI = "file://p-net-sources-1.0.2.zip"
S = "${WORKDIR}/p-net"

FILES:${PN}-dev += " \
${prefix}/cmake/*.cmake \
"

FILES:${PN} += " \
${prefix}/share/profinet \
"

# We need network access to get Osal
EXTRA_OECMAKE += "-DFETCHCONTENT_FULLY_DISCONNECTED=OFF"
do_configure[network] = "1"

# Disable the tests since build fail
# when cross compiling due to test discovery
# using GOOGLE_TEST_INDIVIDUAL
EXTRA_OECMAKE += "-DBUILD_TESTING=OFF"

inherit pkgconfig cmake
52 changes: 52 additions & 0 deletions recipes-connectivity/p-net/p-net-evaluation_1.0.2.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
SUMMARY = "P-Net Profinet communication stack"
HOMEPAGE = "https://github.com/rtlabs-com/p-net"
LICENSE = "GPL-3.0-or-later"
LIC_FILES_CHKSUM = "file://include/pnet_api.h;beginline=1;endline=14;md5=9613aac56556c534a901f25038170285"
SECTION = "libs"
PROVIDES = "p-net"

COMPATIBLE_HOST = "(x86_64|aarch64).*-linux"

_SRC_CHECKSUM:x86-64 = "58f3e1e0a645bf3ca83232f2ec1d605d3fea7fbe114fe530ab2dc98ae3c950c5"
_SRC_CHECKSUM:aarch64 = "e1f928b5ec66e80c5b2a589fc42d8a1a371c70d5ebc0d53f63a5cec2a6860ad8"
_SRC_SUFFIX:x86-64 = "-Linux-x86_64"
_SRC_SUFFIX:aarch64 = "-Linux-aarch64"

SRC_URI = "https://github.com/rtlabs-com/p-net/releases/download/public%2Fv${PV}/p-net-${PV}${_SRC_SUFFIX}.zip"
SRC_URI[sha256sum] = "${_SRC_CHECKSUM}"
S = "${WORKDIR}/p-net-${PV}${_SRC_SUFFIX}"

INSANE_SKIP:${PN} = "ldflags"
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_SYSROOT_STRIP = "1"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"

FILES:${PN}-dev += " \
${prefix}/cmake/*.cmake \
"

FILES:${PN} += " \
${prefix}/share/profinet \
"

SYSROOT_DIRS += "${prefix}/cmake"

do_install () {
install -d ${D}${libdir}
install -m 0755 ${S}/lib/* ${D}${libdir}

install -d ${D}${includedir}
install -m 0755 ${S}/include/*.h ${D}${includedir}

install -d ${D}${includedir}/sys
install -m 0755 ${S}/include/sys/*.h ${D}${includedir}/sys

install -d ${D}${bindir}
install -m 0755 ${S}/bin/* ${D}${bindir}

install -d ${D}${prefix}/cmake
install -m 0755 ${S}/cmake/*.cmake ${D}${prefix}/cmake

install -d ${D}${prefix}/share/profinet
install -m 0755 ${S}/share/profinet/* ${D}${prefix}/share/profinet
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the intention to install a static library in the image? If so, does this actually work?
(My experience is that a "-staticdev" package is necessary to install a static library.)

13 changes: 13 additions & 0 deletions recipes-connectivity/p-net/p-net-samples_1.0.2.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SUMMARY = "P-Net Profinet communication stack - Samples"
LICENSE = "GPL-3.0-or-later"
LIC_FILES_CHKSUM = "file://CMakeLists.txt;beginline=1;endline=14;md5=aa7e6f963fad674b02c35dc8e9aa5519"
SECTION = "console/network"

DEPENDS = "p-net-eval"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is "p-net-eval" defined?


SRC_URI = "https://github.com/rtlabs-com/p-net/releases/download/public%2Fv${PV}/p-net-${PV}-samples.zip"
SRC_URI[sha256sum] = "8ce40738fa67bf04deb4f27938e6a70599526765ea6d8cf1a26b73395073d658"

S = "${WORKDIR}/p-net-${PV}-samples"

inherit pkgconfig cmake
45 changes: 0 additions & 45 deletions recipes-connectivity/p-net/p-net.bb

This file was deleted.