[PATCH 03/13] kas: Add dependencies between machine and distro configuration

86 views
Skip to first unread message

Uladzimir Bely

unread,
Sep 15, 2023, 2:44:30 AM9/15/23
to isar-...@googlegroups.com
Isar can't build any combination of supported machines and distros.
For the specific machine, only a limited set of distros can be built.

This patch adds required dependencies between these configruations
so that user could not select unsupported (untested) on from menu.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/distro/Kconfig | 28 ++++++++++++++++++++++++++
kas/machine/Kconfig | 49 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 77 insertions(+)

diff --git a/kas/distro/Kconfig b/kas/distro/Kconfig
index 0bb58c87..4453a3df 100644
--- a/kas/distro/Kconfig
+++ b/kas/distro/Kconfig
@@ -6,27 +6,55 @@ choice

config DEBIAN_BUSTER
bool "Debian Buster (10)"
+ depends on DEP_DEBIAN_BUSTER

config DEBIAN_BULLSEYE
bool "Debian Bullseye (11)"
+ depends on DEP_DEBIAN_BULLSEYE

config DEBIAN_BOOKWORM
bool "Debian Bookworm (12)"
+ depends on DEP_DEBIAN_BOOKWORM

config DEBIAN_SID_PORTS
bool "Debian Sid (unstable) with unofficial ports"
+ depends on DEP_DEBIAN_SID_PORTS

config RASPIOS_BULLSEYE
bool "Raspi OS Bullseye (11)"
+ depends on DEP_RASPIOS_BULLSEYE

config UBUNTU_FOCAL
bool "Ubuntu Focal (20.04)"
+ depends on DEP_UBUNTU_FOCAL

config UBUNTU_JAMMY
bool "Ubuntu Jammy (22.04)"
+ depends on DEP_UBUNTU_JAMMY

endchoice

+config DEP_DEBIAN_BUSTER
+ bool
+
+config DEP_DEBIAN_BULLSEYE
+ bool
+
+config DEP_DEBIAN_BOOKWORM
+ bool
+
+config DEP_DEBIAN_SID_PORTS
+ bool
+
+config DEP_RASPIOS_BULLSEYE
+ bool
+
+config DEP_UBUNTU_FOCAL
+ bool
+
+config DEP_UBUNTU_JAMMY
+ bool
+
config KAS_INCLUDE_DISTRO
string
default "kas/distro/debian-buster.yml" if DEBIAN_BUSTER
diff --git a/kas/machine/Kconfig b/kas/machine/Kconfig
index 7989a362..4a713c29 100644
--- a/kas/machine/Kconfig
+++ b/kas/machine/Kconfig
@@ -6,69 +6,118 @@ choice

config MACHINE_BANANAPI
bool "bananapi"
+ select DEP_DEBIAN_BUSTER
+ select DEP_DEBIAN_BULLSEYE
+ select DEP_DEBIAN_BOOKWORM

config MACHINE_CONTAINER_AMD64
bool "container-amd64"
+ select DEP_DEBIAN_BUSTER
+ select DEP_DEBIAN_BULLSEYE
+ select DEP_DEBIAN_BOOKWORM

config MACHINE_DE0_NANO_SOC
bool "de0-nano-soc"
+ select DEP_DEBIAN_BUSTER
+ select DEP_DEBIAN_BULLSEYE
+ select DEP_DEBIAN_BOOKWORM

config MACHINE_HIKEY
bool "hikey"
+ select DEP_DEBIAN_BULLSEYE
+ select DEP_DEBIAN_BOOKWORM

config MACHINE_IMX6_SABRELITE
bool "imx6-sabrelite"
+ select DEP_DEBIAN_BUSTER
+ select DEP_DEBIAN_BULLSEYE
+ select DEP_DEBIAN_BOOKWORM

config MACHINE_IMX6_NANOPI_NEO
bool "nanopi-neo"
+ select DEP_DEBIAN_BUSTER
+ select DEP_DEBIAN_BULLSEYE
+ select DEP_DEBIAN_BOOKWORM

config MACHINE_PHIBOARD_MIRA
bool "phyboard-mira"
+ select DEP_DEBIAN_BULLSEYE
+ select DEP_DEBIAN_BOOKWORM

config MACHINE_QEMU_AMD64_SB
bool "qemuamd64-sb"
+ select DEP_DEBIAN_BULLSEYE

config MACHINE_QEMU_AMD64
bool "qemuamd64"
+ select DEP_DEBIAN_BUSTER
+ select DEP_DEBIAN_BULLSEYE
+ select DEP_DEBIAN_BOOKWORM
+ select DEP_UBUNTU_FOCAL
+ select DEP_UBUNTU_JAMMY

config MACHINE_QEMU_ARM
bool "qemuarm"
+ select DEP_DEBIAN_BUSTER
+ select DEP_DEBIAN_BULLSEYE
+ select DEP_DEBIAN_BOOKWORM

config MACHINE_QEMU_ARM64
bool "qemuarm64"
+ select DEP_DEBIAN_BUSTER
+ select DEP_DEBIAN_BULLSEYE
+ select DEP_DEBIAN_BOOKWORM
+ select DEP_UBUNTU_FOCAL
+ select DEP_UBUNTU_JAMMY

config MACHINE_QEMU_I386
bool "qemui386"
+ select DEP_DEBIAN_BUSTER
+ select DEP_DEBIAN_BULLSEYE
+ select DEP_DEBIAN_BOOKWORM

config MACHINE_QEMU_MIPSEL
bool "qemumipsel"
+ select DEP_DEBIAN_BUSTER
+ select DEP_DEBIAN_BULLSEYE
+ select DEP_DEBIAN_BOOKWORM

config MACHINE_QEMU_RISCV64
bool "qemuriscv64"
+ select DEP_DEBIAN_SID_PORTS

config MACHINE_RPI_ARM_V7
bool "rpi-arm-v7"
+ select DEP_RASPIOS_BULLSEYE

config MACHINE_RPI_ARM_V7L
bool "rpi-arm-v7l"
+ select DEP_RASPIOS_BULLSEYE

config MACHINE_RPI_ARM
bool "rpi-arm"
+ select DEP_RASPIOS_BULLSEYE

config MACHINE_RPI_ARM64_V8
bool "rpi-arm64-v8"
+ select DEP_RASPIOS_BULLSEYE

config MACHINE_SIFIVE_FU540
bool "sifive-fu540"
+ select DEP_DEBIAN_SID_PORTS

config MACHINE_STARFIVE_VISIONFIVE2
bool "starfive-visionfive2"
+ select DEP_DEBIAN_SID_PORTS

config MACHINE_STM32MP15X
bool "stm32mp15x"
+ select DEP_DEBIAN_BULLSEYE
+ select DEP_DEBIAN_BOOKWORM

config MACHINE_VIRTUALBOX
bool "virtualbox"
+ select DEP_DEBIAN_BULLSEYE

config MACHINE_VMWARE
bool "vmware"
--
2.20.1

Uladzimir Bely

unread,
Sep 15, 2023, 2:44:30 AM9/15/23
to isar-...@googlegroups.com
This patchset adds YAML fragments and Kconfig files to support
configuring Isar using `kas-container menu` and building it
with 'kas-container script`.

This patchset can be treated as a reply to
`https://groups.google.com/g/isar-users/c/GgMvGOkXkcg` request.

Uladzimir Bely (13):
kas: Add initial Kconfig support
kas: Add a local copy of kas-container script
kas: Add dependencies between machine and distro configuration
kas: Add mirror selection
kas: Add packages selection
kas: Add COMPAT_ARCH support
kas: Add cross compilation mode selection support
kas: Add ccache option
kas: Add image type selection
kas: Add IMAGE_FSTYPES selection
kas: Support CACHE_DEB_SRC option in menu
kas: Add options to activate predefined users
kas: Add Readme.md

.gitignore | 1 +
Kconfig | 36 ++
kas/README.md | 36 ++
kas/distro/Kconfig | 68 ++++
kas/distro/debian-bookworm.yml | 4 +
kas/distro/debian-bullseye.yml | 4 +
kas/distro/debian-buster.yml | 4 +
kas/distro/debian-sid-ports.yml | 4 +
kas/distro/raspios-bullseye.yml | 4 +
kas/distro/ubuntu-focal.yml | 4 +
kas/distro/ubuntu-jammy.yml | 4 +
kas/isar-image-base.yml | 7 +
kas/isar-image-debug.yml | 7 +
kas/isar.yml | 15 +
kas/kas-container | 562 +++++++++++++++++++++++++++
kas/machine/Kconfig | 153 ++++++++
kas/machine/bananapi.yml | 4 +
kas/machine/container-amd64.yml | 4 +
kas/machine/de0-nano-soc.yml | 4 +
kas/machine/hikey.yml | 4 +
kas/machine/imx6-sabrelite.yml | 4 +
kas/machine/nanopi-neo.yml | 4 +
kas/machine/phyboard-mira.yml | 4 +
kas/machine/qemuamd64-sb.yml | 4 +
kas/machine/qemuamd64.yml | 4 +
kas/machine/qemuarm.yml | 4 +
kas/machine/qemuarm64.yml | 4 +
kas/machine/qemui386.yml | 4 +
kas/machine/qemumipsel.yml | 4 +
kas/machine/qemuriscv64.yml | 4 +
kas/machine/rpi-arm-v7.yml | 4 +
kas/machine/rpi-arm-v7l.yml | 4 +
kas/machine/rpi-arm.yml | 4 +
kas/machine/rpi-arm64-v8.yml | 4 +
kas/machine/sifive-fu540.yml | 4 +
kas/machine/starfive-visionfive2.yml | 4 +
kas/machine/stm32mp15x.yml | 4 +
kas/machine/virtualbox.yml | 4 +
kas/machine/vmware.yml | 4 +
kas/opt/Kconfig | 181 +++++++++
kas/opt/cache-deb-src.yml | 6 +
kas/opt/ccache.yml | 6 +
kas/opt/compat-arch.yml | 7 +
kas/opt/crosscompile.yml | 6 +
kas/opt/image-fstypes.yml | 6 +
kas/opt/mirror-debian.yml | 7 +
kas/opt/mirror-ubuntu.yml | 7 +
kas/opt/packages-distro.yml | 6 +
kas/opt/packages-isar.yml | 6 +
kas/opt/user-isar.yml | 16 +
kas/opt/user-root.yml | 7 +
51 files changed, 1266 insertions(+)
create mode 100644 Kconfig
create mode 100644 kas/README.md
create mode 100644 kas/distro/Kconfig
create mode 100644 kas/distro/debian-bookworm.yml
create mode 100644 kas/distro/debian-bullseye.yml
create mode 100644 kas/distro/debian-buster.yml
create mode 100644 kas/distro/debian-sid-ports.yml
create mode 100644 kas/distro/raspios-bullseye.yml
create mode 100644 kas/distro/ubuntu-focal.yml
create mode 100644 kas/distro/ubuntu-jammy.yml
create mode 100644 kas/isar-image-base.yml
create mode 100644 kas/isar-image-debug.yml
create mode 100644 kas/isar.yml
create mode 100755 kas/kas-container
create mode 100644 kas/machine/Kconfig
create mode 100644 kas/machine/bananapi.yml
create mode 100644 kas/machine/container-amd64.yml
create mode 100644 kas/machine/de0-nano-soc.yml
create mode 100644 kas/machine/hikey.yml
create mode 100644 kas/machine/imx6-sabrelite.yml
create mode 100644 kas/machine/nanopi-neo.yml
create mode 100644 kas/machine/phyboard-mira.yml
create mode 100644 kas/machine/qemuamd64-sb.yml
create mode 100644 kas/machine/qemuamd64.yml
create mode 100644 kas/machine/qemuarm.yml
create mode 100644 kas/machine/qemuarm64.yml
create mode 100644 kas/machine/qemui386.yml
create mode 100644 kas/machine/qemumipsel.yml
create mode 100644 kas/machine/qemuriscv64.yml
create mode 100644 kas/machine/rpi-arm-v7.yml
create mode 100644 kas/machine/rpi-arm-v7l.yml
create mode 100644 kas/machine/rpi-arm.yml
create mode 100644 kas/machine/rpi-arm64-v8.yml
create mode 100644 kas/machine/sifive-fu540.yml
create mode 100644 kas/machine/starfive-visionfive2.yml
create mode 100644 kas/machine/stm32mp15x.yml
create mode 100644 kas/machine/virtualbox.yml
create mode 100644 kas/machine/vmware.yml
create mode 100644 kas/opt/Kconfig
create mode 100644 kas/opt/cache-deb-src.yml
create mode 100644 kas/opt/ccache.yml
create mode 100644 kas/opt/compat-arch.yml
create mode 100644 kas/opt/crosscompile.yml
create mode 100644 kas/opt/image-fstypes.yml
create mode 100644 kas/opt/mirror-debian.yml
create mode 100644 kas/opt/mirror-ubuntu.yml
create mode 100644 kas/opt/packages-distro.yml
create mode 100644 kas/opt/packages-isar.yml
create mode 100644 kas/opt/user-isar.yml
create mode 100644 kas/opt/user-root.yml

--
2.20.1

Uladzimir Bely

unread,
Sep 15, 2023, 2:44:30 AM9/15/23
to isar-...@googlegroups.com
Taken from revision `044c7d0` (tag `4.0`) of `kas` project [1].

Basic usage:

```
./kas/kas-container menu
./kas/kas-container build
./kas/kas-container shell
```

[1] https://github.com/siemens/kas

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/kas-container | 562 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 562 insertions(+)
create mode 100755 kas/kas-container

diff --git a/kas/kas-container b/kas/kas-container
new file mode 100755
index 00000000..8fa2d16e
--- /dev/null
+++ b/kas/kas-container
@@ -0,0 +1,562 @@
+#!/bin/sh
+#
+# kas - setup tool for bitbake based projects
+#
+# Copyright (c) Siemens AG, 2018-2022
+#
+# Authors:
+# Jan Kiszka <jan.k...@siemens.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+set -e
+
+usage()
+{
+ printf "%b" "Usage: $0 [OPTIONS] { build | shell } [KASOPTIONS] [KASFILE]\n"
+ printf "%b" " $0 [OPTIONS] { checkout | dump } [KASOPTIONS] [KASFILE]\n"
+ printf "%b" " $0 [OPTIONS] for-all-repos [KASOPTIONS] [KASFILE] COMMAND\n"
+ printf "%b" " $0 [OPTIONS] { clean | cleansstate | cleanall}\n"
+ printf "%b" " $0 [OPTIONS] menu [KCONFIG]\n"
+ printf "%b" "\nPositional arguments:\n"
+ printf "%b" "build\t\t\tCheck out repositories and build target.\n"
+ printf "%b" "checkout\t\tCheck out repositories but do not build.\n"
+ printf "%b" "dump\t\t\tCheck out repositories and write flat version\n"
+ printf "%b" " \t\t\tof config to stdout.\n"
+ printf "%b" "shell\t\t\tRun a shell in the build environment.\n"
+ printf "%b" "for-all-repos\t\tRun specified command in each repository.\n"
+ printf "%b" "clean\t\t\tClean build artifacts, keep sstate cache and " \
+ "downloads.\n"
+ printf "%b" "cleansstate\t\tClean build artifacts and sstate cache, " \
+ "keep downloads.\n"
+ printf "%b" "cleanall\t\tClean build artifacts, sstate cache and " \
+ "downloads.\n"
+ printf "%b" "menu\t\t\tProvide configuration menu and trigger " \
+ "configured build.\n"
+ printf "%b" "\nOptional arguments:\n"
+ printf "%b" "--isar\t\t\tUse kas-isar container to build Isar image.\n"
+ printf "%b" "--with-loop-dev Pass a loop device to the " \
+ "container. Only required if\n"
+ printf "%b" "\t\t\tloop-mounting is used by recipes.\n"
+ printf "%b" "--runtime-args\t\tAdditional arguments to pass to the " \
+ "container runtime\n"
+ printf "%b" "\t\t\tfor running the build.\n"
+ printf "%b" "-d\t\t\tPrint debug output (deprecated, use -l debug).\n"
+ printf "%b" "-l, --log-level\t\tSet log level (default=info).\n"
+ printf "%b" "-v\t\t\tSame as -d (deprecated).\n"
+ printf "%b" "--version\t\tprint program version.\n"
+ printf "%b" "--ssh-dir\t\tDirectory containing SSH configurations.\n"
+ printf "%b" "\t\t\tAvoid \$HOME/.ssh unless you fully trust the " \
+ "container.\n"
+ printf "%b" "--ssh-agent\t\tForward ssh-agent socket to the container.\n"
+ printf "%b" "--aws-dir\t\tDirectory containing AWScli configuration.\n"
+ printf "%b" "--git-credential-store\tFile path to the git credential " \
+ "store\n"
+ printf "%b" "--no-proxy-from-env\tDo not inherit proxy settings from " \
+ "environment.\n"
+ printf "%b" "--repo-ro\t\tMount current repository read-only\n" \
+ "\t\t\t(default for build command)\n"
+ printf "%b" "--repo-rw\t\tMount current repository writeable\n" \
+ "\t\t\t(default for shell command)\n"
+ printf "%b" "\n"
+ printf "%b" "You can force the use of podman over docker using " \
+ "KAS_CONTAINER_ENGINE=podman.\n"
+ exit 1
+}
+
+trace()
+{
+ [ -n "${KAS_VERBOSE}" ] && echo "+ $*" >&2
+ "$@"
+}
+
+enable_isar_mode() {
+ if [ -n "${ISAR_MODE}" ]; then
+ return
+ fi
+ ISAR_MODE=1
+
+ KAS_CONTAINER_IMAGE_NAME_DEFAULT="kas-isar"
+ KAS_ISAR_ARGS="--privileged"
+
+ if [ "${KAS_CONTAINER_ENGINE}" = "podman" ]; then
+ # sudo is needed for a privileged podman container
+ KAS_CONTAINER_COMMAND="sudo --preserve-env ${KAS_CONTAINER_COMMAND}"
+ # preserved user PATH may lack sbin needed by privileged podman
+ export PATH="${PATH}:/usr/sbin"
+ fi
+}
+
+enable_oe_mode() {
+ if [ "${KAS_CONTAINER_ENGINE}" = "podman" ]; then
+ # The container entry point expects that the current userid
+ # calling "podman run" has a 1:1 mapping
+ KAS_RUNTIME_ARGS="${KAS_RUNTIME_ARGS} --userns=keep-id"
+ fi
+}
+
+run_clean() {
+ if [ -n "${KAS_ISAR_ARGS}" ]; then
+ set_container_image_var
+ # SC2086: Double quote to prevent globbing and word splitting.
+ # shellcheck disable=2086
+ trace ${KAS_CONTAINER_COMMAND} run -v "${KAS_BUILD_DIR}":/build:rw \
+ --workdir=/build --rm ${KAS_ISAR_ARGS} \
+ ${KAS_CONTAINER_IMAGE} \
+ sudo rm -rf tmp
+ else
+ trace rm -rf "${KAS_BUILD_DIR}"/tmp*
+ fi
+
+ if [ "$1" != "clean" ]; then
+ SSTATE_DIR=${SSTATE_DIR:-${KAS_BUILD_DIR}/sstate-cache}
+ trace rm -rf "${SSTATE_DIR}"
+
+ if [ "$1" = "cleanall" ]; then
+ DL_DIR=${DL_DIR:-${KAS_BUILD_DIR}/downloads}
+ trace rm -rf "${DL_DIR}"
+ fi
+ fi
+}
+
+KAS_IMAGE_VERSION_DEFAULT="4.0"
+KAS_CONTAINER_IMAGE_PATH_DEFAULT="ghcr.io/siemens/kas"
+KAS_CONTAINER_IMAGE_NAME_DEFAULT="kas"
+
+set_container_image_var() {
+ KAS_IMAGE_VERSION="${KAS_IMAGE_VERSION:-${KAS_IMAGE_VERSION_DEFAULT}}"
+ KAS_CONTAINER_IMAGE_NAME="${KAS_CONTAINER_IMAGE_NAME:-${KAS_CONTAINER_IMAGE_NAME_DEFAULT}}"
+ KAS_CONTAINER_IMAGE_PATH="${KAS_CONTAINER_IMAGE_PATH:-${KAS_CONTAINER_IMAGE_PATH_DEFAULT}}"
+ KAS_CONTAINER_IMAGE_DEFAULT="${KAS_CONTAINER_IMAGE_PATH}/${KAS_CONTAINER_IMAGE_NAME}:${KAS_IMAGE_VERSION}"
+ KAS_CONTAINER_IMAGE="${KAS_CONTAINER_IMAGE:-${KAS_CONTAINER_IMAGE_DEFAULT}}"
+}
+
+KAS_WORK_DIR=$(readlink -fv "${KAS_WORK_DIR:-$(pwd)}")
+# KAS_WORK_DIR needs to exist for the subsequent code
+trace mkdir -p "${KAS_WORK_DIR}"
+KAS_BUILD_DIR=$(readlink -fv "${KAS_BUILD_DIR:-${KAS_WORK_DIR}/build}")
+trace mkdir -p "${KAS_BUILD_DIR}"
+
+KAS_CONTAINER_ENGINE="${KAS_CONTAINER_ENGINE:-${KAS_DOCKER_ENGINE}}"
+if [ -z "${KAS_CONTAINER_ENGINE}" ]; then
+ # Try to auto-detect a container engine
+ if command -v docker >/dev/null; then
+ case $(docker -v 2>/dev/null) in
+ podman*)
+ # The docker command is an alias for podman
+ KAS_CONTAINER_ENGINE=podman
+ ;;
+ Docker*)
+ # The docker command is the real docker
+ KAS_CONTAINER_ENGINE=docker
+ ;;
+ *)
+ # The docker command is an unknown engine
+ echo "$0: docker command found, but unknown engine detected" >&2
+ exit 1
+ esac
+ elif command -v podman >/dev/null; then
+ KAS_CONTAINER_ENGINE=podman
+ else
+ echo "$0: no container engine found, need docker or podman" >&2
+ exit 1
+ fi
+fi
+
+KAS_RUNTIME_ARGS="--log-driver=none --user=root"
+
+case "${KAS_CONTAINER_ENGINE}" in
+docker)
+ KAS_CONTAINER_COMMAND="docker"
+ ;;
+podman)
+ KAS_CONTAINER_COMMAND="podman"
+ KAS_RUNTIME_ARGS="${KAS_RUNTIME_ARGS} --security-opt label=disable"
+ ;;
+*)
+ echo "$0: unknown container engine '${KAS_CONTAINER_ENGINE}'" >&2
+ exit 1
+ ;;
+esac
+
+# parse kas-container options
+while [ $# -gt 0 ]; do
+ case "$1" in
+ --isar)
+ enable_isar_mode
+ shift 1
+ ;;
+ --with-loop-dev)
+ if ! KAS_LOOP_DEV=$(/sbin/losetup -f 2>/dev/null); then
+ if [ "$(id -u)" -eq 0 ]; then
+ echo "Error: loop device not available!"
+ exit 1
+ fi
+ sudo_command="/sbin/losetup -f"
+ sudo_message="[sudo] enter password to setup loop"
+ sudo_message="$sudo_message devices by calling"
+ sudo_message="$sudo_message '$sudo_command': "
+ # SC2086: Double quote to prevent globbing and word splitting.
+ # shellcheck disable=2086
+ if ! KAS_LOOP_DEV=$(sudo -p "$sudo_message" $sudo_command \
+ 2>/dev/null); then
+ echo "Error: loop device setup unsuccessful!"
+ echo "try calling '$sudo_command' with root" \
+ "permissions manually."
+ exit 1
+ fi
+ fi
+ KAS_WITH_LOOP_DEV="--device ${KAS_LOOP_DEV}"
+ shift 1
+ ;;
+ --runtime-args|--docker-args)
+ [ $# -gt 0 ] || usage
+ KAS_RUNTIME_ARGS="${KAS_RUNTIME_ARGS} $2"
+ shift 2
+ ;;
+ --ssh-dir)
+ [ $# -gt 2 ] || usage
+ KAS_SSH_DIR="$2"
+ shift 2
+ ;;
+ --ssh-agent)
+ KAS_SSH_AUTH_SOCK=$(readlink -fv "$SSH_AUTH_SOCK")
+ shift 1
+ ;;
+ --aws-dir)
+ [ $# -gt 2 ] || usage
+ KAS_AWS_DIR="$2"
+ shift 2
+ ;;
+ --git-credential-store)
+ [ $# -gt 2 ] || usage
+ KAS_GIT_CREDENTIAL_STORE="$2"
+ shift 2
+ ;;
+ --no-proxy-from-env)
+ KAS_NO_PROXY_FROM_ENV=1
+ shift 1
+ ;;
+ --repo-ro)
+ KAS_REPO_MOUNT_OPT="ro"
+ shift 1
+ ;;
+ --repo-rw)
+ KAS_REPO_MOUNT_OPT="rw"
+ shift 1
+ ;;
+ -v | -d)
+ KAS_VERBOSE=1
+ KAS_OPTIONS_DIRECT="${KAS_OPTIONS_DIRECT} -d"
+ shift 1
+ ;;
+ -l | --log-level)
+ if [ "$2" = "debug" ]; then
+ KAS_VERBOSE=1
+ fi
+ KAS_OPTIONS_DIRECT="${KAS_OPTIONS_DIRECT} -l $2"
+ shift 2
+ ;;
+ --version)
+ echo "$(basename "$0") $KAS_IMAGE_VERSION_DEFAULT"
+ exit 0
+ ;;
+ --*)
+ usage
+ ;;
+ clean|cleansstate|cleanall)
+ [ $# -eq 1 ] || usage
+ run_clean "$1"
+ exit 0
+ ;;
+ shell)
+ KAS_REPO_MOUNT_OPT_DEFAULT="rw"
+ KAS_CMD=$1
+ shift 1
+ break
+ ;;
+ build|checkout|for-all-repos|menu)
+ KAS_REPO_MOUNT_OPT_DEFAULT="ro"
+ KAS_CMD=$1
+ shift 1
+ break
+ ;;
+ dump)
+ if printf '%s\0' "$@" | grep -xqz -- '--inplace\|-i'; then
+ KAS_REPO_MOUNT_OPT_DEFAULT="rw"
+ else
+ KAS_REPO_MOUNT_OPT_DEFAULT="ro"
+ fi
+ KAS_CMD=$1
+ shift 1
+ break
+ ;;
+ *)
+ usage
+ ;;
+ esac
+done
+
+[ -n "${KAS_CMD}" ] || usage
+
+KAS_EXTRA_BITBAKE_ARGS=0
+
+# parse kas sub-command options
+while [ $# -gt 0 ] && [ $KAS_EXTRA_BITBAKE_ARGS -eq 0 ]; do
+ case "$1" in
+ --skip|--target|--task)
+ KAS_OPTIONS="${KAS_OPTIONS} $1 $2"
+ shift 2
+ ;;
+ -c|--cmd|--command)
+ KAS_BITBAKE_C_OPTION_ARGS="$2"
+ shift 2
+ ;;
+ -E|--preserve-env)
+ echo "$1 is not supported with kas-container"
+ exit 1
+ ;;
+ --)
+ KAS_EXTRA_BITBAKE_ARGS=$#
+ ;;
+ -*)
+ KAS_OPTIONS="${KAS_OPTIONS} $1"
+ shift 1
+ ;;
+ *)
+ KAS_FILES=
+ # SC2086: Double quote to prevent globbing and word splitting.
+ # shellcheck disable=2086
+ for FILE in $(IFS=':'; echo $1); do
+ if ! KAS_REAL_FILE="$(realpath -qe "$FILE")"; then
+ echo "Error: configuration file '${FILE}' not found"
+ exit 1
+ fi
+ if [ -z "${KAS_FILES}" ]; then
+ KAS_FIRST_FILE="${KAS_REAL_FILE}"
+ KAS_FILES="${KAS_REAL_FILE}"
+ else
+ KAS_FILES="${KAS_FILES}:${KAS_REAL_FILE}"
+ fi
+ done
+ shift 1
+ if [ "$KAS_CMD" = "for-all-repos" ]; then
+ KAS_REPO_CMD="$1"
+ shift 1
+ fi
+ ;;
+ esac
+done
+
+if [ -n "${KAS_FIRST_FILE}" ]; then
+ KAS_FILE_DIR="$(dirname "${KAS_FIRST_FILE}")"
+ KAS_REPO_DIR=$(git -C "${KAS_FILE_DIR}" rev-parse --show-toplevel 2>/dev/null) \
+ || KAS_REPO_DIR=$(hg --cwd "${KAS_FILE_DIR}" root 2>/dev/null) \
+ || KAS_REPO_DIR=${KAS_FILE_DIR}
+else
+ KAS_REPO_DIR=$(pwd)
+fi
+
+SOURCE_DIR_HOST=$(
+ grep -e "^_source_dir_host: " "${KAS_WORK_DIR}/.config.yaml" 2>/dev/null | \
+ sed 's/_source_dir_host:[ ]\+//')
+if [ -n "${SOURCE_DIR_HOST}" ]; then
+ KAS_REPO_DIR="${SOURCE_DIR_HOST}"
+fi
+
+if [ "${KAS_CMD}" = "menu" ]; then
+ if [ -z "${KAS_FIRST_FILE}" ]; then
+ KAS_FIRST_FILE="Kconfig"
+ fi
+
+ # When using the menu plugin, we need to track the KAS_REPO_DIR outside
+ # of the container to later allow a simple `kas-container build`. For
+ # that, we tell the kas menu plugin via an env-var about the location
+ # on the host. This data is then added to the .config.yaml where it can
+ # be evaluated by the next invocation of kas-container.
+
+ if ! [ "$(realpath -qe "${KAS_REPO_DIR}")" = "$(realpath -qe "${KAS_WORK_DIR}")" ]; then
+ set -- "$@" -e _KAS_REPO_DIR_HOST="$(readlink -fv "${KAS_REPO_DIR}")"
+ fi
+
+ BUILD_SYSTEM=$(tr '\n' '\f' 2>/dev/null < ${KAS_FIRST_FILE} | \
+ sed -e 's/\(.*\fconfig KAS_BUILD_SYSTEM\f\(.*\)\|.*\)/\2/' \
+ -e 's/\f\([[:alpha:]].*\|$\)//' \
+ -e 's/.*default \"\(.*\)\".*/\1/')
+else
+ if [ -z "${KAS_FIRST_FILE}" ]; then
+ KAS_FIRST_FILE="${KAS_WORK_DIR}/.config.yaml"
+ fi
+
+ BUILD_SYSTEM=$(grep -e "^build_system: " "${KAS_FIRST_FILE}" 2>/dev/null | \
+ sed 's/build_system:[ ]\+//')
+fi
+
+if [ "${BUILD_SYSTEM}" = "isar" ]; then
+ enable_isar_mode
+elif [ -z "${ISAR_MODE}" ]; then
+ enable_oe_mode
+fi
+
+set_container_image_var
+
+KAS_REPO_MOUNT_OPT="${KAS_REPO_MOUNT_OPT:-${KAS_REPO_MOUNT_OPT_DEFAULT}}"
+
+KAS_FILES="$(echo "${KAS_FILES}" | sed 's|'"${KAS_REPO_DIR}"'/|/repo/|g')"
+
+if [ "$(id -u)" -eq 0 ] && [ "${KAS_ALLOW_ROOT}" != "yes" ] ; then
+ echo "Error: Running as root - may break certain recipes."
+ echo "Better give a regular user docker access. Set" \
+ "KAS_ALLOW_ROOT=yes to override."
+ exit 1
+fi
+
+set -- "$@" -v "${KAS_REPO_DIR}":/repo:${KAS_REPO_MOUNT_OPT} \
+ -v "${KAS_WORK_DIR}":/work:rw -e KAS_WORK_DIR=/work \
+ -v "${KAS_BUILD_DIR}":/build:rw \
+ --workdir=/repo \
+ -e KAS_BUILD_DIR=/build \
+ -e USER_ID="$(id -u)" -e GROUP_ID="$(id -g)" --rm --init
+
+if [ -n "${KAS_SSH_DIR}" ] ; then
+ if [ ! -d "${KAS_SSH_DIR}" ]; then
+ echo "Passed KAS_SSH_DIR '${KAS_SSH_DIR}' is not a directory"
+ exit 1
+ fi
+ set -- "$@" -v "$(readlink -fv "${KAS_SSH_DIR}")":/var/kas/userdata/.ssh:ro
+fi
+
+if [ -n "${KAS_SSH_AUTH_SOCK}" ]; then
+ if [ ! -S "${KAS_SSH_AUTH_SOCK}" ]; then
+ echo "Passed SSH_AUTH_SOCK '${KAS_SSH_AUTH_SOCK}' is not a socket"
+ exit 1
+ fi
+ set -- "$@" -v "${KAS_SSH_AUTH_SOCK}":/ssh-agent/ssh-auth-sock \
+ -e SSH_AUTH_SOCK=/ssh-agent/ssh-auth-sock
+fi
+
+if [ -n "${KAS_AWS_DIR}" ] ; then
+ if [ ! -d "${KAS_AWS_DIR}" ]; then
+ echo "Passed KAS_AWS_DIR '${KAS_AWS_DIR}' is not a directory"
+ exit 1
+ fi
+ set -- "$@" -v "$(readlink -fv "${KAS_AWS_DIR}")":/var/kas/userdata/.aws:ro \
+ -e AWS_CONFIG_FILE="${AWS_CONFIG_FILE:-/var/kas/userdata/.aws/config}" \
+ -e AWS_SHARED_CREDENTIALS_FILE="${AWS_SHARED_CREDENTIALS_FILE:-/var/kas/userdata/.aws/credentials}"
+fi
+
+KAS_GIT_CREDENTIAL_HELPER_DEFAULT=""
+
+if [ -n "${KAS_GIT_CREDENTIAL_STORE}" ] ; then
+ if [ ! -f "${KAS_GIT_CREDENTIAL_STORE}" ]; then
+ echo "Passed KAS_GIT_CREDENTIAL_STORE '${KAS_GIT_CREDENTIAL_STORE}' is not a file"
+ exit 1
+ fi
+ KAS_GIT_CREDENTIAL_HELPER_DEFAULT="store --file=/var/kas/userdata/.git-credentials"
+ set -- "$@" -v "$(readlink -fv "${KAS_GIT_CREDENTIAL_STORE}")":/var/kas/userdata/.git-credentials:ro
+fi
+
+GIT_CREDENTIAL_HELPER="${GIT_CREDENTIAL_HELPER:-${KAS_GIT_CREDENTIAL_HELPER_DEFAULT}}"
+
+if [ -n "${GIT_CREDENTIAL_HELPER}" ] ; then
+ set -- "$@" -e GIT_CREDENTIAL_HELPER="${GIT_CREDENTIAL_HELPER}"
+fi
+
+if [ -f "${NETRC_FILE}" ]; then
+ set -- "$@" -v "$(readlink -fv "${NETRC_FILE}")":/var/kas/userdata/.netrc:ro \
+ -e NETRC_FILE="/var/kas/userdata/.netrc"
+fi
+
+if [ -t 1 ]; then
+ set -- "$@" -t -i
+fi
+
+if [ -n "${DL_DIR}" ]; then
+ trace mkdir -p "${DL_DIR}"
+ set -- "$@" \
+ -v "$(readlink -fv "${DL_DIR}")":/downloads:rw \
+ -e DL_DIR=/downloads
+fi
+
+if [ -n "${SSTATE_DIR}" ]; then
+ trace mkdir -p "${SSTATE_DIR}"
+ set -- "$@" \
+ -v "$(readlink -fv "${SSTATE_DIR}")":/sstate:rw \
+ -e SSTATE_DIR=/sstate
+fi
+
+if [ -n "${KAS_REPO_REF_DIR}" ]; then
+ if [ ! -d "${KAS_REPO_REF_DIR}" ]; then
+ echo "Passed KAS_REPO_REF_DIR '${KAS_REPO_REF_DIR}' is not a directory"
+ exit 1
+ fi
+ set -- "$@" \
+ -v "$(readlink -fv "${KAS_REPO_REF_DIR}")":/repo-ref:rw \
+ -e KAS_REPO_REF_DIR=/repo-ref
+fi
+
+for var in TERM KAS_DISTRO KAS_MACHINE KAS_TARGET KAS_TASK \
+ KAS_PREMIRRORS DISTRO_APT_PREMIRRORS BB_NUMBER_THREADS PARALLEL_MAKE \
+ GIT_CREDENTIAL_USEHTTPPATH; do
+ if [ -n "$(eval echo \$${var})" ]; then
+ set -- "$@" -e "${var}=$(eval echo \"\$${var}\")"
+ fi
+done
+
+# propagate only supported SHELL settings
+case "$SHELL" in
+/bin/sh|/bin/bash|/bin/dash)
+ set -- "$@" -e "SHELL=$SHELL"
+ ;;
+*)
+ set -- "$@" -e "SHELL=/bin/bash"
+ ;;
+esac
+
+if [ -z "${KAS_NO_PROXY_FROM_ENV+x}" ]; then
+ for var in http_proxy https_proxy ftp_proxy no_proxy NO_PROXY; do
+ if [ -n "$(eval echo \$${var})" ]; then
+ set -- "$@" -e "${var}=$(eval echo \$${var})"
+ fi
+ done
+fi
+
+# SC2086: Double quote to prevent globbing and word splitting.
+# shellcheck disable=2086
+set -- "$@" ${KAS_ISAR_ARGS} ${KAS_WITH_LOOP_DEV} ${KAS_RUNTIME_ARGS} \
+ ${KAS_CONTAINER_IMAGE} ${KAS_OPTIONS_DIRECT} ${KAS_CMD} ${KAS_OPTIONS}
+if [ -n "${KAS_BITBAKE_C_OPTION_ARGS}" ]; then
+ set -- "$@" -c "${KAS_BITBAKE_C_OPTION_ARGS}"
+fi
+# SC2086: Double quote to prevent globbing and word splitting.
+# shellcheck disable=2086
+set -- "$@" ${KAS_FILES}
+if [ "$KAS_CMD" = "for-all-repos" ]; then
+ set -- "$@" "${KAS_REPO_CMD}"
+fi
+
+# rotate any extra bitbake args from the front to the end of the argument list
+while [ $KAS_EXTRA_BITBAKE_ARGS -gt 0 ]; do
+ arg="$1"
+ shift 1
+ set -- "$@" "$arg"
+ KAS_EXTRA_BITBAKE_ARGS=$((KAS_EXTRA_BITBAKE_ARGS - 1))
+done
+
+trace ${KAS_CONTAINER_COMMAND} run "$@"
--
2.20.1

Uladzimir Bely

