public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH 00/13] Support building Isar using kas
@ 2023-09-15  6:44 Uladzimir Bely
  2023-09-15  6:44 ` [PATCH 01/13] kas: Add initial Kconfig support Uladzimir Bely
                   ` (13 more replies)
  0 siblings, 14 replies; 26+ messages in thread
From: Uladzimir Bely @ 2023-09-15  6:44 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`.

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

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

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

-- 
2.20.1


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

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

Create required Kconfig files and appropriate YAML configuration
fragments for supporting initial build configuragion via
`kas-container menu`.

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

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


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

* [PATCH 02/13] kas: Add a local copy of kas-container script
  2023-09-15  6:44 [PATCH 00/13] Support building Isar using kas Uladzimir Bely
  2023-09-15  6:44 ` [PATCH 01/13] kas: Add initial Kconfig support Uladzimir Bely
@ 2023-09-15  6:44 ` Uladzimir Bely
  2023-09-15  6:44 ` [PATCH 03/13] kas: Add dependencies between machine and distro configuration Uladzimir Bely
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 26+ messages in thread
From: Uladzimir Bely @ 2023-09-15  6:44 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] 26+ messages in thread

* [PATCH 03/13] kas: Add dependencies between machine and distro configuration
  2023-09-15  6:44 [PATCH 00/13] Support building Isar using kas Uladzimir Bely
  2023-09-15  6:44 ` [PATCH 01/13] kas: Add initial Kconfig support Uladzimir Bely
  2023-09-15  6:44 ` [PATCH 02/13] kas: Add a local copy of kas-container script Uladzimir Bely
@ 2023-09-15  6:44 ` Uladzimir Bely
  2023-09-16  9:34   ` Jan Kiszka
  2023-09-15  6:44 ` [PATCH 04/13] kas: Add mirror selection Uladzimir Bely
                   ` (10 subsequent siblings)
  13 siblings, 1 reply; 26+ messages in thread
From: Uladzimir Bely @ 2023-09-15  6:44 UTC (permalink / raw)
  To: isar-users

Isar can't build any combination of supported machines and distros.
For the specific machine, only a limited set of distros can be built.

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

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

diff --git a/kas/distro/Kconfig b/kas/distro/Kconfig
index 0bb58c87..4453a3df 100644
--- a/kas/distro/Kconfig
+++ b/kas/distro/Kconfig
@@ -6,27 +6,55 @@ choice
 
 config DEBIAN_BUSTER
 	bool "Debian Buster (10)"
+	depends on DEP_DEBIAN_BUSTER
 
 config DEBIAN_BULLSEYE
 	bool "Debian Bullseye (11)"
+	depends on DEP_DEBIAN_BULLSEYE
 
 config DEBIAN_BOOKWORM
 	bool "Debian Bookworm (12)"
+	depends on DEP_DEBIAN_BOOKWORM
 
 config DEBIAN_SID_PORTS
 	bool "Debian Sid (unstable) with unofficial ports"
+	depends on DEP_DEBIAN_SID_PORTS
 
 config RASPIOS_BULLSEYE
   bool "Raspi OS Bullseye (11)"
+	depends on DEP_RASPIOS_BULLSEYE
 
 config UBUNTU_FOCAL
 	bool "Ubuntu Focal (20.04)"
+	depends on DEP_UBUNTU_FOCAL
 
 config UBUNTU_JAMMY
 	bool "Ubuntu Jammy (22.04)"
+	depends on DEP_UBUNTU_JAMMY
 
 endchoice
 
+config DEP_DEBIAN_BUSTER
+	bool
+
+config DEP_DEBIAN_BULLSEYE
+	bool
+
+config DEP_DEBIAN_BOOKWORM
+	bool
+
+config DEP_DEBIAN_SID_PORTS
+	bool
+
+config DEP_RASPIOS_BULLSEYE
+  bool
+
+config DEP_UBUNTU_FOCAL
+	bool
+
+config DEP_UBUNTU_JAMMY
+	bool
+
 config KAS_INCLUDE_DISTRO
 	string
 	default "kas/distro/debian-buster.yml" if DEBIAN_BUSTER
diff --git a/kas/machine/Kconfig b/kas/machine/Kconfig
index 7989a362..4a713c29 100644
--- a/kas/machine/Kconfig
+++ b/kas/machine/Kconfig
@@ -6,69 +6,118 @@ choice
 
 config MACHINE_BANANAPI
 	bool "bananapi"
+	select DEP_DEBIAN_BUSTER
+	select DEP_DEBIAN_BULLSEYE
+	select DEP_DEBIAN_BOOKWORM
 
 config MACHINE_CONTAINER_AMD64
 	bool "container-amd64"
+	select DEP_DEBIAN_BUSTER
+	select DEP_DEBIAN_BULLSEYE
+	select DEP_DEBIAN_BOOKWORM
 
 config MACHINE_DE0_NANO_SOC
 	bool "de0-nano-soc"
+	select DEP_DEBIAN_BUSTER
+	select DEP_DEBIAN_BULLSEYE
+	select DEP_DEBIAN_BOOKWORM
 
 config MACHINE_HIKEY
 	bool "hikey"
+	select DEP_DEBIAN_BULLSEYE
+	select DEP_DEBIAN_BOOKWORM
 
 config MACHINE_IMX6_SABRELITE
 	bool "imx6-sabrelite"
+	select DEP_DEBIAN_BUSTER
+	select DEP_DEBIAN_BULLSEYE
+	select DEP_DEBIAN_BOOKWORM
 
 config MACHINE_IMX6_NANOPI_NEO
 	bool "nanopi-neo"
+	select DEP_DEBIAN_BUSTER
+	select DEP_DEBIAN_BULLSEYE
+	select DEP_DEBIAN_BOOKWORM
 
 config MACHINE_PHIBOARD_MIRA
 	bool "phyboard-mira"
+	select DEP_DEBIAN_BULLSEYE
+	select DEP_DEBIAN_BOOKWORM
 
 config MACHINE_QEMU_AMD64_SB
 	bool "qemuamd64-sb"
+	select DEP_DEBIAN_BULLSEYE
 
 config MACHINE_QEMU_AMD64
 	bool "qemuamd64"
+	select DEP_DEBIAN_BUSTER
+	select DEP_DEBIAN_BULLSEYE
+	select DEP_DEBIAN_BOOKWORM
+	select DEP_UBUNTU_FOCAL
+	select DEP_UBUNTU_JAMMY
 
 config MACHINE_QEMU_ARM
 	bool "qemuarm"
+	select DEP_DEBIAN_BUSTER
+	select DEP_DEBIAN_BULLSEYE
+	select DEP_DEBIAN_BOOKWORM
 
 config MACHINE_QEMU_ARM64
 	bool "qemuarm64"
+	select DEP_DEBIAN_BUSTER
+	select DEP_DEBIAN_BULLSEYE
+	select DEP_DEBIAN_BOOKWORM
+	select DEP_UBUNTU_FOCAL
+	select DEP_UBUNTU_JAMMY
 
 config MACHINE_QEMU_I386
 	bool "qemui386"
+	select DEP_DEBIAN_BUSTER
+	select DEP_DEBIAN_BULLSEYE
+	select DEP_DEBIAN_BOOKWORM
 
 config MACHINE_QEMU_MIPSEL
 	bool "qemumipsel"
+	select DEP_DEBIAN_BUSTER
+	select DEP_DEBIAN_BULLSEYE
+	select DEP_DEBIAN_BOOKWORM
 
 config MACHINE_QEMU_RISCV64
 	bool "qemuriscv64"
+	select DEP_DEBIAN_SID_PORTS
 
 config MACHINE_RPI_ARM_V7
 	bool "rpi-arm-v7"
+	select DEP_RASPIOS_BULLSEYE
 
 config MACHINE_RPI_ARM_V7L
 	bool "rpi-arm-v7l"
+	select DEP_RASPIOS_BULLSEYE
 
 config MACHINE_RPI_ARM
 	bool "rpi-arm"
+	select DEP_RASPIOS_BULLSEYE
 
 config MACHINE_RPI_ARM64_V8
 	bool "rpi-arm64-v8"
+	select DEP_RASPIOS_BULLSEYE
 
 config MACHINE_SIFIVE_FU540
 	bool "sifive-fu540"
+	select DEP_DEBIAN_SID_PORTS
 
 config MACHINE_STARFIVE_VISIONFIVE2
 	bool "starfive-visionfive2"
+	select DEP_DEBIAN_SID_PORTS
 
 config MACHINE_STM32MP15X
 	bool "stm32mp15x"
+	select DEP_DEBIAN_BULLSEYE
+	select DEP_DEBIAN_BOOKWORM
 
 config MACHINE_VIRTUALBOX
 	bool "virtualbox"
+	select DEP_DEBIAN_BULLSEYE
 
 config MACHINE_VMWARE
 	bool "vmware"
-- 
2.20.1


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

* [PATCH 04/13] kas: Add mirror selection
  2023-09-15  6:44 [PATCH 00/13] Support building Isar using kas Uladzimir Bely
                   ` (2 preceding siblings ...)
  2023-09-15  6:44 ` [PATCH 03/13] kas: Add dependencies between machine and distro configuration Uladzimir Bely
@ 2023-09-15  6:44 ` Uladzimir Bely
  2023-09-16  9:34   ` Jan Kiszka
  2023-09-15  6:44 ` [PATCH 05/13] kas: Add packages selection Uladzimir Bely
                   ` (9 subsequent siblings)
  13 siblings, 1 reply; 26+ messages in thread
