Skip to content

Commit

Permalink
Kirkstone migration (#4) (#6)
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Haller <mike.haller@bosch.com>
Signed-off-by: Stoyan Lachev <stoyan.lachev@bosch.io>
Co-authored-by: Mike Haller <mike.haller@bosch.com>
  • Loading branch information
mikehaller authored Sep 5, 2022
1 parent bce79ab commit cf2fcb0
Show file tree
Hide file tree
Showing 22 changed files with 603 additions and 20 deletions.
68 changes: 68 additions & 0 deletions .config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# /********************************************************************************
# * Copyright (c) 2022 Contributors to the Eclipse Foundation
# *
# * See the NOTICE file(s) distributed with this work for additional
# * information regarding copyright ownership.
# *
# * This program and the accompanying materials are made available under the
# * terms of the Apache License 2.0 which is available at
# * https://www.apache.org/licenses/LICENSE-2.0
# *
# * SPDX-License-Identifier: Apache-2.0
# ********************************************************************************/
# Every file needs to contain a header, that provides kas with information
# about the context of this file.
header:
# The `version` entry in the header describes for which configuration
# format version this file was created for. It is used by kas to figure
# out if it is compatible with this file. The version is an integer that
# is increased on every format change.
version: 12
# The machine as it is written into the `local.conf` of bitbake.
machine: qemux86-64
# The distro name as it is written into the `local.conf` of bitbake.
distro: leda
target: sdv-image-all
local_conf_header:
meta-leda: |
INHERIT:append = " rm_work"
INHERIT:remove = " archiver"
INHERIT:remove = " cve-check"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
repos:
# This entry includes the repository where the config file is located
# to the bblayers.conf:
# Here we include a list of layers from the poky repository to the
# bblayers.conf:
poky:
url: "https://git.yoctoproject.org/git/poky"
refspec: kirkstone
layers:
meta:
meta-poky:
meta-yocto-bsp:
meta-rauc-community:
url: "https://github.com/rauc/meta-rauc-community.git"
refspec: krikstone
layers:
meta-rauc-qemux86:
meta-rauc:
url: "https://github.com/rauc/meta-rauc.git"
refspec: kirkstone
meta-virtualization:
url: "https://git.yoctoproject.org/meta-virtualization"
refspec: kirkstone
meta-openembedded:
url: "https://git.openembedded.org/meta-openembedded"
refspec: kirkstone
layers:
meta-oe:
meta-filesystems:
meta-python:
meta-networking:
meta-leda:
path: ./
layers:
meta-leda-bsp:
meta-leda-components:
meta-leda-distro:
39 changes: 39 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# /********************************************************************************
# * Copyright (c) 2022 Contributors to the Eclipse Foundation
# *
# * See the NOTICE file(s) distributed with this work for additional
# * information regarding copyright ownership.
# *
# * This program and the accompanying materials are made available under the
# * terms of the Apache License 2.0 which is available at
# * https://www.apache.org/licenses/LICENSE-2.0
# *
# * SPDX-License-Identifier: Apache-2.0
# ********************************************************************************/

# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/debian/.devcontainer/base.Dockerfile

# [Choice] Debian version (use bullseye on local arm64/Apple Silicon): bullseye, buster
ARG VARIANT="buster"
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}

# ** [Optional] Uncomment this section to install additional packages. **
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# Install Dependencies
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends socat file gawk wget git diffstat unzip texinfo \
gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils \
iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 xterm python3-subunit \
mesa-common-dev zstd liblz4-tool tmux mc skopeo fdisk ruby-full jq \
libvirt-clients libvirt-daemon-system qemu-system-x86 qemu-system-arm qemu-kvm \
squashfs-tools rauc python3-newt

RUN DEBIAN_FRONTEND=noninteractive apt-get -y install ca-certificates \
curl \
gnupg \
lsb-release

# Install kas tool to set up Yocto build environment
RUN pip3 install kas
38 changes: 38 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// ********************************************************************************
// * Copyright (c) 2022 Contributors to the Eclipse Foundation
// *
// * See the NOTICE file(s) distributed with this work for additional
// * information regarding copyright ownership.
// *
// * This program and the accompanying materials are made available under the
// * terms of the Apache License 2.0 which is available at
// * https://www.apache.org/licenses/LICENSE-2.0
// *
// * SPDX-License-Identifier: Apache-2.0
// ********************************************************************************/
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/debian
{
"name": "Debian",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick an Debian version: bullseye, buster
// Use bullseye on local arm64/Apple Silicon.
"args": { "VARIANT": "bullseye" }
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],

// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"features": {
"github-cli": "latest"
}
}
31 changes: 31 additions & 0 deletions .github/workflows/dryrun.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# /********************************************************************************
# * Copyright (c) 2022 Contributors to the Eclipse Foundation
# *
# * See the NOTICE file(s) distributed with this work for additional
# * information regarding copyright ownership.
# *
# * This program and the accompanying materials are made available under the
# * terms of the Apache License 2.0 which is available at
# * https://www.apache.org/licenses/LICENSE-2.0
# *
# * SPDX-License-Identifier: Apache-2.0
# ********************************************************************************/

name: BitBake DryRun
on:
push:
workflow_dispatch:

jobs:
mybranch:
name: Yocto (This Branch)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install tools
run: sudo apt-get install -y --no-install-recommends socat file gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 xterm python3-subunit mesa-common-dev zstd liblz4-tool tmux mc skopeo fdisk ruby-full jq libvirt-clients libvirt-daemon-system qemu-system-x86 qemu-system-arm qemu-kvm squashfs-tools rauc python3-newt ca-certificates curl gnupg lsb-release
- name: Install kas
run: sudo pip3 install kas
- name: DryRun sdv-image-all
run: kas build --target sdv-image-all -- --dry-run
49 changes: 49 additions & 0 deletions .github/workflows/leda-utils.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# /********************************************************************************
# * Copyright (c) 2022 Contributors to the Eclipse Foundation
# *
# * See the NOTICE file(s) distributed with this work for additional
# * information regarding copyright ownership.
# *
# * This program and the accompanying materials are made available under the
# * terms of the Apache License 2.0 which is available at
# * https://www.apache.org/licenses/LICENSE-2.0
# *
# * SPDX-License-Identifier: Apache-2.0
# ********************************************************************************/

name: Leda-Utils (Full)
on:
pull_request:
workflow_dispatch:

jobs:
leda-utils:
name: Leda Utils Recipe
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install tools
run: sudo apt-get install -y --no-install-recommends socat file gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 xterm python3-subunit mesa-common-dev zstd liblz4-tool tmux mc skopeo fdisk ruby-full jq libvirt-clients libvirt-daemon-system qemu-system-x86 qemu-system-arm qemu-kvm squashfs-tools rauc python3-newt ca-certificates curl gnupg lsb-release
- name: Install kas
run: sudo pip3 install kas
- name: Cache Downloads
id: cache-downloads
uses: actions/cache@v3
with:
path: build/downloads
key: bb-downloads
- name: Cache SState
id: cache-sstate
uses: actions/cache@v3
with:
path: build/sstate-cache
key: bb-sstate-cache
- name: Cache Local
id: cache-local
uses: actions/cache@v3
with:
path: build/cache
key: bb-cache-local
- name: Build leda-utils
run: kas build --target sdv-core-utils
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Build folder generated by running "kas build"
build/

# Metalayer folders are created by running "kas build" and we don't
# want to commit them as git submodules.
meta-openembedded
meta-rauc
meta-rauc-community
meta-virtualization
poky
52 changes: 44 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/eclipse-leda/meta-leda/BitBake%20DryRun/main?label=main)
![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/eclipse-leda/meta-leda/BitBake%20DryRun/kirkstone?label=kirkstone)
![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/eclipse-leda/meta-leda/BitBake%20DryRun/honister?label=honister)

# OpenEmbedded Meta-Layer for Software Defined Vehicles components