unread,
Sep 15, 2023, 2:44:30 AM9/15/23
to isar-...@googlegroups.com
Create required Kconfig files and appropriate YAML configuration
fragments for supporting initial build configuragion via
`kas-container menu`.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
.gitignore | 1 +
Kconfig | 12 ++++
kas/distro/Kconfig | 40 +++++++++++
kas/distro/debian-bookworm.yml | 4 ++
kas/distro/debian-bullseye.yml | 4 ++
kas/distro/debian-buster.yml | 4 ++
kas/distro/debian-sid-ports.yml | 4 ++
kas/distro/raspios-bullseye.yml | 4 ++
kas/distro/ubuntu-focal.yml | 4 ++
kas/distro/ubuntu-jammy.yml | 4 ++
kas/isar.yml | 18 +++++
kas/machine/Kconfig | 104 +++++++++++++++++++++++++++
kas/machine/bananapi.yml | 4 ++
kas/machine/container-amd64.yml | 4 ++
kas/machine/de0-nano-soc.yml | 4 ++
kas/machine/hikey.yml | 4 ++
kas/machine/imx6-sabrelite.yml | 4 ++
kas/machine/nanopi-neo.yml | 4 ++
kas/machine/phyboard-mira.yml | 4 ++
kas/machine/qemuamd64-sb.yml | 4 ++
kas/machine/qemuamd64.yml | 4 ++
kas/machine/qemuarm.yml | 4 ++
kas/machine/qemuarm64.yml | 4 ++
kas/machine/qemui386.yml | 4 ++
kas/machine/qemumipsel.yml | 4 ++
kas/machine/qemuriscv64.yml | 4 ++
kas/machine/rpi-arm-v7.yml | 4 ++
kas/machine/rpi-arm-v7l.yml | 4 ++
kas/machine/rpi-arm.yml | 4 ++
kas/machine/rpi-arm64-v8.yml | 4 ++
kas/machine/sifive-fu540.yml | 4 ++
kas/machine/starfive-visionfive2.yml | 4 ++
kas/machine/stm32mp15x.yml | 4 ++
kas/machine/virtualbox.yml | 4 ++
kas/machine/vmware.yml | 4 ++
35 files changed, 295 insertions(+)
create mode 100644 Kconfig
create mode 100644 kas/distro/Kconfig
create mode 100644 kas/distro/debian-bookworm.yml
create mode 100644 kas/distro/debian-bullseye.yml
create mode 100644 kas/distro/debian-buster.yml
create mode 100644 kas/distro/debian-sid-ports.yml
create mode 100644 kas/distro/raspios-bullseye.yml
create mode 100644 kas/distro/ubuntu-focal.yml
create mode 100644 kas/distro/ubuntu-jammy.yml
create mode 100644 kas/isar.yml
create mode 100644 kas/machine/Kconfig
create mode 100644 kas/machine/bananapi.yml
create mode 100644 kas/machine/container-amd64.yml
create mode 100644 kas/machine/de0-nano-soc.yml
create mode 100644 kas/machine/hikey.yml
create mode 100644 kas/machine/imx6-sabrelite.yml
create mode 100644 kas/machine/nanopi-neo.yml
create mode 100644 kas/machine/phyboard-mira.yml
create mode 100644 kas/machine/qemuamd64-sb.yml
create mode 100644 kas/machine/qemuamd64.yml
create mode 100644 kas/machine/qemuarm.yml
create mode 100644 kas/machine/qemuarm64.yml
create mode 100644 kas/machine/qemui386.yml
create mode 100644 kas/machine/qemumipsel.yml
create mode 100644 kas/machine/qemuriscv64.yml
create mode 100644 kas/machine/rpi-arm-v7.yml
create mode 100644 kas/machine/rpi-arm-v7l.yml
create mode 100644 kas/machine/rpi-arm.yml
create mode 100644 kas/machine/rpi-arm64-v8.yml
create mode 100644 kas/machine/sifive-fu540.yml
create mode 100644 kas/machine/starfive-visionfive2.yml
create mode 100644 kas/machine/stm32mp15x.yml
create mode 100644 kas/machine/virtualbox.yml
create mode 100644 kas/machine/vmware.yml