From: Uladzimir Bely @ 2023-09-15  6:44 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           | 34 ++++++++++++++++++++++++++++++++++
 kas/opt/mirror-debian.yml |  7 +++++++
 kas/opt/mirror-ubuntu.yml |  7 +++++++
 4 files changed, 49 insertions(+)
 create mode 100644 kas/opt/Kconfig
 create mode 100644 kas/opt/mirror-debian.yml
 create mode 100644 kas/opt/mirror-ubuntu.yml

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


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

* [PATCH 05/13] kas: Add packages selection
  2023-09-15  6:44 [PATCH 00/13] Support building Isar using kas Uladzimir Bely
                   ` (3 preceding siblings ...)
  2023-09-15  6:44 ` [PATCH 04/13] kas: Add mirror selection Uladzimir Bely
@ 2023-09-15  6:44 ` Uladzimir Bely
  2023-09-16  9:37   ` Jan Kiszka
  2023-09-15  6:44 ` [PATCH 06/13] kas: Add COMPAT_ARCH support Uladzimir Bely
                   ` (8 subsequent siblings)
  13 siblings, 1 reply; 26+ messages in thread
From: Uladzimir Bely @ 2023-09-15  6:44 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>
---
 kas/opt/Kconfig             | 41 +++++++++++++++++++++++++++++++++++++
 kas/opt/packages-distro.yml |  6 ++++++
 kas/opt/packages-isar.yml   |  6 ++++++
 3 files changed, 53 insertions(+)
 create mode 100644 kas/opt/packages-distro.yml
 create mode 100644 kas/opt/packages-isar.yml

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


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

* [PATCH 06/13] kas: Add COMPAT_ARCH support
  2023-09-15  6:44 [PATCH 00/13] Support building Isar using kas Uladzimir Bely
                   ` (4 preceding siblings ...)
  2023-09-15  6:44 ` [PATCH 05/13] kas: Add packages selection Uladzimir Bely
@ 2023-09-15  6:44 ` Uladzimir Bely
  2023-09-15  6:44 ` [PATCH 07/13] kas: Add cross compilation mode selection support Uladzimir Bely
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 26+ messages in thread
From: Uladzimir Bely @ 2023-09-15  6:44 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.yml | 7 +++++++
 2 files changed, 16 insertions(+)
 create mode 100644 kas/opt/compat-arch.yml

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


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

* [PATCH 07/13] kas: Add cross compilation mode selection support
  2023-09-15  6:44 [PATCH 00/13] Support building Isar using kas Uladzimir Bely
                   ` (5 preceding siblings ...)
  2023-09-15  6:44 ` [PATCH 06/13] kas: Add COMPAT_ARCH support Uladzimir Bely
@ 2023-09-15  6:44 ` Uladzimir Bely
  2023-09-15  6:44 ` [PATCH 08/13] kas: Add ccache option Uladzimir Bely
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 26+ messages in thread
From: Uladzimir Bely @ 2023-09-15  6:44 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.yml |  6 ++++++
 2 files changed, 16 insertions(+)
 create mode 100644 kas/opt/crosscompile.yml

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


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

* [PATCH 08/13] kas: Add ccache option
  2023-09-15  6:44 [PATCH 00/13] Support building Isar using kas Uladzimir Bely
                   ` (6 preceding siblings ...)
  2023-09-15  6:44 ` [PATCH 07/13] kas: Add cross compilation mode selection support Uladzimir Bely
@ 2023-09-15  6:44 ` Uladzimir Bely
  2023-09-15  6:44 ` [PATCH 09/13] kas: Add image type selection Uladzimir Bely
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 26+ messages in thread
From: Uladzimir Bely @ 2023-09-15  6:44 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.yml |  6 ++++++
 2 files changed, 16 insertions(+)
 create mode 100644 kas/opt/ccache.yml

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


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

* [PATCH 09/13] kas: Add image type selection
  2023-09-15  6:44 [PATCH 00/13] Support building Isar using kas Uladzimir Bely
                   ` (7 preceding siblings ...)
  2023-09-15  6:44 ` [PATCH 08/13] kas: Add ccache option Uladzimir Bely
@ 2023-09-15  6:44 ` Uladzimir Bely
  2023-09-16  9:57   ` Jan Kiszka
  2023-09-15  6:44 ` [PATCH 10/13] kas: Add IMAGE_FSTYPES selection Uladzimir Bely
                   ` (4 subsequent siblings)
  13 siblings, 1 reply; 26+ messages in thread
From: Uladzimir Bely @ 2023-09-15  6:44 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                  | 25 ++++++++++++++++++++++++-
 kas/isar-image-base.yml  |  7 +++++++
 kas/isar-image-debug.yml |  7 +++++++
 kas/isar.yml             |  3 ---
 4 files changed, 38 insertions(+), 4 deletions(-)
 create mode 100644 kas/isar-image-base.yml
 create mode 100644 kas/isar-image-debug.yml

diff --git a/Kconfig b/Kconfig
index 4c2e2339..66c6c44a 100644
--- a/Kconfig
+++ b/Kconfig
@@ -1,8 +1,31 @@
 mainmenu "Isar configuration"
 
+menu "Image type selection"
+
+choice
+	prompt "Image type selection"
+	default IMAGE_BASE
+
+config IMAGE_BASE
+	bool "Base image"
+	help
+	  This is the basic Isar image with bare minimum of preinstalled packages.
+	  It's technically close do the debootstrapped system with packages
+	  required to boot up the system.
+
+config IMAGE_DEBUG
+	bool "Debug image"
+	help
+	  This image includes some tools preinstalled useful for debug.
+
+endchoice
+
 config KAS_INCLUDE_MAIN
 	string
-	default "kas/isar.yml"
+	default "kas/isar-image-base.yml" if IMAGE_BASE
+	default "kas/isar-image-debug.yml" if IMAGE_DEBUG
+
+endmenu
 
 config KAS_BUILD_SYSTEM
 	string
diff --git a/kas/isar-image-base.yml b/kas/isar-image-base.yml
new file mode 100644
index 00000000..bfe3860b
--- /dev/null
+++ b/kas/isar-image-base.yml
@@ -0,0 +1,7 @@
+header:
+  version: 14
+  includes:
+   - isar.yml
+
+target:
+- isar-image-base
diff --git a/kas/isar-image-debug.yml b/kas/isar-image-debug.yml
new file mode 100644
index 00000000..f8f6977a
--- /dev/null
+++ b/kas/isar-image-debug.yml
@@ -0,0 +1,7 @@
+header:
+  version: 14
+  includes:
+   - isar.yml
+
+target:
+- isar-image-debug
diff --git a/kas/isar.yml b/kas/isar.yml
index 500bf1d4..47cbc290 100644
--- a/kas/isar.yml
+++ b/kas/isar.yml
@@ -3,9 +3,6 @@ header:
 
 build_system: isar
 
-target:
-- isar-image-base
-
 repos:
   isar:
     layers:
-- 
2.20.1


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

* [PATCH 10/13] kas: Add IMAGE_FSTYPES selection
  2023-09-15  6:44 [PATCH 00/13] Support building Isar using kas Uladzimir Bely
                   ` (8 preceding siblings ...)
  2023-09-15  6:44 ` [PATCH 09/13] kas: Add image type selection Uladzimir Bely
@ 2023-09-15  6:44 ` Uladzimir Bely
  2023-09-15  6:44 ` [PATCH 11/13] kas: Support CACHE_DEB_SRC option in menu Uladzimir Bely
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 26+ messages in thread
From: Uladzimir Bely @ 2023-09-15  6:44 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.yml |  6 ++++++
 2 files changed, 30 insertions(+)
 create mode 100644 kas/opt/image-fstypes.yml

diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
index 56b29824..506434ba 100644
--- a/kas/opt/Kconfig
+++ b/kas/opt/Kconfig
@@ -75,6 +75,30 @@ config KAS_INCLUDE_PACKAGES_DISTRO
 endmenu
 
 
+config KAS_IMAGE_FSTYPES
+	string "Additional image fstypes"
+	default ""
+	help
+	  Space-separated list of additional image fstypes to generate. Default
+	  machine configurations set up IMAGE_FSTYPES variable, but it's possible
+	  to select additonal ones to generate.
+	  The following IMAGE_FSTYPES are supported:
+	    cpio
+	    fit
+	    docker-archive
+	    ext4
+	    ova
+	    tar
+	    ubi
+	    ubifs
+	    wic
+	  They can be followed by suffixes like ".gz" for compressing the image
+
+config KAS_INCLUDE_IMAGE_FSTYPES
+	string
+	default "kas/opt/image-fstypes.yml"
+
+
 config COMPAT_ARCH
 	bool "Enable compat arch support"
 
diff --git a/kas/opt/image-fstypes.yml b/kas/opt/image-fstypes.yml
new file mode 100644
index 00000000..b87f1abd
--- /dev/null
+++ b/kas/opt/image-fstypes.yml
@@ -0,0 +1,6 @@
+header:
+  version: 14
+
+local_conf_header:
+  image-fstypes: |
+    IMAGE_FSTYPES:append = " ${KAS_IMAGE_FSTYPES}"
-- 
2.20.1


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

* [PATCH 11/13] kas: Support CACHE_DEB_SRC option in menu
  2023-09-15  6:44 [PATCH 00/13] Support building Isar using kas Uladzimir Bely
                   ` (9 preceding siblings ...)
  2023-09-15  6:44 ` [PATCH 10/13] kas: Add IMAGE_FSTYPES selection Uladzimir Bely
