diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 2909154..7408a30 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -4,14 +4,14 @@ on: push: branches: - main - - kirkstone + - hardknott paths-ignore: - "**/*.md" pull_request: branches: - main - - kirkstone + - hardknott paths-ignore: - "**/*.md" @@ -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 @@ -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 diff --git a/README.md b/README.md index 9fd2ab3..0bd35ee 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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" @@ -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) diff --git a/conf/layer.conf b/conf/layer.conf index e2296b8..026c16f 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -15,5 +15,5 @@ LAYERDEPENDS_meta-kanto = " \ virtualization-layer \ " -LAYERSERIES_COMPAT_meta-kanto = "scarthgap" +LAYERSERIES_COMPAT_meta-kanto = "hardknott" \ No newline at end of file diff --git a/recipes-connectivity/aws-connector/aws-connector_git.bb b/recipes-connectivity/aws-connector/aws-connector_git.bb index 3a7afa1..e3ef306 100644 --- a/recipes-connectivity/aws-connector/aws-connector_git.bb +++ b/recipes-connectivity/aws-connector/aws-connector_git.bb @@ -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