diff --git a/.gitignore b/.gitignore
index 2525d41e..c12658eb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
*~
/*.patch
__pycache__
+.config.yaml
diff --git a/Kconfig b/Kconfig
new file mode 100644
index 00000000..ac77fb81
--- /dev/null
+++ b/Kconfig
@@ -0,0 +1,12 @@
+mainmenu "Isar configuration"
+
+config KAS_INCLUDE_MAIN
+ string
+ default "kas/isar.yml"
+
+config KAS_BUILD_SYSTEM
+ string
+ default "isar"
+
+source "kas/machine/Kconfig"
+source "kas/distro/Kconfig"
diff --git a/kas/distro/Kconfig b/kas/distro/Kconfig
new file mode 100644
index 00000000..0bb58c87
--- /dev/null
+++ b/kas/distro/Kconfig
@@ -0,0 +1,40 @@
+menu "Distro selection"
+
+choice
+ prompt "Distro selection"
+ default DEBIAN_BOOKWORM
+
+config DEBIAN_BUSTER
+ bool "Debian Buster (10)"
+
+config DEBIAN_BULLSEYE
+ bool "Debian Bullseye (11)"
+
+config DEBIAN_BOOKWORM
+ bool "Debian Bookworm (12)"
+
+config DEBIAN_SID_PORTS
+ bool "Debian Sid (unstable) with unofficial ports"
+
+config RASPIOS_BULLSEYE
+ bool "Raspi OS Bullseye (11)"
+
+config UBUNTU_FOCAL
+ bool "Ubuntu Focal (20.04)"
+
+config UBUNTU_JAMMY
+ bool "Ubuntu Jammy (22.04)"
+
+endchoice
+
+config KAS_INCLUDE_DISTRO
+ string
+ default "kas/distro/debian-buster.yml" if DEBIAN_BUSTER
+ default "kas/distro/debian-bullseye.yml" if DEBIAN_BULLSEYE
+ default "kas/distro/debian-bookworm.yml" if DEBIAN_BOOKWORM
+ default "kas/distro/debian-sid-ports.yml" if DEBIAN_SID_PORTS
+ default "kas/distro/raspios-bullseye.yml" if RASPIOS_BULLSEYE
+ default "kas/distro/ubuntu-focal.yml" if UBUNTU_FOCAL
+ default "kas/distro/ubuntu-jammy.yml" if UBUNTU_JAMMY
+
+endmenu
diff --git a/kas/distro/debian-bookworm.yml b/kas/distro/debian-bookworm.yml
new file mode 100644
index 00000000..0f49e01a
--- /dev/null
+++ b/kas/distro/debian-bookworm.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+distro: debian-bookworm
diff --git a/kas/distro/debian-bullseye.yml b/kas/distro/debian-bullseye.yml
new file mode 100644
index 00000000..f2e13dc4
--- /dev/null
+++ b/kas/distro/debian-bullseye.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+distro: debian-bullseye
diff --git a/kas/distro/debian-buster.yml b/kas/distro/debian-buster.yml
new file mode 100644
index 00000000..35f6fd79
--- /dev/null
+++ b/kas/distro/debian-buster.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+distro: debian-buster
diff --git a/kas/distro/debian-sid-ports.yml b/kas/distro/debian-sid-ports.yml
new file mode 100644
index 00000000..fafc438d
--- /dev/null
+++ b/kas/distro/debian-sid-ports.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+distro: debian-sid-ports
diff --git a/kas/distro/raspios-bullseye.yml b/kas/distro/raspios-bullseye.yml
new file mode 100644
index 00000000..941fa8f4
--- /dev/null
+++ b/kas/distro/raspios-bullseye.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+distro: raspios-bullseye
diff --git a/kas/distro/ubuntu-focal.yml b/kas/distro/ubuntu-focal.yml
new file mode 100644
index 00000000..facfd7a1
--- /dev/null
+++ b/kas/distro/ubuntu-focal.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+distro: ubuntu-focal
diff --git a/kas/distro/ubuntu-jammy.yml b/kas/distro/ubuntu-jammy.yml
new file mode 100644
index 00000000..c82539a3
--- /dev/null
+++ b/kas/distro/ubuntu-jammy.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+distro: ubuntu-jammy
diff --git a/kas/isar.yml b/kas/isar.yml
new file mode 100644
index 00000000..500bf1d4
--- /dev/null
+++ b/kas/isar.yml
@@ -0,0 +1,18 @@
+header:
+ version: 14
+
+build_system: isar
+
+target:
+- isar-image-base
+
+repos:
+ isar:
+ layers:
+ meta:
+ meta-isar:
+
+bblayers_conf_header:
+ standard: |
+ BBPATH = "${TOPDIR}"
+ BBFILES ?= ""
diff --git a/kas/machine/Kconfig b/kas/machine/Kconfig
new file mode 100644
index 00000000..7989a362
--- /dev/null
+++ b/kas/machine/Kconfig
@@ -0,0 +1,104 @@
+menu "Machine selection"
+
+choice
+ prompt "Machine selection"
+ default MACHINE_QEMU_AMD64
+
+config MACHINE_BANANAPI
+ bool "bananapi"
+
+config MACHINE_CONTAINER_AMD64
+ bool "container-amd64"
+
+config MACHINE_DE0_NANO_SOC
+ bool "de0-nano-soc"
+
+config MACHINE_HIKEY
+ bool "hikey"
+
+config MACHINE_IMX6_SABRELITE
+ bool "imx6-sabrelite"
+
+config MACHINE_IMX6_NANOPI_NEO
+ bool "nanopi-neo"
+
+config MACHINE_PHIBOARD_MIRA
+ bool "phyboard-mira"
+
+config MACHINE_QEMU_AMD64_SB
+ bool "qemuamd64-sb"
+
+config MACHINE_QEMU_AMD64
+ bool "qemuamd64"
+
+config MACHINE_QEMU_ARM
+ bool "qemuarm"
+
+config MACHINE_QEMU_ARM64
+ bool "qemuarm64"
+
+config MACHINE_QEMU_I386
+ bool "qemui386"
+
+config MACHINE_QEMU_MIPSEL
+ bool "qemumipsel"
+
+config MACHINE_QEMU_RISCV64
+ bool "qemuriscv64"
+
+config MACHINE_RPI_ARM_V7
+ bool "rpi-arm-v7"
+
+config MACHINE_RPI_ARM_V7L
+ bool "rpi-arm-v7l"
+
+config MACHINE_RPI_ARM
+ bool "rpi-arm"
+
+config MACHINE_RPI_ARM64_V8
+ bool "rpi-arm64-v8"
+
+config MACHINE_SIFIVE_FU540
+ bool "sifive-fu540"
+
+config MACHINE_STARFIVE_VISIONFIVE2
+ bool "starfive-visionfive2"
+
+config MACHINE_STM32MP15X
+ bool "stm32mp15x"
+
+config MACHINE_VIRTUALBOX
+ bool "virtualbox"
+
+config MACHINE_VMWARE
+ bool "vmware"
+
+endchoice
+
+config KAS_INCLUDE_MACHINE
+ string
+ default "kas/machine/bananapi.yml" if MACHINE_BANANAPI
+ default "kas/machine/container-amd64.yml" if MACHINE_CONTAINER_AMD64
+ default "kas/machine/de0-nano-soc.yml" if MACHINE_DE0_NANO_SOC
+ default "kas/machine/hikey.yml" if MACHINE_HIKEY
+ default "kas/machine/imx6-sabrelite" if MACHINE_IMX6_SABRELITE
+ default "kas/machine/nanopi-neo" if MACHINE_IMX6_NANOPI_NEO
+ default "kas/machine/phyboard-mira" if MACHINE_PHIBOARD_MIRA
+ default "kas/machine/qemuamd64-sb.yml" if MACHINE_QEMU_AMD64_SB
+ default "kas/machine/qemuamd64.yml" if MACHINE_QEMU_AMD64
+ default "kas/machine/qemuarm.yml" if MACHINE_QEMU_ARM
+ default "kas/machine/qemuarm64.yml" if MACHINE_QEMU_ARM64
+ default "kas/machine/qemui386.yml" if MACHINE_QEMU_I386
+ default "kas/machine/qemumipsel.yml" if MACHINE_QEMU_MIPSEL
+ default "kas/machine/qemuriscv64.yml" if MACHINE_QEMU_RISCV64
+ default "kas/machine/rpi-arm-v7.yml" if MACHINE_RPI_ARM_V7
+ default "kas/machine/rpi-arm-v7l.yml" if MACHINE_RPI_ARM_V7L
+ default "kas/machine/rpi-arm.yml" if MACHINE_RPI_ARM
+ default "kas/machine/rpi-arm64-v8.yml" if MACHINE_RPI_ARM64_V8
+ default "kas/machine/sifive-fu540.yml" if MACHINE_SIFIVE_FU540
+ default "kas/machine/starfive-visionfive2.yml" if MACHINE_STARFIVE_VISIONFIVE2
+ default "kas/machine/stm32mp15x.yml" if MACHINE_STM32MP15X
+ default "kas/machine/virtualbox.yml" if MACHINE_VIRTUALBOX
+ default "kas/machine/vmware.yml" if MACHINE_VMWARE
+
+endmenu
diff --git a/kas/machine/bananapi.yml b/kas/machine/bananapi.yml
new file mode 100644
index 00000000..e11caa87
--- /dev/null
+++ b/kas/machine/bananapi.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: bananapi
diff --git a/kas/machine/container-amd64.yml b/kas/machine/container-amd64.yml
new file mode 100644
index 00000000..93e47891
--- /dev/null
+++ b/kas/machine/container-amd64.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: container-amd64
diff --git a/kas/machine/de0-nano-soc.yml b/kas/machine/de0-nano-soc.yml
new file mode 100644
index 00000000..7a1a6bf1
--- /dev/null
+++ b/kas/machine/de0-nano-soc.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: de0-nano-soc
diff --git a/kas/machine/hikey.yml b/kas/machine/hikey.yml
new file mode 100644
index 00000000..05c362f0
--- /dev/null
+++ b/kas/machine/hikey.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: hikey
diff --git a/kas/machine/imx6-sabrelite.yml b/kas/machine/imx6-sabrelite.yml
new file mode 100644
index 00000000..4ee7b027
--- /dev/null
+++ b/kas/machine/imx6-sabrelite.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: imx6-sabrelite
diff --git a/kas/machine/nanopi-neo.yml b/kas/machine/nanopi-neo.yml
new file mode 100644
index 00000000..53c3aae6
--- /dev/null
+++ b/kas/machine/nanopi-neo.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: nanopi-neo
diff --git a/kas/machine/phyboard-mira.yml b/kas/machine/phyboard-mira.yml
new file mode 100644
index 00000000..9601593d
--- /dev/null
+++ b/kas/machine/phyboard-mira.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: phyboard-mira
diff --git a/kas/machine/qemuamd64-sb.yml b/kas/machine/qemuamd64-sb.yml
new file mode 100644
index 00000000..41297fab
--- /dev/null
+++ b/kas/machine/qemuamd64-sb.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: qemuamd64-sb
diff --git a/kas/machine/qemuamd64.yml b/kas/machine/qemuamd64.yml
new file mode 100644
index 00000000..ff686de4
--- /dev/null
+++ b/kas/machine/qemuamd64.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: qemuamd64
diff --git a/kas/machine/qemuarm.yml b/kas/machine/qemuarm.yml
new file mode 100644
index 00000000..64674c01
--- /dev/null
+++ b/kas/machine/qemuarm.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: qemuarm
diff --git a/kas/machine/qemuarm64.yml b/kas/machine/qemuarm64.yml
new file mode 100644
index 00000000..03d7aba4
--- /dev/null
+++ b/kas/machine/qemuarm64.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: qemuarm64
diff --git a/kas/machine/qemui386.yml b/kas/machine/qemui386.yml
new file mode 100644
index 00000000..1b68a809
--- /dev/null
+++ b/kas/machine/qemui386.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: qemui386
diff --git a/kas/machine/qemumipsel.yml b/kas/machine/qemumipsel.yml
new file mode 100644
index 00000000..a90c9fd4
--- /dev/null
+++ b/kas/machine/qemumipsel.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: qemumipsel
diff --git a/kas/machine/qemuriscv64.yml b/kas/machine/qemuriscv64.yml
new file mode 100644
index 00000000..f6d9c478
--- /dev/null
+++ b/kas/machine/qemuriscv64.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: qemuriscv64
diff --git a/kas/machine/rpi-arm-v7.yml b/kas/machine/rpi-arm-v7.yml
new file mode 100644
index 00000000..4a1b7999
--- /dev/null
+++ b/kas/machine/rpi-arm-v7.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: rpi-arm-v7
diff --git a/kas/machine/rpi-arm-v7l.yml b/kas/machine/rpi-arm-v7l.yml
new file mode 100644
index 00000000..ffa5e7b4
--- /dev/null
+++ b/kas/machine/rpi-arm-v7l.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: rpi-arm-v7l
diff --git a/kas/machine/rpi-arm.yml b/kas/machine/rpi-arm.yml
new file mode 100644
index 00000000..eb942be2
--- /dev/null
+++ b/kas/machine/rpi-arm.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: rpi-arm
diff --git a/kas/machine/rpi-arm64-v8.yml b/kas/machine/rpi-arm64-v8.yml
new file mode 100644
index 00000000..c64afe38
--- /dev/null
+++ b/kas/machine/rpi-arm64-v8.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: rpi-arm64-v8
diff --git a/kas/machine/sifive-fu540.yml b/kas/machine/sifive-fu540.yml
new file mode 100644
index 00000000..009a02cf
--- /dev/null
+++ b/kas/machine/sifive-fu540.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: sifive-fu540
diff --git a/kas/machine/starfive-visionfive2.yml b/kas/machine/starfive-visionfive2.yml
new file mode 100644
index 00000000..75f36974
--- /dev/null
+++ b/kas/machine/starfive-visionfive2.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: starfive-visionfive2
diff --git a/kas/machine/stm32mp15x.yml b/kas/machine/stm32mp15x.yml
new file mode 100644
index 00000000..9af101af
--- /dev/null
+++ b/kas/machine/stm32mp15x.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: stm32mp15x
diff --git a/kas/machine/virtualbox.yml b/kas/machine/virtualbox.yml
new file mode 100644
index 00000000..d5768a62
--- /dev/null
+++ b/kas/machine/virtualbox.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: virtualbox
diff --git a/kas/machine/vmware.yml b/kas/machine/vmware.yml
new file mode 100644
index 00000000..cec23b3b
--- /dev/null
+++ b/kas/machine/vmware.yml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: vmware
--
2.20.1

Uladzimir Bely

unread,
Sep 15, 2023, 2:44:31 AM9/15/23
to isar-...@googlegroups.com
This part of configuration allows to choose which additional packages
(both from Isar and Debian) to include to the target image.

Isar packages are added to IMAGE_INSTALL since Debian packages go
to IMAGE_PREINSTALL.

The features are implemented as "string" parameter in the menu since
it reduces a number of required YAML fragments.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 41 +++++++++++++++++++++++++++++++++++++
kas/opt/packages-distro.yml | 6 ++++++
kas/opt/packages-isar.yml | 6 ++++++
3 files changed, 53 insertions(+)
create mode 100644 kas/opt/packages-distro.yml
create mode 100644 kas/opt/packages-isar.yml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index c6e60583..1aa319dc 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -32,3 +32,44 @@ config KAS_INCLUDE_MIRROR_UBUNTU
depends on MIRROR_UBUNTU

endmenu
+
+menu "Packages selection"
+
+config KAS_IMAGE_INSTALL
+ string "Isar packages"
+ default ""
+ help
+ Space-separated list of packages that are build by Isar, usually from
+ the sources. Isar provides build-in recipes for these packages.
+ The list includes (but not limited by) the following packages:
+ cowsay
+ enable-fsck
+ example-raw
+ example-module-${KERNEL_NAME}
+ example-prebuilt
+ expand-on-first-boot
+ hello
+ hello-isar
+ isar-exclude-docs
+ isar-disable-apt-cache
+ kselftest
+ samefile
+ sshd-regen-keys
+
+config KAS_INCLUDE_PACKAGES_ISAR
+ string
+ default "kas/opt/packages-isar.yml"
+
+config KAS_IMAGE_PREINSTALL
+ string "Distro packages"
+ default ""
+ help
+ Space-separated list of packages that are provided by the selected distro.
+ These packages are downloaded from distro mirrors and just unpacked
+ and configured by Isar.
+
+config KAS_INCLUDE_PACKAGES_DISTRO
+ string
+ default "kas/opt/packages-distro.yml"
+
+endmenu
diff --git a/kas/opt/packages-distro.yml b/kas/opt/packages-distro.yml
new file mode 100644
index 00000000..d2fca914
--- /dev/null
+++ b/kas/opt/packages-distro.yml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ packages-distro: |
+ IMAGE_PREINSTALL:append = " ${KAS_IMAGE_PREINSTALL}"
diff --git a/kas/opt/packages-isar.yml b/kas/opt/packages-isar.yml
new file mode 100644
index 00000000..c8da258d
--- /dev/null
+++ b/kas/opt/packages-isar.yml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ packages-isar: |
+ IMAGE_INSTALL:append = " ${KAS_IMAGE_INSTALL}"
--
2.20.1

Uladzimir Bely

unread,
Sep 15, 2023, 2:44:31 AM9/15/23
to isar-...@googlegroups.com
This allows to select better (faster) mirror for Debian and Ubuntu
distributions.

Isar DISTRO_APT_PREMIRRORS is used under the hood.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
Kconfig | 1 +
kas/opt/Kconfig | 34 ++++++++++++++++++++++++++++++++++
kas/opt/mirror-debian.yml | 7 +++++++
kas/opt/mirror-ubuntu.yml | 7 +++++++
4 files changed, 49 insertions(+)
create mode 100644 kas/opt/Kconfig
create mode 100644 kas/opt/mirror-debian.yml
create mode 100644 kas/opt/mirror-ubuntu.yml

diff --git a/Kconfig b/Kconfig
index ac77fb81..4c2e2339 100644
--- a/Kconfig
+++ b/Kconfig
@@ -10,3 +10,4 @@ config KAS_BUILD_SYSTEM

source "kas/machine/Kconfig"
source "kas/distro/Kconfig"
+source "kas/opt/Kconfig"
diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
new file mode 100644
index 00000000..c6e60583
--- /dev/null
+++ b/kas/opt/Kconfig
@@ -0,0 +1,34 @@
+menu "Mirror selection"
+
+config MIRROR_DEBIAN
+ bool "Use specific Debian mirror"
+ help
+ Select better local Debian mirror instead of deb.debian.org
+
+config MIRROR_DEBIAN_URL
+ string "URL of Debian mirror"
+ default "http://deb.debian.org"
+ depends on MIRROR_DEBIAN
+
+config KAS_INCLUDE_MIRROR_DEBIAN
+ string
+ default "kas/opt/mirror-debian.yml"
+ depends on MIRROR_DEBIAN
+
+
+config MIRROR_UBUNTU
+ bool "Use specific Ubuntu mirror"
+ help
+ Select better local Ubuntu mirror instead of archive.ubuntu.com
+
+config MIRROR_UBUNTU_URL
+ string "URL of Ubuntu mirror"
+ default "http://archive.ubuntu.com"
+ depends on MIRROR_UBUNTU
+
+config KAS_INCLUDE_MIRROR_UBUNTU
+ string
+ default "kas/opt/mirror-ubuntu.yml"
+ depends on MIRROR_UBUNTU
+
+endmenu
diff --git a/kas/opt/mirror-debian.yml b/kas/opt/mirror-debian.yml
new file mode 100644
index 00000000..ad708f2e
--- /dev/null
+++ b/kas/opt/mirror-debian.yml
@@ -0,0 +1,7 @@
+header:
+ version: 14
+
+local_conf_header:
+ mirror-debian: |
+ DISTRO_APT_PREMIRRORS += "\
+ http://deb\.debian\.org ${MIRROR_DEBIAN_URL}\n"
diff --git a/kas/opt/mirror-ubuntu.yml b/kas/opt/mirror-ubuntu.yml
new file mode 100644
index 00000000..beb73d59
--- /dev/null
+++ b/kas/opt/mirror-ubuntu.yml
@@ -0,0 +1,7 @@
+header:
+ version: 14
+
+local_conf_header:
+ mirror-ubuntu: |
+ DISTRO_APT_PREMIRRORS += "\
+ http://archive\.ubuntu\.com ${MIRROR_UBUNTU_URL}\n"
--
2.20.1

Uladzimir Bely

unread,
Sep 15, 2023, 2:44:32 AM9/15/23
to isar-...@googlegroups.com
This adds an option to the menu that allows to enable support
of cross-compilation via ISAR_CROSS_COMPILE variable.

The option is enabled by default.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 10 ++++++++++
kas/opt/crosscompile.yml | 6 ++++++
2 files changed, 16 insertions(+)
create mode 100644 kas/opt/crosscompile.yml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 10f05320..87e8287d 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -82,3 +82,13 @@ config KAS_INCLUDE_COMPAT_ARCH
string
default "kas/opt/compat-arch.yml"
depends on COMPAT_ARCH
+
+
+config ISAR_CROSS_COMPILE
+ bool "Enable cross compilation mode"
+ default y
+
+config KAS_INCLUDE_ISAR_CROSS_COMPILE
+ string
+ default "kas/opt/crosscompile.yml"
+ depends on ISAR_CROSS_COMPILE
diff --git a/kas/opt/crosscompile.yml b/kas/opt/crosscompile.yml
new file mode 100644
index 00000000..6fdf94d8
--- /dev/null
+++ b/kas/opt/crosscompile.yml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ crosscompile: |
+ ISAR_CROSS_COMPILE = "1"
--
2.20.1

Uladzimir Bely

unread,
Sep 15, 2023, 2:44:32 AM9/15/23
to isar-...@googlegroups.com
This adds an option to the menu that allows to enable or disable
ccache support for the build.

The option is enabled by default.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>

ccache
---
kas/opt/Kconfig | 10 ++++++++++
kas/opt/ccache.yml | 6 ++++++
2 files changed, 16 insertions(+)
create mode 100644 kas/opt/ccache.yml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 87e8287d..56b29824 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -92,3 +92,13 @@ config KAS_INCLUDE_ISAR_CROSS_COMPILE
string
default "kas/opt/crosscompile.yml"
depends on ISAR_CROSS_COMPILE
+
+
+config USE_CCACHE
+ bool "Use ccache during build"
+ default y
+
+config KAS_INCLUDE_USE_CCACHE
+ string
+ default "kas/opt/ccache.yml"
+ depends on USE_CCACHE
diff --git a/kas/opt/ccache.yml b/kas/opt/ccache.yml
new file mode 100644
index 00000000..7443dd8b
--- /dev/null
+++ b/kas/opt/ccache.yml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ ccache: |
+ USE_CCACHE = "1"
--
2.20.1

Uladzimir Bely

unread,
Sep 15, 2023, 2:44:32 AM9/15/23
to isar-...@googlegroups.com
This makes possible to adjust IMAGE_FSTYPES variable.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 24 ++++++++++++++++++++++++
kas/opt/image-fstypes.yml | 6 ++++++
2 files changed, 30 insertions(+)
create mode 100644 kas/opt/image-fstypes.yml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 56b29824..506434ba 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -75,6 +75,30 @@ config KAS_INCLUDE_PACKAGES_DISTRO
endmenu


+config KAS_IMAGE_FSTYPES
+ string "Additional image fstypes"
+ default ""
+ help
+ Space-separated list of additional image fstypes to generate. Default
+ machine configurations set up IMAGE_FSTYPES variable, but it's possible
+ to select additonal ones to generate.
+ The following IMAGE_FSTYPES are supported:
+ cpio
+ fit
+ docker-archive
+ ext4
+ ova
+ tar
+ ubi
+ ubifs
+ wic
+ They can be followed by suffixes like ".gz" for compressing the image
+
+config KAS_INCLUDE_IMAGE_FSTYPES
+ string
+ default "kas/opt/image-fstypes.yml"
+
+
config COMPAT_ARCH
bool "Enable compat arch support"

diff --git a/kas/opt/image-fstypes.yml b/kas/opt/image-fstypes.yml
new file mode 100644
index 00000000..b87f1abd
--- /dev/null
+++ b/kas/opt/image-fstypes.yml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ image-fstypes: |
+ IMAGE_FSTYPES:append = " ${KAS_IMAGE_FSTYPES}"
--
2.20.1

Uladzimir Bely

unread,
Sep 15, 2023, 2:44:32 AM9/15/23
to isar-...@googlegroups.com
This adds an option to the menu that can enable or disable
COMPAT_ARCH support for amd64 and arm64 architectures.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 9 +++++++++
kas/opt/compat-arch.yml | 7 +++++++
2 files changed, 16 insertions(+)
create mode 100644 kas/opt/compat-arch.yml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 1aa319dc..10f05320 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -73,3 +73,12 @@ config KAS_INCLUDE_PACKAGES_DISTRO
default "kas/opt/packages-distro.yml"

endmenu
+
+
+config COMPAT_ARCH
+ bool "Enable compat arch support"
+
+config KAS_INCLUDE_COMPAT_ARCH
+ string
+ default "kas/opt/compat-arch.yml"
+ depends on COMPAT_ARCH
diff --git a/kas/opt/compat-arch.yml b/kas/opt/compat-arch.yml
new file mode 100644
index 00000000..9dbb354a
--- /dev/null
+++ b/kas/opt/compat-arch.yml
@@ -0,0 +1,7 @@
+header:
+ version: 14
+
+local_conf_header:
+ compat-arch: |
+ ISAR_ENABLE_COMPAT_ARCH_amd64 = "1"
+ ISAR_ENABLE_COMPAT_ARCH_arm64 = "1"
--
2.20.1

Uladzimir Bely

unread,
Sep 15, 2023, 2:44:33 AM9/15/23
to isar-...@googlegroups.com
Add brief description of `kas-container` usage.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/README.md | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
create mode 100644 kas/README.md

diff --git a/kas/README.md b/kas/README.md
new file mode 100644
index 00000000..780b0220
--- /dev/null
+++ b/kas/README.md
@@ -0,0 +1,36 @@
+# Support of kas
+
+[kas](https://github.com/siemens/kas) is a tool to setup bitbake based projects.
+
+Directory `kas` contains required configuration fragments to setup and build
+Isar with `kas-container` script and Kconfig language.
+
+## Requirements
+
+Since kas uses Docker or Podman based containers, users that runs Isar build
+using `kas-container` script should be allowed to run these containers in
+privileged mode.
+
+## Configuring Isar build
+
+```
+./kas/kas-container menu
+```
+
+This creates `.config.yaml` file in isar root that stores the configuration.
+
+
+## Building Isar after configuration done
+
+```
+./kas/kas-container build
+```
+
+This generates `build/conf/` configuration and starts building Isar using
+kas container. Required image will be downloaded if not yet).
+
+To access bulid shell, the following command can be used:
+
+```
+./kas/kas-container shell
+```
--
2.20.1

Uladzimir Bely

unread,
Sep 15, 2023, 2:44:33 AM9/15/23
to isar-...@googlegroups.com
This allows to enable 'root' and 'isar' users and set their passwords.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 41 +++++++++++++++++++++++++++++++++++++++++
kas/opt/user-isar.yml | 16 ++++++++++++++++
kas/opt/user-root.yml | 7 +++++++
3 files changed, 64 insertions(+)
create mode 100644 kas/opt/user-isar.yml
create mode 100644 kas/opt/user-root.yml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 113a6c9a..7eb4840b 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -75,6 +75,47 @@ config KAS_INCLUDE_PACKAGES_DISTRO
endmenu


+menu "User management"
+
+config USER_ROOT
+ bool "Activate 'root' user"
+ help
+ Enables root user.
+
+config KAS_USER_ROOT_PASSWORD
+ string "Password for 'root' user"
+ default "$6$rounds=10000$RXeWrnFmkY$DtuS/OmsAS2cCEDo0BF5qQsizIrq6jPgXnwv3PHqREJeKd1sXdHX/ayQtuQWVDHe0KIO0/sVH8dvQm1KthF0d/"
+ depends on USER_ROOT
+ help
+ Set password for 'root' user. Default value 'root', encrypted by:
+ 'mkpasswd -m sha512crypt -R 10000'
+
+config KAS_INCLUDE_USER_ROOT
+ string
+ default "kas/opt/user-root.yml"
+ depends on USER_ROOT
+
+
+config USER_ISAR
+ bool "Activate 'isar' user"
+ default y
+ help
+ Enables `isar` user.
+
+config KAS_USER_ISAR_PASSWORD
+ string "Password for 'isar' user"
+ default "isar"
+ depends on USER_ISAR
+ help
+ Set password for 'isar' user.
+
+config KAS_INCLUDE_USER_ISAR
+ string
+ default "kas/opt/user-isar.yml"
+ depends on USER_ISAR
+
+endmenu
+
config KAS_IMAGE_FSTYPES
string "Additional image fstypes"
default ""
diff --git a/kas/opt/user-isar.yml b/kas/opt/user-isar.yml
new file mode 100644
index 00000000..f249e4e7
--- /dev/null
+++ b/kas/opt/user-isar.yml
@@ -0,0 +1,16 @@
+header:
+ version: 14
+
+local_conf_header:
+ user-isar: |
+ GROUPS += "isar"
+ GROUP_isar[flags] = "system"
+
+ USERS += "isar"
+ USER_isar[gid] = "isar"
+ USER_isar[home] = "/var/lib/isar"
+ USER_isar[comment] = "My isar user"
+ USER_isar[flags] = "system create-home"
+
+ USER_isar[password] = "${KAS_USER_ISAR_PASSWORD}"
+ USER_isar[flags] += "clear-text-password"
diff --git a/kas/opt/user-root.yml b/kas/opt/user-root.yml
new file mode 100644
index 00000000..9c301767
--- /dev/null
+++ b/kas/opt/user-root.yml
@@ -0,0 +1,7 @@
+header:
+ version: 14
+
+local_conf_header:
+ user-root: |
+ USERS += "root"
+ USER_root[password] ??= "${KAS_USER_ROOT_PASSWORD}"
--
2.20.1

Uladzimir Bely

unread,
Sep 15, 2023, 2:44:33 AM9/15/23
to isar-...@googlegroups.com
This allows to choose between base and debug Isar image.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
Kconfig | 25 ++++++++++++++++++++++++-
kas/isar-image-base.yml | 7 +++++++
kas/isar-image-debug.yml | 7 +++++++
kas/isar.yml | 3 ---
4 files changed, 38 insertions(+), 4 deletions(-)
create mode 100644 kas/isar-image-base.yml
create mode 100644 kas/isar-image-debug.yml

diff --git a/Kconfig b/Kconfig
index 4c2e2339..66c6c44a 100644
--- a/Kconfig
+++ b/Kconfig
@@ -1,8 +1,31 @@
mainmenu "Isar configuration"

+menu "Image type selection"
+
+choice
+ prompt "Image type selection"
+ default IMAGE_BASE
+
+config IMAGE_BASE
+ bool "Base image"
+ help
+ This is the basic Isar image with bare minimum of preinstalled packages.
+ It's technically close do the debootstrapped system with packages
+ required to boot up the system.
+
+config IMAGE_DEBUG
+ bool "Debug image"
+ help
+ This image includes some tools preinstalled useful for debug.
+
+endchoice
+
config KAS_INCLUDE_MAIN
string
- default "kas/isar.yml"
+ default "kas/isar-image-base.yml" if IMAGE_BASE
+ default "kas/isar-image-debug.yml" if IMAGE_DEBUG
+
+endmenu

config KAS_BUILD_SYSTEM
string
diff --git a/kas/isar-image-base.yml b/kas/isar-image-base.yml
new file mode 100644
index 00000000..bfe3860b
--- /dev/null
+++ b/kas/isar-image-base.yml
@@ -0,0 +1,7 @@
+header:
+ version: 14
+ includes:
+ - isar.yml
+
+target:
+- isar-image-base
diff --git a/kas/isar-image-debug.yml b/kas/isar-image-debug.yml
new file mode 100644
index 00000000..f8f6977a
--- /dev/null
+++ b/kas/isar-image-debug.yml
@@ -0,0 +1,7 @@
+header:
+ version: 14
+ includes:
+ - isar.yml
+
+target:
+- isar-image-debug
diff --git a/kas/isar.yml b/kas/isar.yml
index 500bf1d4..47cbc290 100644
--- a/kas/isar.yml
+++ b/kas/isar.yml
@@ -3,9 +3,6 @@ header:

build_system: isar

-target:
-- isar-image-base
-
repos:
isar:
layers:
--
2.20.1

Uladzimir Bely

unread,
Sep 15, 2023, 2:44:33 AM9/15/23
to isar-...@googlegroups.com
This allows user to select this option in the menu.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 12 ++++++++++++
kas/opt/cache-deb-src.yml | 6 ++++++
2 files changed, 18 insertions(+)
create mode 100644 kas/opt/cache-deb-src.yml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 506434ba..113a6c9a 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -126,3 +126,15 @@ config KAS_INCLUDE_USE_CCACHE
string
default "kas/opt/ccache.yml"
depends on USE_CCACHE
+
+
+config CACHE_DEB_SRC
+ bool "Cache all source packages"
+ help
+ This feature allows to download srcpackages for any binary package that
+ took part in the build (including ones downloaded from distro mirrors).
+
+config KAS_INCLUDE_CACHE_DEB_SRC
+ string
+ default "kas/opt/cache-deb-src.yml"
+ depends on CACHE_DEB_SRC
diff --git a/kas/opt/cache-deb-src.yml b/kas/opt/cache-deb-src.yml
new file mode 100644
index 00000000..2030c90e
--- /dev/null
+++ b/kas/opt/cache-deb-src.yml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ cache-deb-src: |
+ BASE_REPO_FEATURES:append = " cache-deb-src"
--
2.20.1

Jan Kiszka

unread,
Sep 16, 2023, 5:34:14 AM9/16/23
to Uladzimir Bely, isar-...@googlegroups.com
depends on DEBIAN_BOOKWORM || ...

> + help
> + Select better local Debian mirror instead of deb.debian.org
> +
> +config MIRROR_DEBIAN_URL
> + string "URL of Debian mirror"
> + default "http://deb.debian.org"
> + depends on MIRROR_DEBIAN
> +
> +config KAS_INCLUDE_MIRROR_DEBIAN
> + string
> + default "kas/opt/mirror-debian.yml"
> + depends on MIRROR_DEBIAN
> +
> +
> +config MIRROR_UBUNTU
> + bool "Use specific Ubuntu mirror"

depens on UBUNTU_FOCAL || ...
Jan

--
Siemens AG, Technology
Linux Expert Center

Jan Kiszka

unread,
Sep 16, 2023, 5:34:14 AM9/16/23
to Uladzimir Bely, isar-...@googlegroups.com
On 15.09.23 12:14, Uladzimir Bely wrote:
> Isar can't build any combination of supported machines and distros.
> For the specific machine, only a limited set of distros can be built.
>
> This patch adds required dependencies between these configruations
> so that user could not select unsupported (untested) on from menu.
>

Why not let the machine depend on those distros they support? Would save
your from adding those DEP_* configs.

Jan

Jan Kiszka

unread,
Sep 16, 2023, 5:37:51 AM9/16/23
to Uladzimir Bely, isar-...@googlegroups.com
On 15.09.23 12:14, Uladzimir Bely wrote:
The default we have in the local.conf.sample is different. Is this list
here much shorter on purpose? I'm not necessarily asking for the full
list, just reflecting on this.

> + help
> + Space-separated list of packages that are build by Isar, usually from
> + the sources. Isar provides build-in recipes for these packages.
> + The list includes (but not limited by) the following packages:
> + cowsay
> + enable-fsck
> + example-raw
> + example-module-${KERNEL_NAME}
> + example-prebuilt
> + expand-on-first-boot
> + hello
> + hello-isar
> + isar-exclude-docs
> + isar-disable-apt-cache
> + kselftest
> + samefile
> + sshd-regen-keys

A string is a bit unhandy, at least for the known internal packages.
OTOH, it may then need a kas yaml snippet for each package the user
could select.

> +
> +config KAS_INCLUDE_PACKAGES_ISAR
> + string
> + default "kas/opt/packages-isar.yml"
> +
> +config KAS_IMAGE_PREINSTALL
> + string "Distro packages"
> + default ""

A nice default would be adding networking packages.
Jan

Jan Kiszka

unread,
Sep 16, 2023, 5:40:05 AM9/16/23
to Uladzimir Bely, isar-...@googlegroups.com
On 15.09.23 12:14, Uladzimir Bely wrote:
Better ask for the cleartext password and set the required flag for root
as well.

Jan

Jan Kiszka

unread,
Sep 16, 2023, 5:41:05 AM9/16/23
to Uladzimir Bely, isar-...@googlegroups.com
On 15.09.23 12:14, Uladzimir Bely wrote:
Looks nice and helpful, specifically (but not only) for beginners! Just
had minor remarks.

Jan

Jan Kiszka

unread,
Sep 16, 2023, 5:58:03 AM9/16/23
to Uladzimir Bely, isar-...@googlegroups.com
On 15.09.23 12:14, Uladzimir Bely wrote:
- kas/isar.yml

You should have seen the warning...

> +
> +target:
> +- isar-image-base
> diff --git a/kas/isar-image-debug.yml b/kas/isar-image-debug.yml
> new file mode 100644
> index 00000000..f8f6977a
> --- /dev/null
> +++ b/kas/isar-image-debug.yml
> @@ -0,0 +1,7 @@
> +header:
> + version: 14
> + includes:
> + - isar.yml

Same here.

> +
> +target:
> +- isar-image-debug
> diff --git a/kas/isar.yml b/kas/isar.yml
> index 500bf1d4..47cbc290 100644
> --- a/kas/isar.yml
> +++ b/kas/isar.yml
> @@ -3,9 +3,6 @@ header:
>
> build_system: isar
>
> -target:
> -- isar-image-base
> -
> repos:
> isar:
> layers:

Jan Kiszka

unread,
Sep 16, 2023, 6:02:43 AM9/16/23
to Uladzimir Bely, isar-...@googlegroups.com
One general remark: Maybe we should name all yaml files .yaml at this
chance. This is the official recommendation, though many older
downstream layers still use .yml.

Jan Kiszka

unread,
Sep 16, 2023, 12:10:47 PM9/16/23
to Uladzimir Bely, isar-...@googlegroups.com
A reasonable default should include example-raw, because without it:

NOTE: Executing Tasks
WARNING: isar-image-base-1.0-r0 do_rootfs_postprocess: Your image is not configured completely according to systemd-firstboot.
WARNING: isar-image-base-1.0-r0 do_rootfs_postprocess: It prompted: "
> Please enter hostname for new system (empty to skip): "

Uladzimir Bely

unread,
Sep 19, 2023, 2:30:13 AM9/19/23
to Jan Kiszka, isar-...@googlegroups.com
On Sat, 2023-09-16 at 15:04 +0530, Jan Kiszka wrote:
> On 15.09.23 12:14, Uladzimir Bely wrote:
> > Isar can't build any combination of supported machines and distros.
> > For the specific machine, only a limited set of distros can be
> > built.
> >
> > This patch adds required dependencies between these configruations
> > so that user could not select unsupported (untested) on from menu.
> >
>
> Why not let the machine depend on those distros they support? Would
> save
> your from adding those DEP_* configs.
>
> Jan
>

My initial idea was just to allow user to select a target machine first
(for example, Raspberry) and only after that choose a supported distro.

Tried your proposal. It looks much cleaner and also works, but may
confuse the user a bit since they may not find required target until
"proper" distro selected.

Uladzimir Bely

unread,
Sep 19, 2023, 2:31:34 AM9/19/23
to Jan Kiszka, isar-...@googlegroups.com
On Sat, 2023-09-16 at 15:04 +0530, Jan Kiszka wrote:
Will add in v2.

> > +       help
> > +         Select better local Debian mirror instead of
> > deb.debian.org
> > +
> > +config MIRROR_DEBIAN_URL
> > +       string "URL of Debian mirror"
> > +       default "http://deb.debian.org"
> > +       depends on MIRROR_DEBIAN
> > +
> > +config KAS_INCLUDE_MIRROR_DEBIAN
> > +       string
> > +       default "kas/opt/mirror-debian.yml"
> > +       depends on MIRROR_DEBIAN
> > +
> > +
> > +config MIRROR_UBUNTU
> > +       bool "Use specific Ubuntu mirror"
>
> depens on UBUNTU_FOCAL || ...
>

Will add in v2.

Uladzimir Bely

unread,
Sep 19, 2023, 2:32:28 AM9/19/23
to Jan Kiszka, isar-...@googlegroups.com
Thanks, didn't notice it. Fixed in upcoming v2.

Jan Kiszka

unread,
Sep 19, 2023, 2:43:24 AM9/19/23
to Uladzimir Bely, isar-...@googlegroups.com
On 19.09.23 08:30, Uladzimir Bely wrote:
> On Sat, 2023-09-16 at 15:04 +0530, Jan Kiszka wrote:
>> On 15.09.23 12:14, Uladzimir Bely wrote:
>>> Isar can't build any combination of supported machines and distros.
>>> For the specific machine, only a limited set of distros can be
>>> built.
>>>
>>> This patch adds required dependencies between these configruations
>>> so that user could not select unsupported (untested) on from menu.
>>>
>>
>> Why not let the machine depend on those distros they support? Would
>> save
>> your from adding those DEP_* configs.
>>
>> Jan
>>
>
> My initial idea was just to allow user to select a target machine first
> (for example, Raspberry) and only after that choose a supported distro.
>
> Tried your proposal. It looks much cleaner and also works, but may
> confuse the user a bit since they may not find required target until
> "proper" distro selected.

An alternative could be letting the distros depend on SOME_MACHINE ||
OTHER_MACHINE, or on !SPECIFIC_MACHINE, whatever is shorter under
certain circumstances.

All approaches have the problem that if you are looking for something
that has a disabled dependency, may it be a machine or a distro ("How do
I get an Ubuntu image?"), you will not find it in the menu. We may need
to extend kas menu by some search and a visualization of the deps of the
items that are found, just like the kernel does.

Jan

Uladzimir Bely

unread,
Sep 19, 2023, 7:56:44 AM9/19/23
to isar-...@googlegroups.com
This patchset adds YAML fragments and Kconfig files to support
configuring Isar using `kas-container menu` and building it
with 'kas-container script`.

This patchset can be treated as a reply to
`https://groups.google.com/g/isar-users/c/GgMvGOkXkcg` request.

Changes since v1:
- Simplified deps between distros and machines, removed separate
patch that added redundand DEB_<distro> vars.
- Fixed dependencies in mirror selection block.
- Separate menu items for selecting Isar packages.
- Fix warnings related wrong path to isar.yml file.
- Cleartext password used for root now.
- Use `.yaml` file extensions instead of `.yml`.

Uladzimir Bely (12):
kas: Add initial Kconfig support
kas: Add a local copy of kas-container script
kas: Add mirror selection
kas: Add packages selection
kas: Add COMPAT_ARCH support
kas: Add cross compilation mode selection support
kas: Add ccache option
kas: Add image type selection
kas: Add IMAGE_FSTYPES selection
kas: Support CACHE_DEB_SRC option in menu
kas: Add options to activate predefined users
kas: Add kas/README.md

.gitignore | 1 +
Kconfig | 15 +
README.md | 3 +
kas/README.md | 36 ++
kas/distro/Kconfig | 40 ++
kas/distro/debian-bookworm.yaml | 4 +
kas/distro/debian-bullseye.yaml | 4 +
kas/distro/debian-buster.yaml | 4 +
kas/distro/debian-sid-ports.yaml | 4 +
kas/distro/raspios-bullseye.yaml | 4 +
kas/distro/ubuntu-focal.yaml | 4 +
kas/distro/ubuntu-jammy.yaml | 4 +
kas/image/Kconfig | 26 +
kas/image/isar-image-base.yaml | 5 +
kas/image/isar-image-debug.yaml | 5 +
kas/isar.yaml | 15 +
kas/kas-container | 562 ++++++++++++++++++++
kas/machine/Kconfig | 127 +++++
kas/machine/bananapi.yaml | 4 +
kas/machine/container-amd64.yaml | 4 +
kas/machine/de0-nano-soc.yaml | 4 +
kas/machine/hikey.yaml | 4 +
kas/machine/imx6-sabrelite.yaml | 4 +
kas/machine/nanopi-neo.yaml | 4 +
kas/machine/phyboard-mira.yaml | 4 +
kas/machine/qemuamd64-sb.yaml | 4 +
kas/machine/qemuamd64.yaml | 4 +
kas/machine/qemuarm.yaml | 4 +
kas/machine/qemuarm64.yaml | 4 +
kas/machine/qemui386.yaml | 4 +
kas/machine/qemumipsel.yaml | 4 +
kas/machine/qemuriscv64.yaml | 4 +
kas/machine/rpi-arm-v7.yaml | 4 +
kas/machine/rpi-arm-v7l.yaml | 4 +
kas/machine/rpi-arm.yaml | 4 +
kas/machine/rpi-arm64-v8.yaml | 4 +
kas/machine/sifive-fu540.yaml | 4 +
kas/machine/starfive-visionfive2.yaml | 4 +
kas/machine/stm32mp15x.yaml | 4 +
kas/machine/virtualbox.yaml | 4 +
kas/machine/vmware.yaml | 4 +
kas/opt/Kconfig | 141 +++++
kas/opt/cache-deb-src.yaml | 6 +
kas/opt/ccache.yaml | 6 +
kas/opt/compat-arch.yaml | 7 +
kas/opt/crosscompile.yaml | 6 +
kas/opt/image-fstypes.yaml | 6 +
kas/opt/mirror-debian.yaml | 7 +
kas/opt/mirror-ubuntu.yaml | 7 +
kas/opt/packages-distro.yaml | 6 +
kas/opt/packages-isar.yaml | 6 +
kas/opt/user-isar.yaml | 16 +
kas/opt/user-root.yaml | 8 +
kas/package/Kconfig | 148 ++++++
kas/package/packages-distro.yaml | 6 +
kas/package/pkg_cowsay.yaml | 6 +
kas/package/pkg_enable-fsck.yaml | 6 +
kas/package/pkg_example-module.yaml | 6 +
kas/package/pkg_example-prebuilt.yaml | 6 +
kas/package/pkg_example-raw.yaml | 6 +
kas/package/pkg_expand-on-first-boot.yaml | 6 +
kas/package/pkg_hello-isar.yaml | 6 +
kas/package/pkg_hello.yaml | 6 +
kas/package/pkg_isar-disable-apt-cache.yaml | 6 +
kas/package/pkg_isar-exclude-docs.yaml | 6 +
kas/package/pkg_kselftest.yaml | 6 +
kas/package/pkg_samefile.yaml | 6 +
kas/package/pkg_sshd-regen-keys.yaml | 6 +
68 files changed, 1409 insertions(+)
create mode 100644 Kconfig
create mode 100644 kas/README.md
create mode 100644 kas/distro/Kconfig
create mode 100644 kas/distro/debian-bookworm.yaml
create mode 100644 kas/distro/debian-bullseye.yaml
create mode 100644 kas/distro/debian-buster.yaml
create mode 100644 kas/distro/debian-sid-ports.yaml
create mode 100644 kas/distro/raspios-bullseye.yaml
create mode 100644 kas/distro/ubuntu-focal.yaml
create mode 100644 kas/distro/ubuntu-jammy.yaml
create mode 100644 kas/image/Kconfig
create mode 100644 kas/image/isar-image-base.yaml
create mode 100644 kas/image/isar-image-debug.yaml
create mode 100644 kas/isar.yaml
create mode 100755 kas/kas-container
create mode 100644 kas/machine/Kconfig
create mode 100644 kas/machine/bananapi.yaml
create mode 100644 kas/machine/container-amd64.yaml
create mode 100644 kas/machine/de0-nano-soc.yaml
create mode 100644 kas/machine/hikey.yaml
create mode 100644 kas/machine/imx6-sabrelite.yaml
create mode 100644 kas/machine/nanopi-neo.yaml
create mode 100644 kas/machine/phyboard-mira.yaml
create mode 100644 kas/machine/qemuamd64-sb.yaml
create mode 100644 kas/machine/qemuamd64.yaml
create mode 100644 kas/machine/qemuarm.yaml
create mode 100644 kas/machine/qemuarm64.yaml
create mode 100644 kas/machine/qemui386.yaml
create mode 100644 kas/machine/qemumipsel.yaml
create mode 100644 kas/machine/qemuriscv64.yaml
create mode 100644 kas/machine/rpi-arm-v7.yaml
create mode 100644 kas/machine/rpi-arm-v7l.yaml
create mode 100644 kas/machine/rpi-arm.yaml
create mode 100644 kas/machine/rpi-arm64-v8.yaml
create mode 100644 kas/machine/sifive-fu540.yaml
create mode 100644 kas/machine/starfive-visionfive2.yaml
create mode 100644 kas/machine/stm32mp15x.yaml
create mode 100644 kas/machine/virtualbox.yaml
create mode 100644 kas/machine/vmware.yaml
create mode 100644 kas/opt/Kconfig
create mode 100644 kas/opt/cache-deb-src.yaml
create mode 100644 kas/opt/ccache.yaml
create mode 100644 kas/opt/compat-arch.yaml
create mode 100644 kas/opt/crosscompile.yaml
create mode 100644 kas/opt/image-fstypes.yaml
create mode 100644 kas/opt/mirror-debian.yaml
create mode 100644 kas/opt/mirror-ubuntu.yaml
create mode 100644 kas/opt/packages-distro.yaml
create mode 100644 kas/opt/packages-isar.yaml
create mode 100644 kas/opt/user-isar.yaml
create mode 100644 kas/opt/user-root.yaml
create mode 100644 kas/package/Kconfig
create mode 100644 kas/package/packages-distro.yaml
create mode 100644 kas/package/pkg_cowsay.yaml
create mode 100644 kas/package/pkg_enable-fsck.yaml
create mode 100644 kas/package/pkg_example-module.yaml
create mode 100644 kas/package/pkg_example-prebuilt.yaml
create mode 100644 kas/package/pkg_example-raw.yaml
create mode 100644 kas/package/pkg_expand-on-first-boot.yaml
create mode 100644 kas/package/pkg_hello-isar.yaml
create mode 100644 kas/package/pkg_hello.yaml
create mode 100644 kas/package/pkg_isar-disable-apt-cache.yaml
create mode 100644 kas/package/pkg_isar-exclude-docs.yaml
create mode 100644 kas/package/pkg_kselftest.yaml
create mode 100644 kas/package/pkg_samefile.yaml
create mode 100644 kas/package/pkg_sshd-regen-keys.yaml

--
2.20.1

Uladzimir Bely

unread,
Sep 19, 2023, 7:56:44 AM9/19/23
to isar-...@googlegroups.com
Create required Kconfig files and appropriate YAML configuration
fragments for supporting initial build configuragion via
`kas-container menu`.

Since Isar does not support any possible combination of machines and
distros, there are particular dependencies between them exist.

User should select the distro first and after that it would be
possible to choose the board this distro supports.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
.gitignore | 1 +
Kconfig | 12 +++
kas/distro/Kconfig | 40 ++++++++
kas/distro/debian-bookworm.yaml | 4 +
kas/distro/debian-bullseye.yaml | 4 +
kas/distro/debian-buster.yaml | 4 +
kas/distro/debian-sid-ports.yaml | 4 +
kas/distro/raspios-bullseye.yaml | 4 +
kas/distro/ubuntu-focal.yaml | 4 +
kas/distro/ubuntu-jammy.yaml | 4 +
kas/isar.yaml | 18 ++++
kas/machine/Kconfig | 127 ++++++++++++++++++++++++++
kas/machine/bananapi.yaml | 4 +
kas/machine/container-amd64.yaml | 4 +
kas/machine/de0-nano-soc.yaml | 4 +
kas/machine/hikey.yaml | 4 +
kas/machine/imx6-sabrelite.yaml | 4 +
kas/machine/nanopi-neo.yaml | 4 +
kas/machine/phyboard-mira.yaml | 4 +
kas/machine/qemuamd64-sb.yaml | 4 +
kas/machine/qemuamd64.yaml | 4 +
kas/machine/qemuarm.yaml | 4 +
kas/machine/qemuarm64.yaml | 4 +
kas/machine/qemui386.yaml | 4 +
kas/machine/qemumipsel.yaml | 4 +
kas/machine/qemuriscv64.yaml | 4 +
kas/machine/rpi-arm-v7.yaml | 4 +
kas/machine/rpi-arm-v7l.yaml | 4 +
kas/machine/rpi-arm.yaml | 4 +
kas/machine/rpi-arm64-v8.yaml | 4 +
kas/machine/sifive-fu540.yaml | 4 +
kas/machine/starfive-visionfive2.yaml | 4 +
kas/machine/stm32mp15x.yaml | 4 +
kas/machine/virtualbox.yaml | 4 +
kas/machine/vmware.yaml | 4 +
35 files changed, 318 insertions(+)
create mode 100644 Kconfig
create mode 100644 kas/distro/Kconfig
create mode 100644 kas/distro/debian-bookworm.yaml
create mode 100644 kas/distro/debian-bullseye.yaml
create mode 100644 kas/distro/debian-buster.yaml
create mode 100644 kas/distro/debian-sid-ports.yaml
create mode 100644 kas/distro/raspios-bullseye.yaml
create mode 100644 kas/distro/ubuntu-focal.yaml
create mode 100644 kas/distro/ubuntu-jammy.yaml
create mode 100644 kas/isar.yaml
create mode 100644 kas/machine/Kconfig
create mode 100644 kas/machine/bananapi.yaml
create mode 100644 kas/machine/container-amd64.yaml
create mode 100644 kas/machine/de0-nano-soc.yaml
create mode 100644 kas/machine/hikey.yaml
create mode 100644 kas/machine/imx6-sabrelite.yaml
create mode 100644 kas/machine/nanopi-neo.yaml
create mode 100644 kas/machine/phyboard-mira.yaml
create mode 100644 kas/machine/qemuamd64-sb.yaml
create mode 100644 kas/machine/qemuamd64.yaml
create mode 100644 kas/machine/qemuarm.yaml
create mode 100644 kas/machine/qemuarm64.yaml
create mode 100644 kas/machine/qemui386.yaml
create mode 100644 kas/machine/qemumipsel.yaml
create mode 100644 kas/machine/qemuriscv64.yaml
create mode 100644 kas/machine/rpi-arm-v7.yaml
create mode 100644 kas/machine/rpi-arm-v7l.yaml
create mode 100644 kas/machine/rpi-arm.yaml
create mode 100644 kas/machine/rpi-arm64-v8.yaml
create mode 100644 kas/machine/sifive-fu540.yaml
create mode 100644 kas/machine/starfive-visionfive2.yaml
create mode 100644 kas/machine/stm32mp15x.yaml
create mode 100644 kas/machine/virtualbox.yaml
create mode 100644 kas/machine/vmware.yaml

diff --git a/.gitignore b/.gitignore
index 2525d41e..c12658eb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
*~
/*.patch
__pycache__
+.config.yaml
diff --git a/Kconfig b/Kconfig
new file mode 100644
index 00000000..624237a5
--- /dev/null
+++ b/Kconfig
@@ -0,0 +1,12 @@
+mainmenu "Isar configuration"
+
+config KAS_INCLUDE_MAIN
+ string
+ default "kas/isar.yaml"
+
+config KAS_BUILD_SYSTEM
+ string
+ default "isar"
+
+source "kas/distro/Kconfig"
+source "kas/machine/Kconfig"
diff --git a/kas/distro/Kconfig b/kas/distro/Kconfig
new file mode 100644
index 00000000..58464c8c
--- /dev/null
+++ b/kas/distro/Kconfig
@@ -0,0 +1,40 @@
+menu "Distro selection"
+
+choice
+ prompt "Distro selection"
+ default DEBIAN_BOOKWORM
+
+config DEBIAN_BUSTER
+ bool "Debian Buster (10)"
+
+config DEBIAN_BULLSEYE
+ bool "Debian Bullseye (11)"
+
+config DEBIAN_BOOKWORM
+ bool "Debian Bookworm (12)"
+
+config DEBIAN_SID_PORTS
+ bool "Debian Sid (unstable) with unofficial ports"
+
+config RASPIOS_BULLSEYE
+ bool "Raspi OS Bullseye (11)"
+
+config UBUNTU_FOCAL
+ bool "Ubuntu Focal (20.04)"
+
+config UBUNTU_JAMMY
+ bool "Ubuntu Jammy (22.04)"
+
+endchoice
+
+config KAS_INCLUDE_DISTRO
+ string
+ default "kas/distro/debian-buster.yaml" if DEBIAN_BUSTER
+ default "kas/distro/debian-bullseye.yaml" if DEBIAN_BULLSEYE
+ default "kas/distro/debian-bookworm.yaml" if DEBIAN_BOOKWORM
+ default "kas/distro/debian-sid-ports.yaml" if DEBIAN_SID_PORTS
+ default "kas/distro/raspios-bullseye.yaml" if RASPIOS_BULLSEYE
+ default "kas/distro/ubuntu-focal.yaml" if UBUNTU_FOCAL
+ default "kas/distro/ubuntu-jammy.yaml" if UBUNTU_JAMMY
+
+endmenu
diff --git a/kas/distro/debian-bookworm.yaml b/kas/distro/debian-bookworm.yaml
new file mode 100644
index 00000000..0f49e01a
--- /dev/null
+++ b/kas/distro/debian-bookworm.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+distro: debian-bookworm
diff --git a/kas/distro/debian-bullseye.yaml b/kas/distro/debian-bullseye.yaml
new file mode 100644
index 00000000..f2e13dc4
--- /dev/null
+++ b/kas/distro/debian-bullseye.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+distro: debian-bullseye
diff --git a/kas/distro/debian-buster.yaml b/kas/distro/debian-buster.yaml
new file mode 100644
index 00000000..35f6fd79
--- /dev/null
+++ b/kas/distro/debian-buster.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+distro: debian-buster
diff --git a/kas/distro/debian-sid-ports.yaml b/kas/distro/debian-sid-ports.yaml
new file mode 100644
index 00000000..fafc438d
--- /dev/null
+++ b/kas/distro/debian-sid-ports.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+distro: debian-sid-ports
diff --git a/kas/distro/raspios-bullseye.yaml b/kas/distro/raspios-bullseye.yaml
new file mode 100644
index 00000000..941fa8f4
--- /dev/null
+++ b/kas/distro/raspios-bullseye.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+distro: raspios-bullseye
diff --git a/kas/distro/ubuntu-focal.yaml b/kas/distro/ubuntu-focal.yaml
new file mode 100644
index 00000000..facfd7a1
--- /dev/null
+++ b/kas/distro/ubuntu-focal.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+distro: ubuntu-focal
diff --git a/kas/distro/ubuntu-jammy.yaml b/kas/distro/ubuntu-jammy.yaml
new file mode 100644
index 00000000..c82539a3
--- /dev/null
+++ b/kas/distro/ubuntu-jammy.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+distro: ubuntu-jammy
diff --git a/kas/isar.yaml b/kas/isar.yaml
new file mode 100644
index 00000000..500bf1d4
--- /dev/null
+++ b/kas/isar.yaml
@@ -0,0 +1,18 @@
+header:
+ version: 14
+
+build_system: isar
+
+target:
+- isar-image-base
+
+repos:
+ isar:
+ layers:
+ meta:
+ meta-isar:
+
+bblayers_conf_header:
+ standard: |
+ BBPATH = "${TOPDIR}"
+ BBFILES ?= ""
diff --git a/kas/machine/Kconfig b/kas/machine/Kconfig
new file mode 100644
index 00000000..e1fdafca
--- /dev/null
+++ b/kas/machine/Kconfig
@@ -0,0 +1,127 @@
+menu "Machine selection"
+
+choice
+ prompt "Machine selection"
+ default MACHINE_QEMU_AMD64
+
+config MACHINE_BANANAPI
+ bool "bananapi"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_CONTAINER_AMD64
+ bool "container-amd64"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_DE0_NANO_SOC
+ bool "de0-nano-soc"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_HIKEY
+ bool "hikey"
+ depends on DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_IMX6_SABRELITE
+ bool "imx6-sabrelite"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_IMX6_NANOPI_NEO
+ bool "nanopi-neo"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_PHIBOARD_MIRA
+ bool "phyboard-mira"
+ depends on DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_QEMU_AMD64_SB
+ bool "qemuamd64-sb"
+ depends on DEBIAN_BULLSEYE
+
+config MACHINE_QEMU_AMD64
+ bool "qemuamd64"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM || UBUNTU_FOCAL || UBUNTU_JAMMY
+
+config MACHINE_QEMU_ARM
+ bool "qemuarm"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_QEMU_ARM64
+ bool "qemuarm64"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM || UBUNTU_FOCAL || UBUNTU_JAMMY
+
+config MACHINE_QEMU_I386
+ bool "qemui386"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_QEMU_MIPSEL
+ bool "qemumipsel"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_QEMU_RISCV64
+ bool "qemuriscv64"
+ depends on DEBIAN_SID_PORTS
+
+config MACHINE_RPI_ARM_V7
+ bool "rpi-arm-v7"
+ depends on RASPIOS_BULLSEYE
+
+config MACHINE_RPI_ARM_V7L
+ bool "rpi-arm-v7l"
+ depends on RASPIOS_BULLSEYE
+
+config MACHINE_RPI_ARM
+ bool "rpi-arm"
+ depends on RASPIOS_BULLSEYE
+
+config MACHINE_RPI_ARM64_V8
+ bool "rpi-arm64-v8"
+ depends on RASPIOS_BULLSEYE
+
+config MACHINE_SIFIVE_FU540
+ bool "sifive-fu540"
+ depends on DEBIAN_SID_PORTS
+
+config MACHINE_STARFIVE_VISIONFIVE2
+ bool "starfive-visionfive2"
+ depends on DEBIAN_SID_PORTS
+
+config MACHINE_STM32MP15X
+ bool "stm32mp15x"
+ depends on DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_VIRTUALBOX
+ bool "virtualbox"
+ depends on DEBIAN_BULLSEYE
+
+config MACHINE_VMWARE
+ bool "vmware"
+ depends on DEBIAN_BULLSEYE
+
+endchoice
+
+config KAS_INCLUDE_MACHINE
+ string
+ default "kas/machine/bananapi.yaml" if MACHINE_BANANAPI
+ default "kas/machine/container-amd64.yaml" if MACHINE_CONTAINER_AMD64
+ default "kas/machine/de0-nano-soc.yaml" if MACHINE_DE0_NANO_SOC
+ default "kas/machine/hikey.yaml" if MACHINE_HIKEY
+ default "kas/machine/imx6-sabrelite" if MACHINE_IMX6_SABRELITE
+ default "kas/machine/nanopi-neo" if MACHINE_IMX6_NANOPI_NEO
+ default "kas/machine/phyboard-mira" if MACHINE_PHIBOARD_MIRA
+ default "kas/machine/qemuamd64-sb.yaml" if MACHINE_QEMU_AMD64_SB
+ default "kas/machine/qemuamd64.yaml" if MACHINE_QEMU_AMD64
+ default "kas/machine/qemuarm.yaml" if MACHINE_QEMU_ARM
+ default "kas/machine/qemuarm64.yaml" if MACHINE_QEMU_ARM64
+ default "kas/machine/qemui386.yaml" if MACHINE_QEMU_I386
+ default "kas/machine/qemumipsel.yaml" if MACHINE_QEMU_MIPSEL
+ default "kas/machine/qemuriscv64.yaml" if MACHINE_QEMU_RISCV64
+ default "kas/machine/rpi-arm-v7.yaml" if MACHINE_RPI_ARM_V7
+ default "kas/machine/rpi-arm-v7l.yaml" if MACHINE_RPI_ARM_V7L
+ default "kas/machine/rpi-arm.yaml" if MACHINE_RPI_ARM
+ default "kas/machine/rpi-arm64-v8.yaml" if MACHINE_RPI_ARM64_V8
+ default "kas/machine/sifive-fu540.yaml" if MACHINE_SIFIVE_FU540
+ default "kas/machine/starfive-visionfive2.yaml" if MACHINE_STARFIVE_VISIONFIVE2
+ default "kas/machine/stm32mp15x.yaml" if MACHINE_STM32MP15X
+ default "kas/machine/virtualbox.yaml" if MACHINE_VIRTUALBOX
+ default "kas/machine/vmware.yaml" if MACHINE_VMWARE
+
+endmenu
diff --git a/kas/machine/bananapi.yaml b/kas/machine/bananapi.yaml
new file mode 100644
index 00000000..e11caa87
--- /dev/null
+++ b/kas/machine/bananapi.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: bananapi
diff --git a/kas/machine/container-amd64.yaml b/kas/machine/container-amd64.yaml
new file mode 100644
index 00000000..93e47891
--- /dev/null
+++ b/kas/machine/container-amd64.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: container-amd64
diff --git a/kas/machine/de0-nano-soc.yaml b/kas/machine/de0-nano-soc.yaml
new file mode 100644
index 00000000..7a1a6bf1
--- /dev/null
+++ b/kas/machine/de0-nano-soc.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: de0-nano-soc
diff --git a/kas/machine/hikey.yaml b/kas/machine/hikey.yaml
new file mode 100644
index 00000000..05c362f0
--- /dev/null
+++ b/kas/machine/hikey.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: hikey
diff --git a/kas/machine/imx6-sabrelite.yaml b/kas/machine/imx6-sabrelite.yaml
new file mode 100644
index 00000000..4ee7b027
--- /dev/null
+++ b/kas/machine/imx6-sabrelite.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: imx6-sabrelite
diff --git a/kas/machine/nanopi-neo.yaml b/kas/machine/nanopi-neo.yaml
new file mode 100644
index 00000000..53c3aae6
--- /dev/null
+++ b/kas/machine/nanopi-neo.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: nanopi-neo
diff --git a/kas/machine/phyboard-mira.yaml b/kas/machine/phyboard-mira.yaml
new file mode 100644
index 00000000..9601593d
--- /dev/null
+++ b/kas/machine/phyboard-mira.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: phyboard-mira
diff --git a/kas/machine/qemuamd64-sb.yaml b/kas/machine/qemuamd64-sb.yaml
new file mode 100644
index 00000000..41297fab
--- /dev/null
+++ b/kas/machine/qemuamd64-sb.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: qemuamd64-sb
diff --git a/kas/machine/qemuamd64.yaml b/kas/machine/qemuamd64.yaml
new file mode 100644
index 00000000..ff686de4
--- /dev/null
+++ b/kas/machine/qemuamd64.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: qemuamd64
diff --git a/kas/machine/qemuarm.yaml b/kas/machine/qemuarm.yaml
new file mode 100644
index 00000000..64674c01
--- /dev/null
+++ b/kas/machine/qemuarm.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: qemuarm
diff --git a/kas/machine/qemuarm64.yaml b/kas/machine/qemuarm64.yaml
new file mode 100644
index 00000000..03d7aba4
--- /dev/null
+++ b/kas/machine/qemuarm64.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: qemuarm64
diff --git a/kas/machine/qemui386.yaml b/kas/machine/qemui386.yaml
new file mode 100644
index 00000000..1b68a809
--- /dev/null
+++ b/kas/machine/qemui386.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: qemui386
diff --git a/kas/machine/qemumipsel.yaml b/kas/machine/qemumipsel.yaml
new file mode 100644
index 00000000..a90c9fd4
--- /dev/null
+++ b/kas/machine/qemumipsel.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: qemumipsel
diff --git a/kas/machine/qemuriscv64.yaml b/kas/machine/qemuriscv64.yaml
new file mode 100644
index 00000000..f6d9c478
--- /dev/null
+++ b/kas/machine/qemuriscv64.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: qemuriscv64
diff --git a/kas/machine/rpi-arm-v7.yaml b/kas/machine/rpi-arm-v7.yaml
new file mode 100644
index 00000000..4a1b7999
--- /dev/null
+++ b/kas/machine/rpi-arm-v7.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: rpi-arm-v7
diff --git a/kas/machine/rpi-arm-v7l.yaml b/kas/machine/rpi-arm-v7l.yaml
new file mode 100644
index 00000000..ffa5e7b4
--- /dev/null
+++ b/kas/machine/rpi-arm-v7l.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: rpi-arm-v7l
diff --git a/kas/machine/rpi-arm.yaml b/kas/machine/rpi-arm.yaml
new file mode 100644
index 00000000..eb942be2
--- /dev/null
+++ b/kas/machine/rpi-arm.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: rpi-arm
diff --git a/kas/machine/rpi-arm64-v8.yaml b/kas/machine/rpi-arm64-v8.yaml
new file mode 100644
index 00000000..c64afe38
--- /dev/null
+++ b/kas/machine/rpi-arm64-v8.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: rpi-arm64-v8
diff --git a/kas/machine/sifive-fu540.yaml b/kas/machine/sifive-fu540.yaml
new file mode 100644
index 00000000..009a02cf
--- /dev/null
+++ b/kas/machine/sifive-fu540.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: sifive-fu540
diff --git a/kas/machine/starfive-visionfive2.yaml b/kas/machine/starfive-visionfive2.yaml
new file mode 100644
index 00000000..75f36974
--- /dev/null
+++ b/kas/machine/starfive-visionfive2.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: starfive-visionfive2
diff --git a/kas/machine/stm32mp15x.yaml b/kas/machine/stm32mp15x.yaml
new file mode 100644
index 00000000..9af101af
--- /dev/null
+++ b/kas/machine/stm32mp15x.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: stm32mp15x
diff --git a/kas/machine/virtualbox.yaml b/kas/machine/virtualbox.yaml
new file mode 100644
index 00000000..d5768a62
--- /dev/null
+++ b/kas/machine/virtualbox.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: virtualbox
diff --git a/kas/machine/vmware.yaml b/kas/machine/vmware.yaml
new file mode 100644
index 00000000..cec23b3b
--- /dev/null
+++ b/kas/machine/vmware.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: vmware
--
2.20.1

Uladzimir Bely

unread,
Sep 19, 2023, 7:56:45 AM9/19/23
to isar-...@googlegroups.com
This allows to select better (faster) mirror for Debian and Ubuntu
distributions.

Isar DISTRO_APT_PREMIRRORS is used under the hood.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
Kconfig | 1 +
kas/opt/Kconfig | 36 ++++++++++++++++++++++++++++++++++++
kas/opt/mirror-debian.yaml | 7 +++++++
kas/opt/mirror-ubuntu.yaml | 7 +++++++
4 files changed, 51 insertions(+)
create mode 100644 kas/opt/Kconfig
create mode 100644 kas/opt/mirror-debian.yaml
create mode 100644 kas/opt/mirror-ubuntu.yaml

diff --git a/Kconfig b/Kconfig
index 624237a5..f48c56cf 100644
--- a/Kconfig
+++ b/Kconfig
@@ -10,3 +10,4 @@ config KAS_BUILD_SYSTEM

source "kas/distro/Kconfig"
source "kas/machine/Kconfig"
+source "kas/opt/Kconfig"
diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
new file mode 100644
index 00000000..1f04d1ba
--- /dev/null
+++ b/kas/opt/Kconfig
@@ -0,0 +1,36 @@
+menu "Mirror selection"
+
+config MIRROR_DEBIAN
+ bool "Use specific Debian mirror"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+ help
+ Select better local Debian mirror instead of deb.debian.org
+
+config MIRROR_DEBIAN_URL
+ string "URL of Debian mirror"
+ default "http://deb.debian.org"
+ depends on MIRROR_DEBIAN
+
+config KAS_INCLUDE_MIRROR_DEBIAN
+ string
+ default "kas/opt/mirror-debian.yaml"
+ depends on MIRROR_DEBIAN
+
+
+config MIRROR_UBUNTU
+ bool "Use specific Ubuntu mirror"
+ depends on UBUNTU_FOCAL || UBUNTU_JAMMY
+ help
+ Select better local Ubuntu mirror instead of archive.ubuntu.com
+
+config MIRROR_UBUNTU_URL
+ string "URL of Ubuntu mirror"
+ default "http://archive.ubuntu.com"
+ depends on MIRROR_UBUNTU
+
+config KAS_INCLUDE_MIRROR_UBUNTU
+ string
+ default "kas/opt/mirror-ubuntu.yaml"
+ depends on MIRROR_UBUNTU
+
+endmenu
diff --git a/kas/opt/mirror-debian.yaml b/kas/opt/mirror-debian.yaml
new file mode 100644
index 00000000..ad708f2e
--- /dev/null
+++ b/kas/opt/mirror-debian.yaml
@@ -0,0 +1,7 @@
+header:
+ version: 14
+
+local_conf_header:
+ mirror-debian: |
+ DISTRO_APT_PREMIRRORS += "\
+ http://deb\.debian\.org ${MIRROR_DEBIAN_URL}\n"
diff --git a/kas/opt/mirror-ubuntu.yaml b/kas/opt/mirror-ubuntu.yaml
new file mode 100644
index 00000000..beb73d59
--- /dev/null
+++ b/kas/opt/mirror-ubuntu.yaml
@@ -0,0 +1,7 @@
+header:
+ version: 14
+
+local_conf_header:
+ mirror-ubuntu: |
+ DISTRO_APT_PREMIRRORS += "\
+ http://archive\.ubuntu\.com ${MIRROR_UBUNTU_URL}\n"
--
2.20.1

Uladzimir Bely

unread,
Sep 19, 2023, 7:56:45 AM9/19/23
to isar-...@googlegroups.com
Taken from revision `044c7d0` (tag `4.0`) of `kas` project [1].

Basic usage:

```
./kas/kas-container menu
./kas/kas-container build
./kas/kas-container shell
```

[1] https://github.com/siemens/kas

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/kas-container | 562 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 562 insertions(+)
create mode 100755 kas/kas-container

diff --git a/kas/kas-container b/kas/kas-container
new file mode 100755
index 00000000..8fa2d16e
--- /dev/null
+++ b/kas/kas-container
@@ -0,0 +1,562 @@
+#!/bin/sh
+#
+# kas - setup tool for bitbake based projects
+#
+# Copyright (c) Siemens AG, 2018-2022
+#
+# Authors:
+# Jan Kiszka <jan.k...@siemens.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+set -e
+
+usage()
+{
+ printf "%b" "Usage: $0 [OPTIONS] { build | shell } [KASOPTIONS] [KASFILE]\n"
+ printf "%b" " $0 [OPTIONS] { checkout | dump } [KASOPTIONS] [KASFILE]\n"
+ printf "%b" " $0 [OPTIONS] for-all-repos [KASOPTIONS] [KASFILE] COMMAND\n"
+ printf "%b" " $0 [OPTIONS] { clean | cleansstate | cleanall}\n"
+ printf "%b" " $0 [OPTIONS] menu [KCONFIG]\n"
+ printf "%b" "\nPositional arguments:\n"
+ printf "%b" "build\t\t\tCheck out repositories and build target.\n"
+ printf "%b" "checkout\t\tCheck out repositories but do not build.\n"
+ printf "%b" "dump\t\t\tCheck out repositories and write flat version\n"
+ printf "%b" " \t\t\tof config to stdout.\n"
+ printf "%b" "shell\t\t\tRun a shell in the build environment.\n"
+ printf "%b" "for-all-repos\t\tRun specified command in each repository.\n"
+ printf "%b" "clean\t\t\tClean build artifacts, keep sstate cache and " \
+ "downloads.\n"
+ printf "%b" "cleansstate\t\tClean build artifacts and sstate cache, " \
+ "keep downloads.\n"
+ printf "%b" "cleanall\t\tClean build artifacts, sstate cache and " \
+ "downloads.\n"
+ printf "%b" "menu\t\t\tProvide configuration menu and trigger " \
+ "configured build.\n"
+ printf "%b" "\nOptional arguments:\n"
+ printf "%b" "--isar\t\t\tUse kas-isar container to build Isar image.\n"
+ printf "%b" "--with-loop-dev Pass a loop device to the " \
+ "container. Only required if\n"
+ printf "%b" "\t\t\tloop-mounting is used by recipes.\n"
+ printf "%b" "--runtime-args\t\tAdditional arguments to pass to the " \
+ "container runtime\n"
+ printf "%b" "\t\t\tfor running the build.\n"
+ printf "%b" "-d\t\t\tPrint debug output (deprecated, use -l debug).\n"
+ printf "%b" "-l, --log-level\t\tSet log level (default=info).\n"
+ printf "%b" "-v\t\t\tSame as -d (deprecated).\n"
+ printf "%b" "--version\t\tprint program version.\n"
+ printf "%b" "--ssh-dir\t\tDirectory containing SSH configurations.\n"
+ printf "%b" "\t\t\tAvoid \$HOME/.ssh unless you fully trust the " \
+ "container.\n"
+ printf "%b" "--ssh-agent\t\tForward ssh-agent socket to the container.\n"
+ printf "%b" "--aws-dir\t\tDirectory containing AWScli configuration.\n"
+ printf "%b" "--git-credential-store\tFile path to the git credential " \
+ "store\n"
+ printf "%b" "--no-proxy-from-env\tDo not inherit proxy settings from " \
+ "environment.\n"
+ printf "%b" "--repo-ro\t\tMount current repository read-only\n" \
+ "\t\t\t(default for build command)\n"
+ printf "%b" "--repo-rw\t\tMount current repository writeable\n" \
+ "\t\t\t(default for shell command)\n"
+ printf "%b" "\n"
+ printf "%b" "You can force the use of podman over docker using " \
+ "KAS_CONTAINER_ENGINE=podman.\n"
+ exit 1
+}
+
+trace()
+{
+ [ -n "${KAS_VERBOSE}" ] && echo "+ $*" >&2
+ "$@"
+}
+
+enable_isar_mode() {
+ if [ -n "${ISAR_MODE}" ]; then
+ return
+ fi
+ ISAR_MODE=1
+
+ KAS_CONTAINER_IMAGE_NAME_DEFAULT="kas-isar"
+ KAS_ISAR_ARGS="--privileged"
+
+ if [ "${KAS_CONTAINER_ENGINE}" = "podman" ]; then
+ # sudo is needed for a privileged podman container
+ KAS_CONTAINER_COMMAND="sudo --preserve-env ${KAS_CONTAINER_COMMAND}"
+ # preserved user PATH may lack sbin needed by privileged podman
+ export PATH="${PATH}:/usr/sbin"
+ fi
+}
+
+enable_oe_mode() {
+ if [ "${KAS_CONTAINER_ENGINE}" = "podman" ]; then
+ # The container entry point expects that the current userid
+ # calling "podman run" has a 1:1 mapping
+ KAS_RUNTIME_ARGS="${KAS_RUNTIME_ARGS} --userns=keep-id"
+ fi
+}
+
+run_clean() {
+ if [ -n "${KAS_ISAR_ARGS}" ]; then
+ set_container_image_var
+ # SC2086: Double quote to prevent globbing and word splitting.
+ # shellcheck disable=2086
+ trace ${KAS_CONTAINER_COMMAND} run -v "${KAS_BUILD_DIR}":/build:rw \
+ --workdir=/build --rm ${KAS_ISAR_ARGS} \
+ ${KAS_CONTAINER_IMAGE} \
+ sudo rm -rf tmp
+ else
+ trace rm -rf "${KAS_BUILD_DIR}"/tmp*
+ fi
+
+ if [ "$1" != "clean" ]; then
+ SSTATE_DIR=${SSTATE_DIR:-${KAS_BUILD_DIR}/sstate-cache}
+ trace rm -rf "${SSTATE_DIR}"
+
+ if [ "$1" = "cleanall" ]; then
+ DL_DIR=${DL_DIR:-${KAS_BUILD_DIR}/downloads}
+ trace rm -rf "${DL_DIR}"
+ fi
+ fi
+}
+
+KAS_IMAGE_VERSION_DEFAULT="4.0"
+KAS_CONTAINER_IMAGE_PATH_DEFAULT="ghcr.io/siemens/kas"
+KAS_CONTAINER_IMAGE_NAME_DEFAULT="kas"
+
+set_container_image_var() {
+ KAS_IMAGE_VERSION="${KAS_IMAGE_VERSION:-${KAS_IMAGE_VERSION_DEFAULT}}"
+ KAS_CONTAINER_IMAGE_NAME="${KAS_CONTAINER_IMAGE_NAME:-${KAS_CONTAINER_IMAGE_NAME_DEFAULT}}"
+ KAS_CONTAINER_IMAGE_PATH="${KAS_CONTAINER_IMAGE_PATH:-${KAS_CONTAINER_IMAGE_PATH_DEFAULT}}"
+ KAS_CONTAINER_IMAGE_DEFAULT="${KAS_CONTAINER_IMAGE_PATH}/${KAS_CONTAINER_IMAGE_NAME}:${KAS_IMAGE_VERSION}"
+ KAS_CONTAINER_IMAGE="${KAS_CONTAINER_IMAGE:-${KAS_CONTAINER_IMAGE_DEFAULT}}"
+}
+
+KAS_WORK_DIR=$(readlink -fv "${KAS_WORK_DIR:-$(pwd)}")
+# KAS_WORK_DIR needs to exist for the subsequent code
+trace mkdir -p "${KAS_WORK_DIR}"
+KAS_BUILD_DIR=$(readlink -fv "${KAS_BUILD_DIR:-${KAS_WORK_DIR}/build}")
+trace mkdir -p "${KAS_BUILD_DIR}"
+
+KAS_CONTAINER_ENGINE="${KAS_CONTAINER_ENGINE:-${KAS_DOCKER_ENGINE}}"
+if [ -z "${KAS_CONTAINER_ENGINE}" ]; then
+ # Try to auto-detect a container engine
+ if command -v docker >/dev/null; then
+ case $(docker -v 2>/dev/null) in
+ podman*)
+ # The docker command is an alias for podman
+ KAS_CONTAINER_ENGINE=podman
+ ;;
+ Docker*)
+ # The docker command is the real docker
+ KAS_CONTAINER_ENGINE=docker
+ ;;
+ *)
+ # The docker command is an unknown engine
+ echo "$0: docker command found, but unknown engine detected" >&2
+ exit 1
+ esac
+ elif command -v podman >/dev/null; then
+ KAS_CONTAINER_ENGINE=podman
+ else
+ echo "$0: no container engine found, need docker or podman" >&2
+ exit 1
+ fi
+fi
+
+KAS_RUNTIME_ARGS="--log-driver=none --user=root"
+
+case "${KAS_CONTAINER_ENGINE}" in
+docker)
+ KAS_CONTAINER_COMMAND="docker"
+ ;;
+podman)
+ KAS_CONTAINER_COMMAND="podman"
+ KAS_RUNTIME_ARGS="${KAS_RUNTIME_ARGS} --security-opt label=disable"
+ ;;
+*)
+ echo "$0: unknown container engine '${KAS_CONTAINER_ENGINE}'" >&2
+ exit 1
+ ;;
+esac
+
+# parse kas-container options
+while [ $# -gt 0 ]; do
+ case "$1" in
+ --isar)
+ enable_isar_mode
+ shift 1
+ ;;
+ --with-loop-dev)
+ if ! KAS_LOOP_DEV=$(/sbin/losetup -f 2>/dev/null); then
+ if [ "$(id -u)" -eq 0 ]; then
+ echo "Error: loop device not available!"
+ exit 1
+ fi
+ sudo_command="/sbin/losetup -f"
+ sudo_message="[sudo] enter password to setup loop"
+ sudo_message="$sudo_message devices by calling"
+ sudo_message="$sudo_message '$sudo_command': "
+ # SC2086: Double quote to prevent globbing and word splitting.
+ # shellcheck disable=2086
+ if ! KAS_LOOP_DEV=$(sudo -p "$sudo_message" $sudo_command \
+ 2>/dev/null); then
+ echo "Error: loop device setup unsuccessful!"
+ echo "try calling '$sudo_command' with root" \
+ "permissions manually."
+ exit 1
+ fi
+ fi
+ KAS_WITH_LOOP_DEV="--device ${KAS_LOOP_DEV}"
+ shift 1
+ ;;
+ --runtime-args|--docker-args)
+ [ $# -gt 0 ] || usage
+ KAS_RUNTIME_ARGS="${KAS_RUNTIME_ARGS} $2"
+ shift 2
+ ;;
+ --ssh-dir)
+ [ $# -gt 2 ] || usage
+ KAS_SSH_DIR="$2"
+ shift 2
+ ;;
+ --ssh-agent)
+ KAS_SSH_AUTH_SOCK=$(readlink -fv "$SSH_AUTH_SOCK")
+ shift 1
+ ;;
+ --aws-dir)
+ [ $# -gt 2 ] || usage
+ KAS_AWS_DIR="$2"
+ shift 2
+ ;;
+ --git-credential-store)
+ [ $# -gt 2 ] || usage
+ KAS_GIT_CREDENTIAL_STORE="$2"
+ shift 2
+ ;;
+ --no-proxy-from-env)
+ KAS_NO_PROXY_FROM_ENV=1
+ shift 1
+ ;;
+ --repo-ro)
+ KAS_REPO_MOUNT_OPT="ro"
+ shift 1
+ ;;
+ --repo-rw)
+ KAS_REPO_MOUNT_OPT="rw"
+ shift 1
+ ;;
+ -v | -d)
+ KAS_VERBOSE=1
+ KAS_OPTIONS_DIRECT="${KAS_OPTIONS_DIRECT} -d"
+ shift 1
+ ;;
+ -l | --log-level)
+ if [ "$2" = "debug" ]; then
+ KAS_VERBOSE=1
+ fi
+ KAS_OPTIONS_DIRECT="${KAS_OPTIONS_DIRECT} -l $2"
+ shift 2
+ ;;
+ --version)
+ echo "$(basename "$0") $KAS_IMAGE_VERSION_DEFAULT"
+ exit 0
+ ;;
+ --*)
+ usage
+ ;;
+ clean|cleansstate|cleanall)
+ [ $# -eq 1 ] || usage
+ run_clean "$1"
+ exit 0
+ ;;
+ shell)
+ KAS_REPO_MOUNT_OPT_DEFAULT="rw"
+ KAS_CMD=$1
+ shift 1
+ break
+ ;;
+ build|checkout|for-all-repos|menu)
+ KAS_REPO_MOUNT_OPT_DEFAULT="ro"
+ KAS_CMD=$1
+ shift 1
+ break
+ ;;
+ dump)
+ if printf '%s\0' "$@" | grep -xqz -- '--inplace\|-i'; then
+ KAS_REPO_MOUNT_OPT_DEFAULT="rw"
+ else
+ KAS_REPO_MOUNT_OPT_DEFAULT="ro"
+ fi
+ KAS_CMD=$1
+ shift 1
+ break
+ ;;
+ *)
+ usage
+ ;;
+ esac
+done
+
+[ -n "${KAS_CMD}" ] || usage
+
+KAS_EXTRA_BITBAKE_ARGS=0
+
+# parse kas sub-command options
+while [ $# -gt 0 ] && [ $KAS_EXTRA_BITBAKE_ARGS -eq 0 ]; do
+ case "$1" in
+ --skip|--target|--task)
+ KAS_OPTIONS="${KAS_OPTIONS} $1 $2"
+ shift 2
+ ;;
+ -c|--cmd|--command)
+ KAS_BITBAKE_C_OPTION_ARGS="$2"
+ shift 2
+ ;;
+ -E|--preserve-env)
+ echo "$1 is not supported with kas-container"
+ exit 1
+ ;;
+ --)
+ KAS_EXTRA_BITBAKE_ARGS=$#
+ ;;
+ -*)
+ KAS_OPTIONS="${KAS_OPTIONS} $1"
+ shift 1
+ ;;
+ *)
+ KAS_FILES=
+ # SC2086: Double quote to prevent globbing and word splitting.
+ # shellcheck disable=2086
+ for FILE in $(IFS=':'; echo $1); do
+ if ! KAS_REAL_FILE="$(realpath -qe "$FILE")"; then
+ echo "Error: configuration file '${FILE}' not found"
+ exit 1
+ fi
+ if [ -z "${KAS_FILES}" ]; then
+ KAS_FIRST_FILE="${KAS_REAL_FILE}"
+ KAS_FILES="${KAS_REAL_FILE}"
+ else
+ KAS_FILES="${KAS_FILES}:${KAS_REAL_FILE}"
+ fi
+ done
+ shift 1
+ if [ "$KAS_CMD" = "for-all-repos" ]; then
+ KAS_REPO_CMD="$1"
+ shift 1
+ fi
+ ;;
+ esac
+done
+
+if [ -n "${KAS_FIRST_FILE}" ]; then
+ KAS_FILE_DIR="$(dirname "${KAS_FIRST_FILE}")"
+ KAS_REPO_DIR=$(git -C "${KAS_FILE_DIR}" rev-parse --show-toplevel 2>/dev/null) \
+ || KAS_REPO_DIR=$(hg --cwd "${KAS_FILE_DIR}" root 2>/dev/null) \
+ || KAS_REPO_DIR=${KAS_FILE_DIR}
+else
+ KAS_REPO_DIR=$(pwd)
+fi
+
+SOURCE_DIR_HOST=$(
+ grep -e "^_source_dir_host: " "${KAS_WORK_DIR}/.config.yaml" 2>/dev/null | \
+ sed 's/_source_dir_host:[ ]\+//')
+if [ -n "${SOURCE_DIR_HOST}" ]; then
+ KAS_REPO_DIR="${SOURCE_DIR_HOST}"
+fi
+
+if [ "${KAS_CMD}" = "menu" ]; then
+ if [ -z "${KAS_FIRST_FILE}" ]; then
+ KAS_FIRST_FILE="Kconfig"
+ fi
+
+ # When using the menu plugin, we need to track the KAS_REPO_DIR outside
+ # of the container to later allow a simple `kas-container build`. For
+ # that, we tell the kas menu plugin via an env-var about the location
+ # on the host. This data is then added to the .config.yaml where it can
+ # be evaluated by the next invocation of kas-container.
+
+ if ! [ "$(realpath -qe "${KAS_REPO_DIR}")" = "$(realpath -qe "${KAS_WORK_DIR}")" ]; then
+ set -- "$@" -e _KAS_REPO_DIR_HOST="$(readlink -fv "${KAS_REPO_DIR}")"
+ fi
+
+ BUILD_SYSTEM=$(tr '\n' '\f' 2>/dev/null < ${KAS_FIRST_FILE} | \
+ sed -e 's/\(.*\fconfig KAS_BUILD_SYSTEM\f\(.*\)\|.*\)/\2/' \
+ -e 's/\f\([[:alpha:]].*\|$\)//' \
+ -e 's/.*default \"\(.*\)\".*/\1/')
+else
+ if [ -z "${KAS_FIRST_FILE}" ]; then
+ KAS_FIRST_FILE="${KAS_WORK_DIR}/.config.yaml"
+ fi
+
+ BUILD_SYSTEM=$(grep -e "^build_system: " "${KAS_FIRST_FILE}" 2>/dev/null | \
+ sed 's/build_system:[ ]\+//')
+fi
+
+if [ "${BUILD_SYSTEM}" = "isar" ]; then
+ enable_isar_mode
+elif [ -z "${ISAR_MODE}" ]; then
+ enable_oe_mode
+fi
+
+set_container_image_var
+
+KAS_REPO_MOUNT_OPT="${KAS_REPO_MOUNT_OPT:-${KAS_REPO_MOUNT_OPT_DEFAULT}}"
+
+KAS_FILES="$(echo "${KAS_FILES}" | sed 's|'"${KAS_REPO_DIR}"'/|/repo/|g')"
+
+if [ "$(id -u)" -eq 0 ] && [ "${KAS_ALLOW_ROOT}" != "yes" ] ; then
+ echo "Error: Running as root - may break certain recipes."
+ echo "Better give a regular user docker access. Set" \
+ "KAS_ALLOW_ROOT=yes to override."
+ exit 1
+fi
+
+set -- "$@" -v "${KAS_REPO_DIR}":/repo:${KAS_REPO_MOUNT_OPT} \
+ -v "${KAS_WORK_DIR}":/work:rw -e KAS_WORK_DIR=/work \
+ -v "${KAS_BUILD_DIR}":/build:rw \
+ --workdir=/repo \
+ -e KAS_BUILD_DIR=/build \
+ -e USER_ID="$(id -u)" -e GROUP_ID="$(id -g)" --rm --init
+
+if [ -n "${KAS_SSH_DIR}" ] ; then
+ if [ ! -d "${KAS_SSH_DIR}" ]; then
+ echo "Passed KAS_SSH_DIR '${KAS_SSH_DIR}' is not a directory"
+ exit 1
+ fi
+ set -- "$@" -v "$(readlink -fv "${KAS_SSH_DIR}")":/var/kas/userdata/.ssh:ro
+fi
+
+if [ -n "${KAS_SSH_AUTH_SOCK}" ]; then
+ if [ ! -S "${KAS_SSH_AUTH_SOCK}" ]; then
+ echo "Passed SSH_AUTH_SOCK '${KAS_SSH_AUTH_SOCK}' is not a socket"
+ exit 1
+ fi
+ set -- "$@" -v "${KAS_SSH_AUTH_SOCK}":/ssh-agent/ssh-auth-sock \
+ -e SSH_AUTH_SOCK=/ssh-agent/ssh-auth-sock
+fi
+
+if [ -n "${KAS_AWS_DIR}" ] ; then
+ if [ ! -d "${KAS_AWS_DIR}" ]; then
+ echo "Passed KAS_AWS_DIR '${KAS_AWS_DIR}' is not a directory"
+ exit 1
+ fi
+ set -- "$@" -v "$(readlink -fv "${KAS_AWS_DIR}")":/var/kas/userdata/.aws:ro \
+ -e AWS_CONFIG_FILE="${AWS_CONFIG_FILE:-/var/kas/userdata/.aws/config}" \
+ -e AWS_SHARED_CREDENTIALS_FILE="${AWS_SHARED_CREDENTIALS_FILE:-/var/kas/userdata/.aws/credentials}"
+fi
+
+KAS_GIT_CREDENTIAL_HELPER_DEFAULT=""
+
+if [ -n "${KAS_GIT_CREDENTIAL_STORE}" ] ; then
+ if [ ! -f "${KAS_GIT_CREDENTIAL_STORE}" ]; then
+ echo "Passed KAS_GIT_CREDENTIAL_STORE '${KAS_GIT_CREDENTIAL_STORE}' is not a file"
+ exit 1
+ fi
+ KAS_GIT_CREDENTIAL_HELPER_DEFAULT="store --file=/var/kas/userdata/.git-credentials"
+ set -- "$@" -v "$(readlink -fv "${KAS_GIT_CREDENTIAL_STORE}")":/var/kas/userdata/.git-credentials:ro
+fi
+
+GIT_CREDENTIAL_HELPER="${GIT_CREDENTIAL_HELPER:-${KAS_GIT_CREDENTIAL_HELPER_DEFAULT}}"
+
+if [ -n "${GIT_CREDENTIAL_HELPER}" ] ; then
+ set -- "$@" -e GIT_CREDENTIAL_HELPER="${GIT_CREDENTIAL_HELPER}"
+fi
+
+if [ -f "${NETRC_FILE}" ]; then
+ set -- "$@" -v "$(readlink -fv "${NETRC_FILE}")":/var/kas/userdata/.netrc:ro \
+ -e NETRC_FILE="/var/kas/userdata/.netrc"
+fi
+
+if [ -t 1 ]; then
+ set -- "$@" -t -i
+fi
+
+if [ -n "${DL_DIR}" ]; then
+ trace mkdir -p "${DL_DIR}"
+ set -- "$@" \
+ -v "$(readlink -fv "${DL_DIR}")":/downloads:rw \
+ -e DL_DIR=/downloads
+fi
+
+if [ -n "${SSTATE_DIR}" ]; then
+ trace mkdir -p "${SSTATE_DIR}"
+ set -- "$@" \
+ -v "$(readlink -fv "${SSTATE_DIR}")":/sstate:rw \
+ -e SSTATE_DIR=/sstate
+fi
+
+if [ -n "${KAS_REPO_REF_DIR}" ]; then
+ if [ ! -d "${KAS_REPO_REF_DIR}" ]; then
+ echo "Passed KAS_REPO_REF_DIR '${KAS_REPO_REF_DIR}' is not a directory"
+ exit 1
+ fi
+ set -- "$@" \
+ -v "$(readlink -fv "${KAS_REPO_REF_DIR}")":/repo-ref:rw \
+ -e KAS_REPO_REF_DIR=/repo-ref
+fi
+
+for var in TERM KAS_DISTRO KAS_MACHINE KAS_TARGET KAS_TASK \
+ KAS_PREMIRRORS DISTRO_APT_PREMIRRORS BB_NUMBER_THREADS PARALLEL_MAKE \
+ GIT_CREDENTIAL_USEHTTPPATH; do
+ if [ -n "$(eval echo \$${var})" ]; then
+ set -- "$@" -e "${var}=$(eval echo \"\$${var}\")"
+ fi
+done
+
+# propagate only supported SHELL settings
+case "$SHELL" in
+/bin/sh|/bin/bash|/bin/dash)
+ set -- "$@" -e "SHELL=$SHELL"
+ ;;
+*)
+ set -- "$@" -e "SHELL=/bin/bash"
+ ;;
+esac
+
+if [ -z "${KAS_NO_PROXY_FROM_ENV+x}" ]; then
+ for var in http_proxy https_proxy ftp_proxy no_proxy NO_PROXY; do
+ if [ -n "$(eval echo \$${var})" ]; then
+ set -- "$@" -e "${var}=$(eval echo \$${var})"
+ fi
+ done
+fi
+
+# SC2086: Double quote to prevent globbing and word splitting.
+# shellcheck disable=2086
+set -- "$@" ${KAS_ISAR_ARGS} ${KAS_WITH_LOOP_DEV} ${KAS_RUNTIME_ARGS} \
+ ${KAS_CONTAINER_IMAGE} ${KAS_OPTIONS_DIRECT} ${KAS_CMD} ${KAS_OPTIONS}
+if [ -n "${KAS_BITBAKE_C_OPTION_ARGS}" ]; then
+ set -- "$@" -c "${KAS_BITBAKE_C_OPTION_ARGS}"
+fi
+# SC2086: Double quote to prevent globbing and word splitting.
+# shellcheck disable=2086
+set -- "$@" ${KAS_FILES}
+if [ "$KAS_CMD" = "for-all-repos" ]; then
+ set -- "$@" "${KAS_REPO_CMD}"
+fi
+
+# rotate any extra bitbake args from the front to the end of the argument list
+while [ $KAS_EXTRA_BITBAKE_ARGS -gt 0 ]; do
+ arg="$1"
+ shift 1
+ set -- "$@" "$arg"
+ KAS_EXTRA_BITBAKE_ARGS=$((KAS_EXTRA_BITBAKE_ARGS - 1))
+done
+
+trace ${KAS_CONTAINER_COMMAND} run "$@"
--
2.20.1