@ 2023-09-15  6:44 ` Uladzimir Bely
  2023-09-15  6:44 ` [PATCH 12/13] kas: Add options to activate predefined users Uladzimir Bely
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 26+ messages in thread
From: Uladzimir Bely @ 2023-09-15  6:44 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.yml |  6 ++++++
 2 files changed, 18 insertions(+)
 create mode 100644 kas/opt/cache-deb-src.yml

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


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

* [PATCH 12/13] kas: Add options to activate predefined users
  2023-09-15  6:44 [PATCH 00/13] Support building Isar using kas Uladzimir Bely
                   ` (10 preceding siblings ...)
  2023-09-15  6:44 ` [PATCH 11/13] kas: Support CACHE_DEB_SRC option in menu Uladzimir Bely
@ 2023-09-15  6:44 ` Uladzimir Bely
  2023-09-16  9:39   ` Jan Kiszka
  2023-09-15  6:44 ` [PATCH 13/13] kas: Add Readme.md Uladzimir Bely
  2023-09-16  9:40 ` [PATCH 00/13] Support building Isar using kas Jan Kiszka
  13 siblings, 1 reply; 26+ messages in thread
From: Uladzimir Bely @ 2023-09-15  6:44 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       | 41 +++++++++++++++++++++++++++++++++++++++++
 kas/opt/user-isar.yml | 16 ++++++++++++++++
 kas/opt/user-root.yml |  7 +++++++
 3 files changed, 64 insertions(+)
 create mode 100644 kas/opt/user-isar.yml
 create mode 100644 kas/opt/user-root.yml

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


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

* [PATCH 13/13] kas: Add Readme.md
  2023-09-15  6:44 [PATCH 00/13] Support building Isar using kas Uladzimir Bely
                   ` (11 preceding siblings ...)
  2023-09-15  6:44 ` [PATCH 12/13] kas: Add options to activate predefined users Uladzimir Bely
@ 2023-09-15  6:44 ` Uladzimir Bely
  2023-09-16  9:40 ` [PATCH 00/13] Support building Isar using kas Jan Kiszka
  13 siblings, 0 replies; 26+ messages in thread
From: Uladzimir Bely @ 2023-09-15  6:44 UTC (permalink / raw)
  To: isar-users

Add brief description of `kas-container` usage.

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

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


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

* Re: [PATCH 03/13] kas: Add dependencies between machine and distro configuration
  2023-09-15  6:44 ` [PATCH 03/13] kas: Add dependencies between machine and distro configuration Uladzimir Bely
@ 2023-09-16  9:34   ` Jan Kiszka
  2023-09-19  6:30     ` Uladzimir Bely
  0 siblings, 1 reply; 26+ messages in thread
From: Jan Kiszka @ 2023-09-16  9:34 UTC (permalink / raw)
  To: Uladzimir Bely, isar-users

On 15.09.23 12:14, Uladzimir Bely wrote:
> Isar can't build any combination of supported machines and distros.
> For the specific machine, only a limited set of distros can be built.
> 
> This patch adds required dependencies between these configruations
> so that user could not select unsupported (untested) on from menu.
> 

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

Jan

> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> ---
>  kas/distro/Kconfig  | 28 ++++++++++++++++++++++++++
>  kas/machine/Kconfig | 49 +++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 77 insertions(+)
> 
> diff --git a/kas/distro/Kconfig b/kas/distro/Kconfig
> index 0bb58c87..4453a3df 100644
> --- a/kas/distro/Kconfig
> +++ b/kas/distro/Kconfig
> @@ -6,27 +6,55 @@ choice
>  
>  config DEBIAN_BUSTER
>  	bool "Debian Buster (10)"
> +	depends on DEP_DEBIAN_BUSTER
>  
>  config DEBIAN_BULLSEYE
>  	bool "Debian Bullseye (11)"
> +	depends on DEP_DEBIAN_BULLSEYE
>  
>  config DEBIAN_BOOKWORM
>  	bool "Debian Bookworm (12)"
> +	depends on DEP_DEBIAN_BOOKWORM
>  
>  config DEBIAN_SID_PORTS
>  	bool "Debian Sid (unstable) with unofficial ports"
> +	depends on DEP_DEBIAN_SID_PORTS
>  
>  config RASPIOS_BULLSEYE
>    bool "Raspi OS Bullseye (11)"
> +	depends on DEP_RASPIOS_BULLSEYE
>  
>  config UBUNTU_FOCAL
>  	bool "Ubuntu Focal (20.04)"
> +	depends on DEP_UBUNTU_FOCAL
>  
>  config UBUNTU_JAMMY
>  	bool "Ubuntu Jammy (22.04)"
> +	depends on DEP_UBUNTU_JAMMY
>  
>  endchoice
>  
> +config DEP_DEBIAN_BUSTER
> +	bool
> +
> +config DEP_DEBIAN_BULLSEYE
> +	bool
> +
> +config DEP_DEBIAN_BOOKWORM
> +	bool
> +
> +config DEP_DEBIAN_SID_PORTS
> +	bool
> +
> +config DEP_RASPIOS_BULLSEYE
> +  bool
> +
> +config DEP_UBUNTU_FOCAL
> +	bool
> +
> +config DEP_UBUNTU_JAMMY
> +	bool
> +
>  config KAS_INCLUDE_DISTRO
>  	string
>  	default "kas/distro/debian-buster.yml" if DEBIAN_BUSTER
> diff --git a/kas/machine/Kconfig b/kas/machine/Kconfig
> index 7989a362..4a713c29 100644
> --- a/kas/machine/Kconfig
> +++ b/kas/machine/Kconfig
> @@ -6,69 +6,118 @@ choice
>  
>  config MACHINE_BANANAPI
>  	bool "bananapi"
> +	select DEP_DEBIAN_BUSTER
> +	select DEP_DEBIAN_BULLSEYE
> +	select DEP_DEBIAN_BOOKWORM
>  
>  config MACHINE_CONTAINER_AMD64
>  	bool "container-amd64"
> +	select DEP_DEBIAN_BUSTER
> +	select DEP_DEBIAN_BULLSEYE
> +	select DEP_DEBIAN_BOOKWORM
>  
>  config MACHINE_DE0_NANO_SOC
>  	bool "de0-nano-soc"
> +	select DEP_DEBIAN_BUSTER
> +	select DEP_DEBIAN_BULLSEYE
> +	select DEP_DEBIAN_BOOKWORM
>  
>  config MACHINE_HIKEY
>  	bool "hikey"
> +	select DEP_DEBIAN_BULLSEYE
> +	select DEP_DEBIAN_BOOKWORM
>  
>  config MACHINE_IMX6_SABRELITE
>  	bool "imx6-sabrelite"
> +	select DEP_DEBIAN_BUSTER
> +	select DEP_DEBIAN_BULLSEYE
> +	select DEP_DEBIAN_BOOKWORM
>  
>  config MACHINE_IMX6_NANOPI_NEO
>  	bool "nanopi-neo"
> +	select DEP_DEBIAN_BUSTER
> +	select DEP_DEBIAN_BULLSEYE
> +	select DEP_DEBIAN_BOOKWORM
>  
>  config MACHINE_PHIBOARD_MIRA
>  	bool "phyboard-mira"
> +	select DEP_DEBIAN_BULLSEYE
> +	select DEP_DEBIAN_BOOKWORM
>  
>  config MACHINE_QEMU_AMD64_SB
>  	bool "qemuamd64-sb"
> +	select DEP_DEBIAN_BULLSEYE
>  
>  config MACHINE_QEMU_AMD64
>  	bool "qemuamd64"
> +	select DEP_DEBIAN_BUSTER
> +	select DEP_DEBIAN_BULLSEYE
> +	select DEP_DEBIAN_BOOKWORM
> +	select DEP_UBUNTU_FOCAL
> +	select DEP_UBUNTU_JAMMY
>  
>  config MACHINE_QEMU_ARM
>  	bool "qemuarm"
> +	select DEP_DEBIAN_BUSTER
> +	select DEP_DEBIAN_BULLSEYE
> +	select DEP_DEBIAN_BOOKWORM
>  
>  config MACHINE_QEMU_ARM64
>  	bool "qemuarm64"
> +	select DEP_DEBIAN_BUSTER
> +	select DEP_DEBIAN_BULLSEYE
> +	select DEP_DEBIAN_BOOKWORM
> +	select DEP_UBUNTU_FOCAL
> +	select DEP_UBUNTU_JAMMY
>  
>  config MACHINE_QEMU_I386
>  	bool "qemui386"
> +	select DEP_DEBIAN_BUSTER
> +	select DEP_DEBIAN_BULLSEYE
> +	select DEP_DEBIAN_BOOKWORM
>  
>  config MACHINE_QEMU_MIPSEL
>  	bool "qemumipsel"
> +	select DEP_DEBIAN_BUSTER
> +	select DEP_DEBIAN_BULLSEYE
> +	select DEP_DEBIAN_BOOKWORM
>  
>  config MACHINE_QEMU_RISCV64
>  	bool "qemuriscv64"
> +	select DEP_DEBIAN_SID_PORTS
>  
>  config MACHINE_RPI_ARM_V7
>  	bool "rpi-arm-v7"
> +	select DEP_RASPIOS_BULLSEYE
>  
>  config MACHINE_RPI_ARM_V7L
>  	bool "rpi-arm-v7l"
> +	select DEP_RASPIOS_BULLSEYE
>  
>  config MACHINE_RPI_ARM
>  	bool "rpi-arm"
> +	select DEP_RASPIOS_BULLSEYE
>  
>  config MACHINE_RPI_ARM64_V8
>  	bool "rpi-arm64-v8"
> +	select DEP_RASPIOS_BULLSEYE
>  
>  config MACHINE_SIFIVE_FU540
>  	bool "sifive-fu540"
> +	select DEP_DEBIAN_SID_PORTS
>  
>  config MACHINE_STARFIVE_VISIONFIVE2
>  	bool "starfive-visionfive2"
> +	select DEP_DEBIAN_SID_PORTS
>  
>  config MACHINE_STM32MP15X
>  	bool "stm32mp15x"
> +	select DEP_DEBIAN_BULLSEYE
> +	select DEP_DEBIAN_BOOKWORM
>  
>  config MACHINE_VIRTUALBOX
>  	bool "virtualbox"
> +	select DEP_DEBIAN_BULLSEYE
>  
>  config MACHINE_VMWARE
>  	bool "vmware"

-- 
Siemens AG, Technology
Linux Expert Center


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

* Re: [PATCH 04/13] kas: Add mirror selection
  2023-09-15  6:44 ` [PATCH 04/13] kas: Add mirror selection Uladzimir Bely
