public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v4 00/13] Support building Isar using kas
@ 2023-09-22  9:09 Uladzimir Bely
  2023-09-22  9:09 ` [PATCH v4 01/13] kas: Add initial Kconfig support Uladzimir Bely
                   ` (12 more replies)
  0 siblings, 13 replies; 18+ messages in thread
From: Uladzimir Bely @ 2023-09-22  9:09 UTC (permalink / raw)
  To: isar-users

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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v4 01/13] kas: Add initial Kconfig support
  2023-09-22  9:09 [PATCH v4 00/13] Support building Isar using kas Uladzimir Bely
@ 2023-09-22  9:09 ` Uladzimir Bely
  2023-09-22  9:09 ` [PATCH v4 02/13] kas: Add a local copy of kas-container script Uladzimir Bely
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Uladzimir Bely @ 2023-09-22  9:09 UTC (permalink / raw)
  To: isar-users

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 <ubely@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
 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

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 <ubely@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 <ubely@ilbers.de>
+
+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..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 <ubely@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
+
+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_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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v4 02/13] kas: Add a local copy of kas-container script
  2023-09-22  9:09 [PATCH v4 00/13] Support building Isar using kas Uladzimir Bely
  2023-09-22  9:09 ` [PATCH v4 01/13] kas: Add initial Kconfig support Uladzimir Bely
@ 2023-09-22  9:09 ` Uladzimir Bely
  2023-09-22  9:09 ` [PATCH v4 03/13] kas: Add mirror selection Uladzimir Bely
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Uladzimir Bely @ 2023-09-22  9:09 UTC (permalink / raw)
  To: isar-users

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 <ubely@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.kiszka@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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v4 03/13] kas: Add mirror selection
  2023-09-22  9:09 [PATCH v4 00/13] Support building Isar using kas Uladzimir Bely
  2023-09-22  9:09 ` [PATCH v4 01/13] kas: Add initial Kconfig support Uladzimir Bely
  2023-09-22  9:09 ` [PATCH v4 02/13] kas: Add a local copy of kas-container script Uladzimir Bely
@ 2023-09-22  9:09 ` Uladzimir Bely
  2023-09-25 11:34   ` Jan Kiszka
  2023-09-22  9:09 ` [PATCH v4 04/13] kas: Add packages selection Uladzimir Bely
                   ` (9 subsequent siblings)
  12 siblings, 1 reply; 18+ messages in thread
From: Uladzimir Bely @ 2023-09-22  9:09 UTC (permalink / raw)
  To: isar-users

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 <ubely@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 <ubely@ilbers.de>
+
+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..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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v4 04/13] kas: Add packages selection
  2023-09-22  9:09 [PATCH v4 00/13] Support building Isar using kas Uladzimir Bely
                   ` (2 preceding siblings ...)
  2023-09-22  9:09 ` [PATCH v4 03/13] kas: Add mirror selection Uladzimir Bely
@ 2023-09-22  9:09 ` Uladzimir Bely
  2023-09-22  9:09 ` [PATCH v4 05/13] kas: Add COMPAT_ARCH support Uladzimir Bely
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Uladzimir Bely @ 2023-09-22  9:09 UTC (permalink / raw)
  To: isar-users

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 <ubely@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 <ubely@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:
+  package-sshd-regen-keys: |
+    IMAGE_INSTALL:append = " sshd-regen-keys"
-- 
2.20.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v4 05/13] kas: Add COMPAT_ARCH support
  2023-09-22  9:09 [PATCH v4 00/13] Support building Isar using kas Uladzimir Bely
                   ` (3 preceding siblings ...)
  2023-09-22  9:09 ` [PATCH v4 04/13] kas: Add packages selection Uladzimir Bely
@ 2023-09-22  9:09 ` Uladzimir Bely
  2023-09-22  9:09 ` [PATCH v4 06/13] kas: Add cross compilation mode selection support Uladzimir Bely
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Uladzimir Bely @ 2023-09-22  9:09 UTC (permalink / raw)
  To: isar-users

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 <ubely@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:
+  compat-arch: |
+    ISAR_ENABLE_COMPAT_ARCH_amd64 = "1"
+    ISAR_ENABLE_COMPAT_ARCH_arm64 = "1"
-- 
2.20.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v4 06/13] kas: Add cross compilation mode selection support
  2023-09-22  9:09 [PATCH v4 00/13] Support building Isar using kas Uladzimir Bely
                   ` (4 preceding siblings ...)
  2023-09-22  9:09 ` [PATCH v4 05/13] kas: Add COMPAT_ARCH support Uladzimir Bely
@ 2023-09-22  9:09 ` Uladzimir Bely
  2023-09-22  9:09 ` [PATCH v4 07/13] kas: Add ccache option Uladzimir Bely
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Uladzimir Bely @ 2023-09-22  9:09 UTC (permalink / raw)
  To: isar-users

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 <ubely@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:
+  crosscompile: |
+    ISAR_CROSS_COMPILE = "1"
-- 
2.20.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v4 07/13] kas: Add ccache option
  2023-09-22  9:09 [PATCH v4 00/13] Support building Isar using kas Uladzimir Bely
                   ` (5 preceding siblings ...)
  2023-09-22  9:09 ` [PATCH v4 06/13] kas: Add cross compilation mode selection support Uladzimir Bely
@ 2023-09-22  9:09 ` Uladzimir Bely
  2023-09-22  9:09 ` [PATCH v4 08/13] kas: Add image type selection Uladzimir Bely
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Uladzimir Bely @ 2023-09-22  9:09 UTC (permalink / raw)
  To: isar-users

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 <ubely@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:
+  ccache: |
+    USE_CCACHE = "1"
-- 
2.20.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v4 08/13] kas: Add image type selection
  2023-09-22  9:09 [PATCH v4 00/13] Support building Isar using kas Uladzimir Bely
                   ` (6 preceding siblings ...)
  2023-09-22  9:09 ` [PATCH v4 07/13] kas: Add ccache option Uladzimir Bely
@ 2023-09-22  9:09 ` Uladzimir Bely
  2023-09-22  9:09 ` [PATCH v4 09/13] kas: Add IMAGE_FSTYPES selection Uladzimir Bely
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Uladzimir Bely @ 2023-09-22  9:09 UTC (permalink / raw)
  To: isar-users

This allows to choose between base and debug Isar image.

Signed-off-by: Uladzimir Bely <ubely@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 <ubely@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:
 
 build_system: isar
 
-target:
-- isar-image-base
-
 repos:
   isar:
     layers:
-- 
2.20.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v4 09/13] kas: Add IMAGE_FSTYPES selection
  2023-09-22  9:09 [PATCH v4 00/13] Support building Isar using kas Uladzimir Bely
                   ` (7 preceding siblings ...)
  2023-09-22  9:09 ` [PATCH v4 08/13] kas: Add image type selection Uladzimir Bely
@ 2023-09-22  9:09 ` Uladzimir Bely
  2023-09-22  9:10 ` [PATCH v4 10/13] kas: Support CACHE_DEB_SRC option in menu Uladzimir Bely
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Uladzimir Bely @ 2023-09-22  9:09 UTC (permalink / raw)
  To: isar-users

This makes possible to adjust IMAGE_FSTYPES variable.

Signed-off-by: Uladzimir Bely <ubely@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:
+  image-fstypes: |
+    IMAGE_FSTYPES:append = " ${KAS_IMAGE_FSTYPES}"
-- 
2.20.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v4 10/13] kas: Support CACHE_DEB_SRC option in menu
  2023-09-22  9:09 [PATCH v4 00/13] Support building Isar using kas Uladzimir Bely
                   ` (8 preceding siblings ...)
  2023-09-22  9:09 ` [PATCH v4 09/13] kas: Add IMAGE_FSTYPES selection Uladzimir Bely
@ 2023-09-22  9:10 ` Uladzimir Bely
  2023-09-22  9:10 ` [PATCH v4 11/13] kas: Add options to activate predefined users Uladzimir Bely
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Uladzimir Bely @ 2023-09-22  9:10 UTC (permalink / raw)
  To: isar-users

This allows user to select this option in the menu.

Signed-off-by: Uladzimir Bely <ubely@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
+
+local_conf_header:
+  cache-deb-src: |
+    BASE_REPO_FEATURES:append = " cache-deb-src"
-- 
2.20.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v4 11/13] kas: Add options to activate predefined users
  2023-09-22  9:09 [PATCH v4 00/13] Support building Isar using kas Uladzimir Bely
                   ` (9 preceding siblings ...)
  2023-09-22  9:10 ` [PATCH v4 10/13] kas: Support CACHE_DEB_SRC option in menu Uladzimir Bely
@ 2023-09-22  9:10 ` Uladzimir Bely
  2023-09-22  9:10 ` [PATCH v4 12/13] kas: Add kas/README.md Uladzimir Bely
  2023-09-22  9:10 ` [PATCH v4 13/13] scripts: Add a script to generate kas yaml configs Uladzimir Bely
  12 siblings, 0 replies; 18+ messages in thread
