Skip to content

Commit

Permalink
upgrade to latest scarthgap, build aarch64 SDKs
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidma committed Jun 6, 2024
1 parent 1c41d02 commit 54a9df3
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 266 deletions.
File renamed without changes.
17 changes: 10 additions & 7 deletions .github/workflows/yocto_cicd.yml → .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Yocto CI/CD
name: CI/CD
on: push
jobs:
cicd:
name: Yocto CI/CD
name: CI/CD
runs-on:
- self-hosted
- v3
Expand All @@ -17,13 +17,15 @@ jobs:
fetch-depth: 0
path: meta-nao
- name: Checkout Yocto layers
run: kas checkout meta-nao/kas-project.yml
run: kas checkout meta-nao/kas/base.yml:meta-nao/kas/hulks.yml
- name: Populate aldebaran_binaries.tar.gz
run: mkdir -p meta-nao/meta/recipes-support/aldebaran/aldebaran-binaries/ && cp /aldebaran_binaries.tar.gz meta-nao/meta/recipes-support/aldebaran/aldebaran-binaries/
- name: Build image
run: kas build --target nao-image --cmd build meta-nao/kas-project.yml
- name: Build SDK
run: kas build --target nao-image --cmd populate_sdk meta-nao/kas-project.yml
run: kas build --target nao-image --cmd build meta-nao/kas/base.yml:meta-nao/kas/hulks.yml
- name: Build SDK (x86_64)
run: kas build --target nao-image --cmd populate_sdk meta-nao/kas/base.yml:meta-nao/kas/hulks.yml
- name: Build SDK (aarch64)
run: kas build --target nao-image --cmd populate_sdk meta-nao/kas/base.yml:meta-nao/kas/hulks.yml:meta-nao/kas/aarch64.yml
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -32,5 +34,6 @@ jobs:
body: Flashable image containing HULKs-OS ${{ github.ref_name }} and the corresponding SDK with the toolchain and other tools targeting HULKs-OS, for instructions see https://hulks.de/hulk/setup/overview/
files: |
build/tmp/deploy/images/nao-v6/nao-image-HULKs-OS-${{ github.ref_name }}.ext3.gz.opn
build/tmp/deploy/sdk/HULKs-OS-toolchain-${{ github.ref_name }}.sh
build/tmp/deploy/sdk/HULKs-OS-x86_64-toolchain-${{ github.ref_name }}.sh
build/tmp/deploy/sdk/HULKs-OS-aarch64-toolchain-${{ github.ref_name }}.sh
fail_on_unmatched_files: true
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ As this is a very first attempt with the Yocto project and image construction fo