@ 2023-09-16  9:34   ` Jan Kiszka
  2023-09-19  6:31     ` Uladzimir Bely
  0 siblings, 1 reply; 26+ messages in thread
From: Jan Kiszka @ 2023-09-16  9:34 UTC (permalink / raw)
  To: Uladzimir Bely, isar-users

On 15.09.23 12:14, 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           | 34 ++++++++++++++++++++++++++++++++++
>  kas/opt/mirror-debian.yml |  7 +++++++
>  kas/opt/mirror-ubuntu.yml |  7 +++++++
>  4 files changed, 49 insertions(+)
>  create mode 100644 kas/opt/Kconfig
>  create mode 100644 kas/opt/mirror-debian.yml
>  create mode 100644 kas/opt/mirror-ubuntu.yml
> 
> diff --git a/Kconfig b/Kconfig
> index ac77fb81..4c2e2339 100644
> --- a/Kconfig
> +++ b/Kconfig
> @@ -10,3 +10,4 @@ config KAS_BUILD_SYSTEM
>  
>  source "kas/machine/Kconfig"
>  source "kas/distro/Kconfig"
> +source "kas/opt/Kconfig"
> diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
> new file mode 100644
> index 00000000..c6e60583
> --- /dev/null
> +++ b/kas/opt/Kconfig
> @@ -0,0 +1,34 @@
> +menu "Mirror selection"
> +
> +config MIRROR_DEBIAN
> +	bool "Use specific Debian mirror"

depends on DEBIAN_BOOKWORM || ...

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

depens on UBUNTU_FOCAL || ...

> +	help
> +	  Select better local Ubuntu mirror instead of archive.ubuntu.com
> +
> +config MIRROR_UBUNTU_URL
> +	string "URL of Ubuntu mirror"
> +	default "http://archive.ubuntu.com"
> +	depends on MIRROR_UBUNTU
> +
> +config KAS_INCLUDE_MIRROR_UBUNTU
> +	string
> +	default "kas/opt/mirror-ubuntu.yml"
> +	depends on MIRROR_UBUNTU
> +
> +endmenu
> diff --git a/kas/opt/mirror-debian.yml b/kas/opt/mirror-debian.yml
> new file mode 100644
> index 00000000..ad708f2e
> --- /dev/null
> +++ b/kas/opt/mirror-debian.yml
> @@ -0,0 +1,7 @@
> +header:
> +  version: 14
> +
> +local_conf_header:
> +  mirror-debian: |
> +    DISTRO_APT_PREMIRRORS += "\
> +      http://deb\.debian\.org ${MIRROR_DEBIAN_URL}\n"
> diff --git a/kas/opt/mirror-ubuntu.yml b/kas/opt/mirror-ubuntu.yml
> new file mode 100644
> index 00000000..beb73d59
> --- /dev/null
> +++ b/kas/opt/mirror-ubuntu.yml
> @@ -0,0 +1,7 @@
> +header:
> +  version: 14
> +
> +local_conf_header:
> +  mirror-ubuntu: |
> +    DISTRO_APT_PREMIRRORS += "\
> +      http://archive\.ubuntu\.com ${MIRROR_UBUNTU_URL}\n"

Jan

-- 
Siemens AG, Technology
Linux Expert Center


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

* Re: [PATCH 05/13] kas: Add packages selection
  2023-09-15  6:44 ` [PATCH 05/13] kas: Add packages selection Uladzimir Bely
@ 2023-09-16  9:37   ` Jan Kiszka
  2023-09-16 16:10     ` Jan Kiszka
  0 siblings, 1 reply; 26+ messages in thread
From: Jan Kiszka @ 2023-09-16  9:37 UTC (permalink / raw)
  To: Uladzimir Bely, isar-users

On 15.09.23 12:14, Uladzimir Bely wrote:
> 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>
> ---
>  kas/opt/Kconfig             | 41 +++++++++++++++++++++++++++++++++++++
>  kas/opt/packages-distro.yml |  6 ++++++
>  kas/opt/packages-isar.yml   |  6 ++++++
>  3 files changed, 53 insertions(+)
>  create mode 100644 kas/opt/packages-distro.yml
>  create mode 100644 kas/opt/packages-isar.yml
> 
> diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
> index c6e60583..1aa319dc 100644
> --- a/kas/opt/Kconfig
> +++ b/kas/opt/Kconfig
> @@ -32,3 +32,44 @@ config KAS_INCLUDE_MIRROR_UBUNTU
>  	depends on MIRROR_UBUNTU
>  
>  endmenu
> +
> +menu "Packages selection"
> +
> +config KAS_IMAGE_INSTALL
> +	string "Isar packages"
> +	default ""

The default we have in the local.conf.sample is different. Is this list
here much shorter on purpose? I'm not necessarily asking for the full
list, just reflecting on this.

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

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

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

A nice default would be adding networking packages.

> +	help
> +	  Space-separated list of packages that are provided by the selected distro.
> +	  These packages are downloaded from distro mirrors and just unpacked
> +	  and configured by Isar.
> +
> +config KAS_INCLUDE_PACKAGES_DISTRO
> +	string
> +	default "kas/opt/packages-distro.yml"
> +
> +endmenu
> diff --git a/kas/opt/packages-distro.yml b/kas/opt/packages-distro.yml
> new file mode 100644
> index 00000000..d2fca914
> --- /dev/null
> +++ b/kas/opt/packages-distro.yml
> @@ -0,0 +1,6 @@
> +header:
> +  version: 14
> +
> +local_conf_header:
> +  packages-distro: |
> +    IMAGE_PREINSTALL:append = " ${KAS_IMAGE_PREINSTALL}"
> diff --git a/kas/opt/packages-isar.yml b/kas/opt/packages-isar.yml
> new file mode 100644
> index 00000000..c8da258d
> --- /dev/null
> +++ b/kas/opt/packages-isar.yml
> @@ -0,0 +1,6 @@
> +header:
> +  version: 14
> +
> +local_conf_header:
> +  packages-isar: |
> +    IMAGE_INSTALL:append = " ${KAS_IMAGE_INSTALL}"

Jan

-- 
Siemens AG, Technology
Linux Expert Center


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

* Re: [PATCH 12/13] kas: Add options to activate predefined users
  2023-09-15  6:44 ` [PATCH 12/13] kas: Add options to activate predefined users Uladzimir Bely
