-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build a development image on release (#14)
* Bump release action to v2 * Add development image container file * Update CI/CD to build development image * Fix aldebaran binaries extraction script path * Specify shell in code blocks * Check if patchelf is installed * Update image used for CI/CD * Remove toolchain after install * Fix architecture name * Build and release devimage in separate job * Fix missing prefix * Update containerfile to download toolchain * Set arch only to x86_64 for now * Fix container name * Hardcode version for now * Get architecture from within container build * Add label and clean up apt cache * Bump QEMU setup action * Let image build run on github infrastructure * Fix checkout path and tag * Specify architectures as amd64 and arm64 * Fix registry * Allow job to write packages * Build image only on release * Move naosdk containerfile to subdirectory * Use second job as release action * Use a two-stage build process * Do not hardcode architecture in symlink * Checkout repository before downloading artifacts * Free up disk space in github runner * Rename jobs --------- Co-authored-by: Julian Schuler <[email protected]>
- Loading branch information
1 parent
1dfa88c
commit 11e4218
Showing
4 changed files
with
82 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,14 +15,14 @@ As this is a very first attempt with the Yocto project and image construction fo | |
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`. | ||
|
||
``` | ||
```sh | ||
git clone [email protected]:hulks/meta-nao worktree/meta-nao | ||
``` | ||
|
||
4. The Nao V6 uses *LoLA* and *HAL* for the communication with the chestboard. All these binaries and libraries necessary to operate the Nao properly are shipped with the `.opn` robocupper image and **not** included in this repository. To acquire the necessary binaries the `meta-nao/recipes-support/aldebaran/extract_binaries.sh` script is used. This script fetches all binaries from inside the robocupper image and collects them in an archive for the upcoming build phase. To generate the archive containing the aldebaran binaries run: | ||
|
||
``` | ||
cd meta-nao/recipes-support/aldebaran/ | ||
```sh | ||
cd meta/recipes-support/aldebaran/ | ||
mkdir -p aldebaran-binaries | ||
./extract_binaries.sh -o aldebaran-binaries/aldebaran_binaries.tar.gz nao-x86-firmware-249_20190503_203829_robocupper.opn | ||
``` | ||
|
@@ -31,7 +31,7 @@ The script references the original robocupper image shipped by softbank. Contact | |
|
||
5. Execute *kas* from inside the `worktree` directory referencing the project description files to enter the build environment | ||
|
||
``` | ||
```sh | ||
./kas-container shell meta-nao/kas/base.yml:meta-nao/kas/hulks.yml | ||
``` | ||
|
||
|
@@ -52,15 +52,15 @@ If your container shell does not work as expected, you might have to set your `T | |
|
||
6. Build a nao image. The Yocto project uses *BitBake* for task execution. Call the following build command from inside the *kas* container shell: | ||
|
||
``` | ||
```sh | ||
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-[VERSION].ext3.gz.opn`. To setup a flash stick run: | ||
|
||
``` | ||
```sh | ||
dd if=image_path.opn of=/dev/sdb bs=4M status=progress oflag=sync | ||
``` | ||
|
||
|
@@ -87,7 +87,7 @@ The Yocto project contains tasks to build a proper SDK to use for development. T | |
|
||
1. Enter the build container | ||
|
||
``` | ||
```sh | ||
./kas-container -d shell meta-nao/kas/base.yml:meta-nao/kas/hulks.yml | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM debian AS build | ||
|
||
LABEL org.opencontainers.image.source https://github.com/hulks/meta-nao | ||
|
||
RUN apt-get update && apt-get install --no-install-recommends --yes \ | ||
file \ | ||
python3 \ | ||
xz-utils \ | ||
zstd \ | ||
&& rm --recursive --force /var/lib/apt/lists/* | ||
|
||
ARG version | ||
COPY --chmod=744 sdk/HULKs-OS-*.sh /opt/ | ||
RUN /opt/HULKs-OS-$(uname -m)-toolchain-${version}.sh -d /naosdk | ||
|
||
FROM busybox | ||
COPY --from=build /naosdk /naosdk | ||
RUN ln -s /naosdk/sysroots/$(uname -m)-naosdk-linux/bin/bash /bin/bash | ||
RUN echo . /naosdk/environment-setup-corei7-64-aldebaran-linux >> /root/.bashrc |