diff --git a/configuration/build_config.yaml b/configuration/build_config.yaml index 9c5743b..2c77dd0 100644 --- a/configuration/build_config.yaml +++ b/configuration/build_config.yaml @@ -1,13 +1,12 @@ Base-Name: ebcl_dev_container Repository: ghcr.io/elektrobit Base-Container: ubuntu:22.04 -Version: v1.6.0 -Version_packages: v1.6.0 +Version: v1.7.0 +Version_packages: v1.7.0 Layers: - ../layers/base - ../layers/yocto - ../layers/pbuilder - - ../layers/kiwi - ../layers/appdev - ../layers/build_tools - ../layers/vscode diff --git a/layers/kiwi/Dockerfile b/layers/kiwi/Dockerfile deleted file mode 100644 index 6efaf76..0000000 --- a/layers/kiwi/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM ubuntu:latest - -ARG CONTAINER_USER="ebcl" - -# "Activate" Python env -ENV VIRTUAL_ENV=/build/venv -ENV PATH="$VIRTUAL_ENV/bin:$PATH" - -USER root - -# Copy berrymill config -RUN mkdir -p /etc/berrymill -COPY conf/berrymill/berrymill_local.conf /etc/berrymill -COPY conf/berrymill/berrymill.conf /etc/berrymill -COPY conf/kiwi/kiwi-boxed-plugin.yml /etc/berrymill -COPY conf/kiwi/kiwi.yml /etc - -# Copy linux.elektrobit.com repo key -RUN mkdir -p /etc/berrymill/keyrings.d -RUN cp /etc/apt/trusted.gpg.d/elektrobit.gpg /etc/berrymill/keyrings.d/ - -USER $CONTAINER_USER -WORKDIR /build - -# Install berrymill -RUN pip install kiwi==10.1.2 kiwi-boxed-plugin==0.2.36 -RUN pip install 'berrymill @ git+https://github.com/tomirgang/berrymill.git@f4ff87f08edf5f178284a5a689e2b6e301faad35' - -# copy apt helper scripts -COPY scripts/apt/* /build/bin/ - -# copy berrymill helper scripts -COPY scripts/berrymill/* /build/bin/ - -# copy gpg helper scripts -COPY scripts/gpg/* /build/bin/ - -# copy kiwi helper scripts -COPY scripts/kiwi/* /build/bin/ diff --git a/layers/kiwi/conf/berrymill/berrymill.conf b/layers/kiwi/conf/berrymill/berrymill.conf deleted file mode 100644 index b7048de..0000000 --- a/layers/kiwi/conf/berrymill/berrymill.conf +++ /dev/null @@ -1,50 +0,0 @@ -# Global repositories will not be added, if set to "false" -use-global-repos: false -# Default location -boxed_plugin_conf: /etc/berrymill/kiwi_boxed_plugin.yml - -# Repository setup -repos: - # These below are repo names. - # They are just free form tags that are addressed later - release: - # Architecture - # Conforms to Debian standard: https://wiki.debian.org/SupportedArchitectures - amd64: - # Just an alias of the repo, free form - EBcL: - url: https://linux.elektrobit.com/eb-corbos-linux/1.1.1 - type: apt-deb - key: file:///etc/berrymill/keyrings.d/elektrobit.gpg - name: ebcl - components: prod - - EBcL-Not-Supported: - url: https://linux.elektrobit.com/eb-corbos-linux/1.1.1 - type: apt-deb - key: file:///etc/berrymill/keyrings.d/elektrobit.gpg - name: ebcl - components: all - - arm64: - EBcL: - url: https://linux.elektrobit.com/eb-corbos-linux/1.1.1 - type: apt-deb - key: file:///etc/berrymill/keyrings.d/elektrobit.gpg - name: ebcl - components: prod - - EBcL-Not-Supported: - url: https://linux.elektrobit.com/eb-corbos-linux/1.1.1 - type: apt-deb - key: file:///etc/berrymill/keyrings.d/elektrobit.gpg - name: ebcl - components: all - - EBcL-NXP-RDB2: - url: https://linux.elektrobit.com/eb-corbos-linux/1.1.1 - type: apt-deb - key: file:///etc/berrymill/keyrings.d/elektrobit.gpg - name: ebcl_nxp_public - components: nxp_public - diff --git a/layers/kiwi/conf/berrymill/berrymill_local.conf b/layers/kiwi/conf/berrymill/berrymill_local.conf deleted file mode 100644 index 525c0cc..0000000 --- a/layers/kiwi/conf/berrymill/berrymill_local.conf +++ /dev/null @@ -1,56 +0,0 @@ -# Global repositories will not be added, if set to "false" -use-global-repos: false -# Default location -boxed_plugin_conf: /etc/berrymill/kiwi_boxed_plugin.yml - -# Repository setup -repos: - # These below are repo names. - # They are just free form tags that are addressed later - release: - # Architecture - # Conforms to Debian standard: https://wiki.debian.org/SupportedArchitectures - amd64: - # Just an alias of the repo, free form - EBcL: - url: https://linux.elektrobit.com/eb-corbos-linux/1.1.1 - type: apt-deb - key: file:///etc/berrymill/keyrings.d/elektrobit.gpg - name: ebcl - components: prod - - EBcL-Not-Supported: - url: https://linux.elektrobit.com/eb-corbos-linux/1.1.1 - type: apt-deb - key: file:///etc/berrymill/keyrings.d/elektrobit.gpg - name: ebcl - components: all - - app: - url: http://CONTAINERIP:8000 - type: apt-deb - key: file:///build//result_app/dists/local/Release.key - name: local - components: main - - arm64: - EBcL: - url: https://linux.elektrobit.com/eb-corbos-linux/1.1.1 - type: apt-deb - key: file:///etc/berrymill/keyrings.d/elektrobit.gpg - name: ebcl - components: prod - - EBcL-Not-Supported: - url: https://linux.elektrobit.com/eb-corbos-linux/1.1.1 - type: apt-deb - key: file:///etc/berrymill/keyrings.d/elektrobit.gpg - name: ebcl - components: all - - app: - url: http://CONTAINERIP:8000 - type: apt-deb - key: file:///build//result_app/dists/local/Release.key - name: local - components: main diff --git a/layers/kiwi/conf/kiwi/kiwi-boxed-plugin.yml b/layers/kiwi/conf/kiwi/kiwi-boxed-plugin.yml deleted file mode 100644 index 4b5552b..0000000 --- a/layers/kiwi/conf/kiwi/kiwi-boxed-plugin.yml +++ /dev/null @@ -1,32 +0,0 @@ -box: - - - name: ubuntu - mem_mb: 8096 - processors: 4 - console: hvc0 - arch: - - - name: x86_64 - cmdline: - - root=/dev/vda3 - - rd.plymouth=0 - - selinux=0 - source: https://linux.elektrobit.com/boxes/images - packages_file: Ubuntu-Box.x86_64-1.22.04-System-BuildBox.report - boxfiles: - - Ubuntu-Box.x86_64-1.22.04-Kernel-BuildBox.tar.xz - - Ubuntu-Box.x86_64-1.22.04-System-BuildBox.qcow2 - use_initrd: true - - - - name: aarch64 - cmdline: - - root=/dev/vda2 - - rd.plymouth=0 - - selinux=0 - source: https://linux.elektrobit.com/boxes/images - packages_file: Ubuntu-Box.aarch64-1.22.04-System-BuildBox.report - boxfiles: - - Ubuntu-Box.aarch64-1.22.04-Kernel-BuildBox.tar.xz - - Ubuntu-Box.aarch64-1.22.04-System-BuildBox.qcow2 - use_initrd: true diff --git a/layers/kiwi/conf/kiwi/kiwi.yml b/layers/kiwi/conf/kiwi/kiwi.yml deleted file mode 100644 index 1593278..0000000 --- a/layers/kiwi/conf/kiwi/kiwi.yml +++ /dev/null @@ -1,10 +0,0 @@ -# KIWI - Build configuration file - -# Setup access options for the Open BuildService -obs: - # Use linux.elektrobit.com as OBS base url - - download_url: https://linux.elektrobit.com/ - # Specify if the BuildService download server is public or private. - # This information is used to verify if the request to populate - # the repositories via the imageinclude attribute is possible - - public: true diff --git a/layers/kiwi/scripts/apt/berrymill_local_repo b/layers/kiwi/scripts/apt/berrymill_local_repo deleted file mode 100755 index 615e6d3..0000000 --- a/layers/kiwi/scripts/apt/berrymill_local_repo +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# get current IP of SDK container -IP=$(hostname -I | cut -d " " -f1 -s) - -BASE_FOLDER="/workspace/images" - -if [ ! -f "${BASE_FOLDER}/berrymill.template" ]; then - # copy the default template - cp /etc/berrymill/berrymill_local.conf ${BASE_FOLDER}/berrymill.template -fi - -if [ -f "${BASE_FOLDER}" ]; then - # if already a berrymill config exists - cat ${BASE_FOLDER}/berrymill.conf | grep "${IP}" - if [ $? -ne 0 ]; then - # and the config doesn't contain the local IP - # backup the config - mv ${BASE_FOLDER}/berrymill.conf ${BASE_FOLDER}/berrymill_$(date +%s).old - # and add the right config - cp ${BASE_FOLDER}/berrymill.template ${BASE_FOLDER}/berrymill.conf - sed -i "s/CONTAINERIP/${IP}/g" ${BASE_FOLDER}/berrymill.conf - fi -else - # genrate a berrymill config - cp ${BASE_FOLDER}/berrymill.template ${BASE_FOLDER}/berrymill.conf - sed -i "s/CONTAINERIP/${IP}/g" ${BASE_FOLDER}/berrymill.conf -fi diff --git a/layers/kiwi/scripts/apt/gen_app_apt_repo b/layers/kiwi/scripts/apt/gen_app_apt_repo deleted file mode 100755 index 5d19461..0000000 --- a/layers/kiwi/scripts/apt/gen_app_apt_repo +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash - -# Generate the apt repo metadata -cd /build/results/packages - -mkdir -p dists/local/main/{binary-arm64,binary-amd64} - -dpkg-scanpackages -m -a amd64 . /dev/null > dists/local/main/binary-amd64/Packages -dpkg-scanpackages -m -a arm64 . /dev/null > dists/local/main/binary-arm64/Packages -dpkg-scanpackages -m -a amd64 . /dev/null | gzip -9c > dists/local/main/binary-amd64/Packages.gz -dpkg-scanpackages -m -a arm64 . /dev/null | gzip -9c > dists/local/main/binary-arm64/Packages.gz -dpkg-scanpackages -m -a amd64 . /dev/null | xz -9 > dists/local/main/binary-amd64/Packages.xz -dpkg-scanpackages -m -a arm64 . /dev/null | xz -9 > dists/local/main/binary-arm64/Packages.xz - -# generate the release file -cd dists/local - -do_hash() { - HASH_NAME=$1 - HASH_CMD=$2 - echo "${HASH_NAME}:" - for f in $(find -type f -name "Packages*"); do - f=$(echo $f | cut -c3-) # remove ./ prefix - if [ "$f" = "Release" ]; then - continue - fi - echo " $(${HASH_CMD} ${f} | cut -d" " -f1) $(wc -c $f)" - done -} - -cat > Release << EOF -Origin: EBcL workspace local repository -Label: LocalRepo -Suite: local -Codename: local -Version: 1.0 -Architectures: amd64 arm64 -Description: An example software repository -Components: main -Date: $(date -Ru) -EOF - -do_hash "MD5Sum" "md5sum" >> Release -do_hash "SHA1" "sha1sum" >> Release -do_hash "SHA256" "sha256sum" >> Release - -# Generate Release signature -gpg -b --output Release.gpg --armor Release - -# Generate InRelease file -gpg --clearsign -o InRelease Release - -# Export signing key -gpg --export $DEBMAIL > Release.key - -# Update local apt config -sudo cp Release.key /etc/apt/trusted.gpg.d/local.gpg -sudo bash -c "echo 'deb file:/build/results/packages local main' > /etc/apt/sources.list.d/local.list" diff --git a/layers/kiwi/scripts/apt/serve_packages b/layers/kiwi/scripts/apt/serve_packages deleted file mode 100755 index 3a5cde6..0000000 --- a/layers/kiwi/scripts/apt/serve_packages +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -# Ensure berrymill conf has correct container IP -berrymill_local_repo - -if [ -z "$APT_PATH" ]; then - export APT_PATH="/build/results/packages" -fi - -if [ -n "$1" ]; then - APT_PATH=$1 - # complete apt path - if [[ "${APT_PATH}" != "/"* ]]; then - # handle relative path - if [ ! -d "${APT_PATH}" ]; then - # relative path from current folder does not exist - # use relative path in workspace apps folder - APT_PATH="/build/workspace/${APT_PATH}" - else - APT_PATH=$(realpath $APT_PATH) - fi - fi - export APT_PATH=${APT_PATH} -fi - -# serve the apt repo -echo "Now serving the local apt repository from ${APT_PATH}." -echo "Press Strg + C to stop the server." -python3 -m http.server --directory ${APT_PATH} diff --git a/layers/kiwi/scripts/apt/stop_server b/layers/kiwi/scripts/apt/stop_server deleted file mode 100755 index a609a2f..0000000 --- a/layers/kiwi/scripts/apt/stop_server +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -PROC=$(lsof -i :8000 | grep LISTEN) -if [ $? -eq 0 ]; then - echo "Killing process ${PROC}." - PID=$(lsof -i :8000 | grep LISTEN | awk '{print $2}') - kill $PID -fi diff --git a/layers/kiwi/scripts/berrymill/box_build_image b/layers/kiwi/scripts/berrymill/box_build_image deleted file mode 100755 index 75fc9ca..0000000 --- a/layers/kiwi/scripts/berrymill/box_build_image +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# copy image to tmp -source prepare_image_build $@ - -# run berrymill -berrymill -c $BERRYMILL_CFG -d -a amd64 -i $APPLIANCE --clean build --box-memory 4G --target-dir /tmp/result_image --no-accel --cpu qemu64-v1 - -set -e -check_image_build diff --git a/layers/kiwi/scripts/berrymill/cross_build_image b/layers/kiwi/scripts/berrymill/cross_build_image deleted file mode 100755 index 6dda28f..0000000 --- a/layers/kiwi/scripts/berrymill/cross_build_image +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# copy image to tmp -source prepare_image_build $@ - -# run berrymill -berrymill -c $BERRYMILL_CFG -d -a arm64 -i $APPLIANCE --clean build --cross --box-memory 4G --target-dir /tmp/result_image - -set -e -check_image_build diff --git a/layers/kiwi/scripts/berrymill/kvm_build_image b/layers/kiwi/scripts/berrymill/kvm_build_image deleted file mode 100755 index af8058d..0000000 --- a/layers/kiwi/scripts/berrymill/kvm_build_image +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# copy image to tmp -source prepare_image_build $@ - -# run berrymill -sudo -E env PATH=$PATH berrymill -c $BERRYMILL_CFG -d -a amd64 -i $APPLIANCE --clean build --target-dir /tmp/result_image - -set -e -check_image_build diff --git a/layers/kiwi/scripts/berrymill/prepare_image_build b/layers/kiwi/scripts/berrymill/prepare_image_build deleted file mode 100644 index 3c0ed3e..0000000 --- a/layers/kiwi/scripts/berrymill/prepare_image_build +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash - -source /build/venv/bin/activate - -# get appliance name -if [ $# -eq 0 ]; then - APPLIANCE="/tmp/build/images/appliance.kiwi" - echo "Using default $APPLIANCE" -else - APPLIANCE=$1 -fi - -# complete appliance path -if [[ "${APPLIANCE}" != "/"* ]]; then - # handle relative path - if [ ! -f "${APPLIANCE}" ]; then - # relative path from current folder does not exist - # use relative path in workspace images folder - APPLIANCE="/tmp/build/images/$APPLIANCE" - fi -fi - -APPLIANCE=$(realpath $APPLIANCE) - -if [ ! -f "$APPLIANCE" ]; then - echo "Appliance file $APPLIANCE not found!" - exit 1 -fi - -echo "Building appliance ${APPLIANCE}" - -# clean old result folder -sudo rm -rf /tmp/result_image - -FILENAME="$(basename "${APPLIANCE}")" - -echo "Appliance file ${FILENAME}" - -export APPLIANCE - -# check if user berrymill config exists -BUILD_FOLDER=$(dirname "${APPLIANCE}") -if [ -f "${BUILD_FOLDER}/berrymill.conf" ]; then - # use config from specific image folder - BERRYMILL_CFG="${BUILD_FOLDER}/berrymill.conf" -else - if [ -f "/workspace/images/berrymill.conf" ]; then - # use config form workspace images folder - BERRYMILL_CFG="/workspace/images/berrymill.conf" - else - # use default config - BERRYMILL_CFG="/etc/berrymill/berrymill.conf" - fi -fi - -export BERRYMILL_CFG diff --git a/layers/kiwi/scripts/gpg/gen_key_script b/layers/kiwi/scripts/gpg/gen_key_script deleted file mode 100644 index dc5672a..0000000 --- a/layers/kiwi/scripts/gpg/gen_key_script +++ /dev/null @@ -1,9 +0,0 @@ -Key-Type: 1 -Key-Length: 4096 -Subkey-Type: 1 -Subkey-Length: 4096 -Name-Real: DEBFULLNAME -Name-Email: DEBEMAIL -Expire-Date: 0 -%no-ask-passphrase -%no-protection diff --git a/layers/kiwi/scripts/gpg/gen_sign_key b/layers/kiwi/scripts/gpg/gen_sign_key deleted file mode 100755 index 9626f94..0000000 --- a/layers/kiwi/scripts/gpg/gen_sign_key +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -# Ensure env is up-to-date -source /workspace/identity/env -GNUPGHOME="/workspace/gpg-keys/.gnupg" -export GNUPGHOME - -# prepare folder if not exists -mkdir -p $GNUPGHOME -chmod -R 700 $GNUPGHOME - -# generate gnupg script -mkdir -p /workspace/gpg-keys -cp /build/bin/gen_key_script /workspace/gpg-keys/ -sed -i "s/DEBFULLNAME/${DEBFULLNAME}/g" /workspace/gpg-keys/gen_key_script -sed -i "s/DEBEMAIL/${DEBEMAIL}/g" /workspace/gpg-keys/gen_key_script - -# test if key already exists -gpg --list-secret-keys $DEBEMAIL -# get appliance name -if [ $? -ne 0 ]; then - gpg --batch --gen-key /workspace/gpg-keys/gen_key_script -fi - -gpg --list-keys -gpg --list-secret-keys - -sudo chown -R ebcl:ebcl $GNUPGHOME -sudo chmod -R 700 $GNUPGHOME diff --git a/layers/kiwi/scripts/kiwi/check_image_build b/layers/kiwi/scripts/kiwi/check_image_build deleted file mode 100755 index bbda4af..0000000 --- a/layers/kiwi/scripts/kiwi/check_image_build +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -if [ ! -d "/tmp/result_image" ]; then - echo "Build failed! No results folder found." - exit 1 -fi - -# copy result to ouput folder -sudo chown -R ebcl:ebcl /tmp/result_image -cp -R /tmp/result_image/* /build/results/images - -BUILD_RESULT=$(find /tmp/result_image/* -maxdepth 0 -type d | head -n 1) -if [ -z "$BUILD_RESULT" ]; then - echo "ERROR: No build result found!" - exit 1 -fi - -BUILD_RESULT=$(basename $BUILD_RESULT) -BUILD_LOG="/tmp/result_image/${BUILD_RESULT}/result.log" - -if [ -f $BUILD_LOG ]; then - cat $BUILD_LOG | grep "\[[ ]*ERROR[ ]*\]:" - if [ $? -eq 0 ]; then - echo "ERROR: Build failed, see result.log!" - exit 1 - else - echo "SUCCESS: Build was successful!" - exit 0 - fi -else - echo "ERROR: No build log found!" - exit 1 -fi - -rm -rf /tmp/result_image diff --git a/tests/kiwi.robot b/tests/kiwi.robot deleted file mode 100644 index 4898211..0000000 --- a/tests/kiwi.robot +++ /dev/null @@ -1,20 +0,0 @@ -*** Settings *** -Library lib/Setup.py -Library lib/Kiwi.py -Suite Setup Setup -Suite Teardown Teardown -Keyword Tags kiwi - -*** Test Cases *** - -SDK shall provide Kiwi-ng and Berrymill - [Tags] fast - Kiwi Is Available - Berrymill Is Available - -*** Keywords *** -Setup - Run Container - -Teardown - Stop Container diff --git a/tests/lib/Kiwi.py b/tests/lib/Kiwi.py deleted file mode 100644 index a671c69..0000000 --- a/tests/lib/Kiwi.py +++ /dev/null @@ -1,11 +0,0 @@ -from utils import run_command - -class Kiwi: - - def kiwi_is_available(self): - (lines, _stdout, _stderr) = run_command('source /build/venv/bin/activate; kiwi-ng -v') - assert lines[-2].startswith('KIWI ') - - def berrymill_is_available(self): - (_lines, stdout, _stderr) = run_command('source /build/venv/bin/activate; berrymill -h') - assert 'usage: berrymill' in stdout