@ 2023-09-16  9:39   ` Jan Kiszka
  0 siblings, 0 replies; 26+ messages in thread
From: Jan Kiszka @ 2023-09-16  9:39 UTC (permalink / raw)
  To: Uladzimir Bely, isar-users

On 15.09.23 12:14, Uladzimir Bely wrote:
> This allows to enable 'root' and 'isar' users and set their passwords.
> 
> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> ---
>  kas/opt/Kconfig       | 41 +++++++++++++++++++++++++++++++++++++++++
>  kas/opt/user-isar.yml | 16 ++++++++++++++++
>  kas/opt/user-root.yml |  7 +++++++
>  3 files changed, 64 insertions(+)
>  create mode 100644 kas/opt/user-isar.yml
>  create mode 100644 kas/opt/user-root.yml
> 
> diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
> index 113a6c9a..7eb4840b 100644
> --- a/kas/opt/Kconfig
> +++ b/kas/opt/Kconfig
> @@ -75,6 +75,47 @@ config KAS_INCLUDE_PACKAGES_DISTRO
>  endmenu
>  
>  
> +menu "User management"
> +
> +config USER_ROOT
> +	bool "Activate 'root' user"
> +	help
> +	  Enables root user.
> +
> +config KAS_USER_ROOT_PASSWORD
> +	string "Password for 'root' user"
> +	default "$6$rounds=10000$RXeWrnFmkY$DtuS/OmsAS2cCEDo0BF5qQsizIrq6jPgXnwv3PHqREJeKd1sXdHX/ayQtuQWVDHe0KIO0/sVH8dvQm1KthF0d/"

Better ask for the cleartext password and set the required flag for root
as well.

Jan

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

-- 
Siemens AG, Technology
Linux Expert Center


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

* Re: [PATCH 00/13] Support building Isar using kas
  2023-09-15  6:44 [PATCH 00/13] Support building Isar using kas Uladzimir Bely
                   ` (12 preceding siblings ...)
  2023-09-15  6:44 ` [PATCH 13/13] kas: Add Readme.md Uladzimir Bely
@ 2023-09-16  9:40 ` Jan Kiszka
  2023-09-16 10:02   ` Jan Kiszka
  13 siblings, 1 reply; 26+ messages in thread
From: Jan Kiszka @ 2023-09-16  9:40 UTC (permalink / raw)
  To: Uladzimir Bely, isar-users

On 15.09.23 12:14, Uladzimir Bely wrote:
> This patchset adds YAML fragments and Kconfig files to support
> configuring Isar using `kas-container menu` and building it
> with 'kas-container script`.
> 
> This patchset can be treated as a reply to
> `https://groups.google.com/g/isar-users/c/GgMvGOkXkcg` request.
> 
> Uladzimir Bely (13):
>   kas: Add initial Kconfig support
>   kas: Add a local copy of kas-container script
>   kas: Add dependencies between machine and distro configuration
>   kas: Add mirror selection
>   kas: Add packages selection
>   kas: Add COMPAT_ARCH support
>   kas: Add cross compilation mode selection support
>   kas: Add ccache option
>   kas: Add image type selection
>   kas: Add IMAGE_FSTYPES selection
>   kas: Support CACHE_DEB_SRC option in menu
>   kas: Add options to activate predefined users
>   kas: Add Readme.md
> 
>  .gitignore                           |   1 +
>  Kconfig                              |  36 ++
>  kas/README.md                        |  36 ++
>  kas/distro/Kconfig                   |  68 ++++
>  kas/distro/debian-bookworm.yml       |   4 +
>  kas/distro/debian-bullseye.yml       |   4 +
>  kas/distro/debian-buster.yml         |   4 +
>  kas/distro/debian-sid-ports.yml      |   4 +
>  kas/distro/raspios-bullseye.yml      |   4 +
>  kas/distro/ubuntu-focal.yml          |   4 +
>  kas/distro/ubuntu-jammy.yml          |   4 +
>  kas/isar-image-base.yml              |   7 +
>  kas/isar-image-debug.yml             |   7 +
>  kas/isar.yml                         |  15 +
>  kas/kas-container                    | 562 +++++++++++++++++++++++++++
>  kas/machine/Kconfig                  | 153 ++++++++
>  kas/machine/bananapi.yml             |   4 +
>  kas/machine/container-amd64.yml      |   4 +
>  kas/machine/de0-nano-soc.yml         |   4 +
>  kas/machine/hikey.yml                |   4 +
>  kas/machine/imx6-sabrelite.yml       |   4 +
>  kas/machine/nanopi-neo.yml           |   4 +
>  kas/machine/phyboard-mira.yml        |   4 +
>  kas/machine/qemuamd64-sb.yml         |   4 +
>  kas/machine/qemuamd64.yml            |   4 +
>  kas/machine/qemuarm.yml              |   4 +
>  kas/machine/qemuarm64.yml            |   4 +
>  kas/machine/qemui386.yml             |   4 +
>  kas/machine/qemumipsel.yml           |   4 +
>  kas/machine/qemuriscv64.yml          |   4 +
>  kas/machine/rpi-arm-v7.yml           |   4 +
>  kas/machine/rpi-arm-v7l.yml          |   4 +
>  kas/machine/rpi-arm.yml              |   4 +
>  kas/machine/rpi-arm64-v8.yml         |   4 +
>  kas/machine/sifive-fu540.yml         |   4 +
>  kas/machine/starfive-visionfive2.yml |   4 +
>  kas/machine/stm32mp15x.yml           |   4 +
>  kas/machine/virtualbox.yml           |   4 +
>  kas/machine/vmware.yml               |   4 +
>  kas/opt/Kconfig                      | 181 +++++++++
>  kas/opt/cache-deb-src.yml            |   6 +
>  kas/opt/ccache.yml                   |   6 +
>  kas/opt/compat-arch.yml              |   7 +
>  kas/opt/crosscompile.yml             |   6 +
>  kas/opt/image-fstypes.yml            |   6 +
>  kas/opt/mirror-debian.yml            |   7 +
>  kas/opt/mirror-ubuntu.yml            |   7 +
>  kas/opt/packages-distro.yml          |   6 +
>  kas/opt/packages-isar.yml            |   6 +
>  kas/opt/user-isar.yml                |  16 +
>  kas/opt/user-root.yml                |   7 +
>  51 files changed, 1266 insertions(+)
>  create mode 100644 Kconfig
>  create mode 100644 kas/README.md
>  create mode 100644 kas/distro/Kconfig
>  create mode 100644 kas/distro/debian-bookworm.yml
>  create mode 100644 kas/distro/debian-bullseye.yml
>  create mode 100644 kas/distro/debian-buster.yml
>  create mode 100644 kas/distro/debian-sid-ports.yml
>  create mode 100644 kas/distro/raspios-bullseye.yml
>  create mode 100644 kas/distro/ubuntu-focal.yml
>  create mode 100644 kas/distro/ubuntu-jammy.yml
>  create mode 100644 kas/isar-image-base.yml
>  create mode 100644 kas/isar-image-debug.yml
>  create mode 100644 kas/isar.yml
>  create mode 100755 kas/kas-container
>  create mode 100644 kas/machine/Kconfig
>  create mode 100644 kas/machine/bananapi.yml
>  create mode 100644 kas/machine/container-amd64.yml
>  create mode 100644 kas/machine/de0-nano-soc.yml
>  create mode 100644 kas/machine/hikey.yml
>  create mode 100644 kas/machine/imx6-sabrelite.yml
>  create mode 100644 kas/machine/nanopi-neo.yml
>  create mode 100644 kas/machine/phyboard-mira.yml
>  create mode 100644 kas/machine/qemuamd64-sb.yml
>  create mode 100644 kas/machine/qemuamd64.yml
>  create mode 100644 kas/machine/qemuarm.yml
>  create mode 100644 kas/machine/qemuarm64.yml
>  create mode 100644 kas/machine/qemui386.yml
>  create mode 100644 kas/machine/qemumipsel.yml
>  create mode 100644 kas/machine/qemuriscv64.yml
>  create mode 100644 kas/machine/rpi-arm-v7.yml
>  create mode 100644 kas/machine/rpi-arm-v7l.yml
>  create mode 100644 kas/machine/rpi-arm.yml
>  create mode 100644 kas/machine/rpi-arm64-v8.yml
>  create mode 100644 kas/machine/sifive-fu540.yml
>  create mode 100644 kas/machine/starfive-visionfive2.yml
>  create mode 100644 kas/machine/stm32mp15x.yml
>  create mode 100644 kas/machine/virtualbox.yml
>  create mode 100644 kas/machine/vmware.yml
>  create mode 100644 kas/opt/Kconfig
>  create mode 100644 kas/opt/cache-deb-src.yml
>  create mode 100644 kas/opt/ccache.yml
>  create mode 100644 kas/opt/compat-arch.yml
>  create mode 100644 kas/opt/crosscompile.yml
>  create mode 100644 kas/opt/image-fstypes.yml
>  create mode 100644 kas/opt/mirror-debian.yml
>  create mode 100644 kas/opt/mirror-ubuntu.yml
>  create mode 100644 kas/opt/packages-distro.yml
>  create mode 100644 kas/opt/packages-isar.yml
>  create mode 100644 kas/opt/user-isar.yml
>  create mode 100644 kas/opt/user-root.yml
> 

Looks nice and helpful, specifically (but not only) for beginners! Just
had minor remarks.

Jan

-- 
Siemens AG, Technology
Linux Expert Center


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

* Re: [PATCH 09/13] kas: Add image type selection
  2023-09-15  6:44 ` [PATCH 09/13] kas: Add image type selection Uladzimir Bely
@ 2023-09-16  9:57   ` Jan Kiszka
  2023-09-19  6:32     ` Uladzimir Bely
  0 siblings, 1 reply; 26+ messages in thread
From: Jan Kiszka @ 2023-09-16  9:57 UTC (permalink / raw)
  To: Uladzimir Bely, isar-users

On 15.09.23 12:14, Uladzimir Bely wrote:
> This allows to choose between base and debug Isar image.
> 
> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> ---
>  Kconfig                  | 25 ++++++++++++++++++++++++-
>  kas/isar-image-base.yml  |  7 +++++++
>  kas/isar-image-debug.yml |  7 +++++++
>  kas/isar.yml             |  3 ---
>  4 files changed, 38 insertions(+), 4 deletions(-)
>  create mode 100644 kas/isar-image-base.yml
>  create mode 100644 kas/isar-image-debug.yml
> 
> diff --git a/Kconfig b/Kconfig
> index 4c2e2339..66c6c44a 100644
> --- a/Kconfig
> +++ b/Kconfig
> @@ -1,8 +1,31 @@
>  mainmenu "Isar configuration"
>  
> +menu "Image type selection"
> +
> +choice
> +	prompt "Image type selection"
> +	default IMAGE_BASE
> +
> +config IMAGE_BASE
> +	bool "Base image"
> +	help
> +	  This is the basic Isar image with bare minimum of preinstalled packages.
> +	  It's technically close do the debootstrapped system with packages
> +	  required to boot up the system.
> +
> +config IMAGE_DEBUG
> +	bool "Debug image"
> +	help
> +	  This image includes some tools preinstalled useful for debug.
> +
> +endchoice
> +
>  config KAS_INCLUDE_MAIN
>  	string
> -	default "kas/isar.yml"
> +	default "kas/isar-image-base.yml" if IMAGE_BASE
> +	default "kas/isar-image-debug.yml" if IMAGE_DEBUG
> +
> +endmenu
>  
>  config KAS_BUILD_SYSTEM
>  	string
> diff --git a/kas/isar-image-base.yml b/kas/isar-image-base.yml
> new file mode 100644
> index 00000000..bfe3860b
> --- /dev/null
> +++ b/kas/isar-image-base.yml
> @@ -0,0 +1,7 @@
> +header:
> +  version: 14
> +  includes:
> +   - isar.yml

- kas/isar.yml

You should have seen the warning...

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

Same here.

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

Jan

-- 
Siemens AG, Technology
Linux Expert Center


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

* Re: [PATCH 00/13] Support building Isar using kas
  2023-09-16  9:40 ` [PATCH 00/13] Support building Isar using kas Jan Kiszka