Uladzimir Bely

unread,
Sep 19, 2023, 7:56:46 AM9/19/23
to isar-...@googlegroups.com
This adds an option to the menu that allows to enable or disable
ccache support for the build.

The option is enabled by default.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>

ccache
---
kas/opt/Kconfig | 10 ++++++++++
kas/opt/ccache.yaml | 6 ++++++
2 files changed, 16 insertions(+)
create mode 100644 kas/opt/ccache.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 47cff1c4..1909a915 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -53,3 +53,13 @@ config KAS_INCLUDE_ISAR_CROSS_COMPILE
string
default "kas/opt/crosscompile.yaml"
depends on ISAR_CROSS_COMPILE
+
+
+config USE_CCACHE
+ bool "Use ccache during build"
+ default y
+
+config KAS_INCLUDE_USE_CCACHE
+ string
+ default "kas/opt/ccache.yaml"
+ depends on USE_CCACHE
diff --git a/kas/opt/ccache.yaml b/kas/opt/ccache.yaml
new file mode 100644
index 00000000..7443dd8b
--- /dev/null
+++ b/kas/opt/ccache.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:

Uladzimir Bely

unread,
Sep 19, 2023, 7:56:46 AM9/19/23
to isar-...@googlegroups.com
This part of configuration allows to choose which additional packages
(both from Isar and Debian) to include to the target image.

Isar packages are added to IMAGE_INSTALL since Debian packages go
to IMAGE_PREINSTALL.

The features are implemented as "string" parameter in the menu since
it reduces a number of required YAML fragments.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
Kconfig | 1 +
kas/opt/packages-distro.yaml | 6 +
kas/opt/packages-isar.yaml | 6 +
kas/package/Kconfig | 148 ++++++++++++++++++++
kas/package/packages-distro.yaml | 6 +
kas/package/pkg_cowsay.yaml | 6 +
kas/package/pkg_enable-fsck.yaml | 6 +
kas/package/pkg_example-module.yaml | 6 +
kas/package/pkg_example-prebuilt.yaml | 6 +
kas/package/pkg_example-raw.yaml | 6 +
kas/package/pkg_expand-on-first-boot.yaml | 6 +
kas/package/pkg_hello-isar.yaml | 6 +
kas/package/pkg_hello.yaml | 6 +
kas/package/pkg_isar-disable-apt-cache.yaml | 6 +
kas/package/pkg_isar-exclude-docs.yaml | 6 +
kas/package/pkg_kselftest.yaml | 6 +
kas/package/pkg_samefile.yaml | 6 +
kas/package/pkg_sshd-regen-keys.yaml | 6 +
18 files changed, 245 insertions(+)
create mode 100644 kas/opt/packages-distro.yaml
create mode 100644 kas/opt/packages-isar.yaml
create mode 100644 kas/package/Kconfig
create mode 100644 kas/package/packages-distro.yaml
create mode 100644 kas/package/pkg_cowsay.yaml
create mode 100644 kas/package/pkg_enable-fsck.yaml
create mode 100644 kas/package/pkg_example-module.yaml
create mode 100644 kas/package/pkg_example-prebuilt.yaml
create mode 100644 kas/package/pkg_example-raw.yaml
create mode 100644 kas/package/pkg_expand-on-first-boot.yaml
create mode 100644 kas/package/pkg_hello-isar.yaml
create mode 100644 kas/package/pkg_hello.yaml
create mode 100644 kas/package/pkg_isar-disable-apt-cache.yaml
create mode 100644 kas/package/pkg_isar-exclude-docs.yaml
create mode 100644 kas/package/pkg_kselftest.yaml
create mode 100644 kas/package/pkg_samefile.yaml
create mode 100644 kas/package/pkg_sshd-regen-keys.yaml

diff --git a/Kconfig b/Kconfig
index f48c56cf..0d54ea52 100644
--- a/Kconfig
+++ b/Kconfig
@@ -10,4 +10,5 @@ config KAS_BUILD_SYSTEM

source "kas/distro/Kconfig"
source "kas/machine/Kconfig"
+source "kas/package/Kconfig"
source "kas/opt/Kconfig"
diff --git a/kas/opt/packages-distro.yaml b/kas/opt/packages-distro.yaml
new file mode 100644
index 00000000..d2fca914
--- /dev/null
+++ b/kas/opt/packages-distro.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ packages-distro: |
+ IMAGE_PREINSTALL:append = " ${KAS_IMAGE_PREINSTALL}"
diff --git a/kas/opt/packages-isar.yaml b/kas/opt/packages-isar.yaml
new file mode 100644
index 00000000..c8da258d
--- /dev/null
+++ b/kas/opt/packages-isar.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ packages-isar: |
+ IMAGE_INSTALL:append = " ${KAS_IMAGE_INSTALL}"
diff --git a/kas/package/Kconfig b/kas/package/Kconfig
new file mode 100644
index 00000000..a5531167
--- /dev/null
+++ b/kas/package/Kconfig
@@ -0,0 +1,148 @@
+menu "Packages selection"
+
+menu "Isar packages"
+
+config PACKAGE_COWSAY
+ bool "cowsay"
+ default y
+
+config KAS_INCLUDE_PACKAGE_COWSAY
+ string
+ default "kas/package/pkg_cowsay.yaml"
+ depends on PACKAGE_COWSAY
+
+
+config PACKAGE_ENABLE_FSCK
+ bool "enable-fsck"
+ default y
+
+config KAS_INCLUDE_PACKAGE_ENABLE_FSCK
+ string
+ default "kas/package/pkg_enable-fsck.yaml"
+ depends on PACKAGE_ENABLE_FSCK
+
+
+config PACKAGE_EXAMPLE_RAW
+ bool "example-raw"
+ default y
+
+config KAS_INCLUDE_PACKAGE_EXAMPLE_RAW
+ string
+ default "kas/package/pkg_example-raw.yaml"
+ depends on PACKAGE_EXAMPLE_RAW
+
+
+config PACKAGE_EXAMPLE_MODULE
+ bool "example-module"
+ default y
+
+config KAS_INCLUDE_PACKAGE_EXAMPLE_MODULE
+ string
+ default "kas/package/pkg_example-module.yaml"
+ depends on PACKAGE_EXAMPLE_MODULE
+
+
+config PACKAGE_EXAMPLE_PREBUILT
+ bool "example-prebuilt"
+ default y
+
+config KAS_INCLUDE_PACKAGE_EXAMPLE_PREBUILT
+ string
+ default "kas/package/pkg_example-prebuilt.yaml"
+ depends on PACKAGE_EXAMPLE_PREBUILT
+
+
+config PACKAGE_EXPAND_ON_FIRST_BOOT
+ bool "expand-on-first-boot"
+ default y
+
+config KAS_INCLUDE_PACKAGE_EXPAND_ON_FIRST_BOOT
+ string
+ default "kas/package/pkg_expand-on-first-boot.yaml"
+ depends on PACKAGE_EXPAND_ON_FIRST_BOOT
+
+
+config PACKAGE_HELLO
+ bool "hello"
+ default y
+
+config KAS_INCLUDE_PACKAGE_HELLO
+ string
+ default "kas/package/pkg_hello.yaml"
+ depends on PACKAGE_HELLO
+
+
+config PACKAGE_HELLO_ISAR
+ bool "hello-isar"
+ default y
+
+config KAS_INCLUDE_PACKAGE_HELLO_ISAR
+ string
+ default "kas/package/pkg_hello-isar.yaml"
+ depends on PACKAGE_HELLO_ISAR
+
+
+config PACKAGE_ISAR_EXCLUDE_DOCS
+ bool "isar-exclude-docs"
+ default y
+
+config KAS_INCLUDE_PACKAGE_ISAR_EXCLUDE_DOCS
+ string
+ default "kas/package/pkg_isar-exclude-docs.yaml"
+ depends on PACKAGE_ISAR_EXCLUDE_DOCS
+
+
+config PACKAGE_ISAR_DISABLE_APT_CACHE
+ bool "isar-disable-apt-cache"
+ default y
+
+config KAS_INCLUDE_PACKAGE_ISAR_DISABLE_APT_CACHE
+ string
+ default "kas/package/pkg_isar-disable-apt-cache.yaml"
+ depends on PACKAGE_ISAR_DISABLE_APT_CACHE
+
+
+config PACKAGE_KSELFTEST
+ bool "kselftest"
+ default n
+
+config KAS_INCLUDE_PACKAGE_KSELFTEST
+ string
+ default "kas/package/pkg_kselftest.yaml"
+ depends on PACKAGE_KSELFTEST
+
+
+config PACKAGE_SAMEFILE
+ bool "samefile"
+ default y
+
+config KAS_INCLUDE_PACKAGE_SAMEFILE
+ string
+ default "kas/package/pkg_samefile.yaml"
+ depends on PACKAGE_SAMEFILE
+
+
+config PACKAGE_SSHD_REGEN_KEYS
+ bool "sshd-regen-keys"
+ default y
+
+config KAS_INCLUDE_PACKAGE_SSHD_REGEN_KEYS
+ string
+ default "kas/package/pkg_sshd-regen-keys.yaml"
+ depends on PACKAGE_SSHD_REGEN_KEYS
+
+endmenu
+
+config KAS_IMAGE_PREINSTALL
+ string "Distro packages"
+ default "fdisk iproute2 iputils-ping ics-dhcp-client"
+ help
+ Space-separated list of packages that are provided by the selected distro.
+ These packages are downloaded from distro mirrors and just unpacked
+ and configured by Isar.
+
+config KAS_INCLUDE_PACKAGES_DISTRO
+ string
+ default "kas/package/packages-distro.yaml"
+
+endmenu
diff --git a/kas/package/packages-distro.yaml b/kas/package/packages-distro.yaml
new file mode 100644
index 00000000..d2fca914
--- /dev/null
+++ b/kas/package/packages-distro.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ packages-distro: |
+ IMAGE_PREINSTALL:append = " ${KAS_IMAGE_PREINSTALL}"
diff --git a/kas/package/pkg_cowsay.yaml b/kas/package/pkg_cowsay.yaml
new file mode 100644
index 00000000..8d647032
--- /dev/null
+++ b/kas/package/pkg_cowsay.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-cowsay: |
+ IMAGE_INSTALL:append = " cowsay"
diff --git a/kas/package/pkg_enable-fsck.yaml b/kas/package/pkg_enable-fsck.yaml
new file mode 100644
index 00000000..2b2770ea
--- /dev/null
+++ b/kas/package/pkg_enable-fsck.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-enable-fsck: |
+ IMAGE_INSTALL:append = " enable-fsck"
diff --git a/kas/package/pkg_example-module.yaml b/kas/package/pkg_example-module.yaml
new file mode 100644
index 00000000..e9d84b06
--- /dev/null
+++ b/kas/package/pkg_example-module.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-example-module: |
+ IMAGE_INSTALL:append = " example-module-${KERNEL_NAME}"
diff --git a/kas/package/pkg_example-prebuilt.yaml b/kas/package/pkg_example-prebuilt.yaml
new file mode 100644
index 00000000..0489448d
--- /dev/null
+++ b/kas/package/pkg_example-prebuilt.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-example-prebuilt: |
+ IMAGE_INSTALL:append = " example-prebuilt"
diff --git a/kas/package/pkg_example-raw.yaml b/kas/package/pkg_example-raw.yaml
new file mode 100644
index 00000000..cd5d6811
--- /dev/null
+++ b/kas/package/pkg_example-raw.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-example-raw: |
+ IMAGE_INSTALL:append = " example-raw"
diff --git a/kas/package/pkg_expand-on-first-boot.yaml b/kas/package/pkg_expand-on-first-boot.yaml
new file mode 100644
index 00000000..e54812e6
--- /dev/null
+++ b/kas/package/pkg_expand-on-first-boot.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-expand-on-first-boot: |
+ IMAGE_INSTALL:append = " expand-on-first-boot"
diff --git a/kas/package/pkg_hello-isar.yaml b/kas/package/pkg_hello-isar.yaml
new file mode 100644
index 00000000..20372daf
--- /dev/null
+++ b/kas/package/pkg_hello-isar.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-hello-isar: |
+ IMAGE_INSTALL:append = " hello-isar"
diff --git a/kas/package/pkg_hello.yaml b/kas/package/pkg_hello.yaml
new file mode 100644
index 00000000..f6cf2a97
--- /dev/null
+++ b/kas/package/pkg_hello.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-hello: |
+ IMAGE_INSTALL:append = " hello"
diff --git a/kas/package/pkg_isar-disable-apt-cache.yaml b/kas/package/pkg_isar-disable-apt-cache.yaml
new file mode 100644
index 00000000..497c48b0
--- /dev/null
+++ b/kas/package/pkg_isar-disable-apt-cache.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-isar-disable-apt-cache: |
+ IMAGE_INSTALL:append = " isar-disable-apt-cache"
diff --git a/kas/package/pkg_isar-exclude-docs.yaml b/kas/package/pkg_isar-exclude-docs.yaml
new file mode 100644
index 00000000..34c761d6
--- /dev/null
+++ b/kas/package/pkg_isar-exclude-docs.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-isar-exclude-docs: |
+ IMAGE_INSTALL:append = " isar-exclude-docs"
diff --git a/kas/package/pkg_kselftest.yaml b/kas/package/pkg_kselftest.yaml
new file mode 100644
index 00000000..ba925111
--- /dev/null
+++ b/kas/package/pkg_kselftest.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-kselftest: |
+ IMAGE_INSTALL:append = " kselftest"
diff --git a/kas/package/pkg_samefile.yaml b/kas/package/pkg_samefile.yaml
new file mode 100644
index 00000000..b5edaa22
--- /dev/null
+++ b/kas/package/pkg_samefile.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-samefile: |
+ IMAGE_INSTALL:append = " samefile"
diff --git a/kas/package/pkg_sshd-regen-keys.yaml b/kas/package/pkg_sshd-regen-keys.yaml
new file mode 100644
index 00000000..f14e2a12
--- /dev/null
+++ b/kas/package/pkg_sshd-regen-keys.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-sshd-regen-keys: |
+ IMAGE_INSTALL:append = " sshd-regen-keys"
--
2.20.1

Uladzimir Bely

unread,
Sep 19, 2023, 7:56:46 AM9/19/23
to isar-...@googlegroups.com
This adds an option to the menu that can enable or disable
COMPAT_ARCH support for amd64 and arm64 architectures.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 9 +++++++++
kas/opt/compat-arch.yaml | 7 +++++++
2 files changed, 16 insertions(+)
create mode 100644 kas/opt/compat-arch.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 1f04d1ba..273803f7 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -34,3 +34,12 @@ config KAS_INCLUDE_MIRROR_UBUNTU
depends on MIRROR_UBUNTU

endmenu
+
+
+config COMPAT_ARCH
+ bool "Enable compat arch support"
+
+config KAS_INCLUDE_COMPAT_ARCH
+ string
+ default "kas/opt/compat-arch.yaml"
+ depends on COMPAT_ARCH
diff --git a/kas/opt/compat-arch.yaml b/kas/opt/compat-arch.yaml
new file mode 100644
index 00000000..9dbb354a
--- /dev/null
+++ b/kas/opt/compat-arch.yaml
@@ -0,0 +1,7 @@
+header:
+ version: 14
+
+local_conf_header:

Uladzimir Bely

unread,
Sep 19, 2023, 7:56:47 AM9/19/23
to isar-...@googlegroups.com
This allows to enable 'root' and 'isar' users and set their passwords.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 40 ++++++++++++++++++++++++++++++++++++++++
kas/opt/user-isar.yaml | 16 ++++++++++++++++
kas/opt/user-root.yaml | 8 ++++++++
3 files changed, 64 insertions(+)
create mode 100644 kas/opt/user-isar.yaml
create mode 100644 kas/opt/user-root.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 344a0b91..15f19bc7 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -36,6 +36,46 @@ config KAS_INCLUDE_MIRROR_UBUNTU
endmenu