From: Uladzimir Bely @ 2023-09-22  9:10 UTC (permalink / raw)
  To: isar-users

This allows to enable 'root' and 'isar' users and set their passwords.

Signed-off-by: Uladzimir Bely <ubely@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
 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..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:
+  user-root: |
+    USERS += "root"
+    USER_root[password] ??= "${KAS_USER_ROOT_PASSWORD}"
+    USER_root[flags] += "clear-text-password"
-- 
2.20.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v4 12/13] kas: Add kas/README.md
  2023-09-22  9:09 [PATCH v4 00/13] Support building Isar using kas Uladzimir Bely
                   ` (10 preceding siblings ...)
  2023-09-22  9:10 ` [PATCH v4 11/13] kas: Add options to activate predefined users Uladzimir Bely
@ 2023-09-22  9:10 ` Uladzimir Bely
  2023-09-22  9:10 ` [PATCH v4 13/13] scripts: Add a script to generate kas yaml configs Uladzimir Bely
  12 siblings, 0 replies; 18+ messages in thread
From: Uladzimir Bely @ 2023-09-22  9:10 UTC (permalink / raw)
  To: isar-users

Add a brief description of `kas-container` usage.

Signed-off-by: Uladzimir Bely <ubely@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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v4 13/13] scripts: Add a script to generate kas yaml configs
  2023-09-22  9:09 [PATCH v4 00/13] Support building Isar using kas Uladzimir Bely
                   ` (11 preceding siblings ...)
  2023-09-22  9:10 ` [PATCH v4 12/13] kas: Add kas/README.md Uladzimir Bely