@ 2023-09-16 10:02   ` Jan Kiszka
  0 siblings, 0 replies; 26+ messages in thread
From: Jan Kiszka @ 2023-09-16 10:02 UTC (permalink / raw)
  To: Uladzimir Bely, isar-users

On 16.09.23 15:10, 'Jan Kiszka' via isar-users wrote:
> On 15.09.23 12:14, Uladzimir Bely wrote:
>> This patchset adds YAML fragments and Kconfig files to support
>> configuring Isar using `kas-container menu` and building it
>> with 'kas-container script`.
>>
>> This patchset can be treated as a reply to
>> `https://groups.google.com/g/isar-users/c/GgMvGOkXkcg` request.
>>
>> Uladzimir Bely (13):
>>   kas: Add initial Kconfig support
>>   kas: Add a local copy of kas-container script
>>   kas: Add dependencies between machine and distro configuration
>>   kas: Add mirror selection
>>   kas: Add packages selection
>>   kas: Add COMPAT_ARCH support
>>   kas: Add cross compilation mode selection support
>>   kas: Add ccache option
>>   kas: Add image type selection
>>   kas: Add IMAGE_FSTYPES selection
>>   kas: Support CACHE_DEB_SRC option in menu
>>   kas: Add options to activate predefined users
>>   kas: Add Readme.md
>>
>>  .gitignore                           |   1 +
>>  Kconfig                              |  36 ++
>>  kas/README.md                        |  36 ++
>>  kas/distro/Kconfig                   |  68 ++++
>>  kas/distro/debian-bookworm.yml       |   4 +
>>  kas/distro/debian-bullseye.yml       |   4 +
>>  kas/distro/debian-buster.yml         |   4 +
>>  kas/distro/debian-sid-ports.yml      |   4 +
>>  kas/distro/raspios-bullseye.yml      |   4 +
>>  kas/distro/ubuntu-focal.yml          |   4 +
>>  kas/distro/ubuntu-jammy.yml          |   4 +
>>  kas/isar-image-base.yml              |   7 +
>>  kas/isar-image-debug.yml             |   7 +
>>  kas/isar.yml                         |  15 +
>>  kas/kas-container                    | 562 +++++++++++++++++++++++++++
>>  kas/machine/Kconfig                  | 153 ++++++++
>>  kas/machine/bananapi.yml             |   4 +
>>  kas/machine/container-amd64.yml      |   4 +
>>  kas/machine/de0-nano-soc.yml         |   4 +
>>  kas/machine/hikey.yml                |   4 +
>>  kas/machine/imx6-sabrelite.yml       |   4 +
>>  kas/machine/nanopi-neo.yml           |   4 +
>>  kas/machine/phyboard-mira.yml        |   4 +
>>  kas/machine/qemuamd64-sb.yml         |   4 +
>>  kas/machine/qemuamd64.yml            |   4 +
>>  kas/machine/qemuarm.yml              |   4 +
>>  kas/machine/qemuarm64.yml            |   4 +
>>  kas/machine/qemui386.yml             |   4 +
>>  kas/machine/qemumipsel.yml           |   4 +
>>  kas/machine/qemuriscv64.yml          |   4 +
>>  kas/machine/rpi-arm-v7.yml           |   4 +
>>  kas/machine/rpi-arm-v7l.yml          |   4 +
>>  kas/machine/rpi-arm.yml              |   4 +
>>  kas/machine/rpi-arm64-v8.yml         |   4 +
>>  kas/machine/sifive-fu540.yml         |   4 +
>>  kas/machine/starfive-visionfive2.yml |   4 +
>>  kas/machine/stm32mp15x.yml           |   4 +
>>  kas/machine/virtualbox.yml           |   4 +
>>  kas/machine/vmware.yml               |   4 +
>>  kas/opt/Kconfig                      | 181 +++++++++
>>  kas/opt/cache-deb-src.yml            |   6 +
>>  kas/opt/ccache.yml                   |   6 +
>>  kas/opt/compat-arch.yml              |   7 +
>>  kas/opt/crosscompile.yml             |   6 +
>>  kas/opt/image-fstypes.yml            |   6 +
>>  kas/opt/mirror-debian.yml            |   7 +
>>  kas/opt/mirror-ubuntu.yml            |   7 +
>>  kas/opt/packages-distro.yml          |   6 +
>>  kas/opt/packages-isar.yml            |   6 +
>>  kas/opt/user-isar.yml                |  16 +
>>  kas/opt/user-root.yml                |   7 +
>>  51 files changed, 1266 insertions(+)
>>  create mode 100644 Kconfig
>>  create mode 100644 kas/README.md
>>  create mode 100644 kas/distro/Kconfig
>>  create mode 100644 kas/distro/debian-bookworm.yml
>>  create mode 100644 kas/distro/debian-bullseye.yml
>>  create mode 100644 kas/distro/debian-buster.yml
>>  create mode 100644 kas/distro/debian-sid-ports.yml
>>  create mode 100644 kas/distro/raspios-bullseye.yml
>>  create mode 100644 kas/distro/ubuntu-focal.yml
>>  create mode 100644 kas/distro/ubuntu-jammy.yml
>>  create mode 100644 kas/isar-image-base.yml
>>  create mode 100644 kas/isar-image-debug.yml
>>  create mode 100644 kas/isar.yml
>>  create mode 100755 kas/kas-container
>>  create mode 100644 kas/machine/Kconfig
>>  create mode 100644 kas/machine/bananapi.yml
>>  create mode 100644 kas/machine/container-amd64.yml
>>  create mode 100644 kas/machine/de0-nano-soc.yml
>>  create mode 100644 kas/machine/hikey.yml
>>  create mode 100644 kas/machine/imx6-sabrelite.yml
>>  create mode 100644 kas/machine/nanopi-neo.yml
>>  create mode 100644 kas/machine/phyboard-mira.yml
>>  create mode 100644 kas/machine/qemuamd64-sb.yml
>>  create mode 100644 kas/machine/qemuamd64.yml
>>  create mode 100644 kas/machine/qemuarm.yml
>>  create mode 100644 kas/machine/qemuarm64.yml
>>  create mode 100644 kas/machine/qemui386.yml
>>  create mode 100644 kas/machine/qemumipsel.yml
>>  create mode 100644 kas/machine/qemuriscv64.yml
>>  create mode 100644 kas/machine/rpi-arm-v7.yml
>>  create mode 100644 kas/machine/rpi-arm-v7l.yml
>>  create mode 100644 kas/machine/rpi-arm.yml
>>  create mode 100644 kas/machine/rpi-arm64-v8.yml
>>  create mode 100644 kas/machine/sifive-fu540.yml
>>  create mode 100644 kas/machine/starfive-visionfive2.yml
>>  create mode 100644 kas/machine/stm32mp15x.yml
>>  create mode 100644 kas/machine/virtualbox.yml
>>  create mode 100644 kas/machine/vmware.yml
>>  create mode 100644 kas/opt/Kconfig
>>  create mode 100644 kas/opt/cache-deb-src.yml
>>  create mode 100644 kas/opt/ccache.yml
>>  create mode 100644 kas/opt/compat-arch.yml
>>  create mode 100644 kas/opt/crosscompile.yml
>>  create mode 100644 kas/opt/image-fstypes.yml
>>  create mode 100644 kas/opt/mirror-debian.yml
>>  create mode 100644 kas/opt/mirror-ubuntu.yml
>>  create mode 100644 kas/opt/packages-distro.yml
>>  create mode 100644 kas/opt/packages-isar.yml
>>  create mode 100644 kas/opt/user-isar.yml
>>  create mode 100644 kas/opt/user-root.yml
>>
> 
> Looks nice and helpful, specifically (but not only) for beginners! Just
> had minor remarks.
> 

One general remark: Maybe we should name all yaml files .yaml at this
chance. This is the official recommendation, though many older
downstream layers still use .yml.

Jan

-- 
Siemens AG, Technology
Linux Expert Center


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

* Re: [PATCH 05/13] kas: Add packages selection
  2023-09-16  9:37   ` Jan Kiszka
@ 2023-09-16 16:10     ` Jan Kiszka
  0 siblings, 0 replies; 26+ messages in thread
From: Jan Kiszka @ 2023-09-16 16:10 UTC (permalink / raw)
  To: Uladzimir Bely, isar-users

On 16.09.23 15:07, 'Jan Kiszka' via isar-users wrote:
> On 15.09.23 12:14, Uladzimir Bely wrote:
>> 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>
>> ---
>>  kas/opt/Kconfig             | 41 +++++++++++++++++++++++++++++++++++++
>>  kas/opt/packages-distro.yml |  6 ++++++
>>  kas/opt/packages-isar.yml   |  6 ++++++
>>  3 files changed, 53 insertions(+)
>>  create mode 100644 kas/opt/packages-distro.yml
>>  create mode 100644 kas/opt/packages-isar.yml
>>
>> diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
>> index c6e60583..1aa319dc 100644
>> --- a/kas/opt/Kconfig
>> +++ b/kas/opt/Kconfig
>> @@ -32,3 +32,44 @@ config KAS_INCLUDE_MIRROR_UBUNTU
>>  	depends on MIRROR_UBUNTU
>>  
>>  endmenu
>> +
>> +menu "Packages selection"
>> +
>> +config KAS_IMAGE_INSTALL
>> +	string "Isar packages"
>> +	default ""
> 
> The default we have in the local.conf.sample is different. Is this list
> here much shorter on purpose? I'm not necessarily asking for the full
> list, just reflecting on this.