2. For project setup the [siemens/kas](https://github.com/siemens/kas) framework is used. To setup *kas* use the containerized (podman/docker) version via the `kas-container` script provided [here](https://github.com/siemens/kas/blob/master/kas-container) and store it inside the `worktree` directory. Alternatively setup *kas* via a *python-pip* installation, follow the installation steps in the [user guide](https://kas.readthedocs.io/en/latest/userguide.html).

3. *meta-nao* ships a `kas-project.yml` project description file. This file defines the project structure *kas* has to setup for the Yocto build phase.
3. *meta-nao* ships multiple `kas-project.yml` project description file. This file defines the project structure *kas* has to setup for the Yocto build phase.
Clone the *meta-nao* repository into some directory used for the Yocto build e.g. `worktree/meta-nao`.

```
Expand All @@ -29,10 +29,10 @@ mkdir -p aldebaran-binaries

The script references the original robocupper image shipped by softbank. Contact the RoboCup SPL TC to get this image. If you get errors regarding `libguestfs` and `supermin`, try running `./extract_binaries.sh` with root permissions again.

5. Execute *kas* from inside the `worktree` directory referencing the `kas-project.yml` to enter the build environment
5. Execute *kas* from inside the `worktree` directory referencing the project description files to enter the build environment

```
./kas-container -d shell meta-nao/kas-project.yml
./kas-container shell meta-nao/kas/base.yml:meta-nao/kas/hulks.yml
```

*kas* fetches all necessary build sources and sets them up in the respective `worktree` directory. After *kas* has setup the working directory, your directory structure should look like this:
Expand All @@ -58,7 +58,7 @@ bitbake nao-image

This generates and executes all necessary tasks and targets to construct a proper `.opn` file. This build phase might take several hours depending on the performance of your build machine and your internet connection. *BitBake* uses a very elaborated caching strategy to speed up following builds of targets. Thus small changes afterwards can only take a few minutes.

7. Fetch and deploy the image. After *BitBake* ran all tasks up to `nao-opn` a new `.opn` file is generated in `worktree/build/tmp/deploy/images/nao-v6/nao-image-HULKs-OS-[...].ext3.gz.opn`. To setup a flash stick run:
7. Fetch and deploy the image. After *BitBake* ran all tasks up to `nao-opn` a new `.opn` file is generated in `worktree/build/tmp/deploy/images/nao-v6/nao-image-HULKs-OS-[VERSION].ext3.gz.opn`. To setup a flash stick run:

```
dd if=image_path.opn of=/dev/sdb bs=4M status=progress oflag=sync
Expand All @@ -68,30 +68,31 @@ dd if=image_path.opn of=/dev/sdb bs=4M status=progress oflag=sync

### How can I log into the robot?

The login credentials for user *root* and *nao* are defined in `meta-nao/recipes-core/images/nao-image.bb`.
The login credentials for user *root* and *nao* are defined in `meta-nao/meta/recipes-core/images/nao-image.bb`.
Per default the nao user has an empty password.
The password of the root user is *root*.

### How can I configure IP addresses?

Currently there is no proper network manager installed. This means, networking is controlled via *systemd-networkd* and respective `.network` units. This might change in the future. Team HULKs did not yet decide on the best way to go. Up until now you can configure the network via `wpa_supplicant.conf` and proper `.network` files. Have a look at `meta-nao/recipes-conf/nao-wifi-conf/nao-wifi-conf/80-wlan.network` and `meta-nao/recipes-conf/nao-wifi-conf/nao-wifi-conf/wpa_supplicant-nl80211-wlan0.conf`.
If you have suggestions how to tackle the network configuration problem, please let us know.
Networking is controlled via *systemd-networkd* and respective `.network` units. You can configure the network via `wpa_supplicant.conf` and respective `.network` files. Have a look at `meta-nao/meta/recipes-conf/nao-wifi-conf/nao-wifi-conf/80-wlan.network` and `meta-nao/meta/recipes-conf/nao-wifi-conf/nao-wifi-conf/wpa_supplicant-nl80211-wlan0.conf`.

### How can I customize the image?

The Yocto Project is organized in layers. You can edit the existing *meta-nao* layer or (better) add an additional layer alongside *meta-nao*, *meta-openembedded*, etc. to overlay configuration in other layers. Have a look at [meta-example](https://github.com/HULKs/meta-example) for an example overlay extending the nao image by the *boost* library.
The Yocto Project is organized in layers. You can edit the existing *meta-nao/meta* layer or (better) add an additional layer alongside *meta-nao*, *meta-openembedded*, etc. to overlay configuration in other layers. Have a look at [meta-example](https://github.com/HULKs/meta-example) for an example overlay extending the nao image by the *boost* library.
You can use [https://layers.openembedded.org/layerindex/branch/master/recipes/](https://layers.openembedded.org/layerindex/branch/master/recipes/) to search for existing recipes.

### How do I target the nao architecture during development?

The Yocto project contains tasks to build a proper SDK to use for development. To build the sdk do the following:
The Yocto project contains tasks to build a proper SDK to use for development. To build the SDK do the following:

1. Enter the build container

```
./kas-container -d shell meta-nao/kas-project.yml
./kas-container -d shell meta-nao/kas/base.yml:meta-nao/kas/hulks.yml
```

You can append the `aarch64.yml` project description to configure Yocto for building a aarch64 SDK.

2. Build the SDK (from inside the container)

```
Expand All @@ -102,7 +103,7 @@ This again takes several hours. On machines at HULKs this can take up to 4 hours

3. Download and install the SDK

After a successful build, the SDK is located at `worktree/build/tmp/deploy/sdk/HULKs-OS-toolchain-[...].sh`. To install the SDK run the script and follow the instructions. Afterwards you are able to source the build environment and use the respective cross compilers.
After a successful build, the SDK is located at `worktree/build/tmp/deploy/sdk/HULKs-OS-[MACHINE]-toolchain-[VERSION].sh`. To install the SDK run the script and follow the instructions. Afterwards you are able to source the build environment and use the respective cross compilers.


## Links and Resources
Expand Down
6 changes: 6 additions & 0 deletions kas/aarch64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
header:
version: 14

local_conf_header:
aarch64-sdk: |
SDKMACHINE = "aarch64"
20 changes: 8 additions & 12 deletions kas-project.yml → kas/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ header:
version: 14

machine: nao-v6
distro: HULKs-OS
distro: nao-core-minimal
target: nao-image

local_conf_header:
meta-nao: |
CONF_VERSION = "2"
SDK_TOOLCHAIN_LANGS ?= "rust"
PACKAGE_CLASSES ?= "package_ipk"
CLANGSDK = "1"
EXTRA_IMAGE_FEATURES += "allow-empty-password"
CLANGSDK = "1"
repos:
meta-nao:
layers:
meta:
meta-hulks:
poky:
url: "https://git.yoctoproject.org/git/poky"
commit: ca93c215fdd2e0f3b0ab4a205ccf80e5077e5d06
commit: ae6cebca5bac9521230c69fed23b375d0de7f5f6
layers:
meta:
meta-poky:
Expand All @@ -42,17 +42,13 @@ repos:
path: "patches/0002-congatec-new-override-syntax.patch"
meta-clang:
url: "https://github.com/kraj/meta-clang.git"
commit: 989ff6a4e7db59f01d511727135610006124ead2
commit: e7dceb1c92caf7f21ef1d7b49c85328c30cffd90
meta-intel:
url: "https://git.yoctoproject.org/git/meta-intel"
commit: bdb3a52062a1290302674c05398e950f915d10f9
patches:
0005-downgrade_openvino_to_2023.3.0:
repo: "meta-nao"
path: "patches/0005-downgrade_openvino_to_2023.3.0.patch"
commit: c8cd0317ec19332bce86697f3413a82b9828b329
meta-openembedded:
url: "https://git.openembedded.org/meta-openembedded"
commit: cf942682b8ff5b30393f1f60a1a4d37571c0d1ba
commit: 4a7bb77f7ebe0ac8be5bab5103d8bd993e17e18d
layers:
meta-oe:
meta-multimedia:
Expand Down
12 changes: 12 additions & 0 deletions kas/hulks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
header:
version: 14

distro: HULKs-OS
local_conf_header:
meta-hulks: |
SDK_TOOLCHAIN_LANGS ?= "rust"
repos:
meta-nao:
layers:
meta-hulks:
2 changes: 1 addition & 1 deletion meta-hulks/conf/distro/HULKs-OS.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ SUMMARY = "HULKs flavoured Poky"

DISTRO = "HULKs-OS"
DISTRO_NAME = "HULKs-OS"
DISTRO_VERSION = "7.4.2"
DISTRO_VERSION = "7.5.0"
SDKIMAGE_FEATURES:remove = "dbg-pkgs src-pkgs"
1 change: 1 addition & 0 deletions meta-hulks/recipes-core/images/nao-image.bbappend
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ CORE_IMAGE_EXTRA_INSTALL += "\
iproute2 \
jq \
libxml2-utils \
libcap-bin \
libogg \
libopus \
nano \
Expand Down
2 changes: 1 addition & 1 deletion meta/conf/distro/nao-core-minimal.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SUMMARY = "A small image just capable of allowing a device to boot."
DISTRO = "nao-core-minimal"
DISTRO_NAME = "nao-core-minimal"
DISTRO_VERSION = "2.0"
SDK_NAME = "${DISTRO}"
SDK_NAME = "${DISTRO}-${SDKMACHINE}"
TARGET_VENDOR = "-aldebaran"
SDK_VENDOR = "-naosdk"
SDK_ARCHIVE_TYPE = "tar.zst"
Expand Down
Loading

0 comments on commit 54a9df3

Please sign in to comment.