[v4,04/13] kas: Add packages selection

Message ID 20230922091003.20763-5-ubely@ilbers.de
State Superseded, archived
Headers show
Series Support building Isar using kas | expand

Commit Message

Uladzimir Bely Sept. 22, 2023, 9:09 a.m. UTC
This part of configuration allows to choose which additional packages
(both from Isar and Debian) to include to the target image.

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

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

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

Patch

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