This metalayer can be used to integrate software-defined vehicle open source components into a Yocto based build.
Expand All @@ -6,21 +10,53 @@ It is based on the guidelines documented in the [Yocto Project Documentation](ht

# Structure

- Eclipse Leda Quickstart Distribution: `meta-leda/meta-sdv-distro`
- BSP for QEMU and Raspberry Pi: `meta-leda/meta-sdv-bsp`
- SDV Component Recipes: `meta-leda/meta-sdv-components`
- Eclipse Leda Quickstart Distribution: `meta-leda/meta-leda-distro`
- BSP for QEMU and Raspberry Pi: `meta-leda/meta-leda-bsp`
- SDV Component Recipes: `meta-leda/meta-leda-components`

Note: `meta-leda` is a [container layer](https://docs.yoctoproject.org/ref-manual/terms.html#term-Container-Layer).

# Usage

After cloning the repository, add the needed layers to your build configuration, for example:

bitbake-layers add-layer meta-leda/meta-leda-components

Enable the `sdv` distro feature by adding the following line to your distro (or local) configuration:

DISTRO_FEATURES:append = " sdv"

## Building using kas

The repository contains an example configuration (`.config.yaml`) for [kas](https://github.com/siemens/kas) . To build the image, simply run the kas build command:

kas build

# Dependencies

This layer depends on
- poky
- meta-virtualization
- meta-rauc
- meta-openembedded
- meta-security
- URI: https://git.yoctoproject.org/git/poky
- Branch: kirkstone
- meta-rauc-community
- URI: https://github.com/rauc/meta-rauc-community.git
- Branch: krikstone **(Note the typo in the branch name)**
- Layers:
- meta-rauc-qemux86
- meta-rauc:
- URI: https://github.com/rauc/meta-rauc.git
- Branch: kirkstone
- meta-virtualization:
- URI: https://git.yoctoproject.org/meta-virtualization
- Branch: kirkstone
- meta-openembedded:
- URI: https://git.openembedded.org/meta-openembedded
- Branch: kirkstone
- Layers:
- meta-oe
- meta-filesystems
- meta-python
- meta-networking

# License and Copyright

Expand All @@ -40,7 +76,7 @@ https://www.apache.org/licenses/LICENSE-2.0

The project maintains the following source code repositories:

* https://github.com/eclipse-leda/
* https://github.com/eclipse-leda/meta-leda

## Cryptography

Expand Down
4 changes: 2 additions & 2 deletions conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
BBFILE_COLLECTIONS += "meta-leda"
BBFILE_PATTERN_meta-leda := "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-leda = "7"
LAYERDEPENDS_meta-leda += "core meta-sdv-bsp meta-sdv-components meta-sdv-distro"
LAYERSERIES_COMPAT_meta-leda = "honister"
LAYERDEPENDS_meta-leda += "core meta-leda-bsp meta-leda-components meta-leda-distro"
LAYERSERIES_COMPAT_meta-leda = "kirkstone"
53 changes: 53 additions & 0 deletions docs/manual-bitbake-dryrun.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Manual BitBake Install and DryRun

After creating the DevContainer, set up the build environment by checking out Poky and the required layers

*Note: This setup is much easier to do with the `kas` tooling. See [Setup with kas](setup-kas.md)*

Clone Poky and switch to the branch under test:

git clone git://git.yoctoproject.org/poky
cd poky
git checkout -t origin/kirkstone -b kirkstone

Pull updates if necessary:

git config pull.rebase false
git pull

Set up build environment:

source oe-init-build-env

Dry-run a build of the Linux Kernel recipe using BitBake:

bitbake --dry-run linux-yocto

Check out dependencies for the meta-leda metalayer:

cd ${CODESPACE_VSCODE_FOLDER}
git clone -b kirkstone https://github.com/rauc/meta-rauc.git meta-rauc
git clone -b krikstone https://github.com/rauc/meta-rauc-community.git meta-rauc-community
git clone -b kirkstone https://git.yoctoproject.org/meta-virtualization meta-virtualization
git clone -b kirkstone https://git.openembedded.org/meta-openembedded meta-openembedded

From the `poky/build` directory, add the meta-leda Layer to the BBLAYERS configuration:

bitbake-layers add-layer ${CODESPACE_VSCODE_FOLDER}/meta-rauc
bitbake-layers add-layer ${CODESPACE_VSCODE_FOLDER}/meta-rauc-community/meta-rauc-qemux86
bitbake-layers add-layer ${CODESPACE_VSCODE_FOLDER}/meta-openembedded/meta-oe
bitbake-layers add-layer ${CODESPACE_VSCODE_FOLDER}/meta-openembedded/meta-filesystems
bitbake-layers add-layer ${CODESPACE_VSCODE_FOLDER}/meta-openembedded/meta-python
bitbake-layers add-layer ${CODESPACE_VSCODE_FOLDER}/meta-openembedded/meta-networking
bitbake-layers add-layer ${CODESPACE_VSCODE_FOLDER}/meta-virtualization
bitbake-layers add-layer ${CODESPACE_VSCODE_FOLDER}/meta-leda-components
bitbake-layers add-layer ${CODESPACE_VSCODE_FOLDER}/meta-leda-bsp
bitbake-layers add-layer ${CODESPACE_VSCODE_FOLDER}/meta-leda-distro

Dry-run a build of one of the Leda recipes:

DISTRO=leda bitbake --dry-run sdv-image-all

Perform a real build of one of the targets, e.g. the Eclipse Kanto Container Management recipe:

DISTRO=leda bitbake kanto-container-management
Loading

0 comments on commit cf2fcb0

Please sign in to comment.