@ 2023-09-22  9:10 ` Uladzimir Bely
  12 siblings, 0 replies; 18+ messages in thread
From: Uladzimir Bely @ 2023-09-22  9:10 UTC (permalink / raw)
  To: isar-users

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 <ubely@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 <ubely@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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v4 03/13] kas: Add mirror selection
  2023-09-22  9:09 ` [PATCH v4 03/13] kas: Add mirror selection Uladzimir Bely
@ 2023-09-25 11:34   ` Jan Kiszka
  2023-09-25 14:38     ` Uladzimir Bely
  0 siblings, 1 reply; 18+ messages in thread
From: Jan Kiszka @ 2023-09-25 11:34 UTC (permalink / raw)
  To: Uladzimir Bely, isar-users

On 22.09.23 11:09, Uladzimir Bely wrote:
> 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 <ubely@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 <ubely@ilbers.de>
> +
> +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

This menu looks strangely empty when selecting sid[-ports]. Maybe make
it !depend on that or depend on supported distros?

Jan

> 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"

-- 
Siemens AG, Technology
Linux Expert Center


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v4 03/13] kas: Add mirror selection
  2023-09-25 11:34   ` Jan Kiszka
@ 2023-09-25 14:38     ` Uladzimir Bely
  2023-09-25 14:49       ` Jan Kiszka
  0 siblings, 1 reply; 18+ messages in thread
From: Uladzimir Bely @ 2023-09-25 14:38 UTC (permalink / raw)
  To: Jan Kiszka, isar-users

On Mon, 2023-09-25 at 13:34 +0200, Jan Kiszka wrote:
> On 22.09.23 11:09, Uladzimir Bely wrote:
> > 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 <ubely@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 <ubely@ilbers.de>
> > +
> > +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
> 
> This menu looks strangely empty when selecting sid[-ports]. Maybe
> make
> it !depend on that or depend on supported distros?
> 

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-
> > 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"
> 


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v4 03/13] kas: Add mirror selection
  2023-09-25 14:38     ` Uladzimir Bely