+menu "User management"
+
+config USER_ROOT
+ bool "Activate 'root' user"
+ help
+ Enables root user.
+
+config KAS_USER_ROOT_PASSWORD
+ string "Password for 'root' user"
+ default "root"
+ depends on USER_ROOT
+ help
+ Set password for 'root' user.
+
+config KAS_INCLUDE_USER_ROOT
+ string
+ default "kas/opt/user-root.yaml"
+ depends on USER_ROOT
+
+
+config USER_ISAR
+ bool "Activate 'isar' user"
+ default y
+ help
+ Enables `isar` user.
+
+config KAS_USER_ISAR_PASSWORD
+ string "Password for 'isar' user"
+ default "isar"
+ depends on USER_ISAR
+ help
+ Set password for 'isar' user.
+
+config KAS_INCLUDE_USER_ISAR
+ string
+ default "kas/opt/user-isar.yaml"
+ depends on USER_ISAR
+
+endmenu
+
config KAS_IMAGE_FSTYPES
string "Additional image fstypes"
default ""
diff --git a/kas/opt/user-isar.yaml b/kas/opt/user-isar.yaml
new file mode 100644
index 00000000..f249e4e7
--- /dev/null
+++ b/kas/opt/user-isar.yaml
@@ -0,0 +1,16 @@
+header:
+ version: 14
+
+local_conf_header:
+ user-isar: |
+ GROUPS += "isar"
+ GROUP_isar[flags] = "system"
+
+ USERS += "isar"
+ USER_isar[gid] = "isar"
+ USER_isar[home] = "/var/lib/isar"
+ USER_isar[comment] = "My isar user"
+ USER_isar[flags] = "system create-home"
+
+ USER_isar[password] = "${KAS_USER_ISAR_PASSWORD}"
+ USER_isar[flags] += "clear-text-password"
diff --git a/kas/opt/user-root.yaml b/kas/opt/user-root.yaml
new file mode 100644
index 00000000..88cc7e95
--- /dev/null
+++ b/kas/opt/user-root.yaml
@@ -0,0 +1,8 @@
+header:
+ version: 14
+
+local_conf_header:
+ user-root: |
+ USERS += "root"
+ USER_root[password] ??= "${KAS_USER_ROOT_PASSWORD}"
+ USER_root[flags] += "clear-text-password"
--
2.20.1

Uladzimir Bely

unread,
Sep 19, 2023, 7:56:47 AM9/19/23
to isar-...@googlegroups.com
This makes possible to adjust IMAGE_FSTYPES variable.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 24 ++++++++++++++++++++++++
kas/opt/image-fstypes.yaml | 6 ++++++
2 files changed, 30 insertions(+)
create mode 100644 kas/opt/image-fstypes.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 1909a915..d4a1de38 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -36,6 +36,30 @@ config KAS_INCLUDE_MIRROR_UBUNTU
endmenu


+config KAS_IMAGE_FSTYPES
+ string "Additional image fstypes"
+ default ""
+ help
+ Space-separated list of additional image fstypes to generate. Default
+ machine configurations set up IMAGE_FSTYPES variable, but it's possible
+ to select additonal ones to generate.
+ The following IMAGE_FSTYPES are supported:
+ cpio
+ fit
+ docker-archive
+ ext4
+ ova
+ tar
+ ubi
+ ubifs
+ wic
+ They can be followed by suffixes like ".gz" for compressing the image
+
+config KAS_INCLUDE_IMAGE_FSTYPES
+ string
+ default "kas/opt/image-fstypes.yaml"
+
+
config COMPAT_ARCH
bool "Enable compat arch support"

diff --git a/kas/opt/image-fstypes.yaml b/kas/opt/image-fstypes.yaml
new file mode 100644
index 00000000..b87f1abd
--- /dev/null
+++ b/kas/opt/image-fstypes.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ image-fstypes: |
+ IMAGE_FSTYPES:append = " ${KAS_IMAGE_FSTYPES}"
--
2.20.1

Uladzimir Bely

unread,
Sep 19, 2023, 7:56:47 AM9/19/23
to isar-...@googlegroups.com
This allows to choose between base and debug Isar image.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
Kconfig | 1 +
kas/image/Kconfig | 26 ++++++++++++++++++++++++++
kas/image/isar-image-base.yaml | 5 +++++
kas/image/isar-image-debug.yaml | 5 +++++
kas/isar.yaml | 3 ---
5 files changed, 37 insertions(+), 3 deletions(-)
create mode 100644 kas/image/Kconfig
create mode 100644 kas/image/isar-image-base.yaml
create mode 100644 kas/image/isar-image-debug.yaml

diff --git a/Kconfig b/Kconfig
index 0d54ea52..59fd8fed 100644
--- a/Kconfig
+++ b/Kconfig
@@ -10,5 +10,6 @@ config KAS_BUILD_SYSTEM

source "kas/distro/Kconfig"
source "kas/machine/Kconfig"
+source "kas/image/Kconfig"
source "kas/package/Kconfig"
source "kas/opt/Kconfig"
diff --git a/kas/image/Kconfig b/kas/image/Kconfig
new file mode 100644
index 00000000..1b37025f
--- /dev/null
+++ b/kas/image/Kconfig
@@ -0,0 +1,26 @@
+menu "Image type selection"
+
+choice
+ prompt "Image type selection"
+ default IMAGE_BASE
+
+config IMAGE_BASE
+ bool "Base image"
+ help
+ This is the basic Isar image with bare minimum of preinstalled packages.
+ It's technically close do the debootstrapped system with packages
+ required to boot up the system.
+
+config IMAGE_DEBUG
+ bool "Debug image"
+ help
+ This image includes some tools preinstalled useful for debug.
+
+endchoice
+
+config KAS_INCLUDE_IMAGE
+ string
+ default "kas/image/isar-image-base.yaml" if IMAGE_BASE
+ default "kas/image/isar-image-debug.yaml" if IMAGE_DEBUG
+
+endmenu
diff --git a/kas/image/isar-image-base.yaml b/kas/image/isar-image-base.yaml
new file mode 100644
index 00000000..bf0d4dab
--- /dev/null
+++ b/kas/image/isar-image-base.yaml
@@ -0,0 +1,5 @@
+header:
+ version: 14
+
+target:
+- isar-image-base
diff --git a/kas/image/isar-image-debug.yaml b/kas/image/isar-image-debug.yaml
new file mode 100644
index 00000000..92125203
--- /dev/null
+++ b/kas/image/isar-image-debug.yaml
@@ -0,0 +1,5 @@
+header:
+ version: 14
+
+target:
+- isar-image-debug
diff --git a/kas/isar.yaml b/kas/isar.yaml
index 500bf1d4..47cbc290 100644
--- a/kas/isar.yaml
+++ b/kas/isar.yaml
@@ -3,9 +3,6 @@ header:

build_system: isar

-target:
-- isar-image-base
-
repos:
isar:
layers:
--
2.20.1

Uladzimir Bely

unread,
Sep 19, 2023, 7:56:47 AM9/19/23
to isar-...@googlegroups.com
This adds an option to the menu that allows to enable support
of cross-compilation via ISAR_CROSS_COMPILE variable.

The option is enabled by default.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 10 ++++++++++
kas/opt/crosscompile.yaml | 6 ++++++
2 files changed, 16 insertions(+)
create mode 100644 kas/opt/crosscompile.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 273803f7..47cff1c4 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -43,3 +43,13 @@ config KAS_INCLUDE_COMPAT_ARCH
string
default "kas/opt/compat-arch.yaml"
depends on COMPAT_ARCH
+
+
+config ISAR_CROSS_COMPILE
+ bool "Enable cross compilation mode"
+ default y
+
+config KAS_INCLUDE_ISAR_CROSS_COMPILE
+ string
+ default "kas/opt/crosscompile.yaml"
+ depends on ISAR_CROSS_COMPILE
diff --git a/kas/opt/crosscompile.yaml b/kas/opt/crosscompile.yaml
new file mode 100644
index 00000000..6fdf94d8
--- /dev/null
+++ b/kas/opt/crosscompile.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ crosscompile: |
+ ISAR_CROSS_COMPILE = "1"
--
2.20.1

Uladzimir Bely

unread,
Sep 19, 2023, 7:56:48 AM9/19/23
to isar-...@googlegroups.com
This allows user to select this option in the menu.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 12 ++++++++++++
kas/opt/cache-deb-src.yaml | 6 ++++++
2 files changed, 18 insertions(+)
create mode 100644 kas/opt/cache-deb-src.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index d4a1de38..344a0b91 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -87,3 +87,15 @@ config KAS_INCLUDE_USE_CCACHE
string
default "kas/opt/ccache.yaml"
depends on USE_CCACHE
+
+
+config CACHE_DEB_SRC
+ bool "Cache all source packages"
+ help
+ This feature allows to download srcpackages for any binary package that
+ took part in the build (including ones downloaded from distro mirrors).
+
+config KAS_INCLUDE_CACHE_DEB_SRC
+ string
+ default "kas/opt/cache-deb-src.yaml"
+ depends on CACHE_DEB_SRC
diff --git a/kas/opt/cache-deb-src.yaml b/kas/opt/cache-deb-src.yaml
new file mode 100644
index 00000000..2030c90e
--- /dev/null
+++ b/kas/opt/cache-deb-src.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:

Uladzimir Bely

unread,
Sep 19, 2023, 7:56:48 AM9/19/23
to isar-...@googlegroups.com
Add a brief description of `kas-container` usage.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
README.md | 3 +++
kas/README.md | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+)
create mode 100644 kas/README.md

diff --git a/README.md b/README.md
index 118acf52..f549aa9f 100644
--- a/README.md
+++ b/README.md
@@ -11,6 +11,9 @@ https://github.com/ilbers/isar/

Instruction on how to build can be found in the [User Manual](doc/user_manual.md).

+For beginners, it could be easier to use kas-based approach that allows to
+simply configure and run build using menu. Look at [kas/README](kas/README.md)
+for the instructions.

# Try

diff --git a/kas/README.md b/kas/README.md
new file mode 100644
index 00000000..d821f0c8
--- /dev/null
+++ b/kas/README.md
@@ -0,0 +1,36 @@
+# Support of kas
+
+[kas](https://github.com/siemens/kas) is a tool to setup bitbake based projects.
+
+Directory `kas` contains required configuration fragments to setup and build
+Isar with `kas-container` script and Kconfig language.
+
+## Requirements
+
+Since kas uses Docker or Podman based containers, users that runs Isar build
+using `kas-container` script should be allowed to run these containers in
+privileged mode.
+
+## Configuring Isar build
+
+```
+./kas/kas-container menu
+```
+
+This creates `.config.yaml` file in isar root that stores the configuration.
+
+
+## Building Isar after configuration done
+
+```
+./kas/kas-container build
+```
+
+This generates `build/conf/` configuration and starts building Isar using
+kas container. Required image will be downloaded if not yet).
+
+To access bulid shell, the following command can be used:
+
+```
+./kas/kas-container shell
+```
--
2.20.1

Jan Kiszka

unread,
Sep 19, 2023, 8:05:05 AM9/19/23
to Uladzimir Bely, isar-...@googlegroups.com
.config.yaml* (to catch also .config.yaml.old).

And we should ignore the kas workdir (build).

Uladzimir Bely

unread,
Sep 20, 2023, 2:54:25 AM9/20/23
to isar-...@googlegroups.com
This patchset adds YAML fragments and Kconfig files to support
configuring Isar using `kas-container menu` and building it
with 'kas-container script`.

This patchset can be treated as a reply to
`https://groups.google.com/g/isar-users/c/GgMvGOkXkcg` request.

Changes since v2:
- Added kas build dir and config under .gitignore.

Changes since v1:
- Simplified deps between distros and machines, removed separate
patch that added redundand DEB_<distro> vars.
- Fixed dependencies in mirror selection block.
- Separate menu items for selecting Isar packages.
- Fix warnings related wrong path to isar.yml file.
- Cleartext password used for root now.
- Use `.yaml` file extensions instead of `.yml`.

Uladzimir Bely (12):
kas: Add initial Kconfig support
kas: Add a local copy of kas-container script
kas: Add mirror selection
kas: Add packages selection
kas: Add COMPAT_ARCH support
kas: Add cross compilation mode selection support
kas: Add ccache option
kas: Add image type selection
kas: Add IMAGE_FSTYPES selection
kas: Support CACHE_DEB_SRC option in menu
kas: Add options to activate predefined users
kas: Add kas/README.md

.gitignore | 2 +
Kconfig | 15 +
README.md | 3 +
kas/README.md | 36 ++
kas/distro/Kconfig | 40 ++
kas/distro/debian-bookworm.yaml | 4 +
kas/distro/debian-bullseye.yaml | 4 +
kas/distro/debian-buster.yaml | 4 +
kas/distro/debian-sid-ports.yaml | 4 +
kas/distro/raspios-bullseye.yaml | 4 +
kas/distro/ubuntu-focal.yaml | 4 +
kas/distro/ubuntu-jammy.yaml | 4 +
kas/image/Kconfig | 26 +
kas/image/isar-image-base.yaml | 5 +
kas/image/isar-image-debug.yaml | 5 +
kas/isar.yaml | 15 +
kas/kas-container | 562 ++++++++++++++++++++
kas/machine/Kconfig | 127 +++++
kas/machine/bananapi.yaml | 4 +
kas/machine/container-amd64.yaml | 4 +
kas/machine/de0-nano-soc.yaml | 4 +
kas/machine/hikey.yaml | 4 +
kas/machine/imx6-sabrelite.yaml | 4 +
kas/machine/nanopi-neo.yaml | 4 +
kas/machine/phyboard-mira.yaml | 4 +
kas/machine/qemuamd64-sb.yaml | 4 +
kas/machine/qemuamd64.yaml | 4 +
kas/machine/qemuarm.yaml | 4 +
kas/machine/qemuarm64.yaml | 4 +
kas/machine/qemui386.yaml | 4 +
kas/machine/qemumipsel.yaml | 4 +
kas/machine/qemuriscv64.yaml | 4 +
kas/machine/rpi-arm-v7.yaml | 4 +
kas/machine/rpi-arm-v7l.yaml | 4 +
kas/machine/rpi-arm.yaml | 4 +
kas/machine/rpi-arm64-v8.yaml | 4 +
kas/machine/sifive-fu540.yaml | 4 +
kas/machine/starfive-visionfive2.yaml | 4 +
kas/machine/stm32mp15x.yaml | 4 +
kas/machine/virtualbox.yaml | 4 +
kas/machine/vmware.yaml | 4 +
kas/opt/Kconfig | 141 +++++
kas/opt/cache-deb-src.yaml | 6 +
kas/opt/ccache.yaml | 6 +
kas/opt/compat-arch.yaml | 7 +
kas/opt/crosscompile.yaml | 6 +
kas/opt/image-fstypes.yaml | 6 +
kas/opt/mirror-debian.yaml | 7 +
kas/opt/mirror-ubuntu.yaml | 7 +
kas/opt/packages-distro.yaml | 6 +
kas/opt/packages-isar.yaml | 6 +
kas/opt/user-isar.yaml | 16 +
kas/opt/user-root.yaml | 8 +
kas/package/Kconfig | 148 ++++++
kas/package/packages-distro.yaml | 6 +
kas/package/pkg_cowsay.yaml | 6 +
kas/package/pkg_enable-fsck.yaml | 6 +
kas/package/pkg_example-module.yaml | 6 +
kas/package/pkg_example-prebuilt.yaml | 6 +
kas/package/pkg_example-raw.yaml | 6 +
kas/package/pkg_expand-on-first-boot.yaml | 6 +
kas/package/pkg_hello-isar.yaml | 6 +
kas/package/pkg_hello.yaml | 6 +
kas/package/pkg_isar-disable-apt-cache.yaml | 6 +
kas/package/pkg_isar-exclude-docs.yaml | 6 +
kas/package/pkg_kselftest.yaml | 6 +
kas/package/pkg_samefile.yaml | 6 +
kas/package/pkg_sshd-regen-keys.yaml | 6 +
68 files changed, 1410 insertions(+)
create mode 100644 Kconfig
create mode 100644 kas/README.md
create mode 100644 kas/distro/Kconfig
create mode 100644 kas/distro/debian-bookworm.yaml
create mode 100644 kas/distro/debian-bullseye.yaml
create mode 100644 kas/distro/debian-buster.yaml
create mode 100644 kas/distro/debian-sid-ports.yaml
create mode 100644 kas/distro/raspios-bullseye.yaml
create mode 100644 kas/distro/ubuntu-focal.yaml
create mode 100644 kas/distro/ubuntu-jammy.yaml
create mode 100644 kas/image/Kconfig
create mode 100644 kas/image/isar-image-base.yaml
create mode 100644 kas/image/isar-image-debug.yaml
create mode 100644 kas/isar.yaml
create mode 100755 kas/kas-container
create mode 100644 kas/machine/Kconfig
create mode 100644 kas/machine/bananapi.yaml
create mode 100644 kas/machine/container-amd64.yaml
create mode 100644 kas/machine/de0-nano-soc.yaml
create mode 100644 kas/machine/hikey.yaml
create mode 100644 kas/machine/imx6-sabrelite.yaml
create mode 100644 kas/machine/nanopi-neo.yaml
create mode 100644 kas/machine/phyboard-mira.yaml
create mode 100644 kas/machine/qemuamd64-sb.yaml
create mode 100644 kas/machine/qemuamd64.yaml
create mode 100644 kas/machine/qemuarm.yaml
create mode 100644 kas/machine/qemuarm64.yaml
create mode 100644 kas/machine/qemui386.yaml
create mode 100644 kas/machine/qemumipsel.yaml
create mode 100644 kas/machine/qemuriscv64.yaml
create mode 100644 kas/machine/rpi-arm-v7.yaml
create mode 100644 kas/machine/rpi-arm-v7l.yaml
create mode 100644 kas/machine/rpi-arm.yaml
create mode 100644 kas/machine/rpi-arm64-v8.yaml
create mode 100644 kas/machine/sifive-fu540.yaml
create mode 100644 kas/machine/starfive-visionfive2.yaml
create mode 100644 kas/machine/stm32mp15x.yaml
create mode 100644 kas/machine/virtualbox.yaml
create mode 100644 kas/machine/vmware.yaml
create mode 100644 kas/opt/Kconfig
create mode 100644 kas/opt/cache-deb-src.yaml
create mode 100644 kas/opt/ccache.yaml
create mode 100644 kas/opt/compat-arch.yaml
create mode 100644 kas/opt/crosscompile.yaml
create mode 100644 kas/opt/image-fstypes.yaml
create mode 100644 kas/opt/mirror-debian.yaml
create mode 100644 kas/opt/mirror-ubuntu.yaml
create mode 100644 kas/opt/packages-distro.yaml
create mode 100644 kas/opt/packages-isar.yaml
create mode 100644 kas/opt/user-isar.yaml
create mode 100644 kas/opt/user-root.yaml
create mode 100644 kas/package/Kconfig
create mode 100644 kas/package/packages-distro.yaml
create mode 100644 kas/package/pkg_cowsay.yaml
create mode 100644 kas/package/pkg_enable-fsck.yaml
create mode 100644 kas/package/pkg_example-module.yaml
create mode 100644 kas/package/pkg_example-prebuilt.yaml
create mode 100644 kas/package/pkg_example-raw.yaml
create mode 100644 kas/package/pkg_expand-on-first-boot.yaml
create mode 100644 kas/package/pkg_hello-isar.yaml
create mode 100644 kas/package/pkg_hello.yaml
create mode 100644 kas/package/pkg_isar-disable-apt-cache.yaml
create mode 100644 kas/package/pkg_isar-exclude-docs.yaml
create mode 100644 kas/package/pkg_kselftest.yaml
create mode 100644 kas/package/pkg_samefile.yaml
create mode 100644 kas/package/pkg_sshd-regen-keys.yaml

--
2.20.1

Uladzimir Bely

unread,
Sep 20, 2023, 2:54:26 AM9/20/23
to isar-...@googlegroups.com
Create required Kconfig files and appropriate YAML configuration
fragments for supporting initial build configuragion via
`kas-container menu`.

Since Isar does not support any possible combination of machines and
distros, there are particular dependencies between them exist.

User should select the distro first and after that it would be
possible to choose the board this distro supports.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
.gitignore | 2 +
Kconfig | 12 +++
kas/distro/Kconfig | 40 ++++++++
kas/distro/debian-bookworm.yaml | 4 +
kas/distro/debian-bullseye.yaml | 4 +
kas/distro/debian-buster.yaml | 4 +
kas/distro/debian-sid-ports.yaml | 4 +
kas/distro/raspios-bullseye.yaml | 4 +
kas/distro/ubuntu-focal.yaml | 4 +
kas/distro/ubuntu-jammy.yaml | 4 +
kas/isar.yaml | 18 ++++
kas/machine/Kconfig | 127 ++++++++++++++++++++++++++
kas/machine/bananapi.yaml | 4 +
kas/machine/container-amd64.yaml | 4 +
kas/machine/de0-nano-soc.yaml | 4 +
kas/machine/hikey.yaml | 4 +
kas/machine/imx6-sabrelite.yaml | 4 +
kas/machine/nanopi-neo.yaml | 4 +
kas/machine/phyboard-mira.yaml | 4 +
kas/machine/qemuamd64-sb.yaml | 4 +
kas/machine/qemuamd64.yaml | 4 +
kas/machine/qemuarm.yaml | 4 +
kas/machine/qemuarm64.yaml | 4 +
kas/machine/qemui386.yaml | 4 +
kas/machine/qemumipsel.yaml | 4 +
kas/machine/qemuriscv64.yaml | 4 +
kas/machine/rpi-arm-v7.yaml | 4 +
kas/machine/rpi-arm-v7l.yaml | 4 +
kas/machine/rpi-arm.yaml | 4 +
kas/machine/rpi-arm64-v8.yaml | 4 +
kas/machine/sifive-fu540.yaml | 4 +
kas/machine/starfive-visionfive2.yaml | 4 +
kas/machine/stm32mp15x.yaml | 4 +
kas/machine/virtualbox.yaml | 4 +
kas/machine/vmware.yaml | 4 +
35 files changed, 319 insertions(+)
create mode 100644 Kconfig
create mode 100644 kas/distro/Kconfig
create mode 100644 kas/distro/debian-bookworm.yaml
create mode 100644 kas/distro/debian-bullseye.yaml
create mode 100644 kas/distro/debian-buster.yaml
create mode 100644 kas/distro/debian-sid-ports.yaml
create mode 100644 kas/distro/raspios-bullseye.yaml
create mode 100644 kas/distro/ubuntu-focal.yaml
create mode 100644 kas/distro/ubuntu-jammy.yaml
create mode 100644 kas/isar.yaml
create mode 100644 kas/machine/Kconfig
create mode 100644 kas/machine/bananapi.yaml
create mode 100644 kas/machine/container-amd64.yaml
create mode 100644 kas/machine/de0-nano-soc.yaml
create mode 100644 kas/machine/hikey.yaml
create mode 100644 kas/machine/imx6-sabrelite.yaml
create mode 100644 kas/machine/nanopi-neo.yaml
create mode 100644 kas/machine/phyboard-mira.yaml
create mode 100644 kas/machine/qemuamd64-sb.yaml
create mode 100644 kas/machine/qemuamd64.yaml
create mode 100644 kas/machine/qemuarm.yaml
create mode 100644 kas/machine/qemuarm64.yaml
create mode 100644 kas/machine/qemui386.yaml
create mode 100644 kas/machine/qemumipsel.yaml
create mode 100644 kas/machine/qemuriscv64.yaml
create mode 100644 kas/machine/rpi-arm-v7.yaml
create mode 100644 kas/machine/rpi-arm-v7l.yaml
create mode 100644 kas/machine/rpi-arm.yaml
create mode 100644 kas/machine/rpi-arm64-v8.yaml
create mode 100644 kas/machine/sifive-fu540.yaml
create mode 100644 kas/machine/starfive-visionfive2.yaml
create mode 100644 kas/machine/stm32mp15x.yaml
create mode 100644 kas/machine/virtualbox.yaml
create mode 100644 kas/machine/vmware.yaml