A reasonable default should include example-raw, because without it:

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

Jan

-- 
Siemens AG, Technology
Linux Expert Center


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

* Re: [PATCH 03/13] kas: Add dependencies between machine and distro configuration
  2023-09-16  9:34   ` Jan Kiszka
@ 2023-09-19  6:30     ` Uladzimir Bely
  2023-09-19  6:43       ` Jan Kiszka
  0 siblings, 1 reply; 26+ messages in thread
From: Uladzimir Bely @ 2023-09-19  6:30 UTC (permalink / raw)
  To: Jan Kiszka, isar-users

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

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

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

> > Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> > ---
> >  kas/distro/Kconfig  | 28 ++++++++++++++++++++++++++
> >  kas/machine/Kconfig | 49
> > +++++++++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 77 insertions(+)
> > 
> > diff --git a/kas/distro/Kconfig b/kas/distro/Kconfig
> > index 0bb58c87..4453a3df 100644
> > --- a/kas/distro/Kconfig
> > +++ b/kas/distro/Kconfig
> > @@ -6,27 +6,55 @@ choice
> >  
> >  config DEBIAN_BUSTER
> >         bool "Debian Buster (10)"
> > +       depends on DEP_DEBIAN_BUSTER
> >  
> >  config DEBIAN_BULLSEYE
> >         bool "Debian Bullseye (11)"
> > +       depends on DEP_DEBIAN_BULLSEYE
> >  
> >  config DEBIAN_BOOKWORM
> >         bool "Debian Bookworm (12)"
> > +       depends on DEP_DEBIAN_BOOKWORM
> >  
> >  config DEBIAN_SID_PORTS
> >         bool "Debian Sid (unstable) with unofficial ports"
> > +       depends on DEP_DEBIAN_SID_PORTS
> >  
> >  config RASPIOS_BULLSEYE
> >    bool "Raspi OS Bullseye (11)"
> > +       depends on DEP_RASPIOS_BULLSEYE
> >  
> >  config UBUNTU_FOCAL
> >         bool "Ubuntu Focal (20.04)"
> > +       depends on DEP_UBUNTU_FOCAL
> >  
> >  config UBUNTU_JAMMY
> >         bool "Ubuntu Jammy (22.04)"
> > +       depends on DEP_UBUNTU_JAMMY
> >  
> >  endchoice
> >  
> > +config DEP_DEBIAN_BUSTER
> > +       bool
> > +
> > +config DEP_DEBIAN_BULLSEYE
> > +       bool
> > +
> > +config DEP_DEBIAN_BOOKWORM
> > +       bool
> > +
> > +config DEP_DEBIAN_SID_PORTS
> > +       bool
> > +
> > +config DEP_RASPIOS_BULLSEYE
> > +  bool
> > +
> > +config DEP_UBUNTU_FOCAL
> > +       bool
> > +
> > +config DEP_UBUNTU_JAMMY
> > +       bool
> > +
> >  config KAS_INCLUDE_DISTRO
> >         string
> >         default "kas/distro/debian-buster.yml" if DEBIAN_BUSTER
> > diff --git a/kas/machine/Kconfig b/kas/machine/Kconfig
> > index 7989a362..4a713c29 100644
> > --- a/kas/machine/Kconfig
> > +++ b/kas/machine/Kconfig
> > @@ -6,69 +6,118 @@ choice
> >  
> >  config MACHINE_BANANAPI
> >         bool "bananapi"
> > +       select DEP_DEBIAN_BUSTER
> > +       select DEP_DEBIAN_BULLSEYE
> > +       select DEP_DEBIAN_BOOKWORM
> >  
> >  config MACHINE_CONTAINER_AMD64
> >         bool "container-amd64"
> > +       select DEP_DEBIAN_BUSTER
> > +       select DEP_DEBIAN_BULLSEYE
> > +       select DEP_DEBIAN_BOOKWORM
> >  
> >  config MACHINE_DE0_NANO_SOC
> >         bool "de0-nano-soc"
> > +       select DEP_DEBIAN_BUSTER
> > +       select DEP_DEBIAN_BULLSEYE
> > +       select DEP_DEBIAN_BOOKWORM
> >  
> >  config MACHINE_HIKEY
> >         bool "hikey"
> > +       select DEP_DEBIAN_BULLSEYE
> > +       select DEP_DEBIAN_BOOKWORM
> >  
> >  config MACHINE_IMX6_SABRELITE
> >         bool "imx6-sabrelite"
> > +       select DEP_DEBIAN_BUSTER
> > +       select DEP_DEBIAN_BULLSEYE
> > +       select DEP_DEBIAN_BOOKWORM
> >  
> >  config MACHINE_IMX6_NANOPI_NEO
> >         bool "nanopi-neo"
> > +       select DEP_DEBIAN_BUSTER
> > +       select DEP_DEBIAN_BULLSEYE
> > +       select DEP_DEBIAN_BOOKWORM
> >  
> >  config MACHINE_PHIBOARD_MIRA
> >         bool "phyboard-mira"
> > +       select DEP_DEBIAN_BULLSEYE
> > +       select DEP_DEBIAN_BOOKWORM
> >  
> >  config MACHINE_QEMU_AMD64_SB
> >         bool "qemuamd64-sb"
> > +       select DEP_DEBIAN_BULLSEYE
> >  
> >  config MACHINE_QEMU_AMD64
> >         bool "qemuamd64"
> > +       select DEP_DEBIAN_BUSTER
> > +       select DEP_DEBIAN_BULLSEYE
> > +       select DEP_DEBIAN_BOOKWORM
> > +       select DEP_UBUNTU_FOCAL
> > +       select DEP_UBUNTU_JAMMY
> >  
> >  config MACHINE_QEMU_ARM
> >         bool "qemuarm"
> > +       select DEP_DEBIAN_BUSTER
> > +       select DEP_DEBIAN_BULLSEYE
> > +       select DEP_DEBIAN_BOOKWORM
> >  
> >  config MACHINE_QEMU_ARM64
> >         bool "qemuarm64"
> > +       select DEP_DEBIAN_BUSTER
> > +       select DEP_DEBIAN_BULLSEYE
> > +       select DEP_DEBIAN_BOOKWORM
> > +       select DEP_UBUNTU_FOCAL
> > +       select DEP_UBUNTU_JAMMY
> >  
> >  config MACHINE_QEMU_I386
> >         bool "qemui386"
> > +       select DEP_DEBIAN_BUSTER
> > +       select DEP_DEBIAN_BULLSEYE
> > +       select DEP_DEBIAN_BOOKWORM
> >  
> >  config MACHINE_QEMU_MIPSEL
> >         bool "qemumipsel"
> > +       select DEP_DEBIAN_BUSTER
> > +       select DEP_DEBIAN_BULLSEYE
> > +       select DEP_DEBIAN_BOOKWORM
> >  
> >  config MACHINE_QEMU_RISCV64
> >         bool "qemuriscv64"
> > +       select DEP_DEBIAN_SID_PORTS
> >  
> >  config MACHINE_RPI_ARM_V7
> >         bool "rpi-arm-v7"
> > +       select DEP_RASPIOS_BULLSEYE
> >  
> >  config MACHINE_RPI_ARM_V7L
> >         bool "rpi-arm-v7l"
> > +       select DEP_RASPIOS_BULLSEYE
> >  
> >  config MACHINE_RPI_ARM
> >         bool "rpi-arm"
> > +       select DEP_RASPIOS_BULLSEYE
> >  
> >  config MACHINE_RPI_ARM64_V8
> >         bool "rpi-arm64-v8"
> > +       select DEP_RASPIOS_BULLSEYE
> >  
> >  config MACHINE_SIFIVE_FU540
> >         bool "sifive-fu540"
> > +       select DEP_DEBIAN_SID_PORTS
> >  
> >  config MACHINE_STARFIVE_VISIONFIVE2
> >         bool "starfive-visionfive2"
> > +       select DEP_DEBIAN_SID_PORTS
> >  
> >  config MACHINE_STM32MP15X
> >         bool "stm32mp15x"
> > +       select DEP_DEBIAN_BULLSEYE
> > +       select DEP_DEBIAN_BOOKWORM
> >  
> >  config MACHINE_VIRTUALBOX
> >         bool "virtualbox"
> > +       select DEP_DEBIAN_BULLSEYE
> >  
> >  config MACHINE_VMWARE
> >         bool "vmware"
> 


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

* Re: [PATCH 04/13] kas: Add mirror selection
  2023-09-16  9:34   ` Jan Kiszka
