Skip to content

Commit

Permalink
meta-kanto layer for Hardknott Yocto image (#109)
Browse files Browse the repository at this point in the history
[#108] updated files to build kanto for hardknott

Signed-off-by: Mahesha Mutharayappa (SDS/EPE2) <Mutharayappa.Mahesha@in.bosch.com>
  • Loading branch information
Mahesha-M authored Dec 19, 2024
1 parent 13a8ed6 commit 0bb8a81
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 33 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ on:
push:
branches:
- main
- kirkstone
- hardknott
paths-ignore:
- "**/*.md"

pull_request:
branches:
- main
- kirkstone
- hardknott
paths-ignore:
- "**/*.md"

Expand All @@ -35,12 +35,12 @@ jobs:
- name: Get branch name (merge)
if: github.event_name != 'pull_request'
shell: bash
run: if [ ${GITHUB_REF#refs/heads/} == "main" ]; then echo "BRANCH_NAME=$(echo "scarthgap")" >>$GITHUB_ENV; else echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >>$GITHUB_ENV; fi
run: if [ ${GITHUB_REF#refs/heads/} == "main" ]; then echo "BRANCH_NAME=$(echo "hardknott")" >>$GITHUB_ENV; else echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >>$GITHUB_ENV; fi
id: get_branch
- name: Get branch name (pull request)
if: github.event_name == 'pull_request'
shell: bash
run: if [ ${{ github.event.pull_request.base.ref }} == "main" ]; then echo "BRANCH_NAME=$(echo "scarthgap")" >>$GITHUB_ENV; else echo "BRANCH_NAME=$(echo ${{ github.event.pull_request.base.ref }})" >>$GITHUB_ENV; fi
run: if [ ${{ github.event.pull_request.base.ref }} == "main" ]; then echo "BRANCH_NAME=$(echo "hardknott")" >>$GITHUB_ENV; else echo "BRANCH_NAME=$(echo ${{ github.event.pull_request.base.ref }})" >>$GITHUB_ENV; fi
id: get_branch_pr
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -53,6 +53,16 @@ jobs:
run: git clone -b ${{ env.BRANCH_NAME }} https://github.com/openembedded/meta-openembedded.git
- name: Clone meta-virtualization
run: git clone -b ${{ env.BRANCH_NAME }} https://github.com/lgirdk/meta-virtualization.git
- name: go recipes update
run: |
git clone --no-checkout https://git.yoctoproject.org/poky go_patch
cd go_patch
git sparse-checkout init --cone
git sparse-checkout set meta/recipes-devtools/go
git checkout mickledore
cd ../
rm -rf poky/meta/recipes-devtools/go
cp -r go_patch/meta/recipes-devtools/go poky/meta/recipes-devtools/go
- name: Add dependencies
run: |
sudo apt-get update
Expand Down
113 changes: 86 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,52 @@
![Kanto logo](https://github.com/eclipse-kanto/kanto/raw/main/logo/kanto.svg)

# Eclipse Kanto - Yocto Layer
# Eclipse Kanto - Essential IoT enablement for edge devices

This layer provides support for building the necessary Eclipse Kanto
components.
Eclipse Kanto is a modular IoT edge software that enables devices for IoT with
all essentials like cloud connectivity, digital twins, local communication,
container management, and software updates - all configurable and remotely
manageable by an IoT cloud ecosystem of choice.

The layer depends on the meta-virtualization one. If the edge containerization
(i.e. Eclipse Kanto container management) is to be included in your target Yocto image,
you need to enable the required by this layer virtualization.
To do that, add in the configuration file the following line:

DISTRO_FEATURES:append = " virtualization"

For further fine-tuning and options see the meta-virtualization README.

# Dependencies
# Table of Contents
1. [Adding the meta-kanto layer to your build](#adding-the-meta-kanto-layer-to-your-build)
2. [Adding the required go version to your build](#adding-the-required-go-version-to-your-build)
3. [Required image configurations](#required-image-configurations)
4. [Adding cloud connectivity and virtualization dependencies](#adding-cloud-connectivity-and-virtualization-dependencies)
5. [Adding edge containerization to your build](#adding-edge-containerization-to-your-build)
6. [Example image configuration](#example-image-configuration)

Required for enabling the cloud connectivity and virtualization.
Could be used as a single dependency if only suite connector
is needed to be built.
## Adding the meta-kanto layer to your build

URI: git://github.com/openembedded/meta-openembedded.git layers:
* meta-networking
The meta-kanto layer is a Yocto layer designed to provide support for Eclipse Kanto,
which is part of the Eclipse IoT stack. The meta-kanto layer simplifies the process
of incorporating Eclipse Kanto components into Yocto-based images.

Required for enabling edge containerization
Run:
```
bitbake-layers add-layer meta-kanto
```

URI: git://git.yoctoproject.org/meta-virtualization
## Adding the required go version to your build

# Table of Contents
The Go version in the poky recipes needs to be upgraded to the required version for
building Eclipse Kanto, as the default Go version in the hardknott Yocto release is 1.16.15.

1. [Adding the meta-kanto layer to your build](#adding-the-meta-kanto-layer-to-your-build)
2. [Required image configurations](#required-image-configurations)
3. [Example image configuration](#example-image-configuration)
The required Go version for buidling Eclipse Kanto can be found in the go.mod file of each
Eclipse Kanto repository that you intend to include in your build.

## Adding the meta-kanto layer to your build
For example, if Go version 1.20.7 is required for building Eclipse Kanto then,
the Go files in the path poky\meta\recipes-devtools\go has to be replaced with 1.20.7.
To do this, run the below commands

Run:
```
bitbake-layers add-layer meta-kanto
git clone --no-checkout https://git.yoctoproject.org/poky go_patch
cd go_patch
git sparse-checkout init --cone
git sparse-checkout set meta/recipes-devtools/go
git checkout mickledore
cd ../
rm -rf poky/meta/recipes-devtools/go
cp -r go_patch/meta/recipes-devtools/go poky/meta/recipes-devtools/go
```

## Required image configurations
Expand All @@ -57,7 +66,56 @@ To do that, add in the configuration file the following line:
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules"
```

## Adding cloud connectivity and virtualization dependencies

Required for enabling the cloud connectivity and virtualization.
Could be used as a single dependency if only suite connector
is needed to be built.

URI: git://github.com/openembedded/meta-openembedded.git layers:

* meta-networking

Required for enabling edge containerization

URI: git://git.yoctoproject.org/meta-virtualization


## Adding edge containerization to your build

The edge containerization (i.e. Eclipse Kanto container management) serves as a
specialized component within the Eclipse Kanto and if it is to be included in your
target Yocto image, you need to enable the required virtualization layer.
To do that, add in the image configuration file the following line:

DISTRO_FEATURES:append = " virtualization"

For further fine-tuning and options see the meta-virtualization README.
https://git.yoctoproject.org/meta-virtualization/tree/README?h=hardknott

It also requires the kernel modules to be included in your target Yocto image.
To do that, add in the kernel module configuration file the following line:

CONFIG_DM_THIN_POOL=m
CONFIG_NF_NAT=m
CONFIG_NF_CT_NETLINK=m
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m
CONFIG_IP_NF_TARGET_MASQUERADE=m

Enabling the above mentioned kernel modules may depend on other kernel modules.
Identify the dependent modules and include them accordingly.

Once all the configurations are applied, then add the container management
software component to Yocto image.

```
# Add the Eclipse Kanto components
IMAGE_INSTALL:append = " container-management"
```


## Example image configuration

```
# Add the required DISTRO_FEATURES
DISTRO_FEATURES:append = " virtualization systemd"
Expand All @@ -73,6 +131,7 @@ VIRTUAL-RUNTIME_initscripts = "systemd-compat-units"
# Add the Eclipse Kanto components
IMAGE_INSTALL:append = " suite-connector"
```

## Community

* [GitHub Issues](https://github.com/eclipse-kanto/meta-kanto/issues)
Expand Down
2 changes: 1 addition & 1 deletion conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ LAYERDEPENDS_meta-kanto = " \
virtualization-layer \
"

LAYERSERIES_COMPAT_meta-kanto = "scarthgap"
LAYERSERIES_COMPAT_meta-kanto = "hardknott"

2 changes: 1 addition & 1 deletion recipes-connectivity/aws-connector/aws-connector_git.bb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ do_install() {
# aws-connector
install -d ${D}${SC_CFG_DD}/aws-connector

# iothub.crt
# aws.crt
install -m 0644 ${S}/src/${GO_IMPORT}/cmd/aws-connector/aws.crt ${D}${SC_CFG_DD}/aws-connector

# config.json
Expand Down

0 comments on commit 0bb8a81

Please sign in to comment.