diff --git a/.gitignore b/.gitignore
index 2525d41e..b1b51dd4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
*~
/*.patch
__pycache__
+.config.yaml*
+build/
diff --git a/Kconfig b/Kconfig
new file mode 100644
index 00000000..624237a5
--- /dev/null
+++ b/Kconfig
@@ -0,0 +1,12 @@
+mainmenu "Isar configuration"
+
+config KAS_INCLUDE_MAIN
+ string
+ default "kas/isar.yaml"
+
+config KAS_BUILD_SYSTEM
+ string
+ default "isar"
+
+source "kas/distro/Kconfig"
+source "kas/machine/Kconfig"
diff --git a/kas/distro/Kconfig b/kas/distro/Kconfig
new file mode 100644
index 00000000..58464c8c
--- /dev/null
+++ b/kas/distro/Kconfig
@@ -0,0 +1,40 @@
+menu "Distro selection"
+
+choice
new file mode 100644
index 00000000..0f49e01a
--- /dev/null
+++ b/kas/distro/debian-bookworm.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+distro: debian-bookworm
diff --git a/kas/distro/debian-bullseye.yaml b/kas/distro/debian-bullseye.yaml
new file mode 100644
index 00000000..f2e13dc4
--- /dev/null
+++ b/kas/distro/debian-bullseye.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+distro: debian-bullseye
diff --git a/kas/distro/debian-buster.yaml b/kas/distro/debian-buster.yaml
new file mode 100644
index 00000000..35f6fd79
--- /dev/null
+++ b/kas/distro/debian-buster.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+distro: debian-buster
diff --git a/kas/distro/debian-sid-ports.yaml b/kas/distro/debian-sid-ports.yaml
new file mode 100644
index 00000000..fafc438d
--- /dev/null
+++ b/kas/distro/debian-sid-ports.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+distro: debian-sid-ports
diff --git a/kas/distro/raspios-bullseye.yaml b/kas/distro/raspios-bullseye.yaml
new file mode 100644
index 00000000..941fa8f4
--- /dev/null
+++ b/kas/distro/raspios-bullseye.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+distro: raspios-bullseye
diff --git a/kas/distro/ubuntu-focal.yaml b/kas/distro/ubuntu-focal.yaml
new file mode 100644
index 00000000..facfd7a1
--- /dev/null
+++ b/kas/distro/ubuntu-focal.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+distro: ubuntu-focal
diff --git a/kas/distro/ubuntu-jammy.yaml b/kas/distro/ubuntu-jammy.yaml
new file mode 100644
index 00000000..c82539a3
--- /dev/null
+++ b/kas/distro/ubuntu-jammy.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+distro: ubuntu-jammy
diff --git a/kas/isar.yaml b/kas/isar.yaml
new file mode 100644
index 00000000..500bf1d4
--- /dev/null
+++ b/kas/isar.yaml
@@ -0,0 +1,18 @@
+header:
+ version: 14
+
+build_system: isar
+
+target:
+- isar-image-base
+
+repos:
+ isar:
+ layers:
+ meta:
+ meta-isar:
+
+bblayers_conf_header:
+ standard: |
+ BBPATH = "${TOPDIR}"
+ BBFILES ?= ""
diff --git a/kas/machine/Kconfig b/kas/machine/Kconfig
new file mode 100644
index 00000000..e1fdafca
--- /dev/null
+++ b/kas/machine/Kconfig
@@ -0,0 +1,127 @@
+menu "Machine selection"
+
+choice
+ prompt "Machine selection"
+ default MACHINE_QEMU_AMD64
+
+config MACHINE_BANANAPI
+ bool "bananapi"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_CONTAINER_AMD64
+ bool "container-amd64"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_DE0_NANO_SOC
+ bool "de0-nano-soc"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_HIKEY
+ bool "hikey"
+ depends on DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_IMX6_SABRELITE
+ bool "imx6-sabrelite"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_IMX6_NANOPI_NEO
+ bool "nanopi-neo"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_PHIBOARD_MIRA
+ bool "phyboard-mira"
+ depends on DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_QEMU_AMD64_SB
+ bool "qemuamd64-sb"
+ depends on DEBIAN_BULLSEYE
+
+config MACHINE_QEMU_AMD64
+ bool "qemuamd64"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM || UBUNTU_FOCAL || UBUNTU_JAMMY
+
+config MACHINE_QEMU_ARM
+ bool "qemuarm"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_QEMU_ARM64
+ bool "qemuarm64"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM || UBUNTU_FOCAL || UBUNTU_JAMMY
+
+config MACHINE_QEMU_I386
+ bool "qemui386"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_QEMU_MIPSEL
+ bool "qemumipsel"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
new file mode 100644
index 00000000..e11caa87
--- /dev/null
+++ b/kas/machine/bananapi.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: bananapi
diff --git a/kas/machine/container-amd64.yaml b/kas/machine/container-amd64.yaml
new file mode 100644
index 00000000..93e47891
--- /dev/null
+++ b/kas/machine/container-amd64.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: container-amd64
diff --git a/kas/machine/de0-nano-soc.yaml b/kas/machine/de0-nano-soc.yaml
new file mode 100644
index 00000000..7a1a6bf1
--- /dev/null
+++ b/kas/machine/de0-nano-soc.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: de0-nano-soc
diff --git a/kas/machine/hikey.yaml b/kas/machine/hikey.yaml
new file mode 100644
index 00000000..05c362f0
--- /dev/null
+++ b/kas/machine/hikey.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: hikey
diff --git a/kas/machine/imx6-sabrelite.yaml b/kas/machine/imx6-sabrelite.yaml
new file mode 100644
index 00000000..4ee7b027
--- /dev/null
+++ b/kas/machine/imx6-sabrelite.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: imx6-sabrelite
diff --git a/kas/machine/nanopi-neo.yaml b/kas/machine/nanopi-neo.yaml
new file mode 100644
index 00000000..53c3aae6
--- /dev/null
+++ b/kas/machine/nanopi-neo.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: nanopi-neo
diff --git a/kas/machine/phyboard-mira.yaml b/kas/machine/phyboard-mira.yaml
new file mode 100644
index 00000000..9601593d
--- /dev/null
+++ b/kas/machine/phyboard-mira.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: phyboard-mira
diff --git a/kas/machine/qemuamd64-sb.yaml b/kas/machine/qemuamd64-sb.yaml
new file mode 100644
index 00000000..41297fab
--- /dev/null
+++ b/kas/machine/qemuamd64-sb.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: qemuamd64-sb
diff --git a/kas/machine/qemuamd64.yaml b/kas/machine/qemuamd64.yaml
new file mode 100644
index 00000000..ff686de4
--- /dev/null
+++ b/kas/machine/qemuamd64.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: qemuamd64
diff --git a/kas/machine/qemuarm.yaml b/kas/machine/qemuarm.yaml
new file mode 100644
index 00000000..64674c01
--- /dev/null
+++ b/kas/machine/qemuarm.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: qemuarm
diff --git a/kas/machine/qemuarm64.yaml b/kas/machine/qemuarm64.yaml
new file mode 100644
index 00000000..03d7aba4
--- /dev/null
+++ b/kas/machine/qemuarm64.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: qemuarm64
diff --git a/kas/machine/qemui386.yaml b/kas/machine/qemui386.yaml
new file mode 100644
index 00000000..1b68a809
--- /dev/null
+++ b/kas/machine/qemui386.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: qemui386
diff --git a/kas/machine/qemumipsel.yaml b/kas/machine/qemumipsel.yaml
new file mode 100644
index 00000000..a90c9fd4
--- /dev/null
+++ b/kas/machine/qemumipsel.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: qemumipsel
diff --git a/kas/machine/qemuriscv64.yaml b/kas/machine/qemuriscv64.yaml
new file mode 100644
index 00000000..f6d9c478
--- /dev/null
+++ b/kas/machine/qemuriscv64.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: qemuriscv64
diff --git a/kas/machine/rpi-arm-v7.yaml b/kas/machine/rpi-arm-v7.yaml
new file mode 100644
index 00000000..4a1b7999
--- /dev/null
+++ b/kas/machine/rpi-arm-v7.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: rpi-arm-v7
diff --git a/kas/machine/rpi-arm-v7l.yaml b/kas/machine/rpi-arm-v7l.yaml
new file mode 100644
index 00000000..ffa5e7b4
--- /dev/null
+++ b/kas/machine/rpi-arm-v7l.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: rpi-arm-v7l
diff --git a/kas/machine/rpi-arm.yaml b/kas/machine/rpi-arm.yaml
new file mode 100644
index 00000000..eb942be2
--- /dev/null
+++ b/kas/machine/rpi-arm.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: rpi-arm
diff --git a/kas/machine/rpi-arm64-v8.yaml b/kas/machine/rpi-arm64-v8.yaml
new file mode 100644
index 00000000..c64afe38
--- /dev/null
+++ b/kas/machine/rpi-arm64-v8.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: rpi-arm64-v8
diff --git a/kas/machine/sifive-fu540.yaml b/kas/machine/sifive-fu540.yaml
new file mode 100644
index 00000000..009a02cf
--- /dev/null
+++ b/kas/machine/sifive-fu540.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: sifive-fu540
diff --git a/kas/machine/starfive-visionfive2.yaml b/kas/machine/starfive-visionfive2.yaml
new file mode 100644
index 00000000..75f36974
--- /dev/null
+++ b/kas/machine/starfive-visionfive2.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: starfive-visionfive2
diff --git a/kas/machine/stm32mp15x.yaml b/kas/machine/stm32mp15x.yaml
new file mode 100644
index 00000000..9af101af
--- /dev/null
+++ b/kas/machine/stm32mp15x.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: stm32mp15x
diff --git a/kas/machine/virtualbox.yaml b/kas/machine/virtualbox.yaml
new file mode 100644
index 00000000..d5768a62
--- /dev/null
+++ b/kas/machine/virtualbox.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: virtualbox
diff --git a/kas/machine/vmware.yaml b/kas/machine/vmware.yaml
new file mode 100644
index 00000000..cec23b3b
--- /dev/null
+++ b/kas/machine/vmware.yaml
@@ -0,0 +1,4 @@
+header:
+ version: 14
+
+machine: vmware
--
2.20.1

Uladzimir Bely

unread,
Sep 20, 2023, 2:54:27 AM9/20/23
to isar-...@googlegroups.com
Taken from revision `044c7d0` (tag `4.0`) of `kas` project [1].

Basic usage:

```
./kas/kas-container menu
./kas/kas-container build
./kas/kas-container shell
```

[1] https://github.com/siemens/kas

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---

Uladzimir Bely

unread,
Sep 20, 2023, 2:54:27 AM9/20/23
to isar-...@googlegroups.com
This part of configuration allows to choose which additional packages
(both from Isar and Debian) to include to the target image.

Isar packages are added to IMAGE_INSTALL since Debian packages go
to IMAGE_PREINSTALL.

The features are implemented as "string" parameter in the menu since
it reduces a number of required YAML fragments.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
Kconfig | 1 +
kas/opt/packages-distro.yaml | 6 +
kas/opt/packages-isar.yaml | 6 +
kas/package/Kconfig | 148 ++++++++++++++++++++
kas/package/packages-distro.yaml | 6 +
kas/package/pkg_cowsay.yaml | 6 +
kas/package/pkg_enable-fsck.yaml | 6 +
kas/package/pkg_example-module.yaml | 6 +
kas/package/pkg_example-prebuilt.yaml | 6 +
kas/package/pkg_example-raw.yaml | 6 +
kas/package/pkg_expand-on-first-boot.yaml | 6 +
kas/package/pkg_hello-isar.yaml | 6 +
kas/package/pkg_hello.yaml | 6 +
kas/package/pkg_isar-disable-apt-cache.yaml | 6 +
kas/package/pkg_isar-exclude-docs.yaml | 6 +
kas/package/pkg_kselftest.yaml | 6 +
kas/package/pkg_samefile.yaml | 6 +
kas/package/pkg_sshd-regen-keys.yaml | 6 +
18 files changed, 245 insertions(+)
create mode 100644 kas/opt/packages-distro.yaml
create mode 100644 kas/opt/packages-isar.yaml
create mode 100644 kas/package/Kconfig
create mode 100644 kas/package/packages-distro.yaml
create mode 100644 kas/package/pkg_cowsay.yaml
create mode 100644 kas/package/pkg_enable-fsck.yaml
create mode 100644 kas/package/pkg_example-module.yaml
create mode 100644 kas/package/pkg_example-prebuilt.yaml
create mode 100644 kas/package/pkg_example-raw.yaml
create mode 100644 kas/package/pkg_expand-on-first-boot.yaml
create mode 100644 kas/package/pkg_hello-isar.yaml
create mode 100644 kas/package/pkg_hello.yaml
create mode 100644 kas/package/pkg_isar-disable-apt-cache.yaml
create mode 100644 kas/package/pkg_isar-exclude-docs.yaml
create mode 100644 kas/package/pkg_kselftest.yaml
create mode 100644 kas/package/pkg_samefile.yaml
create mode 100644 kas/package/pkg_sshd-regen-keys.yaml

diff --git a/Kconfig b/Kconfig
index f48c56cf..0d54ea52 100644
--- a/Kconfig
+++ b/Kconfig
@@ -10,4 +10,5 @@ config KAS_BUILD_SYSTEM

source "kas/distro/Kconfig"
source "kas/machine/Kconfig"
+source "kas/package/Kconfig"
source "kas/opt/Kconfig"
diff --git a/kas/opt/packages-distro.yaml b/kas/opt/packages-distro.yaml
new file mode 100644
index 00000000..d2fca914
--- /dev/null
+++ b/kas/opt/packages-distro.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ packages-distro: |
+ IMAGE_PREINSTALL:append = " ${KAS_IMAGE_PREINSTALL}"
diff --git a/kas/opt/packages-isar.yaml b/kas/opt/packages-isar.yaml
new file mode 100644
index 00000000..c8da258d
--- /dev/null
+++ b/kas/opt/packages-isar.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ packages-isar: |
+ IMAGE_INSTALL:append = " ${KAS_IMAGE_INSTALL}"
diff --git a/kas/package/Kconfig b/kas/package/Kconfig
new file mode 100644
index 00000000..a5531167
--- /dev/null
+++ b/kas/package/Kconfig
@@ -0,0 +1,148 @@
+menu "Packages selection"
+
+menu "Isar packages"
+
+config PACKAGE_COWSAY
+ bool "cowsay"
+ default y
+
+config KAS_INCLUDE_PACKAGE_COWSAY
+ string
+ default "kas/package/pkg_cowsay.yaml"
+ depends on PACKAGE_COWSAY
+
+
+config PACKAGE_ENABLE_FSCK
+ bool "enable-fsck"
+ default y
+
+config KAS_INCLUDE_PACKAGE_ENABLE_FSCK
+ string
+ default "kas/package/pkg_enable-fsck.yaml"
+ depends on PACKAGE_ENABLE_FSCK
+
+
+config PACKAGE_EXAMPLE_RAW
+ bool "example-raw"
+ default y
+
+config KAS_INCLUDE_PACKAGE_EXAMPLE_RAW
+ string
+ default "kas/package/pkg_example-raw.yaml"
+ depends on PACKAGE_EXAMPLE_RAW
+
+
+config PACKAGE_EXAMPLE_MODULE
+ bool "example-module"
+ default y
+
+config KAS_INCLUDE_PACKAGE_EXAMPLE_MODULE
+ string
+ default "kas/package/pkg_example-module.yaml"
+ depends on PACKAGE_EXAMPLE_MODULE
+
+
+config PACKAGE_EXAMPLE_PREBUILT
+ bool "example-prebuilt"
+ default y
+
+config KAS_INCLUDE_PACKAGE_EXAMPLE_PREBUILT
+ string
+ default "kas/package/pkg_example-prebuilt.yaml"
+ depends on PACKAGE_EXAMPLE_PREBUILT
+
+
+config PACKAGE_EXPAND_ON_FIRST_BOOT
+ bool "expand-on-first-boot"
+ default y
+
+config KAS_INCLUDE_PACKAGE_EXPAND_ON_FIRST_BOOT
+ string
+ default "kas/package/pkg_expand-on-first-boot.yaml"
+ depends on PACKAGE_EXPAND_ON_FIRST_BOOT
+
+
+config PACKAGE_HELLO
+ bool "hello"
+ default y
+
+config KAS_INCLUDE_PACKAGE_HELLO
+ string
+ default "kas/package/pkg_hello.yaml"
+ depends on PACKAGE_HELLO
+
+
+config PACKAGE_HELLO_ISAR
+ bool "hello-isar"
+ default y
+
+config KAS_INCLUDE_PACKAGE_HELLO_ISAR
+ string
+ default "kas/package/pkg_hello-isar.yaml"
+ depends on PACKAGE_HELLO_ISAR
+
+
+config PACKAGE_ISAR_EXCLUDE_DOCS
+ bool "isar-exclude-docs"
+ default y
+
+config KAS_INCLUDE_PACKAGE_ISAR_EXCLUDE_DOCS
+ string
+ default "kas/package/pkg_isar-exclude-docs.yaml"
+ depends on PACKAGE_ISAR_EXCLUDE_DOCS
+
+
+config PACKAGE_ISAR_DISABLE_APT_CACHE
+ bool "isar-disable-apt-cache"
+ default y
+
+config KAS_INCLUDE_PACKAGE_ISAR_DISABLE_APT_CACHE
+ string
+ default "kas/package/pkg_isar-disable-apt-cache.yaml"
+ depends on PACKAGE_ISAR_DISABLE_APT_CACHE
+
+
+config PACKAGE_KSELFTEST
+ bool "kselftest"
+ default n
+
+config KAS_INCLUDE_PACKAGE_KSELFTEST
+ string
+ default "kas/package/pkg_kselftest.yaml"
+ depends on PACKAGE_KSELFTEST
+
+
+config PACKAGE_SAMEFILE
+ bool "samefile"
+ default y
+
+config KAS_INCLUDE_PACKAGE_SAMEFILE
+ string
+ default "kas/package/pkg_samefile.yaml"
+ depends on PACKAGE_SAMEFILE
+
+
+config PACKAGE_SSHD_REGEN_KEYS
+ bool "sshd-regen-keys"
+ default y
+
+config KAS_INCLUDE_PACKAGE_SSHD_REGEN_KEYS
+ string
+ default "kas/package/pkg_sshd-regen-keys.yaml"
+ depends on PACKAGE_SSHD_REGEN_KEYS
+
+endmenu
+
+config KAS_IMAGE_PREINSTALL
+ string "Distro packages"
+ default "fdisk iproute2 iputils-ping ics-dhcp-client"
+ help
+ Space-separated list of packages that are provided by the selected distro.
+ These packages are downloaded from distro mirrors and just unpacked
+ and configured by Isar.
+
+config KAS_INCLUDE_PACKAGES_DISTRO
+ string
+ default "kas/package/packages-distro.yaml"
+
+endmenu
diff --git a/kas/package/packages-distro.yaml b/kas/package/packages-distro.yaml
new file mode 100644
index 00000000..d2fca914
--- /dev/null
+++ b/kas/package/packages-distro.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ packages-distro: |
+ IMAGE_PREINSTALL:append = " ${KAS_IMAGE_PREINSTALL}"
diff --git a/kas/package/pkg_cowsay.yaml b/kas/package/pkg_cowsay.yaml
new file mode 100644
index 00000000..8d647032
--- /dev/null
+++ b/kas/package/pkg_cowsay.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-cowsay: |
+ IMAGE_INSTALL:append = " cowsay"
diff --git a/kas/package/pkg_enable-fsck.yaml b/kas/package/pkg_enable-fsck.yaml
new file mode 100644
index 00000000..2b2770ea
--- /dev/null
+++ b/kas/package/pkg_enable-fsck.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-enable-fsck: |
+ IMAGE_INSTALL:append = " enable-fsck"
diff --git a/kas/package/pkg_example-module.yaml b/kas/package/pkg_example-module.yaml
new file mode 100644
index 00000000..e9d84b06
--- /dev/null
+++ b/kas/package/pkg_example-module.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-example-module: |
+ IMAGE_INSTALL:append = " example-module-${KERNEL_NAME}"
diff --git a/kas/package/pkg_example-prebuilt.yaml b/kas/package/pkg_example-prebuilt.yaml
new file mode 100644
index 00000000..0489448d
--- /dev/null
+++ b/kas/package/pkg_example-prebuilt.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-example-prebuilt: |
+ IMAGE_INSTALL:append = " example-prebuilt"
diff --git a/kas/package/pkg_example-raw.yaml b/kas/package/pkg_example-raw.yaml
new file mode 100644
index 00000000..cd5d6811
--- /dev/null
+++ b/kas/package/pkg_example-raw.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-example-raw: |
+ IMAGE_INSTALL:append = " example-raw"
diff --git a/kas/package/pkg_expand-on-first-boot.yaml b/kas/package/pkg_expand-on-first-boot.yaml
new file mode 100644
index 00000000..e54812e6
--- /dev/null
+++ b/kas/package/pkg_expand-on-first-boot.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-expand-on-first-boot: |
+ IMAGE_INSTALL:append = " expand-on-first-boot"
diff --git a/kas/package/pkg_hello-isar.yaml b/kas/package/pkg_hello-isar.yaml
new file mode 100644
index 00000000..20372daf
--- /dev/null
+++ b/kas/package/pkg_hello-isar.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-hello-isar: |
+ IMAGE_INSTALL:append = " hello-isar"
diff --git a/kas/package/pkg_hello.yaml b/kas/package/pkg_hello.yaml
new file mode 100644
index 00000000..f6cf2a97
--- /dev/null
+++ b/kas/package/pkg_hello.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-hello: |
+ IMAGE_INSTALL:append = " hello"
diff --git a/kas/package/pkg_isar-disable-apt-cache.yaml b/kas/package/pkg_isar-disable-apt-cache.yaml
new file mode 100644
index 00000000..497c48b0
--- /dev/null
+++ b/kas/package/pkg_isar-disable-apt-cache.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-isar-disable-apt-cache: |
+ IMAGE_INSTALL:append = " isar-disable-apt-cache"
diff --git a/kas/package/pkg_isar-exclude-docs.yaml b/kas/package/pkg_isar-exclude-docs.yaml
new file mode 100644
index 00000000..34c761d6
--- /dev/null
+++ b/kas/package/pkg_isar-exclude-docs.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-isar-exclude-docs: |
+ IMAGE_INSTALL:append = " isar-exclude-docs"
diff --git a/kas/package/pkg_kselftest.yaml b/kas/package/pkg_kselftest.yaml
new file mode 100644
index 00000000..ba925111
--- /dev/null
+++ b/kas/package/pkg_kselftest.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-kselftest: |
+ IMAGE_INSTALL:append = " kselftest"
diff --git a/kas/package/pkg_samefile.yaml b/kas/package/pkg_samefile.yaml
new file mode 100644
index 00000000..b5edaa22
--- /dev/null
+++ b/kas/package/pkg_samefile.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:
+ package-samefile: |
+ IMAGE_INSTALL:append = " samefile"
diff --git a/kas/package/pkg_sshd-regen-keys.yaml b/kas/package/pkg_sshd-regen-keys.yaml
new file mode 100644
index 00000000..f14e2a12
--- /dev/null
+++ b/kas/package/pkg_sshd-regen-keys.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+

Uladzimir Bely

unread,
Sep 20, 2023, 2:54:28 AM9/20/23
to isar-...@googlegroups.com
This adds an option to the menu that can enable or disable
COMPAT_ARCH support for amd64 and arm64 architectures.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 9 +++++++++
kas/opt/compat-arch.yaml | 7 +++++++
2 files changed, 16 insertions(+)
create mode 100644 kas/opt/compat-arch.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 1f04d1ba..273803f7 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -34,3 +34,12 @@ config KAS_INCLUDE_MIRROR_UBUNTU
depends on MIRROR_UBUNTU

endmenu
+
+
+config COMPAT_ARCH
+ bool "Enable compat arch support"
+
+config KAS_INCLUDE_COMPAT_ARCH
+ string
+ default "kas/opt/compat-arch.yaml"
+ depends on COMPAT_ARCH
diff --git a/kas/opt/compat-arch.yaml b/kas/opt/compat-arch.yaml
new file mode 100644
index 00000000..9dbb354a
--- /dev/null
+++ b/kas/opt/compat-arch.yaml
@@ -0,0 +1,7 @@
+header:
+ version: 14
+
+local_conf_header:

Uladzimir Bely

unread,
Sep 20, 2023, 2:54:28 AM9/20/23
to isar-...@googlegroups.com
This allows to select better (faster) mirror for Debian and Ubuntu
distributions.

Isar DISTRO_APT_PREMIRRORS is used under the hood.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
Kconfig | 1 +
kas/opt/Kconfig | 36 ++++++++++++++++++++++++++++++++++++
kas/opt/mirror-debian.yaml | 7 +++++++
kas/opt/mirror-ubuntu.yaml | 7 +++++++
4 files changed, 51 insertions(+)
create mode 100644 kas/opt/Kconfig
create mode 100644 kas/opt/mirror-debian.yaml
create mode 100644 kas/opt/mirror-ubuntu.yaml

diff --git a/Kconfig b/Kconfig
index 624237a5..f48c56cf 100644
--- a/Kconfig
+++ b/Kconfig
@@ -10,3 +10,4 @@ config KAS_BUILD_SYSTEM

source "kas/distro/Kconfig"
source "kas/machine/Kconfig"
+source "kas/opt/Kconfig"
diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
new file mode 100644
index 00000000..1f04d1ba
--- /dev/null
+++ b/kas/opt/Kconfig
@@ -0,0 +1,36 @@
+menu "Mirror selection"
+
+config MIRROR_DEBIAN
+ bool "Use specific Debian mirror"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
new file mode 100644
index 00000000..ad708f2e
--- /dev/null
+++ b/kas/opt/mirror-debian.yaml
@@ -0,0 +1,7 @@
+header:
+ version: 14
+
+local_conf_header:
+ mirror-debian: |
+ DISTRO_APT_PREMIRRORS += "\
+ http://deb\.debian\.org ${MIRROR_DEBIAN_URL}\n"
diff --git a/kas/opt/mirror-ubuntu.yaml b/kas/opt/mirror-ubuntu.yaml
new file mode 100644
index 00000000..beb73d59
--- /dev/null
+++ b/kas/opt/mirror-ubuntu.yaml
@@ -0,0 +1,7 @@
+header:
+ version: 14
+
+local_conf_header:

Uladzimir Bely

unread,
Sep 20, 2023, 2:54:29 AM9/20/23
to isar-...@googlegroups.com
This adds an option to the menu that allows to enable or disable
ccache support for the build.

The option is enabled by default.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>

ccache
---
kas/opt/Kconfig | 10 ++++++++++
kas/opt/ccache.yaml | 6 ++++++
2 files changed, 16 insertions(+)
create mode 100644 kas/opt/ccache.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 47cff1c4..1909a915 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -53,3 +53,13 @@ config KAS_INCLUDE_ISAR_CROSS_COMPILE
string
default "kas/opt/crosscompile.yaml"
depends on ISAR_CROSS_COMPILE
+
+
+config USE_CCACHE
+ bool "Use ccache during build"
+ default y
+
+config KAS_INCLUDE_USE_CCACHE
+ string
+ default "kas/opt/ccache.yaml"
+ depends on USE_CCACHE
diff --git a/kas/opt/ccache.yaml b/kas/opt/ccache.yaml
new file mode 100644
index 00000000..7443dd8b
--- /dev/null
+++ b/kas/opt/ccache.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:

Uladzimir Bely

unread,
Sep 20, 2023, 2:54:29 AM9/20/23
to isar-...@googlegroups.com
This adds an option to the menu that allows to enable support
of cross-compilation via ISAR_CROSS_COMPILE variable.

The option is enabled by default.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 10 ++++++++++
kas/opt/crosscompile.yaml | 6 ++++++
2 files changed, 16 insertions(+)
create mode 100644 kas/opt/crosscompile.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 273803f7..47cff1c4 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -43,3 +43,13 @@ config KAS_INCLUDE_COMPAT_ARCH
string
default "kas/opt/compat-arch.yaml"
depends on COMPAT_ARCH
+
+
+config ISAR_CROSS_COMPILE
+ bool "Enable cross compilation mode"
+ default y
+
+config KAS_INCLUDE_ISAR_CROSS_COMPILE
+ string
+ default "kas/opt/crosscompile.yaml"
+ depends on ISAR_CROSS_COMPILE
diff --git a/kas/opt/crosscompile.yaml b/kas/opt/crosscompile.yaml
new file mode 100644
index 00000000..6fdf94d8
--- /dev/null
+++ b/kas/opt/crosscompile.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:

Uladzimir Bely

unread,
Sep 20, 2023, 2:54:30 AM9/20/23
to isar-...@googlegroups.com
This makes possible to adjust IMAGE_FSTYPES variable.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 24 ++++++++++++++++++++++++
kas/opt/image-fstypes.yaml | 6 ++++++
2 files changed, 30 insertions(+)
create mode 100644 kas/opt/image-fstypes.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 1909a915..d4a1de38 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -36,6 +36,30 @@ config KAS_INCLUDE_MIRROR_UBUNTU
endmenu


+config KAS_IMAGE_FSTYPES
+ string "Additional image fstypes"
+ default ""
+ help
+ Space-separated list of additional image fstypes to generate. Default
+ machine configurations set up IMAGE_FSTYPES variable, but it's possible
+ to select additonal ones to generate.
+ The following IMAGE_FSTYPES are supported:
+ cpio
+ fit
+ docker-archive
+ ext4
+ ova
+ tar
+ ubi
+ ubifs
+ wic
+ They can be followed by suffixes like ".gz" for compressing the image
+
+config KAS_INCLUDE_IMAGE_FSTYPES
+ string
+ default "kas/opt/image-fstypes.yaml"
+
+
config COMPAT_ARCH
bool "Enable compat arch support"

diff --git a/kas/opt/image-fstypes.yaml b/kas/opt/image-fstypes.yaml
new file mode 100644
index 00000000..b87f1abd
--- /dev/null
+++ b/kas/opt/image-fstypes.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+
+local_conf_header:

Uladzimir Bely

unread,
Sep 20, 2023, 2:54:30 AM9/20/23
to isar-...@googlegroups.com
This allows to choose between base and debug Isar image.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
Kconfig | 1 +
kas/image/Kconfig | 26 ++++++++++++++++++++++++++
kas/image/isar-image-base.yaml | 5 +++++
kas/image/isar-image-debug.yaml | 5 +++++
kas/isar.yaml | 3 ---
5 files changed, 37 insertions(+), 3 deletions(-)
create mode 100644 kas/image/Kconfig
create mode 100644 kas/image/isar-image-base.yaml
create mode 100644 kas/image/isar-image-debug.yaml

diff --git a/Kconfig b/Kconfig
index 0d54ea52..59fd8fed 100644
--- a/Kconfig
+++ b/Kconfig
@@ -10,5 +10,6 @@ config KAS_BUILD_SYSTEM

source "kas/distro/Kconfig"
source "kas/machine/Kconfig"
+source "kas/image/Kconfig"
source "kas/package/Kconfig"
source "kas/opt/Kconfig"
diff --git a/kas/image/Kconfig b/kas/image/Kconfig
new file mode 100644
index 00000000..1b37025f
--- /dev/null
+++ b/kas/image/Kconfig
@@ -0,0 +1,26 @@
+menu "Image type selection"
+
+choice
+ prompt "Image type selection"
+ default IMAGE_BASE
+
+config IMAGE_BASE
+ bool "Base image"
+ help
+ This is the basic Isar image with bare minimum of preinstalled packages.
+ It's technically close do the debootstrapped system with packages
+ required to boot up the system.
+
+config IMAGE_DEBUG
+ bool "Debug image"
+ help
+ This image includes some tools preinstalled useful for debug.
+
+endchoice
+
+config KAS_INCLUDE_IMAGE
+ string
+ default "kas/image/isar-image-base.yaml" if IMAGE_BASE
+ default "kas/image/isar-image-debug.yaml" if IMAGE_DEBUG
+
+endmenu
diff --git a/kas/image/isar-image-base.yaml b/kas/image/isar-image-base.yaml
new file mode 100644
index 00000000..bf0d4dab
--- /dev/null
+++ b/kas/image/isar-image-base.yaml
@@ -0,0 +1,5 @@
+header:
+ version: 14
+
+target:
+- isar-image-base
diff --git a/kas/image/isar-image-debug.yaml b/kas/image/isar-image-debug.yaml
new file mode 100644
index 00000000..92125203
--- /dev/null
+++ b/kas/image/isar-image-debug.yaml
@@ -0,0 +1,5 @@
+header:
+ version: 14
+

Uladzimir Bely

unread,
Sep 20, 2023, 2:54:31 AM9/20/23
to isar-...@googlegroups.com
This allows user to select this option in the menu.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 12 ++++++++++++
kas/opt/cache-deb-src.yaml | 6 ++++++
2 files changed, 18 insertions(+)
create mode 100644 kas/opt/cache-deb-src.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index d4a1de38..344a0b91 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -87,3 +87,15 @@ config KAS_INCLUDE_USE_CCACHE
string
default "kas/opt/ccache.yaml"
depends on USE_CCACHE
+
+
+config CACHE_DEB_SRC
+ bool "Cache all source packages"
+ help
+ This feature allows to download srcpackages for any binary package that
+ took part in the build (including ones downloaded from distro mirrors).
+
+config KAS_INCLUDE_CACHE_DEB_SRC
+ string
+ default "kas/opt/cache-deb-src.yaml"
+ depends on CACHE_DEB_SRC
diff --git a/kas/opt/cache-deb-src.yaml b/kas/opt/cache-deb-src.yaml
new file mode 100644
index 00000000..2030c90e
--- /dev/null
+++ b/kas/opt/cache-deb-src.yaml
@@ -0,0 +1,6 @@
+header:
+ version: 14
+

Uladzimir Bely

unread,
Sep 20, 2023, 2:54:31 AM9/20/23
to isar-...@googlegroups.com
This allows to enable 'root' and 'isar' users and set their passwords.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 40 ++++++++++++++++++++++++++++++++++++++++
kas/opt/user-isar.yaml | 16 ++++++++++++++++
kas/opt/user-root.yaml | 8 ++++++++
3 files changed, 64 insertions(+)
create mode 100644 kas/opt/user-isar.yaml
create mode 100644 kas/opt/user-root.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 344a0b91..15f19bc7 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
new file mode 100644
index 00000000..f249e4e7
--- /dev/null
+++ b/kas/opt/user-isar.yaml
@@ -0,0 +1,16 @@
+header:
+ version: 14
+
+local_conf_header:
+ user-isar: |
+ GROUPS += "isar"
+ GROUP_isar[flags] = "system"
+
+ USERS += "isar"
+ USER_isar[gid] = "isar"
+ USER_isar[home] = "/var/lib/isar"
+ USER_isar[comment] = "My isar user"
+ USER_isar[flags] = "system create-home"
+
+ USER_isar[password] = "${KAS_USER_ISAR_PASSWORD}"
+ USER_isar[flags] += "clear-text-password"
diff --git a/kas/opt/user-root.yaml b/kas/opt/user-root.yaml
new file mode 100644
index 00000000..88cc7e95
--- /dev/null
+++ b/kas/opt/user-root.yaml
@@ -0,0 +1,8 @@
+header:
+ version: 14
+
+local_conf_header:

Uladzimir Bely

unread,
Sep 20, 2023, 2:54:33 AM9/20/23
to isar-...@googlegroups.com
Add a brief description of `kas-container` usage.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
README.md | 3 +++
kas/README.md | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+)
create mode 100644 kas/README.md

diff --git a/README.md b/README.md
index 118acf52..f549aa9f 100644
--- a/README.md
+++ b/README.md
@@ -11,6 +11,9 @@ https://github.com/ilbers/isar/

Instruction on how to build can be found in the [User Manual](doc/user_manual.md).

+For beginners, it could be easier to use kas-based approach that allows to
+simply configure and run build using menu. Look at [kas/README](kas/README.md)
+for the instructions.

# Try

diff --git a/kas/README.md b/kas/README.md
new file mode 100644

Uladzimir Bely

unread,
Sep 22, 2023, 5:10:22 AM9/22/23
to isar-...@googlegroups.com
Taken from revision `044c7d0` (tag `4.0`) of `kas` project [1].

Basic usage:

```
./kas/kas-container menu
./kas/kas-container build
./kas/kas-container shell
```

[1] https://github.com/siemens/kas

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---

Uladzimir Bely

unread,
Sep 22, 2023, 5:10:22 AM9/22/23
to isar-...@googlegroups.com
This patchset adds YAML fragments and Kconfig files to support
configuring Isar using `kas-container menu` and building it
with 'kas-container script`.

The patchset can be treated as a reply to
`https://groups.google.com/g/isar-users/c/GgMvGOkXkcg` request.

Changes since v3:
- Added copyright headers to .yaml and Kconfig files.
- Added script to generate kas yaml configs.

Changes since v2:
- Added kas build dir and config under .gitignore.

Changes since v1:
- Simplified deps between distros and machines, removed separate
patch that added redundand DEB_<distro> vars.
- Fixed dependencies in mirror selection block.
- Separate menu items for selecting Isar packages.
- Fix warnings related wrong path to isar.yml file.
- Cleartext password used for root now.
- Use `.yaml` file extensions instead of `.yml`.

Uladzimir Bely (13):
kas: Add initial Kconfig support
kas: Add a local copy of kas-container script
kas: Add mirror selection
kas: Add packages selection
kas: Add COMPAT_ARCH support
kas: Add cross compilation mode selection support
kas: Add ccache option
kas: Add image type selection
kas: Add IMAGE_FSTYPES selection
kas: Support CACHE_DEB_SRC option in menu
kas: Add options to activate predefined users
kas: Add kas/README.md
scripts: Add a script to generate kas yaml configs

.gitignore | 2 +
Kconfig | 21 +
README.md | 3 +
kas/README.md | 36 ++
kas/distro/Kconfig | 46 ++
kas/distro/debian-bookworm.yaml | 7 +
kas/distro/debian-bullseye.yaml | 7 +
kas/distro/debian-buster.yaml | 7 +
kas/distro/debian-sid-ports.yaml | 7 +
kas/distro/raspios-bullseye.yaml | 7 +
kas/distro/ubuntu-focal.yaml | 7 +
kas/distro/ubuntu-jammy.yaml | 7 +
kas/image/Kconfig | 32 ++
kas/image/isar-image-base.yaml | 7 +
kas/image/isar-image-debug.yaml | 7 +
kas/isar.yaml | 18 +
kas/kas-container | 562 ++++++++++++++++++++
kas/machine/Kconfig | 138 +++++
kas/machine/bananapi.yaml | 7 +
kas/machine/container-amd64.yaml | 7 +
kas/machine/de0-nano-soc.yaml | 7 +
kas/machine/hikey.yaml | 7 +
kas/machine/imx6-sabrelite.yaml | 7 +
kas/machine/nanopi-neo-efi.yaml | 7 +
kas/machine/nanopi-neo.yaml | 7 +
kas/machine/phyboard-mira.yaml | 7 +
kas/machine/qemuamd64-sb.yaml | 7 +
kas/machine/qemuamd64.yaml | 7 +
kas/machine/qemuarm.yaml | 7 +
kas/machine/qemuarm64.yaml | 7 +
kas/machine/qemui386.yaml | 7 +
kas/machine/qemumipsel.yaml | 7 +
kas/machine/qemuriscv64.yaml | 7 +
kas/machine/rpi-arm-v7.yaml | 7 +
kas/machine/rpi-arm-v7l.yaml | 7 +
kas/machine/rpi-arm.yaml | 7 +
kas/machine/rpi-arm64-v8.yaml | 7 +
kas/machine/sifive-fu540.yaml | 7 +
kas/machine/starfive-visionfive2.yaml | 7 +
kas/machine/stm32mp15x.yaml | 7 +
kas/machine/virtualbox.yaml | 7 +
kas/machine/vmware.yaml | 7 +
kas/opt/Kconfig | 147 +++++
kas/opt/cache-deb-src.yaml | 9 +
kas/opt/ccache.yaml | 9 +
kas/opt/compat-arch.yaml | 10 +
kas/opt/crosscompile.yaml | 9 +
kas/opt/image-fstypes.yaml | 9 +
kas/opt/mirror-debian.yaml | 10 +
kas/opt/mirror-ubuntu.yaml | 10 +
kas/opt/user-isar.yaml | 19 +
kas/opt/user-root.yaml | 11 +
kas/package/Kconfig | 154 ++++++
kas/package/packages-distro.yaml | 9 +
kas/package/pkg_cowsay.yaml | 9 +
kas/package/pkg_enable-fsck.yaml | 9 +
kas/package/pkg_example-module.yaml | 9 +
kas/package/pkg_example-prebuilt.yaml | 9 +
kas/package/pkg_example-raw.yaml | 9 +
kas/package/pkg_expand-on-first-boot.yaml | 9 +
kas/package/pkg_hello-isar.yaml | 9 +
kas/package/pkg_hello.yaml | 9 +
kas/package/pkg_isar-disable-apt-cache.yaml | 9 +
kas/package/pkg_isar-exclude-docs.yaml | 9 +
kas/package/pkg_kselftest.yaml | 9 +
kas/package/pkg_samefile.yaml | 9 +
kas/package/pkg_sshd-regen-keys.yaml | 9 +
scripts/generate_yaml.sh | 97 ++++
68 files changed, 1709 insertions(+)
create mode 100644 Kconfig
create mode 100644 kas/README.md
create mode 100644 kas/distro/Kconfig
create mode 100644 kas/distro/debian-bookworm.yaml
create mode 100644 kas/distro/debian-bullseye.yaml
create mode 100644 kas/distro/debian-buster.yaml
create mode 100644 kas/distro/debian-sid-ports.yaml
create mode 100644 kas/distro/raspios-bullseye.yaml
create mode 100644 kas/distro/ubuntu-focal.yaml
create mode 100644 kas/distro/ubuntu-jammy.yaml
create mode 100644 kas/image/Kconfig
create mode 100644 kas/image/isar-image-base.yaml
create mode 100644 kas/image/isar-image-debug.yaml
create mode 100644 kas/isar.yaml
create mode 100755 kas/kas-container
create mode 100644 kas/machine/Kconfig
create mode 100644 kas/machine/bananapi.yaml
create mode 100644 kas/machine/container-amd64.yaml
create mode 100644 kas/machine/de0-nano-soc.yaml
create mode 100644 kas/machine/hikey.yaml
create mode 100644 kas/machine/imx6-sabrelite.yaml
create mode 100644 kas/machine/nanopi-neo-efi.yaml
create mode 100644 kas/machine/nanopi-neo.yaml
create mode 100644 kas/machine/phyboard-mira.yaml
create mode 100644 kas/machine/qemuamd64-sb.yaml
create mode 100644 kas/machine/qemuamd64.yaml
create mode 100644 kas/machine/qemuarm.yaml
create mode 100644 kas/machine/qemuarm64.yaml
create mode 100644 kas/machine/qemui386.yaml
create mode 100644 kas/machine/qemumipsel.yaml
create mode 100644 kas/machine/qemuriscv64.yaml
create mode 100644 kas/machine/rpi-arm-v7.yaml
create mode 100644 kas/machine/rpi-arm-v7l.yaml
create mode 100644 kas/machine/rpi-arm.yaml
create mode 100644 kas/machine/rpi-arm64-v8.yaml
create mode 100644 kas/machine/sifive-fu540.yaml
create mode 100644 kas/machine/starfive-visionfive2.yaml
create mode 100644 kas/machine/stm32mp15x.yaml
create mode 100644 kas/machine/virtualbox.yaml
create mode 100644 kas/machine/vmware.yaml
create mode 100644 kas/opt/Kconfig
create mode 100644 kas/opt/cache-deb-src.yaml
create mode 100644 kas/opt/ccache.yaml
create mode 100644 kas/opt/compat-arch.yaml
create mode 100644 kas/opt/crosscompile.yaml
create mode 100644 kas/opt/image-fstypes.yaml
create mode 100644 kas/opt/mirror-debian.yaml
create mode 100644 kas/opt/mirror-ubuntu.yaml
create mode 100644 kas/opt/user-isar.yaml
create mode 100644 kas/opt/user-root.yaml
create mode 100644 kas/package/Kconfig
create mode 100644 kas/package/packages-distro.yaml
create mode 100644 kas/package/pkg_cowsay.yaml
create mode 100644 kas/package/pkg_enable-fsck.yaml
create mode 100644 kas/package/pkg_example-module.yaml
create mode 100644 kas/package/pkg_example-prebuilt.yaml
create mode 100644 kas/package/pkg_example-raw.yaml
create mode 100644 kas/package/pkg_expand-on-first-boot.yaml
create mode 100644 kas/package/pkg_hello-isar.yaml
create mode 100644 kas/package/pkg_hello.yaml
create mode 100644 kas/package/pkg_isar-disable-apt-cache.yaml
create mode 100644 kas/package/pkg_isar-exclude-docs.yaml
create mode 100644 kas/package/pkg_kselftest.yaml
create mode 100644 kas/package/pkg_samefile.yaml
create mode 100644 kas/package/pkg_sshd-regen-keys.yaml
create mode 100755 scripts/generate_yaml.sh

--
2.20.1

Uladzimir Bely

unread,
Sep 22, 2023, 5:10:22 AM9/22/23
to isar-...@googlegroups.com
Create required Kconfig files and appropriate YAML configuration
fragments for supporting initial build configuragion via
`kas-container menu`.

Since Isar does not support any possible combination of machines and
distros, there are particular dependencies between them exist.

User should select the distro first and after that it would be
possible to choose the board this distro supports.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
.gitignore | 2 +
Kconfig | 18 ++++
kas/distro/Kconfig | 46 +++++++++
kas/distro/debian-bookworm.yaml | 7 ++
kas/distro/debian-bullseye.yaml | 7 ++
kas/distro/debian-buster.yaml | 7 ++
kas/distro/debian-sid-ports.yaml | 7 ++
kas/distro/raspios-bullseye.yaml | 7 ++
kas/distro/ubuntu-focal.yaml | 7 ++
kas/distro/ubuntu-jammy.yaml | 7 ++
kas/isar.yaml | 21 ++++
kas/machine/Kconfig | 138 ++++++++++++++++++++++++++
kas/machine/bananapi.yaml | 7 ++
kas/machine/container-amd64.yaml | 7 ++
kas/machine/de0-nano-soc.yaml | 7 ++
kas/machine/hikey.yaml | 7 ++
kas/machine/imx6-sabrelite.yaml | 7 ++
kas/machine/nanopi-neo-efi.yaml | 7 ++
kas/machine/nanopi-neo.yaml | 7 ++
kas/machine/phyboard-mira.yaml | 7 ++
kas/machine/qemuamd64-sb.yaml | 7 ++
kas/machine/qemuamd64.yaml | 7 ++
kas/machine/qemuarm.yaml | 7 ++
kas/machine/qemuarm64.yaml | 7 ++
kas/machine/qemui386.yaml | 7 ++
kas/machine/qemumipsel.yaml | 7 ++
kas/machine/qemuriscv64.yaml | 7 ++
kas/machine/rpi-arm-v7.yaml | 7 ++
kas/machine/rpi-arm-v7l.yaml | 7 ++
kas/machine/rpi-arm.yaml | 7 ++
kas/machine/rpi-arm64-v8.yaml | 7 ++
kas/machine/sifive-fu540.yaml | 7 ++
kas/machine/starfive-visionfive2.yaml | 7 ++
kas/machine/stm32mp15x.yaml | 7 ++
kas/machine/virtualbox.yaml | 7 ++
kas/machine/vmware.yaml | 7 ++
36 files changed, 442 insertions(+)
create mode 100644 Kconfig
create mode 100644 kas/distro/Kconfig
create mode 100644 kas/distro/debian-bookworm.yaml
create mode 100644 kas/distro/debian-bullseye.yaml
create mode 100644 kas/distro/debian-buster.yaml
create mode 100644 kas/distro/debian-sid-ports.yaml
create mode 100644 kas/distro/raspios-bullseye.yaml
create mode 100644 kas/distro/ubuntu-focal.yaml
create mode 100644 kas/distro/ubuntu-jammy.yaml
create mode 100644 kas/isar.yaml
diff --git a/.gitignore b/.gitignore
index 2525d41e..b1b51dd4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
*~
/*.patch
__pycache__
+.config.yaml*
+build/
diff --git a/Kconfig b/Kconfig
new file mode 100644
index 00000000..591fe765
--- /dev/null
+++ b/Kconfig
@@ -0,0 +1,18 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+#
+# Authors:
+# Uladzimir Bely <ub...@ilbers.de>
+
+mainmenu "Isar configuration"
+
+config KAS_INCLUDE_MAIN
+ string
+ default "kas/isar.yaml"
+
+config KAS_BUILD_SYSTEM
+ string
+ default "isar"
+
+source "kas/distro/Kconfig"
+source "kas/machine/Kconfig"
diff --git a/kas/distro/Kconfig b/kas/distro/Kconfig
new file mode 100644
index 00000000..bd762a98
--- /dev/null
+++ b/kas/distro/Kconfig
@@ -0,0 +1,46 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+#
+# Authors:
+# Uladzimir Bely <ub...@ilbers.de>
+
+menu "Distro selection"
+
+choice
new file mode 100644
index 00000000..2178e7d4
--- /dev/null
+++ b/kas/distro/debian-bookworm.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+distro: debian-bookworm
diff --git a/kas/distro/debian-bullseye.yaml b/kas/distro/debian-bullseye.yaml
new file mode 100644
index 00000000..23e286fb
--- /dev/null
+++ b/kas/distro/debian-bullseye.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+distro: debian-bullseye
diff --git a/kas/distro/debian-buster.yaml b/kas/distro/debian-buster.yaml
new file mode 100644
index 00000000..82949a8f
--- /dev/null
+++ b/kas/distro/debian-buster.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+distro: debian-buster
diff --git a/kas/distro/debian-sid-ports.yaml b/kas/distro/debian-sid-ports.yaml
new file mode 100644
index 00000000..52993646
--- /dev/null
+++ b/kas/distro/debian-sid-ports.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+distro: debian-sid-ports
diff --git a/kas/distro/raspios-bullseye.yaml b/kas/distro/raspios-bullseye.yaml
new file mode 100644
index 00000000..9a1e6abe
--- /dev/null
+++ b/kas/distro/raspios-bullseye.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+distro: raspios-bullseye
diff --git a/kas/distro/ubuntu-focal.yaml b/kas/distro/ubuntu-focal.yaml
new file mode 100644
index 00000000..6a68b796
--- /dev/null
+++ b/kas/distro/ubuntu-focal.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+distro: ubuntu-focal
diff --git a/kas/distro/ubuntu-jammy.yaml b/kas/distro/ubuntu-jammy.yaml
new file mode 100644
index 00000000..e6623871
--- /dev/null
+++ b/kas/distro/ubuntu-jammy.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+distro: ubuntu-jammy
diff --git a/kas/isar.yaml b/kas/isar.yaml
new file mode 100644
index 00000000..c8dec31c
--- /dev/null
+++ b/kas/isar.yaml
@@ -0,0 +1,21 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+build_system: isar
+
+target:
+- isar-image-base
+
+repos:
+ isar:
+ layers:
+ meta:
+ meta-isar:
+
+bblayers_conf_header:
+ standard: |
+ BBPATH = "${TOPDIR}"
+ BBFILES ?= ""
diff --git a/kas/machine/Kconfig b/kas/machine/Kconfig
new file mode 100644
index 00000000..f117724c
--- /dev/null
+++ b/kas/machine/Kconfig
@@ -0,0 +1,138 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+#
+# Authors:
+# Uladzimir Bely <ub...@ilbers.de>
+
+menu "Machine selection"
+
+choice
+ prompt "Machine selection"
+ default MACHINE_QEMU_AMD64
+
+config MACHINE_BANANAPI
+ bool "bananapi"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_CONTAINER_AMD64
+ bool "container-amd64"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_DE0_NANO_SOC
+ bool "de0-nano-soc"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_HIKEY
+ bool "hikey"
+ depends on DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_IMX6_SABRELITE
+ bool "imx6-sabrelite"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_NANOPI_NEO
+ bool "nanopi-neo"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_NANOPI_NEO_EFI
+ bool "nanopi-neo-efi"
+ depends on DEBIAN_BOOKWORM
+
+config MACHINE_PHIBOARD_MIRA
+ bool "phyboard-mira"
+ depends on DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_QEMU_AMD64_SB
+ bool "qemuamd64-sb"
+ depends on DEBIAN_BULLSEYE
+
+config MACHINE_QEMU_AMD64
+ bool "qemuamd64"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM || UBUNTU_FOCAL || UBUNTU_JAMMY
+
+config MACHINE_QEMU_ARM
+ bool "qemuarm"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_QEMU_ARM64
+ bool "qemuarm64"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM || UBUNTU_FOCAL || UBUNTU_JAMMY
+
+config MACHINE_QEMU_I386
+ bool "qemui386"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_QEMU_MIPSEL
+ bool "qemumipsel"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+ default "kas/machine/nanopi-neo" if MACHINE_NANOPI_NEO
+ default "kas/machine/nanopi-neo-efi" if MACHINE_NANOPI_NEO_EFI
+ default "kas/machine/phyboard-mira" if MACHINE_PHIBOARD_MIRA
+ default "kas/machine/qemuamd64-sb.yaml" if MACHINE_QEMU_AMD64_SB
+ default "kas/machine/qemuamd64.yaml" if MACHINE_QEMU_AMD64
+ default "kas/machine/qemuarm.yaml" if MACHINE_QEMU_ARM
+ default "kas/machine/qemuarm64.yaml" if MACHINE_QEMU_ARM64
+ default "kas/machine/qemui386.yaml" if MACHINE_QEMU_I386
+ default "kas/machine/qemumipsel.yaml" if MACHINE_QEMU_MIPSEL
+ default "kas/machine/qemuriscv64.yaml" if MACHINE_QEMU_RISCV64
+ default "kas/machine/rpi-arm-v7.yaml" if MACHINE_RPI_ARM_V7
+ default "kas/machine/rpi-arm-v7l.yaml" if MACHINE_RPI_ARM_V7L
+ default "kas/machine/rpi-arm.yaml" if MACHINE_RPI_ARM
+ default "kas/machine/rpi-arm64-v8.yaml" if MACHINE_RPI_ARM64_V8
+ default "kas/machine/sifive-fu540.yaml" if MACHINE_SIFIVE_FU540
+ default "kas/machine/starfive-visionfive2.yaml" if MACHINE_STARFIVE_VISIONFIVE2
+ default "kas/machine/stm32mp15x.yaml" if MACHINE_STM32MP15X
+ default "kas/machine/virtualbox.yaml" if MACHINE_VIRTUALBOX
+ default "kas/machine/vmware.yaml" if MACHINE_VMWARE
+
+endmenu
diff --git a/kas/machine/bananapi.yaml b/kas/machine/bananapi.yaml
new file mode 100644
index 00000000..53bd3db2
--- /dev/null
+++ b/kas/machine/bananapi.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: bananapi
diff --git a/kas/machine/container-amd64.yaml b/kas/machine/container-amd64.yaml
new file mode 100644
index 00000000..93352c29
--- /dev/null
+++ b/kas/machine/container-amd64.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: container-amd64
diff --git a/kas/machine/de0-nano-soc.yaml b/kas/machine/de0-nano-soc.yaml
new file mode 100644
index 00000000..5dbe6916
--- /dev/null
+++ b/kas/machine/de0-nano-soc.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: de0-nano-soc
diff --git a/kas/machine/hikey.yaml b/kas/machine/hikey.yaml
new file mode 100644
index 00000000..56133afc
--- /dev/null
+++ b/kas/machine/hikey.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: hikey
diff --git a/kas/machine/imx6-sabrelite.yaml b/kas/machine/imx6-sabrelite.yaml
new file mode 100644
index 00000000..466649d5
--- /dev/null
+++ b/kas/machine/imx6-sabrelite.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: imx6-sabrelite
diff --git a/kas/machine/nanopi-neo-efi.yaml b/kas/machine/nanopi-neo-efi.yaml
new file mode 100644
index 00000000..a38e06d7
--- /dev/null
+++ b/kas/machine/nanopi-neo-efi.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: nanopi-neo-efi
diff --git a/kas/machine/nanopi-neo.yaml b/kas/machine/nanopi-neo.yaml
new file mode 100644
index 00000000..7973e5ad
--- /dev/null
+++ b/kas/machine/nanopi-neo.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: nanopi-neo
diff --git a/kas/machine/phyboard-mira.yaml b/kas/machine/phyboard-mira.yaml
new file mode 100644
index 00000000..f2081819
--- /dev/null
+++ b/kas/machine/phyboard-mira.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: phyboard-mira
diff --git a/kas/machine/qemuamd64-sb.yaml b/kas/machine/qemuamd64-sb.yaml
new file mode 100644
index 00000000..f2be984a
--- /dev/null
+++ b/kas/machine/qemuamd64-sb.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: qemuamd64-sb
diff --git a/kas/machine/qemuamd64.yaml b/kas/machine/qemuamd64.yaml
new file mode 100644
index 00000000..cb032e0c
--- /dev/null
+++ b/kas/machine/qemuamd64.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: qemuamd64
diff --git a/kas/machine/qemuarm.yaml b/kas/machine/qemuarm.yaml
new file mode 100644
index 00000000..8aae6bdb
--- /dev/null
+++ b/kas/machine/qemuarm.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: qemuarm
diff --git a/kas/machine/qemuarm64.yaml b/kas/machine/qemuarm64.yaml
new file mode 100644
index 00000000..f965d27b
--- /dev/null
+++ b/kas/machine/qemuarm64.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: qemuarm64
diff --git a/kas/machine/qemui386.yaml b/kas/machine/qemui386.yaml
new file mode 100644
index 00000000..913b419f
--- /dev/null
+++ b/kas/machine/qemui386.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: qemui386
diff --git a/kas/machine/qemumipsel.yaml b/kas/machine/qemumipsel.yaml
new file mode 100644
index 00000000..961fcfe0
--- /dev/null
+++ b/kas/machine/qemumipsel.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: qemumipsel
diff --git a/kas/machine/qemuriscv64.yaml b/kas/machine/qemuriscv64.yaml
new file mode 100644
index 00000000..57fd0980
--- /dev/null
+++ b/kas/machine/qemuriscv64.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: qemuriscv64
diff --git a/kas/machine/rpi-arm-v7.yaml b/kas/machine/rpi-arm-v7.yaml
new file mode 100644
index 00000000..26af1b63
--- /dev/null
+++ b/kas/machine/rpi-arm-v7.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: rpi-arm-v7
diff --git a/kas/machine/rpi-arm-v7l.yaml b/kas/machine/rpi-arm-v7l.yaml
new file mode 100644
index 00000000..86fdd02a
--- /dev/null
+++ b/kas/machine/rpi-arm-v7l.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: rpi-arm-v7l
diff --git a/kas/machine/rpi-arm.yaml b/kas/machine/rpi-arm.yaml
new file mode 100644
index 00000000..3be463e3
--- /dev/null
+++ b/kas/machine/rpi-arm.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: rpi-arm
diff --git a/kas/machine/rpi-arm64-v8.yaml b/kas/machine/rpi-arm64-v8.yaml
new file mode 100644
index 00000000..76b0d42b
--- /dev/null
+++ b/kas/machine/rpi-arm64-v8.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: rpi-arm64-v8
diff --git a/kas/machine/sifive-fu540.yaml b/kas/machine/sifive-fu540.yaml
new file mode 100644
index 00000000..f2bf8a13
--- /dev/null
+++ b/kas/machine/sifive-fu540.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: sifive-fu540
diff --git a/kas/machine/starfive-visionfive2.yaml b/kas/machine/starfive-visionfive2.yaml
new file mode 100644
index 00000000..0837308a
--- /dev/null
+++ b/kas/machine/starfive-visionfive2.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: starfive-visionfive2
diff --git a/kas/machine/stm32mp15x.yaml b/kas/machine/stm32mp15x.yaml
new file mode 100644
index 00000000..9e54c31d
--- /dev/null
+++ b/kas/machine/stm32mp15x.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: stm32mp15x
diff --git a/kas/machine/virtualbox.yaml b/kas/machine/virtualbox.yaml
new file mode 100644
index 00000000..539f3e3b
--- /dev/null
+++ b/kas/machine/virtualbox.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: virtualbox
diff --git a/kas/machine/vmware.yaml b/kas/machine/vmware.yaml
new file mode 100644
index 00000000..6dc49edb
--- /dev/null
+++ b/kas/machine/vmware.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: vmware
--
2.20.1

Uladzimir Bely

unread,
Sep 22, 2023, 5:10:23 AM9/22/23
to isar-...@googlegroups.com
This part of configuration allows to choose which additional packages
(both from Isar and Debian) to include to the target image.

Isar packages are added to IMAGE_INSTALL since Debian packages go
to IMAGE_PREINSTALL.

The features are implemented as "string" parameter in the menu since
it reduces a number of required YAML fragments.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
Kconfig | 1 +
kas/package/Kconfig | 154 ++++++++++++++++++++
kas/package/packages-distro.yaml | 9 ++
kas/package/pkg_cowsay.yaml | 9 ++
kas/package/pkg_enable-fsck.yaml | 9 ++
kas/package/pkg_example-module.yaml | 9 ++
kas/package/pkg_example-prebuilt.yaml | 9 ++
kas/package/pkg_example-raw.yaml | 9 ++
kas/package/pkg_expand-on-first-boot.yaml | 9 ++
kas/package/pkg_hello-isar.yaml | 9 ++
kas/package/pkg_hello.yaml | 9 ++
kas/package/pkg_isar-disable-apt-cache.yaml | 9 ++
kas/package/pkg_isar-exclude-docs.yaml | 9 ++
kas/package/pkg_kselftest.yaml | 9 ++
kas/package/pkg_samefile.yaml | 9 ++
kas/package/pkg_sshd-regen-keys.yaml | 9 ++
16 files changed, 281 insertions(+)
create mode 100644 kas/package/Kconfig
create mode 100644 kas/package/packages-distro.yaml
create mode 100644 kas/package/pkg_cowsay.yaml
create mode 100644 kas/package/pkg_enable-fsck.yaml
create mode 100644 kas/package/pkg_example-module.yaml
create mode 100644 kas/package/pkg_example-prebuilt.yaml
create mode 100644 kas/package/pkg_example-raw.yaml
create mode 100644 kas/package/pkg_expand-on-first-boot.yaml
create mode 100644 kas/package/pkg_hello-isar.yaml
create mode 100644 kas/package/pkg_hello.yaml
create mode 100644 kas/package/pkg_isar-disable-apt-cache.yaml
create mode 100644 kas/package/pkg_isar-exclude-docs.yaml
create mode 100644 kas/package/pkg_kselftest.yaml
create mode 100644 kas/package/pkg_samefile.yaml
create mode 100644 kas/package/pkg_sshd-regen-keys.yaml

diff --git a/Kconfig b/Kconfig
index a62fbf6c..5a3050a4 100644
--- a/Kconfig
+++ b/Kconfig
@@ -16,4 +16,5 @@ config KAS_BUILD_SYSTEM

source "kas/distro/Kconfig"
source "kas/machine/Kconfig"
+source "kas/package/Kconfig"
source "kas/opt/Kconfig"
diff --git a/kas/package/Kconfig b/kas/package/Kconfig
new file mode 100644
index 00000000..139651cd
--- /dev/null
+++ b/kas/package/Kconfig
@@ -0,0 +1,154 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+#
+# Authors:
+# Uladzimir Bely <ub...@ilbers.de>
+
+menu "Packages selection"
+
+menu "Isar packages"
+
+config PACKAGE_COWSAY
+ bool "cowsay"
+ default y
+
+config KAS_INCLUDE_PACKAGE_COWSAY
+ string
+ default "kas/package/pkg_cowsay.yaml"
+ depends on PACKAGE_COWSAY
+
+
+config PACKAGE_ENABLE_FSCK
+ bool "enable-fsck"
+ default y
+
+config KAS_INCLUDE_PACKAGE_ENABLE_FSCK
+ string
+ default "kas/package/pkg_enable-fsck.yaml"
+ depends on PACKAGE_ENABLE_FSCK
+
+
+config PACKAGE_EXAMPLE_RAW
+ bool "example-raw"
+ default y
+
+config KAS_INCLUDE_PACKAGE_EXAMPLE_RAW
+ string
+ default "kas/package/pkg_example-raw.yaml"
+ depends on PACKAGE_EXAMPLE_RAW
+
+
+config PACKAGE_EXAMPLE_MODULE
+ bool "example-module"
+ default y
+
+config KAS_INCLUDE_PACKAGE_EXAMPLE_MODULE
+ string
+ default "kas/package/pkg_example-module.yaml"
+ depends on PACKAGE_EXAMPLE_MODULE
+
+
+config PACKAGE_EXAMPLE_PREBUILT
+ bool "example-prebuilt"
+ default y
+
+config KAS_INCLUDE_PACKAGE_EXAMPLE_PREBUILT
+ string
+ default "kas/package/pkg_example-prebuilt.yaml"
+ depends on PACKAGE_EXAMPLE_PREBUILT
+
+
+config PACKAGE_EXPAND_ON_FIRST_BOOT
+ bool "expand-on-first-boot"
+ default y
+
+config KAS_INCLUDE_PACKAGE_EXPAND_ON_FIRST_BOOT
+ string
+ default "kas/package/pkg_expand-on-first-boot.yaml"
+ depends on PACKAGE_EXPAND_ON_FIRST_BOOT
+
+
+config PACKAGE_HELLO
+ bool "hello"
+ default y
+
+config KAS_INCLUDE_PACKAGE_HELLO
+ string
+ default "kas/package/pkg_hello.yaml"
+ depends on PACKAGE_HELLO
+
+
+config PACKAGE_HELLO_ISAR
+ bool "hello-isar"
+ default y
+
+config KAS_INCLUDE_PACKAGE_HELLO_ISAR
+ string
+ default "kas/package/pkg_hello-isar.yaml"
+ depends on PACKAGE_HELLO_ISAR
+
+
+config PACKAGE_ISAR_EXCLUDE_DOCS
+ bool "isar-exclude-docs"
+ default y
+
+config KAS_INCLUDE_PACKAGE_ISAR_EXCLUDE_DOCS
+ string
+ default "kas/package/pkg_isar-exclude-docs.yaml"
+ depends on PACKAGE_ISAR_EXCLUDE_DOCS
+
+
+config PACKAGE_ISAR_DISABLE_APT_CACHE
+ bool "isar-disable-apt-cache"
+ default y
+
+config KAS_INCLUDE_PACKAGE_ISAR_DISABLE_APT_CACHE
+ string
+ default "kas/package/pkg_isar-disable-apt-cache.yaml"
+ depends on PACKAGE_ISAR_DISABLE_APT_CACHE
+
+
+config PACKAGE_KSELFTEST
+ bool "kselftest"
+ default n
+
+config KAS_INCLUDE_PACKAGE_KSELFTEST
+ string
+ default "kas/package/pkg_kselftest.yaml"
+ depends on PACKAGE_KSELFTEST
+
+
+config PACKAGE_SAMEFILE
+ bool "samefile"
+ default y
+
+config KAS_INCLUDE_PACKAGE_SAMEFILE
+ string
+ default "kas/package/pkg_samefile.yaml"
+ depends on PACKAGE_SAMEFILE
+
+
+config PACKAGE_SSHD_REGEN_KEYS
+ bool "sshd-regen-keys"
+ default y
+
+config KAS_INCLUDE_PACKAGE_SSHD_REGEN_KEYS
+ string
+ default "kas/package/pkg_sshd-regen-keys.yaml"
+ depends on PACKAGE_SSHD_REGEN_KEYS
+
+endmenu
+
+config KAS_IMAGE_PREINSTALL
+ string "Distro packages"
+ default "fdisk iproute2 iputils-ping ics-dhcp-client"
+ help
+ Space-separated list of packages that are provided by the selected distro.
+ These packages are downloaded from distro mirrors and just unpacked
+ and configured by Isar.
+
+config KAS_INCLUDE_PACKAGES_DISTRO
+ string
+ default "kas/package/packages-distro.yaml"
+
+endmenu
diff --git a/kas/package/packages-distro.yaml b/kas/package/packages-distro.yaml
new file mode 100644
index 00000000..a4bf9149
--- /dev/null
+++ b/kas/package/packages-distro.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ packages-distro: |
+ IMAGE_PREINSTALL:append = " ${KAS_IMAGE_PREINSTALL}"
diff --git a/kas/package/pkg_cowsay.yaml b/kas/package/pkg_cowsay.yaml
new file mode 100644
index 00000000..1b1a174d
--- /dev/null
+++ b/kas/package/pkg_cowsay.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-cowsay: |
+ IMAGE_INSTALL:append = " cowsay"
diff --git a/kas/package/pkg_enable-fsck.yaml b/kas/package/pkg_enable-fsck.yaml
new file mode 100644
index 00000000..2ea836d0
--- /dev/null
+++ b/kas/package/pkg_enable-fsck.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-enable-fsck: |
+ IMAGE_INSTALL:append = " enable-fsck"
diff --git a/kas/package/pkg_example-module.yaml b/kas/package/pkg_example-module.yaml
new file mode 100644
index 00000000..f756d681
--- /dev/null
+++ b/kas/package/pkg_example-module.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-example-module: |
+ IMAGE_INSTALL:append = " example-module-${KERNEL_NAME}"
diff --git a/kas/package/pkg_example-prebuilt.yaml b/kas/package/pkg_example-prebuilt.yaml
new file mode 100644
index 00000000..81800d85
--- /dev/null
+++ b/kas/package/pkg_example-prebuilt.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-example-prebuilt: |
+ IMAGE_INSTALL:append = " example-prebuilt"
diff --git a/kas/package/pkg_example-raw.yaml b/kas/package/pkg_example-raw.yaml
new file mode 100644
index 00000000..65298e70
--- /dev/null
+++ b/kas/package/pkg_example-raw.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-example-raw: |
+ IMAGE_INSTALL:append = " example-raw"
diff --git a/kas/package/pkg_expand-on-first-boot.yaml b/kas/package/pkg_expand-on-first-boot.yaml
new file mode 100644
index 00000000..d5dea83d
--- /dev/null
+++ b/kas/package/pkg_expand-on-first-boot.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-expand-on-first-boot: |
+ IMAGE_INSTALL:append = " expand-on-first-boot"
diff --git a/kas/package/pkg_hello-isar.yaml b/kas/package/pkg_hello-isar.yaml
new file mode 100644
index 00000000..391707ea
--- /dev/null
+++ b/kas/package/pkg_hello-isar.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-hello-isar: |
+ IMAGE_INSTALL:append = " hello-isar"
diff --git a/kas/package/pkg_hello.yaml b/kas/package/pkg_hello.yaml
new file mode 100644
index 00000000..9bb35486
--- /dev/null
+++ b/kas/package/pkg_hello.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-hello: |
+ IMAGE_INSTALL:append = " hello"
diff --git a/kas/package/pkg_isar-disable-apt-cache.yaml b/kas/package/pkg_isar-disable-apt-cache.yaml
new file mode 100644
index 00000000..bca3a6e9
--- /dev/null
+++ b/kas/package/pkg_isar-disable-apt-cache.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-isar-disable-apt-cache: |
+ IMAGE_INSTALL:append = " isar-disable-apt-cache"
diff --git a/kas/package/pkg_isar-exclude-docs.yaml b/kas/package/pkg_isar-exclude-docs.yaml
new file mode 100644
index 00000000..5eca26fa
--- /dev/null
+++ b/kas/package/pkg_isar-exclude-docs.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-isar-exclude-docs: |
+ IMAGE_INSTALL:append = " isar-exclude-docs"
diff --git a/kas/package/pkg_kselftest.yaml b/kas/package/pkg_kselftest.yaml
new file mode 100644
index 00000000..f87080aa
--- /dev/null
+++ b/kas/package/pkg_kselftest.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-kselftest: |
+ IMAGE_INSTALL:append = " kselftest"
diff --git a/kas/package/pkg_samefile.yaml b/kas/package/pkg_samefile.yaml
new file mode 100644
index 00000000..9738cf64
--- /dev/null
+++ b/kas/package/pkg_samefile.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-samefile: |
+ IMAGE_INSTALL:append = " samefile"
diff --git a/kas/package/pkg_sshd-regen-keys.yaml b/kas/package/pkg_sshd-regen-keys.yaml
new file mode 100644
index 00000000..94fe6e47
--- /dev/null
+++ b/kas/package/pkg_sshd-regen-keys.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+

Uladzimir Bely

unread,
Sep 22, 2023, 5:10:23 AM9/22/23
to isar-...@googlegroups.com
This allows to select better (faster) mirror for Debian and Ubuntu
distributions.

Isar DISTRO_APT_PREMIRRORS is used under the hood.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
Kconfig | 1 +
kas/opt/Kconfig | 42 ++++++++++++++++++++++++++++++++++++++
kas/opt/mirror-debian.yaml | 10 +++++++++
kas/opt/mirror-ubuntu.yaml | 10 +++++++++
4 files changed, 63 insertions(+)
create mode 100644 kas/opt/Kconfig
create mode 100644 kas/opt/mirror-debian.yaml
create mode 100644 kas/opt/mirror-ubuntu.yaml

diff --git a/Kconfig b/Kconfig
index 591fe765..a62fbf6c 100644
--- a/Kconfig
+++ b/Kconfig
@@ -16,3 +16,4 @@ config KAS_BUILD_SYSTEM

source "kas/distro/Kconfig"
source "kas/machine/Kconfig"
+source "kas/opt/Kconfig"
diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
new file mode 100644
index 00000000..06a9e3e5
--- /dev/null
+++ b/kas/opt/Kconfig
@@ -0,0 +1,42 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+#
+# Authors:
+# Uladzimir Bely <ub...@ilbers.de>
+
+menu "Mirror selection"
+
+config MIRROR_DEBIAN
+ bool "Use specific Debian mirror"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
new file mode 100644
index 00000000..4dd4fc17
--- /dev/null
+++ b/kas/opt/mirror-debian.yaml
@@ -0,0 +1,10 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ mirror-debian: |
+ DISTRO_APT_PREMIRRORS += "\
+ http://deb\.debian\.org ${MIRROR_DEBIAN_URL}\n"
diff --git a/kas/opt/mirror-ubuntu.yaml b/kas/opt/mirror-ubuntu.yaml
new file mode 100644
index 00000000..3774b079
--- /dev/null
+++ b/kas/opt/mirror-ubuntu.yaml
@@ -0,0 +1,10 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:

Uladzimir Bely

unread,
Sep 22, 2023, 5:10:24 AM9/22/23
to isar-...@googlegroups.com
This allows to choose between base and debug Isar image.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
Kconfig | 1 +
kas/image/Kconfig | 32 ++++++++++++++++++++++++++++++++
kas/image/isar-image-base.yaml | 7 +++++++
kas/image/isar-image-debug.yaml | 7 +++++++
kas/isar.yaml | 3 ---
5 files changed, 47 insertions(+), 3 deletions(-)
create mode 100644 kas/image/Kconfig
create mode 100644 kas/image/isar-image-base.yaml
create mode 100644 kas/image/isar-image-debug.yaml

diff --git a/Kconfig b/Kconfig
index 5a3050a4..538c0a1b 100644
--- a/Kconfig
+++ b/Kconfig
@@ -16,5 +16,6 @@ config KAS_BUILD_SYSTEM

source "kas/distro/Kconfig"
source "kas/machine/Kconfig"
+source "kas/image/Kconfig"
source "kas/package/Kconfig"
source "kas/opt/Kconfig"
diff --git a/kas/image/Kconfig b/kas/image/Kconfig
new file mode 100644
index 00000000..8e617386
--- /dev/null
+++ b/kas/image/Kconfig
@@ -0,0 +1,32 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+#
+# Authors:
+# Uladzimir Bely <ub...@ilbers.de>
+
+menu "Image type selection"
+
+choice
+ prompt "Image type selection"
+ default IMAGE_BASE
+
+config IMAGE_BASE
+ bool "Base image"
+ help
+ This is the basic Isar image with bare minimum of preinstalled packages.
+ It's technically close do the debootstrapped system with packages
+ required to boot up the system.
+
+config IMAGE_DEBUG
+ bool "Debug image"
+ help
+ This image includes some tools preinstalled useful for debug.
+
+endchoice
+
+config KAS_INCLUDE_IMAGE
+ string
+ default "kas/image/isar-image-base.yaml" if IMAGE_BASE
+ default "kas/image/isar-image-debug.yaml" if IMAGE_DEBUG
+
+endmenu
diff --git a/kas/image/isar-image-base.yaml b/kas/image/isar-image-base.yaml
new file mode 100644
index 00000000..0666510f
--- /dev/null
+++ b/kas/image/isar-image-base.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+target: isar-image-base
diff --git a/kas/image/isar-image-debug.yaml b/kas/image/isar-image-debug.yaml
new file mode 100644
index 00000000..94c5a334
--- /dev/null
+++ b/kas/image/isar-image-debug.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+target: isar-image-debug
diff --git a/kas/isar.yaml b/kas/isar.yaml
index c8dec31c..df26b780 100644
--- a/kas/isar.yaml
+++ b/kas/isar.yaml
@@ -6,9 +6,6 @@ header:

Uladzimir Bely

unread,
Sep 22, 2023, 5:10:24 AM9/22/23
to isar-...@googlegroups.com
This allows user to select this option in the menu.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 12 ++++++++++++
kas/opt/cache-deb-src.yaml | 9 +++++++++
2 files changed, 21 insertions(+)
create mode 100644 kas/opt/cache-deb-src.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 29415cfc..328ac5e6 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -93,3 +93,15 @@ config KAS_INCLUDE_USE_CCACHE
string
default "kas/opt/ccache.yaml"
depends on USE_CCACHE
+
+
+config CACHE_DEB_SRC
+ bool "Cache all source packages"
+ help
+ This feature allows to download srcpackages for any binary package that
+ took part in the build (including ones downloaded from distro mirrors).
+
+config KAS_INCLUDE_CACHE_DEB_SRC
+ string
+ default "kas/opt/cache-deb-src.yaml"
+ depends on CACHE_DEB_SRC
diff --git a/kas/opt/cache-deb-src.yaml b/kas/opt/cache-deb-src.yaml
new file mode 100644
index 00000000..6a170cd9
--- /dev/null
+++ b/kas/opt/cache-deb-src.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+

Uladzimir Bely

unread,
Sep 22, 2023, 5:10:24 AM9/22/23
to isar-...@googlegroups.com
This makes possible to adjust IMAGE_FSTYPES variable.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 24 ++++++++++++++++++++++++
kas/opt/image-fstypes.yaml | 9 +++++++++
2 files changed, 33 insertions(+)
create mode 100644 kas/opt/image-fstypes.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 0bf6dfe8..29415cfc 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -42,6 +42,30 @@ config KAS_INCLUDE_MIRROR_UBUNTU
endmenu


+config KAS_IMAGE_FSTYPES
+ string "Additional image fstypes"
+ default ""
+ help
+ Space-separated list of additional image fstypes to generate. Default
+ machine configurations set up IMAGE_FSTYPES variable, but it's possible
+ to select additonal ones to generate.
+ The following IMAGE_FSTYPES are supported:
+ cpio
+ fit
+ docker-archive
+ ext4
+ ova
+ tar
+ ubi
+ ubifs
+ wic
+ They can be followed by suffixes like ".gz" for compressing the image
+
+config KAS_INCLUDE_IMAGE_FSTYPES
+ string
+ default "kas/opt/image-fstypes.yaml"
+
+
config COMPAT_ARCH
bool "Enable compat arch support"

diff --git a/kas/opt/image-fstypes.yaml b/kas/opt/image-fstypes.yaml
new file mode 100644
index 00000000..f0658cbf
--- /dev/null
+++ b/kas/opt/image-fstypes.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:

Uladzimir Bely

unread,
Sep 22, 2023, 5:10:24 AM9/22/23
to isar-...@googlegroups.com
This adds an option to the menu that allows to enable support
of cross-compilation via ISAR_CROSS_COMPILE variable.

The option is enabled by default.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 10 ++++++++++
kas/opt/crosscompile.yaml | 9 +++++++++
2 files changed, 19 insertions(+)
create mode 100644 kas/opt/crosscompile.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 02375399..76a00d6a 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -49,3 +49,13 @@ config KAS_INCLUDE_COMPAT_ARCH
string
default "kas/opt/compat-arch.yaml"
depends on COMPAT_ARCH
+
+
+config ISAR_CROSS_COMPILE
+ bool "Enable cross compilation mode"
+ default y
+
+config KAS_INCLUDE_ISAR_CROSS_COMPILE
+ string
+ default "kas/opt/crosscompile.yaml"
+ depends on ISAR_CROSS_COMPILE
diff --git a/kas/opt/crosscompile.yaml b/kas/opt/crosscompile.yaml
new file mode 100644
index 00000000..1b927ebd
--- /dev/null
+++ b/kas/opt/crosscompile.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:

Uladzimir Bely

unread,
Sep 22, 2023, 5:10:24 AM9/22/23
to isar-...@googlegroups.com
This adds an option to the menu that allows to enable or disable
ccache support for the build.

The option is enabled by default.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>

ccache
---
kas/opt/Kconfig | 10 ++++++++++
kas/opt/ccache.yaml | 9 +++++++++
2 files changed, 19 insertions(+)
create mode 100644 kas/opt/ccache.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 76a00d6a..0bf6dfe8 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -59,3 +59,13 @@ config KAS_INCLUDE_ISAR_CROSS_COMPILE
string
default "kas/opt/crosscompile.yaml"
depends on ISAR_CROSS_COMPILE
+
+
+config USE_CCACHE
+ bool "Use ccache during build"
+ default y
+
+config KAS_INCLUDE_USE_CCACHE
+ string
+ default "kas/opt/ccache.yaml"
+ depends on USE_CCACHE
diff --git a/kas/opt/ccache.yaml b/kas/opt/ccache.yaml
new file mode 100644
index 00000000..143c080e
--- /dev/null
+++ b/kas/opt/ccache.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:

Uladzimir Bely

unread,
Sep 22, 2023, 5:10:24 AM9/22/23
to isar-...@googlegroups.com
This adds an option to the menu that can enable or disable
COMPAT_ARCH support for amd64 and arm64 architectures.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 9 +++++++++
kas/opt/compat-arch.yaml | 10 ++++++++++
2 files changed, 19 insertions(+)
create mode 100644 kas/opt/compat-arch.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 06a9e3e5..02375399 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -40,3 +40,12 @@ config KAS_INCLUDE_MIRROR_UBUNTU
depends on MIRROR_UBUNTU

endmenu
+
+
+config COMPAT_ARCH
+ bool "Enable compat arch support"
+
+config KAS_INCLUDE_COMPAT_ARCH
+ string
+ default "kas/opt/compat-arch.yaml"
+ depends on COMPAT_ARCH
diff --git a/kas/opt/compat-arch.yaml b/kas/opt/compat-arch.yaml
new file mode 100644
index 00000000..520bc705
--- /dev/null
+++ b/kas/opt/compat-arch.yaml
@@ -0,0 +1,10 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:

Uladzimir Bely

unread,
Sep 22, 2023, 5:10:25 AM9/22/23
to isar-...@googlegroups.com
This allows to enable 'root' and 'isar' users and set their passwords.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 40 ++++++++++++++++++++++++++++++++++++++++
kas/opt/user-isar.yaml | 19 +++++++++++++++++++
kas/opt/user-root.yaml | 11 +++++++++++
3 files changed, 70 insertions(+)
create mode 100644 kas/opt/user-isar.yaml
create mode 100644 kas/opt/user-root.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 328ac5e6..87fef870 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -42,6 +42,46 @@ config KAS_INCLUDE_MIRROR_UBUNTU
new file mode 100644
index 00000000..67611a40
--- /dev/null
+++ b/kas/opt/user-isar.yaml
@@ -0,0 +1,19 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ user-isar: |
+ GROUPS += "isar"
+ GROUP_isar[flags] = "system"
+
+ USERS += "isar"
+ USER_isar[gid] = "isar"
+ USER_isar[home] = "/var/lib/isar"
+ USER_isar[comment] = "My isar user"
+ USER_isar[flags] = "system create-home"
+
+ USER_isar[password] = "${KAS_USER_ISAR_PASSWORD}"
+ USER_isar[flags] += "clear-text-password"
diff --git a/kas/opt/user-root.yaml b/kas/opt/user-root.yaml
new file mode 100644
index 00000000..65428e24
--- /dev/null
+++ b/kas/opt/user-root.yaml
@@ -0,0 +1,11 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:

Uladzimir Bely

unread,
Sep 22, 2023, 5:10:26 AM9/22/23
to isar-...@googlegroups.com
The script simplifies generating YAML files for new distros,
images, machines and Isar packages and helps to avoid copy-paste
typos possible when using manual way.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
scripts/generate_yaml.sh | 97 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 97 insertions(+)
create mode 100755 scripts/generate_yaml.sh

diff --git a/scripts/generate_yaml.sh b/scripts/generate_yaml.sh
new file mode 100755
index 00000000..3b4568b7
--- /dev/null
+++ b/scripts/generate_yaml.sh
@@ -0,0 +1,97 @@
+#!/usr/bin/env bash
+
+# This software is a part of ISAR.
+# Copyright (c) 2023 ilbers GmbH
+# Authors:
+# Uladzimir Bely <ub...@ilbers.de>
+
+#
+# Script to generate yaml files for kas configuration
+#
+
+set -e
+
+cd "$(dirname "$0")/.."
+
+HEADER="\
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14"
+
+# Scan for distro configs, except "debian-common" used only for including
+
+DISTROS=$(find {meta,meta-isar}/conf/distro -iname *.conf -printf "%f\n" \
+ | sed -e 's/.conf$//' | grep -v "debian-common")
+
+for distro in ${DISTROS}
+do
+ cat << _EOF_ > kas/distro/${distro}.yaml
+${HEADER}
+
+distro: ${distro}
+_EOF_
+done
+
+# Scan for image recipes
+
+IMAGES=$(find {meta,meta-isar}/recipes-core/images -iname *.bb -printf "%f\n" \
+ | sed -e 's/.bb$//')
+
+for image in ${IMAGES}
+do
+ cat << _EOF_ > kas/image/${image}.yaml
+${HEADER}
+
+target: ${image}
+_EOF_
+done
+
+# Scan for machine configs, except "rpi-common" used only for including
+
+MACHINES=$(find meta-isar/conf/machine -iname *.conf -printf "%f\n" \
+ | sed -e 's/.conf$//' | grep -v "rpi-common")
+
+for machine in ${MACHINES}
+do
+ cat << _EOF_ > kas/machine/${machine}.yaml
+${HEADER}
+
+machine: ${machine}
+_EOF_
+done
+
+# Generate configs for fixed list of Isar packages
+
+PKGS=" \
+ cowsay \
+ enable-fsck \
+ example-module \
+ example-prebuilt \
+ example-raw \
+ expand-on-first-boot \
+ hello-isar \
+ hello \
+ isar-disable-apt-cache \
+ isar-exclude-docs \
+ kselftest \
+ samefile \
+ sshd-regen-keys \
+"
+for pkg in ${PKGS}
+do
+ package=${pkg}
+
+ if [ "${pkg}" == "example-module" ]; then
+ package=${pkg}-\$\{KERNEL_NAME\}
+ fi
+
+ cat << _EOF_ > kas/package/pkg_${pkg}.yaml
+${HEADER}
+
+local_conf_header:
+ package-${pkg}: |
+ IMAGE_INSTALL:append = " ${package}"
+_EOF_
+done
--
2.20.1

Uladzimir Bely

unread,
Sep 22, 2023, 5:10:26 AM9/22/23
to isar-...@googlegroups.com
Add a brief description of `kas-container` usage.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
README.md | 3 +++
kas/README.md | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+)
create mode 100644 kas/README.md

diff --git a/README.md b/README.md
index 118acf52..f549aa9f 100644
--- a/README.md
+++ b/README.md
@@ -11,6 +11,9 @@ https://github.com/ilbers/isar/

Instruction on how to build can be found in the [User Manual](doc/user_manual.md).

+For beginners, it could be easier to use kas-based approach that allows to
+simply configure and run build using menu. Look at [kas/README](kas/README.md)
+for the instructions.

# Try

diff --git a/kas/README.md b/kas/README.md
new file mode 100644

Jan Kiszka

unread,
Sep 25, 2023, 7:35:13 AM9/25/23
to Uladzimir Bely, isar-...@googlegroups.com
This menu looks strangely empty when selecting sid[-ports]. Maybe make
it !depend on that or depend on supported distros?

Jan
Siemens AG, Technology
Linux Expert Center

Uladzimir Bely

unread,
Sep 25, 2023, 10:38:18 AM9/25/23
to Jan Kiszka, isar-...@googlegroups.com
Do you mean, hide complete menu if sid-ports/raspbian selected?

I also got an idea - not about mirrors, but in general... Maybe,
instead of always thinking on dependencies between distro and machine -
we could simply replace it with multiconfig selection?

E.g., in one menu we could simply list all possible multiconfigs. And,
even select several of them for the build simulaneously.

> Jan
>
> > diff --git a/kas/opt/mirror-debian.yaml b/kas/opt/mirror-

Jan Kiszka

unread,
Sep 25, 2023, 10:49:38 AM9/25/23
to Uladzimir Bely, isar-...@googlegroups.com
Yep.

>
> I also got an idea - not about mirrors, but in general... Maybe,
> instead of always thinking on dependencies between distro and machine -
> we could simply replace it with multiconfig selection?
>
> E.g., in one menu we could simply list all possible multiconfigs. And,
> even select several of them for the build simulaneously.

Also possible. Only similar case I'm aware of (for whatever reason):
https://github.com/siemens/jailhouse-images/blob/master/Kconfig

Jan

Uladzimir Bely

unread,
Sep 26, 2023, 1:37:46 AM9/26/23
to isar-...@googlegroups.com
This patchset adds YAML fragments and Kconfig files to support
configuring Isar using `kas-container menu` and building it
with 'kas-container script`.

The patchset can be treated as a reply to
`https://groups.google.com/g/isar-users/c/GgMvGOkXkcg` request.

Changes since v4:
- Hide empty "mirrors" menu if sid-ports or raspios distro selected
kas/opt/Kconfig | 148 ++++++
68 files changed, 1710 insertions(+)
create mode 100644 Kconfig
create mode 100644 kas/README.md
create mode 100644 kas/distro/Kconfig
create mode 100644 kas/distro/debian-bookworm.yaml
create mode 100644 kas/distro/debian-bullseye.yaml
create mode 100644 kas/distro/debian-buster.yaml
create mode 100644 kas/distro/debian-sid-ports.yaml
create mode 100644 kas/distro/raspios-bullseye.yaml
create mode 100644 kas/distro/ubuntu-focal.yaml
create mode 100644 kas/distro/ubuntu-jammy.yaml
create mode 100644 kas/image/Kconfig
create mode 100644 kas/image/isar-image-base.yaml
create mode 100644 kas/image/isar-image-debug.yaml
create mode 100644 kas/isar.yaml
create mode 100755 kas/kas-container
create mode 100644 kas/opt/Kconfig
create mode 100644 kas/opt/cache-deb-src.yaml
create mode 100644 kas/opt/ccache.yaml
create mode 100644 kas/opt/compat-arch.yaml
create mode 100644 kas/opt/crosscompile.yaml
create mode 100644 kas/opt/image-fstypes.yaml
create mode 100644 kas/opt/mirror-debian.yaml
create mode 100644 kas/opt/mirror-ubuntu.yaml
create mode 100644 kas/opt/user-isar.yaml
create mode 100644 kas/opt/user-root.yaml
create mode 100644 kas/package/Kconfig
create mode 100644 kas/package/packages-distro.yaml
create mode 100644 kas/package/pkg_cowsay.yaml
create mode 100644 kas/package/pkg_enable-fsck.yaml
create mode 100644 kas/package/pkg_example-module.yaml
create mode 100644 kas/package/pkg_example-prebuilt.yaml
create mode 100644 kas/package/pkg_example-raw.yaml
create mode 100644 kas/package/pkg_expand-on-first-boot.yaml
create mode 100644 kas/package/pkg_hello-isar.yaml
create mode 100644 kas/package/pkg_hello.yaml
create mode 100644 kas/package/pkg_isar-disable-apt-cache.yaml
create mode 100644 kas/package/pkg_isar-exclude-docs.yaml
create mode 100644 kas/package/pkg_kselftest.yaml
create mode 100644 kas/package/pkg_samefile.yaml
create mode 100644 kas/package/pkg_sshd-regen-keys.yaml

Uladzimir Bely

unread,
Sep 26, 2023, 1:37:46 AM9/26/23
to isar-...@googlegroups.com
Create required Kconfig files and appropriate YAML configuration
fragments for supporting initial build configuragion via
`kas-container menu`.

Since Isar does not support any possible combination of machines and
distros, there are particular dependencies between them exist.

User should select the distro first and after that it would be
possible to choose the board this distro supports.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
36 files changed, 442 insertions(+)
create mode 100644 Kconfig
create mode 100644 kas/distro/Kconfig
create mode 100644 kas/distro/debian-bookworm.yaml
create mode 100644 kas/distro/debian-bullseye.yaml
create mode 100644 kas/distro/debian-buster.yaml
create mode 100644 kas/distro/debian-sid-ports.yaml
create mode 100644 kas/distro/raspios-bullseye.yaml
create mode 100644 kas/distro/ubuntu-focal.yaml
create mode 100644 kas/distro/ubuntu-jammy.yaml
create mode 100644 kas/isar.yaml
diff --git a/.gitignore b/.gitignore
index 2525d41e..b1b51dd4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
*~
/*.patch
__pycache__
+.config.yaml*
+build/
diff --git a/Kconfig b/Kconfig
new file mode 100644
index 00000000..591fe765
--- /dev/null
+++ b/Kconfig
@@ -0,0 +1,18 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+#
+# Authors:
+# Uladzimir Bely <ub...@ilbers.de>
+
+mainmenu "Isar configuration"
+
+config KAS_INCLUDE_MAIN
+ string
+ default "kas/isar.yaml"
+
+config KAS_BUILD_SYSTEM
+ string
+ default "isar"
+
+source "kas/distro/Kconfig"
+source "kas/machine/Kconfig"
diff --git a/kas/distro/Kconfig b/kas/distro/Kconfig
new file mode 100644
index 00000000..bd762a98
--- /dev/null
+++ b/kas/distro/Kconfig
@@ -0,0 +1,46 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+#
+# Authors:
+# Uladzimir Bely <ub...@ilbers.de>
+
+menu "Distro selection"
+
+choice
new file mode 100644
index 00000000..2178e7d4
--- /dev/null
+++ b/kas/distro/debian-bookworm.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+distro: debian-bookworm
diff --git a/kas/distro/debian-bullseye.yaml b/kas/distro/debian-bullseye.yaml
new file mode 100644
index 00000000..23e286fb
--- /dev/null
+++ b/kas/distro/debian-bullseye.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+distro: debian-bullseye
diff --git a/kas/distro/debian-buster.yaml b/kas/distro/debian-buster.yaml
new file mode 100644
index 00000000..82949a8f
--- /dev/null
+++ b/kas/distro/debian-buster.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+distro: debian-buster
diff --git a/kas/distro/debian-sid-ports.yaml b/kas/distro/debian-sid-ports.yaml
new file mode 100644
index 00000000..52993646
--- /dev/null
+++ b/kas/distro/debian-sid-ports.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+distro: debian-sid-ports
diff --git a/kas/distro/raspios-bullseye.yaml b/kas/distro/raspios-bullseye.yaml
new file mode 100644
index 00000000..9a1e6abe
--- /dev/null
+++ b/kas/distro/raspios-bullseye.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+distro: raspios-bullseye
diff --git a/kas/distro/ubuntu-focal.yaml b/kas/distro/ubuntu-focal.yaml
new file mode 100644
index 00000000..6a68b796
--- /dev/null
+++ b/kas/distro/ubuntu-focal.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+distro: ubuntu-focal
diff --git a/kas/distro/ubuntu-jammy.yaml b/kas/distro/ubuntu-jammy.yaml
new file mode 100644
index 00000000..e6623871
--- /dev/null
+++ b/kas/distro/ubuntu-jammy.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+distro: ubuntu-jammy
diff --git a/kas/isar.yaml b/kas/isar.yaml
new file mode 100644
index 00000000..c8dec31c
--- /dev/null
+++ b/kas/isar.yaml
@@ -0,0 +1,21 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+build_system: isar
+
+target:
+- isar-image-base
+
+repos:
+ isar:
+ layers:
+ meta:
+ meta-isar:
+
+bblayers_conf_header:
+ standard: |
+ BBPATH = "${TOPDIR}"
+ BBFILES ?= ""
diff --git a/kas/machine/Kconfig b/kas/machine/Kconfig
new file mode 100644
index 00000000..f117724c
--- /dev/null
+++ b/kas/machine/Kconfig
@@ -0,0 +1,138 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+#
+# Authors:
+# Uladzimir Bely <ub...@ilbers.de>
+
+menu "Machine selection"
+
+choice
+ prompt "Machine selection"
+ default MACHINE_QEMU_AMD64
+
+config MACHINE_BANANAPI
+ bool "bananapi"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_CONTAINER_AMD64
+ bool "container-amd64"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_DE0_NANO_SOC
+ bool "de0-nano-soc"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_HIKEY
+ bool "hikey"
+ depends on DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_IMX6_SABRELITE
+ bool "imx6-sabrelite"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_NANOPI_NEO
+ bool "nanopi-neo"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_NANOPI_NEO_EFI
+ bool "nanopi-neo-efi"
+ depends on DEBIAN_BOOKWORM
+
+config MACHINE_PHIBOARD_MIRA
+ bool "phyboard-mira"
+ depends on DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_QEMU_AMD64_SB
+ bool "qemuamd64-sb"
+ depends on DEBIAN_BULLSEYE
+
+config MACHINE_QEMU_AMD64
+ bool "qemuamd64"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM || UBUNTU_FOCAL || UBUNTU_JAMMY
+
+config MACHINE_QEMU_ARM
+ bool "qemuarm"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_QEMU_ARM64
+ bool "qemuarm64"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM || UBUNTU_FOCAL || UBUNTU_JAMMY
+
+config MACHINE_QEMU_I386
+ bool "qemui386"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
+config MACHINE_QEMU_MIPSEL
+ bool "qemumipsel"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+
new file mode 100644
index 00000000..53bd3db2
--- /dev/null
+++ b/kas/machine/bananapi.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: bananapi
diff --git a/kas/machine/container-amd64.yaml b/kas/machine/container-amd64.yaml
new file mode 100644
index 00000000..93352c29
--- /dev/null
+++ b/kas/machine/container-amd64.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: container-amd64
diff --git a/kas/machine/de0-nano-soc.yaml b/kas/machine/de0-nano-soc.yaml
new file mode 100644
index 00000000..5dbe6916
--- /dev/null
+++ b/kas/machine/de0-nano-soc.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: de0-nano-soc
diff --git a/kas/machine/hikey.yaml b/kas/machine/hikey.yaml
new file mode 100644
index 00000000..56133afc
--- /dev/null
+++ b/kas/machine/hikey.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: hikey
diff --git a/kas/machine/imx6-sabrelite.yaml b/kas/machine/imx6-sabrelite.yaml
new file mode 100644
index 00000000..466649d5
--- /dev/null
+++ b/kas/machine/imx6-sabrelite.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: imx6-sabrelite
diff --git a/kas/machine/nanopi-neo-efi.yaml b/kas/machine/nanopi-neo-efi.yaml
new file mode 100644
index 00000000..a38e06d7
--- /dev/null
+++ b/kas/machine/nanopi-neo-efi.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: nanopi-neo-efi
diff --git a/kas/machine/nanopi-neo.yaml b/kas/machine/nanopi-neo.yaml
new file mode 100644
index 00000000..7973e5ad
--- /dev/null
+++ b/kas/machine/nanopi-neo.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: nanopi-neo
diff --git a/kas/machine/phyboard-mira.yaml b/kas/machine/phyboard-mira.yaml
new file mode 100644
index 00000000..f2081819
--- /dev/null
+++ b/kas/machine/phyboard-mira.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: phyboard-mira
diff --git a/kas/machine/qemuamd64-sb.yaml b/kas/machine/qemuamd64-sb.yaml
new file mode 100644
index 00000000..f2be984a
--- /dev/null
+++ b/kas/machine/qemuamd64-sb.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: qemuamd64-sb
diff --git a/kas/machine/qemuamd64.yaml b/kas/machine/qemuamd64.yaml
new file mode 100644
index 00000000..cb032e0c
--- /dev/null
+++ b/kas/machine/qemuamd64.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: qemuamd64
diff --git a/kas/machine/qemuarm.yaml b/kas/machine/qemuarm.yaml
new file mode 100644
index 00000000..8aae6bdb
--- /dev/null
+++ b/kas/machine/qemuarm.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: qemuarm
diff --git a/kas/machine/qemuarm64.yaml b/kas/machine/qemuarm64.yaml
new file mode 100644
index 00000000..f965d27b
--- /dev/null
+++ b/kas/machine/qemuarm64.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: qemuarm64
diff --git a/kas/machine/qemui386.yaml b/kas/machine/qemui386.yaml
new file mode 100644
index 00000000..913b419f
--- /dev/null
+++ b/kas/machine/qemui386.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: qemui386
diff --git a/kas/machine/qemumipsel.yaml b/kas/machine/qemumipsel.yaml
new file mode 100644
index 00000000..961fcfe0
--- /dev/null
+++ b/kas/machine/qemumipsel.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: qemumipsel
diff --git a/kas/machine/qemuriscv64.yaml b/kas/machine/qemuriscv64.yaml
new file mode 100644
index 00000000..57fd0980
--- /dev/null
+++ b/kas/machine/qemuriscv64.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: qemuriscv64
diff --git a/kas/machine/rpi-arm-v7.yaml b/kas/machine/rpi-arm-v7.yaml
new file mode 100644
index 00000000..26af1b63
--- /dev/null
+++ b/kas/machine/rpi-arm-v7.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: rpi-arm-v7
diff --git a/kas/machine/rpi-arm-v7l.yaml b/kas/machine/rpi-arm-v7l.yaml
new file mode 100644
index 00000000..86fdd02a
--- /dev/null
+++ b/kas/machine/rpi-arm-v7l.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: rpi-arm-v7l
diff --git a/kas/machine/rpi-arm.yaml b/kas/machine/rpi-arm.yaml
new file mode 100644
index 00000000..3be463e3
--- /dev/null
+++ b/kas/machine/rpi-arm.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: rpi-arm
diff --git a/kas/machine/rpi-arm64-v8.yaml b/kas/machine/rpi-arm64-v8.yaml
new file mode 100644
index 00000000..76b0d42b
--- /dev/null
+++ b/kas/machine/rpi-arm64-v8.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: rpi-arm64-v8
diff --git a/kas/machine/sifive-fu540.yaml b/kas/machine/sifive-fu540.yaml
new file mode 100644
index 00000000..f2bf8a13
--- /dev/null
+++ b/kas/machine/sifive-fu540.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: sifive-fu540
diff --git a/kas/machine/starfive-visionfive2.yaml b/kas/machine/starfive-visionfive2.yaml
new file mode 100644
index 00000000..0837308a
--- /dev/null
+++ b/kas/machine/starfive-visionfive2.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: starfive-visionfive2
diff --git a/kas/machine/stm32mp15x.yaml b/kas/machine/stm32mp15x.yaml
new file mode 100644
index 00000000..9e54c31d
--- /dev/null
+++ b/kas/machine/stm32mp15x.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: stm32mp15x
diff --git a/kas/machine/virtualbox.yaml b/kas/machine/virtualbox.yaml
new file mode 100644
index 00000000..539f3e3b
--- /dev/null
+++ b/kas/machine/virtualbox.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: virtualbox
diff --git a/kas/machine/vmware.yaml b/kas/machine/vmware.yaml
new file mode 100644
index 00000000..6dc49edb
--- /dev/null
+++ b/kas/machine/vmware.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+machine: vmware
--
2.20.1

Uladzimir Bely

unread,
Sep 26, 2023, 1:37:47 AM9/26/23
to isar-...@googlegroups.com
This allows to select better (faster) mirror for Debian and Ubuntu
distributions.

Isar DISTRO_APT_PREMIRRORS is used under the hood.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
Kconfig | 1 +
kas/opt/Kconfig | 43 ++++++++++++++++++++++++++++++++++++++
kas/opt/mirror-debian.yaml | 10 +++++++++
kas/opt/mirror-ubuntu.yaml | 10 +++++++++
4 files changed, 64 insertions(+)
create mode 100644 kas/opt/Kconfig
create mode 100644 kas/opt/mirror-debian.yaml
create mode 100644 kas/opt/mirror-ubuntu.yaml

diff --git a/Kconfig b/Kconfig
index 591fe765..a62fbf6c 100644
--- a/Kconfig
+++ b/Kconfig
@@ -16,3 +16,4 @@ config KAS_BUILD_SYSTEM

source "kas/distro/Kconfig"
source "kas/machine/Kconfig"
+source "kas/opt/Kconfig"
diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
new file mode 100644
index 00000000..22661bc3
--- /dev/null
+++ b/kas/opt/Kconfig
@@ -0,0 +1,43 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+#
+# Authors:
+# Uladzimir Bely <ub...@ilbers.de>
+
+menu "Mirror selection"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM || UBUNTU_FOCAL || UBUNTU_JAMMY
+
+config MIRROR_DEBIAN
+ bool "Use specific Debian mirror"
+ depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
+ help
diff --git a/kas/opt/mirror-debian.yaml b/kas/opt/mirror-debian.yaml
new file mode 100644
index 00000000..4dd4fc17
--- /dev/null
+++ b/kas/opt/mirror-debian.yaml
@@ -0,0 +1,10 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ mirror-debian: |
+ DISTRO_APT_PREMIRRORS += "\
+ http://deb\.debian\.org ${MIRROR_DEBIAN_URL}\n"
diff --git a/kas/opt/mirror-ubuntu.yaml b/kas/opt/mirror-ubuntu.yaml
new file mode 100644
index 00000000..3774b079
--- /dev/null
+++ b/kas/opt/mirror-ubuntu.yaml
@@ -0,0 +1,10 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ mirror-ubuntu: |
+ DISTRO_APT_PREMIRRORS += "\
+ http://archive\.ubuntu\.com ${MIRROR_UBUNTU_URL}\n"
--
2.20.1

Uladzimir Bely

unread,
Sep 26, 2023, 1:37:47 AM9/26/23
to isar-...@googlegroups.com
Taken from revision `044c7d0` (tag `4.0`) of `kas` project [1].

Basic usage:

```
./kas/kas-container menu
./kas/kas-container build
./kas/kas-container shell
```

[1] https://github.com/siemens/kas

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/kas-container | 562 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 562 insertions(+)
create mode 100755 kas/kas-container

diff --git a/kas/kas-container b/kas/kas-container
new file mode 100755

Uladzimir Bely

unread,
Sep 26, 2023, 1:37:48 AM9/26/23
to isar-...@googlegroups.com
This adds an option to the menu that can enable or disable
COMPAT_ARCH support for amd64 and arm64 architectures.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 9 +++++++++
kas/opt/compat-arch.yaml | 10 ++++++++++
2 files changed, 19 insertions(+)
create mode 100644 kas/opt/compat-arch.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 22661bc3..d7bf5ea2 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -41,3 +41,12 @@ config KAS_INCLUDE_MIRROR_UBUNTU
depends on MIRROR_UBUNTU

endmenu
+
+
+config COMPAT_ARCH
+ bool "Enable compat arch support"
+
+config KAS_INCLUDE_COMPAT_ARCH
+ string
+ default "kas/opt/compat-arch.yaml"
+ depends on COMPAT_ARCH
diff --git a/kas/opt/compat-arch.yaml b/kas/opt/compat-arch.yaml
new file mode 100644
index 00000000..520bc705
--- /dev/null
+++ b/kas/opt/compat-arch.yaml
@@ -0,0 +1,10 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:

Uladzimir Bely

unread,
Sep 26, 2023, 1:37:48 AM9/26/23
to isar-...@googlegroups.com
This adds an option to the menu that allows to enable support
of cross-compilation via ISAR_CROSS_COMPILE variable.

The option is enabled by default.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 10 ++++++++++
kas/opt/crosscompile.yaml | 9 +++++++++
2 files changed, 19 insertions(+)
create mode 100644 kas/opt/crosscompile.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index d7bf5ea2..f5e6e6dd 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -50,3 +50,13 @@ config KAS_INCLUDE_COMPAT_ARCH
string
default "kas/opt/compat-arch.yaml"
depends on COMPAT_ARCH
+
+
+config ISAR_CROSS_COMPILE
+ bool "Enable cross compilation mode"
+ default y
+
+config KAS_INCLUDE_ISAR_CROSS_COMPILE
+ string
+ default "kas/opt/crosscompile.yaml"
+ depends on ISAR_CROSS_COMPILE
diff --git a/kas/opt/crosscompile.yaml b/kas/opt/crosscompile.yaml
new file mode 100644
index 00000000..1b927ebd
--- /dev/null
+++ b/kas/opt/crosscompile.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:

Uladzimir Bely

unread,
Sep 26, 2023, 1:37:48 AM9/26/23
to isar-...@googlegroups.com
This part of configuration allows to choose which additional packages
(both from Isar and Debian) to include to the target image.

Isar packages are added to IMAGE_INSTALL since Debian packages go
to IMAGE_PREINSTALL.

The features are implemented as "string" parameter in the menu since
it reduces a number of required YAML fragments.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
Kconfig | 1 +
kas/package/Kconfig | 154 ++++++++++++++++++++
kas/package/packages-distro.yaml | 9 ++
kas/package/pkg_cowsay.yaml | 9 ++
kas/package/pkg_enable-fsck.yaml | 9 ++
kas/package/pkg_example-module.yaml | 9 ++
kas/package/pkg_example-prebuilt.yaml | 9 ++
kas/package/pkg_example-raw.yaml | 9 ++
kas/package/pkg_expand-on-first-boot.yaml | 9 ++
kas/package/pkg_hello-isar.yaml | 9 ++
kas/package/pkg_hello.yaml | 9 ++
kas/package/pkg_isar-disable-apt-cache.yaml | 9 ++
kas/package/pkg_isar-exclude-docs.yaml | 9 ++
kas/package/pkg_kselftest.yaml | 9 ++
kas/package/pkg_samefile.yaml | 9 ++
kas/package/pkg_sshd-regen-keys.yaml | 9 ++
16 files changed, 281 insertions(+)
create mode 100644 kas/package/Kconfig
create mode 100644 kas/package/packages-distro.yaml
create mode 100644 kas/package/pkg_cowsay.yaml
create mode 100644 kas/package/pkg_enable-fsck.yaml
create mode 100644 kas/package/pkg_example-module.yaml
create mode 100644 kas/package/pkg_example-prebuilt.yaml
create mode 100644 kas/package/pkg_example-raw.yaml
create mode 100644 kas/package/pkg_expand-on-first-boot.yaml
create mode 100644 kas/package/pkg_hello-isar.yaml
create mode 100644 kas/package/pkg_hello.yaml
create mode 100644 kas/package/pkg_isar-disable-apt-cache.yaml
create mode 100644 kas/package/pkg_isar-exclude-docs.yaml
create mode 100644 kas/package/pkg_kselftest.yaml
create mode 100644 kas/package/pkg_samefile.yaml
create mode 100644 kas/package/pkg_sshd-regen-keys.yaml

diff --git a/Kconfig b/Kconfig
index a62fbf6c..5a3050a4 100644
--- a/Kconfig
+++ b/Kconfig
@@ -16,4 +16,5 @@ config KAS_BUILD_SYSTEM

source "kas/distro/Kconfig"
source "kas/machine/Kconfig"
+source "kas/package/Kconfig"
source "kas/opt/Kconfig"
diff --git a/kas/package/Kconfig b/kas/package/Kconfig
new file mode 100644
index 00000000..139651cd
--- /dev/null
+++ b/kas/package/Kconfig
@@ -0,0 +1,154 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+#
+# Authors:
+# Uladzimir Bely <ub...@ilbers.de>
+
+menu "Packages selection"
+
+menu "Isar packages"
+
+config PACKAGE_COWSAY
+ bool "cowsay"
+ default y
+
+config KAS_INCLUDE_PACKAGE_COWSAY
+ string
+ default "kas/package/pkg_cowsay.yaml"
+ depends on PACKAGE_COWSAY
+
+
+config PACKAGE_ENABLE_FSCK
+ bool "enable-fsck"
+ default y
+
+config KAS_INCLUDE_PACKAGE_ENABLE_FSCK
+ string
+ default "kas/package/pkg_enable-fsck.yaml"
+ depends on PACKAGE_ENABLE_FSCK
+
+
+config PACKAGE_EXAMPLE_RAW
+ bool "example-raw"
+ default y
+
+config KAS_INCLUDE_PACKAGE_EXAMPLE_RAW
+ string
+ default "kas/package/pkg_example-raw.yaml"
+ depends on PACKAGE_EXAMPLE_RAW
+
+
+config PACKAGE_EXAMPLE_MODULE
+ bool "example-module"
+ default y
+
+config KAS_INCLUDE_PACKAGE_EXAMPLE_MODULE
+ string
+ default "kas/package/pkg_example-module.yaml"
+ depends on PACKAGE_EXAMPLE_MODULE
+
+
+config PACKAGE_EXAMPLE_PREBUILT
+ bool "example-prebuilt"
+ default y
+
+config KAS_INCLUDE_PACKAGE_EXAMPLE_PREBUILT
+ string
+ default "kas/package/pkg_example-prebuilt.yaml"
+ depends on PACKAGE_EXAMPLE_PREBUILT
+
+
+config PACKAGE_EXPAND_ON_FIRST_BOOT
+ bool "expand-on-first-boot"
+ default y
+
+config KAS_INCLUDE_PACKAGE_EXPAND_ON_FIRST_BOOT
+ string
+ default "kas/package/pkg_expand-on-first-boot.yaml"
+ depends on PACKAGE_EXPAND_ON_FIRST_BOOT
+
+
+config PACKAGE_HELLO
+ bool "hello"
+ default y
+
+config KAS_INCLUDE_PACKAGE_HELLO
+ string
+ default "kas/package/pkg_hello.yaml"
+ depends on PACKAGE_HELLO
+
+
+config PACKAGE_HELLO_ISAR
+ bool "hello-isar"
+ default y
+
+config KAS_INCLUDE_PACKAGE_HELLO_ISAR
+ string
+ default "kas/package/pkg_hello-isar.yaml"
+ depends on PACKAGE_HELLO_ISAR
+
+
+config PACKAGE_ISAR_EXCLUDE_DOCS
+ bool "isar-exclude-docs"
+ default y
+
+config KAS_INCLUDE_PACKAGE_ISAR_EXCLUDE_DOCS
+ string
+ default "kas/package/pkg_isar-exclude-docs.yaml"
+ depends on PACKAGE_ISAR_EXCLUDE_DOCS
+
+
+config PACKAGE_ISAR_DISABLE_APT_CACHE
+ bool "isar-disable-apt-cache"
+ default y
+
+config KAS_INCLUDE_PACKAGE_ISAR_DISABLE_APT_CACHE
+ string
+ default "kas/package/pkg_isar-disable-apt-cache.yaml"
+ depends on PACKAGE_ISAR_DISABLE_APT_CACHE
+
+
+config PACKAGE_KSELFTEST
+ bool "kselftest"
+ default n
+
+config KAS_INCLUDE_PACKAGE_KSELFTEST
+ string
+ default "kas/package/pkg_kselftest.yaml"
+ depends on PACKAGE_KSELFTEST
+
+
+config PACKAGE_SAMEFILE
+ bool "samefile"
+ default y
+
+config KAS_INCLUDE_PACKAGE_SAMEFILE
+ string
+ default "kas/package/pkg_samefile.yaml"
+ depends on PACKAGE_SAMEFILE
+
+
+config PACKAGE_SSHD_REGEN_KEYS
+ bool "sshd-regen-keys"
+ default y
+
+config KAS_INCLUDE_PACKAGE_SSHD_REGEN_KEYS
+ string
+ default "kas/package/pkg_sshd-regen-keys.yaml"
+ depends on PACKAGE_SSHD_REGEN_KEYS
+
+endmenu
+
+config KAS_IMAGE_PREINSTALL
+ string "Distro packages"
+ default "fdisk iproute2 iputils-ping ics-dhcp-client"
+ help
+ Space-separated list of packages that are provided by the selected distro.
+ These packages are downloaded from distro mirrors and just unpacked
+ and configured by Isar.
+
+config KAS_INCLUDE_PACKAGES_DISTRO
+ string
+ default "kas/package/packages-distro.yaml"
+
+endmenu
diff --git a/kas/package/packages-distro.yaml b/kas/package/packages-distro.yaml
new file mode 100644
index 00000000..a4bf9149
--- /dev/null
+++ b/kas/package/packages-distro.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ packages-distro: |
+ IMAGE_PREINSTALL:append = " ${KAS_IMAGE_PREINSTALL}"
diff --git a/kas/package/pkg_cowsay.yaml b/kas/package/pkg_cowsay.yaml
new file mode 100644
index 00000000..1b1a174d
--- /dev/null
+++ b/kas/package/pkg_cowsay.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-cowsay: |
+ IMAGE_INSTALL:append = " cowsay"
diff --git a/kas/package/pkg_enable-fsck.yaml b/kas/package/pkg_enable-fsck.yaml
new file mode 100644
index 00000000..2ea836d0
--- /dev/null
+++ b/kas/package/pkg_enable-fsck.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-enable-fsck: |
+ IMAGE_INSTALL:append = " enable-fsck"
diff --git a/kas/package/pkg_example-module.yaml b/kas/package/pkg_example-module.yaml
new file mode 100644
index 00000000..f756d681
--- /dev/null
+++ b/kas/package/pkg_example-module.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-example-module: |
+ IMAGE_INSTALL:append = " example-module-${KERNEL_NAME}"
diff --git a/kas/package/pkg_example-prebuilt.yaml b/kas/package/pkg_example-prebuilt.yaml
new file mode 100644
index 00000000..81800d85
--- /dev/null
+++ b/kas/package/pkg_example-prebuilt.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-example-prebuilt: |
+ IMAGE_INSTALL:append = " example-prebuilt"
diff --git a/kas/package/pkg_example-raw.yaml b/kas/package/pkg_example-raw.yaml
new file mode 100644
index 00000000..65298e70
--- /dev/null
+++ b/kas/package/pkg_example-raw.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-example-raw: |
+ IMAGE_INSTALL:append = " example-raw"
diff --git a/kas/package/pkg_expand-on-first-boot.yaml b/kas/package/pkg_expand-on-first-boot.yaml
new file mode 100644
index 00000000..d5dea83d
--- /dev/null
+++ b/kas/package/pkg_expand-on-first-boot.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-expand-on-first-boot: |
+ IMAGE_INSTALL:append = " expand-on-first-boot"
diff --git a/kas/package/pkg_hello-isar.yaml b/kas/package/pkg_hello-isar.yaml
new file mode 100644
index 00000000..391707ea
--- /dev/null
+++ b/kas/package/pkg_hello-isar.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-hello-isar: |
+ IMAGE_INSTALL:append = " hello-isar"
diff --git a/kas/package/pkg_hello.yaml b/kas/package/pkg_hello.yaml
new file mode 100644
index 00000000..9bb35486
--- /dev/null
+++ b/kas/package/pkg_hello.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-hello: |
+ IMAGE_INSTALL:append = " hello"
diff --git a/kas/package/pkg_isar-disable-apt-cache.yaml b/kas/package/pkg_isar-disable-apt-cache.yaml
new file mode 100644
index 00000000..bca3a6e9
--- /dev/null
+++ b/kas/package/pkg_isar-disable-apt-cache.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-isar-disable-apt-cache: |
+ IMAGE_INSTALL:append = " isar-disable-apt-cache"
diff --git a/kas/package/pkg_isar-exclude-docs.yaml b/kas/package/pkg_isar-exclude-docs.yaml
new file mode 100644
index 00000000..5eca26fa
--- /dev/null
+++ b/kas/package/pkg_isar-exclude-docs.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-isar-exclude-docs: |
+ IMAGE_INSTALL:append = " isar-exclude-docs"
diff --git a/kas/package/pkg_kselftest.yaml b/kas/package/pkg_kselftest.yaml
new file mode 100644
index 00000000..f87080aa
--- /dev/null
+++ b/kas/package/pkg_kselftest.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-kselftest: |
+ IMAGE_INSTALL:append = " kselftest"
diff --git a/kas/package/pkg_samefile.yaml b/kas/package/pkg_samefile.yaml
new file mode 100644
index 00000000..9738cf64
--- /dev/null
+++ b/kas/package/pkg_samefile.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ package-samefile: |
+ IMAGE_INSTALL:append = " samefile"
diff --git a/kas/package/pkg_sshd-regen-keys.yaml b/kas/package/pkg_sshd-regen-keys.yaml
new file mode 100644
index 00000000..94fe6e47
--- /dev/null
+++ b/kas/package/pkg_sshd-regen-keys.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:

Uladzimir Bely

unread,
Sep 26, 2023, 1:37:48 AM9/26/23
to isar-...@googlegroups.com
This allows to choose between base and debug Isar image.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
Kconfig | 1 +
kas/image/Kconfig | 32 ++++++++++++++++++++++++++++++++
kas/image/isar-image-base.yaml | 7 +++++++
kas/image/isar-image-debug.yaml | 7 +++++++
kas/isar.yaml | 3 ---
5 files changed, 47 insertions(+), 3 deletions(-)
create mode 100644 kas/image/Kconfig
create mode 100644 kas/image/isar-image-base.yaml
create mode 100644 kas/image/isar-image-debug.yaml

diff --git a/Kconfig b/Kconfig
index 5a3050a4..538c0a1b 100644
--- a/Kconfig
+++ b/Kconfig
@@ -16,5 +16,6 @@ config KAS_BUILD_SYSTEM

source "kas/distro/Kconfig"
source "kas/machine/Kconfig"
+source "kas/image/Kconfig"
source "kas/package/Kconfig"
source "kas/opt/Kconfig"
diff --git a/kas/image/Kconfig b/kas/image/Kconfig
new file mode 100644
index 00000000..8e617386
--- /dev/null
+++ b/kas/image/Kconfig
@@ -0,0 +1,32 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+#
+# Authors:
+# Uladzimir Bely <ub...@ilbers.de>
+
+menu "Image type selection"
+
+choice
+ prompt "Image type selection"
+ default IMAGE_BASE
+
+config IMAGE_BASE
+ bool "Base image"
+ help
+ This is the basic Isar image with bare minimum of preinstalled packages.
+ It's technically close do the debootstrapped system with packages
+ required to boot up the system.
+
+config IMAGE_DEBUG
+ bool "Debug image"
+ help
+ This image includes some tools preinstalled useful for debug.
+
+endchoice
+
+config KAS_INCLUDE_IMAGE
+ string
+ default "kas/image/isar-image-base.yaml" if IMAGE_BASE
+ default "kas/image/isar-image-debug.yaml" if IMAGE_DEBUG
+
+endmenu
diff --git a/kas/image/isar-image-base.yaml b/kas/image/isar-image-base.yaml
new file mode 100644
index 00000000..0666510f
--- /dev/null
+++ b/kas/image/isar-image-base.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+target: isar-image-base
diff --git a/kas/image/isar-image-debug.yaml b/kas/image/isar-image-debug.yaml
new file mode 100644
index 00000000..94c5a334
--- /dev/null
+++ b/kas/image/isar-image-debug.yaml
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+

Uladzimir Bely

unread,
Sep 26, 2023, 1:37:48 AM9/26/23
to isar-...@googlegroups.com
This adds an option to the menu that allows to enable or disable
ccache support for the build.

The option is enabled by default.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>

ccache
---
kas/opt/Kconfig | 10 ++++++++++
kas/opt/ccache.yaml | 9 +++++++++
2 files changed, 19 insertions(+)
create mode 100644 kas/opt/ccache.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index f5e6e6dd..981571f6 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -60,3 +60,13 @@ config KAS_INCLUDE_ISAR_CROSS_COMPILE
string
default "kas/opt/crosscompile.yaml"
depends on ISAR_CROSS_COMPILE
+
+
+config USE_CCACHE
+ bool "Use ccache during build"
+ default y
+
+config KAS_INCLUDE_USE_CCACHE
+ string
+ default "kas/opt/ccache.yaml"
+ depends on USE_CCACHE
diff --git a/kas/opt/ccache.yaml b/kas/opt/ccache.yaml
new file mode 100644
index 00000000..143c080e
--- /dev/null
+++ b/kas/opt/ccache.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+

Uladzimir Bely

unread,
Sep 26, 2023, 1:37:49 AM9/26/23
to isar-...@googlegroups.com
This allows user to select this option in the menu.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 12 ++++++++++++
kas/opt/cache-deb-src.yaml | 9 +++++++++
2 files changed, 21 insertions(+)
create mode 100644 kas/opt/cache-deb-src.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 5f14af43..05a1191f 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -94,3 +94,15 @@ config KAS_INCLUDE_USE_CCACHE
string
default "kas/opt/ccache.yaml"
depends on USE_CCACHE
+
+
+config CACHE_DEB_SRC
+ bool "Cache all source packages"
+ help
+ This feature allows to download srcpackages for any binary package that
+ took part in the build (including ones downloaded from distro mirrors).
+
+config KAS_INCLUDE_CACHE_DEB_SRC
+ string
+ default "kas/opt/cache-deb-src.yaml"
+ depends on CACHE_DEB_SRC
diff --git a/kas/opt/cache-deb-src.yaml b/kas/opt/cache-deb-src.yaml
new file mode 100644
index 00000000..6a170cd9
--- /dev/null
+++ b/kas/opt/cache-deb-src.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:

Uladzimir Bely

unread,
Sep 26, 2023, 1:37:49 AM9/26/23
to isar-...@googlegroups.com
This makes possible to adjust IMAGE_FSTYPES variable.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 24 ++++++++++++++++++++++++
kas/opt/image-fstypes.yaml | 9 +++++++++
2 files changed, 33 insertions(+)
create mode 100644 kas/opt/image-fstypes.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 981571f6..5f14af43 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -43,6 +43,30 @@ config KAS_INCLUDE_MIRROR_UBUNTU
endmenu


+config KAS_IMAGE_FSTYPES
+ string "Additional image fstypes"
+ default ""
+ help
+ Space-separated list of additional image fstypes to generate. Default
+ machine configurations set up IMAGE_FSTYPES variable, but it's possible
+ to select additonal ones to generate.
+ The following IMAGE_FSTYPES are supported:
+ cpio
+ fit
+ docker-archive
+ ext4
+ ova
+ tar
+ ubi
+ ubifs
+ wic
+ They can be followed by suffixes like ".gz" for compressing the image
+
+config KAS_INCLUDE_IMAGE_FSTYPES
+ string
+ default "kas/opt/image-fstypes.yaml"
+
+
config COMPAT_ARCH
bool "Enable compat arch support"

diff --git a/kas/opt/image-fstypes.yaml b/kas/opt/image-fstypes.yaml
new file mode 100644
index 00000000..f0658cbf
--- /dev/null
+++ b/kas/opt/image-fstypes.yaml
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:

Uladzimir Bely

unread,
Sep 26, 2023, 1:37:49 AM9/26/23
to isar-...@googlegroups.com
This allows to enable 'root' and 'isar' users and set their passwords.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
kas/opt/Kconfig | 40 ++++++++++++++++++++++++++++++++++++++++
kas/opt/user-isar.yaml | 19 +++++++++++++++++++
kas/opt/user-root.yaml | 11 +++++++++++
3 files changed, 70 insertions(+)
create mode 100644 kas/opt/user-isar.yaml
create mode 100644 kas/opt/user-root.yaml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 05a1191f..1619a4cf 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -43,6 +43,46 @@ config KAS_INCLUDE_MIRROR_UBUNTU
new file mode 100644
index 00000000..67611a40
--- /dev/null
+++ b/kas/opt/user-isar.yaml
@@ -0,0 +1,19 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:
+ user-isar: |
+ GROUPS += "isar"
+ GROUP_isar[flags] = "system"
+
+ USERS += "isar"
+ USER_isar[gid] = "isar"
+ USER_isar[home] = "/var/lib/isar"
+ USER_isar[comment] = "My isar user"
+ USER_isar[flags] = "system create-home"
+
+ USER_isar[password] = "${KAS_USER_ISAR_PASSWORD}"
+ USER_isar[flags] += "clear-text-password"
diff --git a/kas/opt/user-root.yaml b/kas/opt/user-root.yaml
new file mode 100644
index 00000000..65428e24
--- /dev/null
+++ b/kas/opt/user-root.yaml
@@ -0,0 +1,11 @@
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14
+
+local_conf_header:

Uladzimir Bely

unread,
Sep 26, 2023, 1:37:50 AM9/26/23
to isar-...@googlegroups.com
The script simplifies generating YAML files for new distros,
images, machines and Isar packages and helps to avoid copy-paste
typos possible when using manual way.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
scripts/generate_yaml.sh | 97 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 97 insertions(+)
create mode 100755 scripts/generate_yaml.sh

diff --git a/scripts/generate_yaml.sh b/scripts/generate_yaml.sh
new file mode 100755
index 00000000..e17d6d3d
--- /dev/null
+++ b/scripts/generate_yaml.sh
@@ -0,0 +1,97 @@
+#!/usr/bin/env bash
+
+# This software is a part of ISAR.
+# Copyright (c) 2023 ilbers GmbH
+# Authors:
+# Uladzimir Bely <ub...@ilbers.de>
+
+#
+# Script to generate yaml files for kas configuration
+#
+
+set -e
+
+cd "$(dirname "$0")/.."
+
+HEADER="\
+# This software is a part of ISAR.
+# Copyright (C) 2023 ilbers GmbH
+
+header:
+ version: 14"
+
+# Scan for distro configs, except "debian-common" used only for including
+
+DISTROS=$(find {meta,meta-isar}/conf/distro -iname *.conf -printf "%f\n" \
+ | sed -e 's/.conf$//' | grep -v "debian-common" | sort)
+
+for distro in ${DISTROS}
+do
+ cat << _EOF_ > kas/distro/${distro}.yaml
+${HEADER}
+
+distro: ${distro}
+_EOF_
+done
+
+# Scan for image recipes
+
+IMAGES=$(find {meta,meta-isar}/recipes-core/images -iname *.bb -printf "%f\n" \
+ | sed -e 's/.bb$//' | sort)
+
+for image in ${IMAGES}
+do
+ cat << _EOF_ > kas/image/${image}.yaml
+${HEADER}
+
+target: ${image}
+_EOF_
+done
+
+# Scan for machine configs, except "rpi-common" used only for including
+
+MACHINES=$(find meta-isar/conf/machine -iname *.conf -printf "%f\n" \
+ | sed -e 's/.conf$//' | grep -v "rpi-common" | sort)

Uladzimir Bely

unread,
Sep 26, 2023, 1:37:50 AM9/26/23
to isar-...@googlegroups.com
Add a brief description of `kas-container` usage.

Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
---
README.md | 3 +++
kas/README.md | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+)
create mode 100644 kas/README.md

diff --git a/README.md b/README.md
index 118acf52..f549aa9f 100644
--- a/README.md
+++ b/README.md
@@ -11,6 +11,9 @@ https://github.com/ilbers/isar/

Instruction on how to build can be found in the [User Manual](doc/user_manual.md).

+For beginners, it could be easier to use kas-based approach that allows to
+simply configure and run build using menu. Look at [kas/README](kas/README.md)
+for the instructions.

# Try

diff --git a/kas/README.md b/kas/README.md
new file mode 100644

Uladzimir Bely

unread,
Sep 26, 2023, 3:59:49 AM9/26/23
to Jan Kiszka, isar-...@googlegroups.com
Send v5 where "mirrors" menu is hidden if non-debian/ubuntu distro
selected.

Regarding multiconfig support.

I've acutally prepared some work-in-progress solution. It allows to
select several "multiconfig" items additionally to what user selected
in "distro" and "machine" menus.

But it currently does not enable required options depending on
distro/machine. E.g., if user selected "ubuntu" as distro, only URLS
related for ubuntu are shown in "mirrors" menu, even if some "debian"
multiconfigs are selected.

Another moment is that supporting multiconfigs makes "distro" and
"machine" menus a bit redundant. We could simply remove them and even
get some benefits from this:
- we should not care about implementing distro/machine dependency logic
in Kconfig - we simply use those multiconfigs we support in Isar
- user can see all possible configurations in one place and they are
not confused by missing hardware targets in the menu (if wrong distro
chosen for now).

So, we have several options:

1. Leave and merge it as is and don't add multiconfigs for now.
2. Add multiconfigs and keep distro/machine and all this dependency
logic in menu.
3. Add multiconfigs as a replacement of distro/machine menus.

For me, the third looks a bit more reasonable.

Uladzimir Bely

unread,
Sep 29, 2023, 2:53:22 AM9/29/23
to isar-...@googlegroups.com

Applied to next.

Reply all
Reply to author
Forward
0 new messages