@ 2023-09-19  6:31     ` Uladzimir Bely
  0 siblings, 0 replies; 26+ messages in thread
From: Uladzimir Bely @ 2023-09-19  6:31 UTC (permalink / raw)
  To: Jan Kiszka, isar-users

On Sat, 2023-09-16 at 15:04 +0530, Jan Kiszka wrote:
> On 15.09.23 12:14, 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           | 34 ++++++++++++++++++++++++++++++++++
> >  kas/opt/mirror-debian.yml |  7 +++++++
> >  kas/opt/mirror-ubuntu.yml |  7 +++++++
> >  4 files changed, 49 insertions(+)
> >  create mode 100644 kas/opt/Kconfig
> >  create mode 100644 kas/opt/mirror-debian.yml
> >  create mode 100644 kas/opt/mirror-ubuntu.yml
> > 
> > diff --git a/Kconfig b/Kconfig
> > index ac77fb81..4c2e2339 100644
> > --- a/Kconfig
> > +++ b/Kconfig
> > @@ -10,3 +10,4 @@ config KAS_BUILD_SYSTEM
> >  
> >  source "kas/machine/Kconfig"
> >  source "kas/distro/Kconfig"
> > +source "kas/opt/Kconfig"
> > diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig
> > new file mode 100644
> > index 00000000..c6e60583
> > --- /dev/null
> > +++ b/kas/opt/Kconfig
> > @@ -0,0 +1,34 @@
> > +menu "Mirror selection"
> > +
> > +config MIRROR_DEBIAN
> > +       bool "Use specific Debian mirror"
> 
> depends on DEBIAN_BOOKWORM || ...
> 

Will add in v2.

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

Will add in v2.

> > +       help
> > +         Select better local Ubuntu mirror instead of
> > archive.ubuntu.com
> > +
> > +config MIRROR_UBUNTU_URL
> > +       string "URL of Ubuntu mirror"
> > +       default "http://archive.ubuntu.com"
> > +       depends on MIRROR_UBUNTU
> > +
> > +config KAS_INCLUDE_MIRROR_UBUNTU
> > +       string
> > +       default "kas/opt/mirror-ubuntu.yml"
> > +       depends on MIRROR_UBUNTU
> > +
> > +endmenu
> > diff --git a/kas/opt/mirror-debian.yml b/kas/opt/mirror-debian.yml
> > new file mode 100644
> > index 00000000..ad708f2e
> > --- /dev/null
> > +++ b/kas/opt/mirror-debian.yml
> > @@ -0,0 +1,7 @@
> > +header:
> > +  version: 14
> > +
> > +local_conf_header:
> > +  mirror-debian: |
> > +    DISTRO_APT_PREMIRRORS += "\
> > +      http://deb\.debian\.org ${MIRROR_DEBIAN_URL}\n"
> > diff --git a/kas/opt/mirror-ubuntu.yml b/kas/opt/mirror-ubuntu.yml
> > new file mode 100644
> > index 00000000..beb73d59
> > --- /dev/null
> > +++ b/kas/opt/mirror-ubuntu.yml
> > @@ -0,0 +1,7 @@
> > +header:
> > +  version: 14
> > +
> > +local_conf_header:
> > +  mirror-ubuntu: |
> > +    DISTRO_APT_PREMIRRORS += "\
> > +      http://archive\.ubuntu\.com ${MIRROR_UBUNTU_URL}\n"
> 
> Jan
> 


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

* Re: [PATCH 09/13] kas: Add image type selection
  2023-09-16  9:57   ` Jan Kiszka
@ 2023-09-19  6:32     ` Uladzimir Bely
  0 siblings, 0 replies; 26+ messages in thread
From: Uladzimir Bely @ 2023-09-19  6:32 UTC (permalink / raw)
  To: Jan Kiszka, isar-users

On Sat, 2023-09-16 at 15:27 +0530, 'Jan Kiszka' via isar-users wrote:
> On 15.09.23 12:14, Uladzimir Bely wrote:
> > This allows to choose between base and debug Isar image.
> > 
> > Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> > ---
> >  Kconfig                  | 25 ++++++++++++++++++++++++-
> >  kas/isar-image-base.yml  |  7 +++++++
> >  kas/isar-image-debug.yml |  7 +++++++
> >  kas/isar.yml             |  3 ---
> >  4 files changed, 38 insertions(+), 4 deletions(-)
> >  create mode 100644 kas/isar-image-base.yml
> >  create mode 100644 kas/isar-image-debug.yml
> > 
> > diff --git a/Kconfig b/Kconfig
> > index 4c2e2339..66c6c44a 100644
> > --- a/Kconfig
> > +++ b/Kconfig
> > @@ -1,8 +1,31 @@
> >  mainmenu "Isar configuration"
> >  
> > +menu "Image type selection"
> > +
> > +choice
> > +       prompt "Image type selection"
> > +       default IMAGE_BASE
> > +
> > +config IMAGE_BASE
> > +       bool "Base image"
> > +       help
> > +         This is the basic Isar image with bare minimum of
> > preinstalled packages.
> > +         It's technically close do the debootstrapped system with
> > packages
> > +         required to boot up the system.
> > +
> > +config IMAGE_DEBUG
> > +       bool "Debug image"
> > +       help
> > +         This image includes some tools preinstalled useful for
> > debug.
> > +
> > +endchoice
> > +
> >  config KAS_INCLUDE_MAIN
> >         string
> > -       default "kas/isar.yml"
> > +       default "kas/isar-image-base.yml" if IMAGE_BASE
> > +       default "kas/isar-image-debug.yml" if IMAGE_DEBUG
> > +
> > +endmenu
> >  
> >  config KAS_BUILD_SYSTEM
> >         string
> > diff --git a/kas/isar-image-base.yml b/kas/isar-image-base.yml
> > new file mode 100644
> > index 00000000..bfe3860b
> > --- /dev/null
> > +++ b/kas/isar-image-base.yml
> > @@ -0,0 +1,7 @@
> > +header:
> > +  version: 14
> > +  includes:
> > +   - isar.yml
> 
> - kas/isar.yml
> 
> You should have seen the warning...
> 

Thanks, didn't notice it. Fixed in upcoming v2.

> > +
> > +target:
> > +- isar-image-base
> > diff --git a/kas/isar-image-debug.yml b/kas/isar-image-debug.yml
> > new file mode 100644
> > index 00000000..f8f6977a
> > --- /dev/null
> > +++ b/kas/isar-image-debug.yml
> > @@ -0,0 +1,7 @@
> > +header:
> > +  version: 14
> > +  includes:
> > +   - isar.yml
> 
> Same here.
> 
> > +
> > +target:
> > +- isar-image-debug
> > diff --git a/kas/isar.yml b/kas/isar.yml
> > index 500bf1d4..47cbc290 100644
> > --- a/kas/isar.yml
> > +++ b/kas/isar.yml
> > @@ -3,9 +3,6 @@ header:
> >  
> >  build_system: isar
> >  
> > -target:
> > -- isar-image-base
> > -
> >  repos:
> >    isar:
> >      layers:
> 
> Jan
> 
> -- 
> Siemens AG, Technology
> Linux Expert Center
> 


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

* Re: [PATCH 03/13] kas: Add dependencies between machine and distro configuration
  2023-09-19  6:30     ` Uladzimir Bely
@ 2023-09-19  6:43       ` Jan Kiszka
  0 siblings, 0 replies; 26+ messages in thread
From: Jan Kiszka @ 2023-09-19  6:43 UTC (permalink / raw)
  To: Uladzimir Bely, isar-users

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

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

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

Jan

-- 
Siemens AG, Technology
Linux Expert Center


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

end of thread, other threads:[~2023-09-19  6:43 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-15  6:44 [PATCH 00/13] Support building Isar using kas Uladzimir Bely
2023-09-15  6:44 ` [PATCH 01/13] kas: Add initial Kconfig support Uladzimir Bely
2023-09-15  6:44 ` [PATCH 02/13] kas: Add a local copy of kas-container script Uladzimir Bely
2023-09-15  6:44 ` [PATCH 03/13] kas: Add dependencies between machine and distro configuration Uladzimir Bely
2023-09-16  9:34   ` Jan Kiszka
2023-09-19  6:30     ` Uladzimir Bely
2023-09-19  6:43       ` Jan Kiszka
2023-09-15  6:44 ` [PATCH 04/13] kas: Add mirror selection Uladzimir Bely
2023-09-16  9:34   ` Jan Kiszka
2023-09-19  6:31     ` Uladzimir Bely
2023-09-15  6:44 ` [PATCH 05/13] kas: Add packages selection Uladzimir Bely
2023-09-16  9:37   ` Jan Kiszka
2023-09-16 16:10     ` Jan Kiszka
2023-09-15  6:44 ` [PATCH 06/13] kas: Add COMPAT_ARCH support Uladzimir Bely
2023-09-15  6:44 ` [PATCH 07/13] kas: Add cross compilation mode selection support Uladzimir Bely
2023-09-15  6:44 ` [PATCH 08/13] kas: Add ccache option Uladzimir Bely
2023-09-15  6:44 ` [PATCH 09/13] kas: Add image type selection Uladzimir Bely
2023-09-16  9:57   ` Jan Kiszka
2023-09-19  6:32     ` Uladzimir Bely
2023-09-15  6:44 ` [PATCH 10/13] kas: Add IMAGE_FSTYPES selection Uladzimir Bely
2023-09-15  6:44 ` [PATCH 11/13] kas: Support CACHE_DEB_SRC option in menu Uladzimir Bely
2023-09-15  6:44 ` [PATCH 12/13] kas: Add options to activate predefined users Uladzimir Bely
2023-09-16  9:39   ` Jan Kiszka
2023-09-15  6:44 ` [PATCH 13/13] kas: Add Readme.md Uladzimir Bely
2023-09-16  9:40 ` [PATCH 00/13] Support building Isar using kas Jan Kiszka
2023-09-16 10:02   ` Jan Kiszka

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