From dbb7f7e91e89da0a2e12fb48c8cb82a8e152449d Mon Sep 17 00:00:00 2001 From: Jon Mason Date: Tue, 14 Apr 2026 14:23:20 -0400 Subject: [PATCH] kas: split into unique files and add testimage Refactor the existing kas configuration by splitting it into a shared base.yml and a set of per-machine include files. This allows for easier usage and potential CI use cases. Also, change the readme to reflect the new changes. Signed-off-by: Jon Mason --- README.md | 43 ++++++++++++++++++++++++-------- kas-poky-rpi.yml => kas/base.yml | 27 ++++++++++---------- kas/raspberrypi.yml | 8 ++++++ kas/raspberrypi0.yml | 8 ++++++ kas/raspberrypi2-64.yml | 8 ++++++ kas/raspberrypi2.yml | 8 ++++++ kas/raspberrypi3-64.yml | 14 +++++++++++ kas/raspberrypi3.yml | 14 +++++++++++ kas/raspberrypi4-64.yml | 14 +++++++++++ kas/raspberrypi4.yml | 14 +++++++++++ kas/testimage.yml | 28 +++++++++++++++++++++ 11 files changed, 163 insertions(+), 23 deletions(-) rename kas-poky-rpi.yml => kas/base.yml (81%) create mode 100644 kas/raspberrypi.yml create mode 100644 kas/raspberrypi0.yml create mode 100644 kas/raspberrypi2-64.yml create mode 100644 kas/raspberrypi2.yml create mode 100644 kas/raspberrypi3-64.yml create mode 100644 kas/raspberrypi3.yml create mode 100644 kas/raspberrypi4-64.yml create mode 100644 kas/raspberrypi4.yml create mode 100644 kas/testimage.yml diff --git a/README.md b/README.md index cc1c294..99f5aa6 100644 --- a/README.md +++ b/README.md @@ -76,14 +76,31 @@ This layer depends on: ## Quick Start with kas -1. Install kas build tool from PyPi (sudo pip3 install kas) -2. Set the `machine: ` in kas-poky-rpi.yml to one of the supported boards (see conf/machine/*.conf) -3. kas build meta-raspberrypi/kas-poky-rpi.yml -4. Use bmaptool to copy the generated .wic.bz2 file to the SD card -5. Boot your RPI +1. Install the kas build tool from PyPI: -To adjust the build configuration with specific options (I2C, SPI, ...), simply add -a section as follows: + ``` + pip3 install kas + ``` + +2. Select the appropriate machine configuration file from `kas/` + (for example `raspberrypi4.yml`, `raspberrypi3-64.yml`, etc.) + +3. Run the build: + + ``` + kas build meta-raspberrypi/kas/.yml + ``` + +4. Use `bmaptool` to copy the generated `.wic.bz2` image to the SD card + +5. Boot your Raspberry Pi + +The kas configuration is split into a shared `base.yml` and per-machine +configuration files. Machine selection is done by choosing the appropriate +kas file rather than editing a `machine` variable. + +To adjust the build configuration with specific options (I2C, SPI, etc.), +extend the configuration by adding a `local_conf_header` section, for example: ``` local_conf_header: @@ -92,10 +109,16 @@ local_conf_header: RPI_EXTRA_CONFIG = "dtoverlay=disable-bt" ``` -To configure the machine, you have to update the `machine` variable. -And the same for the `distro`. +Additional configurations can be layered by including extra kas files. For example, +to enable runtime testing with `testimage`: + +``` +kas build meta-raspberrypi/kas/raspberrypi4.yml:meta-raspberrypi/kas/testimage.yml +``` + +For further details, see the kas documentation: +https://kas.readthedocs.io/en/latest/index.html -For further information, you can read more at ## Contributing diff --git a/kas-poky-rpi.yml b/kas/base.yml similarity index 81% rename from kas-poky-rpi.yml rename to kas/base.yml index e3f9363..b3e8bee 100644 --- a/kas-poky-rpi.yml +++ b/kas/base.yml @@ -1,40 +1,41 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json +# header: - version: 8 + version: 14 -machine: raspberrypi4 +machine: unset distro: poky target: - core-image-base +defaults: + repos: + branch: master + repos: meta-raspberry: bitbake: url: https://git.openembedded.org/bitbake path: layers/bitbake - branch: master layers: bitbake: disabled openembedded-core: url: https://git.openembedded.org/openembedded-core path: layers/openembedded-core - branch: master layers: meta: meta-yocto: url: https://git.yoctoproject.org/meta-yocto path: layers/meta-yocto - branch: master layers: meta-poky: - meta-yocto-bsp: meta-openembedded: url: http://git.openembedded.org/meta-openembedded path: layers/meta-openembedded - branch: master layers: meta-oe: meta-python: @@ -44,16 +45,20 @@ repos: meta-qt5: url: https://github.com/meta-qt5/meta-qt5/ path: layers/meta-qt5 - branch: master + +env: + BB_LOGCONFIG: "" + BB_HASHSERVE: "auto" bblayers_conf_header: standard: | POKY_BBLAYERS_CONF_VERSION = "2" BBPATH = "${TOPDIR}" BBFILES ?= "" + local_conf_header: reduce_diskspace: | - INHERIT += "rm_work_and_downloads" + INHERIT += "rm_work" standard: | CONF_VERSION = "2" PACKAGE_CLASSES = "package_rpm" @@ -72,7 +77,3 @@ local_conf_header: HALT,${DL_DIR},100M,1K \ HALT,${SSTATE_DIR},100M,1K \ HALT,/tmp,10M,1K" - license: | - # Uncomment next line to allow the license - # See: linux-firmware-rpidistro in docs/ipcompliance.md - #LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch" diff --git a/kas/raspberrypi.yml b/kas/raspberrypi.yml new file mode 100644 index 0000000..32f65fd --- /dev/null +++ b/kas/raspberrypi.yml @@ -0,0 +1,8 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json + +header: + version: 14 + includes: + - kas/base.yml + +machine: raspberrypi diff --git a/kas/raspberrypi0.yml b/kas/raspberrypi0.yml new file mode 100644 index 0000000..bf83dfb --- /dev/null +++ b/kas/raspberrypi0.yml @@ -0,0 +1,8 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json + +header: + version: 14 + includes: + - kas/base.yml + +machine: raspberrypi0 diff --git a/kas/raspberrypi2-64.yml b/kas/raspberrypi2-64.yml new file mode 100644 index 0000000..05f9214 --- /dev/null +++ b/kas/raspberrypi2-64.yml @@ -0,0 +1,8 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json + +header: + version: 14 + includes: + - kas/base.yml + +machine: raspberrypi2-64 diff --git a/kas/raspberrypi2.yml b/kas/raspberrypi2.yml new file mode 100644 index 0000000..46d4043 --- /dev/null +++ b/kas/raspberrypi2.yml @@ -0,0 +1,8 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json + +header: + version: 14 + includes: + - kas/base.yml + +machine: raspberrypi2 diff --git a/kas/raspberrypi3-64.yml b/kas/raspberrypi3-64.yml new file mode 100644 index 0000000..79c45db --- /dev/null +++ b/kas/raspberrypi3-64.yml @@ -0,0 +1,14 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json + +header: + version: 14 + includes: + - kas/base.yml + +local_conf_header: + license: | + # Uncomment next line to allow the license + # See: linux-firmware-rpidistro in docs/ipcompliance.md + LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch" + +machine: raspberrypi3-64 diff --git a/kas/raspberrypi3.yml b/kas/raspberrypi3.yml new file mode 100644 index 0000000..7ddc7c3 --- /dev/null +++ b/kas/raspberrypi3.yml @@ -0,0 +1,14 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json + +header: + version: 14 + includes: + - kas/base.yml + +local_conf_header: + license: | + # Uncomment next line to allow the license + # See: linux-firmware-rpidistro in docs/ipcompliance.md + LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch" + +machine: raspberrypi3 diff --git a/kas/raspberrypi4-64.yml b/kas/raspberrypi4-64.yml new file mode 100644 index 0000000..b09437a --- /dev/null +++ b/kas/raspberrypi4-64.yml @@ -0,0 +1,14 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json + +header: + version: 14 + includes: + - kas/base.yml + +local_conf_header: + license: | + # Uncomment next line to allow the license + # See: linux-firmware-rpidistro in docs/ipcompliance.md + LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch" + +machine: raspberrypi4-64 diff --git a/kas/raspberrypi4.yml b/kas/raspberrypi4.yml new file mode 100644 index 0000000..cfed792 --- /dev/null +++ b/kas/raspberrypi4.yml @@ -0,0 +1,14 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json + +header: + version: 14 + includes: + - kas/base.yml + +local_conf_header: + license: | + # Uncomment next line to allow the license + # See: linux-firmware-rpidistro in docs/ipcompliance.md + LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch" + +machine: raspberrypi4 diff --git a/kas/testimage.yml b/kas/testimage.yml new file mode 100644 index 0000000..884476a --- /dev/null +++ b/kas/testimage.yml @@ -0,0 +1,28 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json + +header: + version: 14 + +local_conf_header: + testimage: | + IMAGE_CLASSES += "testimage" + TESTIMAGE_AUTO = "1" + # Don't testimage initramfs + TESTIMAGE_AUTO:pn-core-image-initramfs-boot = "0" + kvm: | + QEMU_USE_KVM = "" + slirp: | + TEST_RUNQEMUPARAMS = "slirp" + sshd: | + IMAGE_FEATURES += "ssh-server-dropbear" + sshkeys: | + CORE_IMAGE_EXTRA_INSTALL += "ssh-pregen-hostkeys" + sshpregen: | + # Allow the use of the pregen keys as this is CI so safe + COMPATIBLE_MACHINE:pn-ssh-pregen-hostkeys:raspberrypi = "raspberrypi" + COMPATIBLE_MACHINE:pn-ssh-pregen-hostkeys:raspberrypi0 = "raspberrypi0" + COMPATIBLE_MACHINE:pn-ssh-pregen-hostkeys:raspberrypi2 = "raspberrypi2" + COMPATIBLE_MACHINE:pn-ssh-pregen-hostkeys:raspberrypi3-64 = "raspberrypi3-64" + COMPATIBLE_MACHINE:pn-ssh-pregen-hostkeys:raspberrypi4-64 = "raspberrypi4-64" + failing_tests: | + TEST_SUITES:remove = "parselogs"