@ 2023-09-25 14:49       ` Jan Kiszka
  2023-09-26  7:59         ` Uladzimir Bely
  0 siblings, 1 reply; 18+ messages in thread
From: Jan Kiszka @ 2023-09-25 14:49 UTC (permalink / raw)
  To: Uladzimir Bely, isar-users

On 25.09.23 16:38, Uladzimir Bely wrote:
> On Mon, 2023-09-25 at 13:34 +0200, Jan Kiszka wrote:
>> On 22.09.23 11:09, Uladzimir Bely wrote:
>>> 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 <ubely@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 <ubely@ilbers.de>
>>> +
>>> +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
>>
>> This menu looks strangely empty when selecting sid[-ports]. Maybe
>> make
>> it !depend on that or depend on supported distros?
>>
> 
> Do you mean, hide complete menu if sid-ports/raspbian selected?

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

-- 
Siemens AG, Technology
Linux Expert Center


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v4 03/13] kas: Add mirror selection
  2023-09-25 14:49       ` Jan Kiszka
@ 2023-09-26  7:59         ` Uladzimir Bely
  0 siblings, 0 replies; 18+ messages in thread
From: Uladzimir Bely @ 2023-09-26  7:59 UTC (permalink / raw)
  To: Jan Kiszka, isar-users

On Mon, 2023-09-25 at 16:49 +0200, Jan Kiszka wrote:
> On 25.09.23 16:38, Uladzimir Bely wrote:
> > On Mon, 2023-09-25 at 13:34 +0200, Jan Kiszka wrote:
> > > On 22.09.23 11:09, Uladzimir Bely wrote:
> > > > 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 <ubely@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 <ubely@ilbers.de>
> > > > +
> > > > +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
> > > 
> > > This menu looks strangely empty when selecting sid[-ports]. Maybe
> > > make
> > > it !depend on that or depend on supported distros?
> > > 
> > 
> > Do you mean, hide complete menu if sid-ports/raspbian selected?
> 
> 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
> 

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.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-09-26  7:59 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-22  9:09 [PATCH v4 00/13] Support building Isar using kas Uladzimir Bely
2023-09-22  9:09 ` [PATCH v4 01/13] kas: Add initial Kconfig support Uladzimir Bely
2023-09-22  9:09 ` [PATCH v4 02/13] kas: Add a local copy of kas-container script Uladzimir Bely
2023-09-22  9:09 ` [PATCH v4 03/13] kas: Add mirror selection Uladzimir Bely
2023-09-25 11:34   ` Jan Kiszka
2023-09-25 14:38     ` Uladzimir Bely
2023-09-25 14:49       ` Jan Kiszka
2023-09-26  7:59         ` Uladzimir Bely
2023-09-22  9:09 ` [PATCH v4 04/13] kas: Add packages selection Uladzimir Bely
2023-09-22  9:09 ` [PATCH v4 05/13] kas: Add COMPAT_ARCH support Uladzimir Bely
2023-09-22  9:09 ` [PATCH v4 06/13] kas: Add cross compilation mode selection support Uladzimir Bely
2023-09-22  9:09 ` [PATCH v4 07/13] kas: Add ccache option Uladzimir Bely
2023-09-22  9:09 ` [PATCH v4 08/13] kas: Add image type selection Uladzimir Bely
2023-09-22  9:09 ` [PATCH v4 09/13] kas: Add IMAGE_FSTYPES selection Uladzimir Bely
2023-09-22  9:10 ` [PATCH v4 10/13] kas: Support CACHE_DEB_SRC option in menu Uladzimir Bely
2023-09-22  9:10 ` [PATCH v4 11/13] kas: Add options to activate predefined users Uladzimir Bely
2023-09-22  9:10 ` [PATCH v4 12/13] kas: Add kas/README.md Uladzimir Bely
2023-09-22  9:10 ` [PATCH v4 13/13] scripts: Add a script to generate kas yaml configs Uladzimir Bely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox