[PATCH 1/3] drop conditional parts from getting-started guide

0 views
Skip to first unread message

Felix Moessbauer

unread,
May 23, 2024, 3:29:32 AMMay 23
to kas-...@googlegroups.com, jan.k...@siemens.com, Felix Moessbauer
The whole getting-started.rst is only used in the HTML documentation.
By that, we can drop the html-only conditions inside the document.

Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
docs/userguide/getting-started.rst | 30 ++++++++++++++----------------
1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/docs/userguide/getting-started.rst b/docs/userguide/getting-started.rst
index 813200d2f..10b7fc54d 100644
--- a/docs/userguide/getting-started.rst
+++ b/docs/userguide/getting-started.rst
@@ -21,22 +21,20 @@ To install kas into your python site-package repository, run::
Usage
-----

-.. only:: html
-
- There are (at least) four options for using kas:
-
- - Install it locally via pip to get the ``kas`` command.
- - Use the container image locally. In this case, download the ``kas-container``
- script from the kas repository and use it in place of the ``kas`` command.
- The script version corresponds to the kas tool and the kas image version.
- - Use the container image in CI. Specify
- ``ghcr.io/siemens/kas/kas[-isar][:<x.y>]`` in your CI script that requests
- a container image as runtime environment. See
- https://github.com/orgs/siemens/packages/container/kas%2Fkas/versions and
- https://github.com/orgs/siemens/packages/container/kas%2Fkas-isar/versions for
- all available images.
- - Use the **run-kas** wrapper from this directory. In this case,
- replace ``kas`` in the examples below with ``path/to/run-kas``.
+There are (at least) four options for using kas:
+
+- Install it locally via pip to get the ``kas`` command.
+- Use the container image locally. In this case, download the ``kas-container``
+ script from the kas repository and use it in place of the ``kas`` command.
+ The script version corresponds to the kas tool and the kas image version.
+- Use the container image in CI. Specify
+ ``ghcr.io/siemens/kas/kas[-isar][:<x.y>]`` in your CI script that requests
+ a container image as runtime environment. See
+ https://github.com/orgs/siemens/packages/container/kas%2Fkas/versions and
+ https://github.com/orgs/siemens/packages/container/kas%2Fkas-isar/versions for
+ all available images.
+- Use the **run-kas** wrapper from this directory. In this case,
+ replace ``kas`` in the examples below with ``path/to/run-kas``.

Start build::

--
2.39.2

Felix Moessbauer

unread,
May 23, 2024, 3:29:33 AMMay 23
to kas-...@googlegroups.com, jan.k...@siemens.com, Felix Moessbauer
The image tests already provide good and rather minimal examples. As we
currently lack fully working examples, we move the existing test code
into an examples dir and symlink these into the image-tests dir. Further,
we reference (include) them in the documentation.

Creating dedicated examples has been considered, but as these are likely
hard to maintain this idea was dropped.

Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
docs/userguide/getting-started.rst | 11 +++++--
docs/userguide/project-configuration.rst | 24 ++++++++++++++
examples/isar.yml | 41 +++++++++++++++++++++++
examples/openembedded.yml | 39 ++++++++++++++++++++++
image-tests/kas-isar/kas.yml | 42 +-----------------------
image-tests/kas/kas.yml | 40 +---------------------
6 files changed, 114 insertions(+), 83 deletions(-)
create mode 100644 examples/isar.yml
create mode 100644 examples/openembedded.yml
mode change 100644 => 120000 image-tests/kas-isar/kas.yml
mode change 100644 => 120000 image-tests/kas/kas.yml

diff --git a/docs/userguide/getting-started.rst b/docs/userguide/getting-started.rst
index 10b7fc54d..847959422 100644
--- a/docs/userguide/getting-started.rst
+++ b/docs/userguide/getting-started.rst
@@ -45,9 +45,14 @@ manually, e.g.::

$ kas shell /path/to/kas-project.yml -c 'bitbake dosfsutils-native'

-kas will place downloads and build artifacts under the current directory when
-being invoked. You can specify a different location via the environment
-variable `KAS_WORK_DIR`.
+For details about the kas input file(s), see
+:ref:`project-configuration-label`. Example configurations can be found in
+:ref:`example-configurations-label`.
+
+.. note::
+ kas will place downloads and build artifacts under the current directory when
+ being invoked. You can specify a different location via the environment
+ variable ``KAS_WORK_DIR``.


Use Cases
diff --git a/docs/userguide/project-configuration.rst b/docs/userguide/project-configuration.rst
index 878f9a17a..285d5c1d3 100644
--- a/docs/userguide/project-configuration.rst
+++ b/docs/userguide/project-configuration.rst
@@ -1,3 +1,5 @@
+.. _project-configuration-label:
+
Project Configuration
=====================

@@ -474,3 +476,25 @@ Configuration reference
outside of the container (on the host). This value is only evaluated by the
``kas-container`` script. It must not be set manually and might only be
defined in the top-level ``.config.yaml`` file.
+
+.. _example-configurations-label:
+
+Example project configurations
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The following snippets show minimal but working project configurations for
+both OpenEmbedded and ISAR based distributions.
+
+OpenEmbedded
+------------
+
+.. literalinclude:: ../../examples/openembedded.yml
+ :language: YAML
+ :lines: 25-
+
+ISAR
+----
+
+.. literalinclude:: ../../examples/isar.yml
+ :language: YAML
+ :lines: 25-
diff --git a/examples/isar.yml b/examples/isar.yml
new file mode 100644
index 000000000..ae79ea765
--- /dev/null
+++ b/examples/isar.yml
@@ -0,0 +1,41 @@
+#
+# kas - setup tool for bitbake based projects
+#
+# Copyright (c) Siemens AG, 2022-2024
+#
+# 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.
+#
+
+header:
+ version: 14
+
+build_system: isar
+
+machine: qemuamd64
+distro: debian-bullseye
+
+target: mc:qemuamd64-bullseye:cowsay
+
+repos:
+ isar:
+ url: https://github.com/ilbers/isar.git
+ commit: 9dc362cd7115074c0f60843e687ed89db5c9339a
+ layers:
+ meta:
+ meta-isar:
diff --git a/examples/openembedded.yml b/examples/openembedded.yml
new file mode 100644
index 000000000..8e905a9a3
--- /dev/null
+++ b/examples/openembedded.yml
@@ -0,0 +1,39 @@
+#
+# kas - setup tool for bitbake based projects
+#
+# Copyright (c) Siemens AG, 2022-2024
+#
+# 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.
+#
+
+header:
+ version: 14
+
+machine: qemux86-64
+distro: poky
+
+target: zlib-native
+
+repos:
+ poky:
+ url: https://git.yoctoproject.org/poky.git
+ commit: fb91a49387cfb0c8d48303bb3354325ba2a05587
+ layers:
+ meta:
+ meta-poky:
diff --git a/image-tests/kas-isar/kas.yml b/image-tests/kas-isar/kas.yml
deleted file mode 100644
index ae79ea765..000000000
--- a/image-tests/kas-isar/kas.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# kas - setup tool for bitbake based projects
-#
-# Copyright (c) Siemens AG, 2022-2024
-#
-# 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.
-#
-
-header:
- version: 14
-
-build_system: isar
-
-machine: qemuamd64
-distro: debian-bullseye
-
-target: mc:qemuamd64-bullseye:cowsay
-
-repos:
- isar:
- url: https://github.com/ilbers/isar.git
- commit: 9dc362cd7115074c0f60843e687ed89db5c9339a
- layers:
- meta:
- meta-isar:
diff --git a/image-tests/kas-isar/kas.yml b/image-tests/kas-isar/kas.yml
new file mode 120000
index 000000000..912d517fa
--- /dev/null
+++ b/image-tests/kas-isar/kas.yml
@@ -0,0 +1 @@
+../../examples/isar.yml
\ No newline at end of file
diff --git a/image-tests/kas/kas.yml b/image-tests/kas/kas.yml
deleted file mode 100644
index 8e905a9a3..000000000
--- a/image-tests/kas/kas.yml
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# kas - setup tool for bitbake based projects
-#
-# Copyright (c) Siemens AG, 2022-2024
-#
-# 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.
-#
-
-header:
- version: 14
-
-machine: qemux86-64
-distro: poky
-
-target: zlib-native
-
-repos:
- poky:
- url: https://git.yoctoproject.org/poky.git
- commit: fb91a49387cfb0c8d48303bb3354325ba2a05587
- layers:
- meta:
- meta-poky:
diff --git a/image-tests/kas/kas.yml b/image-tests/kas/kas.yml
new file mode 120000
index 000000000..8cdad7e30
--- /dev/null
+++ b/image-tests/kas/kas.yml
@@ -0,0 +1 @@
+../../examples/openembedded.yml
\ No newline at end of file
--
2.39.2

Felix Moessbauer

unread,
May 23, 2024, 3:29:33 AMMay 23
to kas-...@googlegroups.com, jan.k...@siemens.com, Felix Moessbauer
The documentation states, that a minmal image configuration needs to
contain a machine and distro as well. While this is technically not
always required, we should align our tests.

This patch adds OEs default machine and distro to the test example.

Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
image-tests/kas/kas.yml | 3 +++
1 file changed, 3 insertions(+)

diff --git a/image-tests/kas/kas.yml b/image-tests/kas/kas.yml
index eb740eee5..8e905a9a3 100644
--- a/image-tests/kas/kas.yml
+++ b/image-tests/kas/kas.yml
@@ -25,6 +25,9 @@
header:
version: 14

+machine: qemux86-64
+distro: poky
+
target: zlib-native

repos:
--
2.39.2

Jan Kiszka

unread,
May 24, 2024, 8:29:04 AMMay 24
to Felix Moessbauer, kas-...@googlegroups.com
Thanks, all 3 applied.

Jan
--
Siemens AG, Technology
Linux Expert Center

Reply all
Reply to author
Forward
0 new messages