File: getting-started.rst

package info (click to toggle)
kas 5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,268 kB
  • sloc: python: 5,745; sh: 1,095; makefile: 210
file content (107 lines) | stat: -rw-r--r-- 3,086 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
Getting Started
===============

Installation
------------

pipx is the recommended way to install kas. It creates an isolated Python
virtual environment for kas and makes sure its dependencies are installed
correctly. To install pipx, follow the instructions at
https://pipx.pypa.io/stable/installation/

To install the latest version of kas using pipx run::

    $ pipx install kas

With menu support
~~~~~~~~~~~~~~~~~

kas menu requires an additional system dependency. On Debian-based systems,
run::

    $ sudo apt install python3-newt
    $ pipx install kas --system-site-packages

Other installation methods
~~~~~~~~~~~~~~~~~~~~~~~~~~

Debian-based distributions provide a package for kas. However, this may be
outdated compared to the latest release. To install kas using the system
package manager, run::

    $ sudo apt install kas

Dependencies
------------

This project depends on

- Python 3
- distro Python 3 package
- jsonschema Python 3 package
- PyYAML Python 3 package
- GitPython Python 3 package
- kconfiglib Python 3 package (optional, for menu plugin)
- NEWT Python 3 distro package (optional, for menu plugin)
- python-gnupg Python 3 package (optional, for signature verification)

Usage
-----

There are (at least) three options for using kas:

- Install it locally via pip to get the ``kas`` command.
- Use the container image locally. In this case, download the
  :doc:`kas-container <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>][-<distro-release>]`` in your CI
  script that requests a container image as runtime environment.

Start build::

    $ kas build /path/to/kas-project.yml

Alternatively, experienced bitbake users can invoke usual **bitbake** steps
manually, e.g.::

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

For details about the kas input file(s), see
:ref:`project-configuration-label`. Example configurations can be found in
:ref:`example-configurations-label`.

Directory Layout
~~~~~~~~~~~~~~~~

When invoking kas, it places download and build artifacts in the current
directory by default. You can specify a different location using the
environment variable ``KAS_WORK_DIR``. Repositories managed by kas are stored
under their ``path`` (or ``name`` if ``path`` is not set). The build directory
is named ``build`` and is relative to ``KAS_WORK_DIR`` unless explicitly set
with ``KAS_BUILD_DIR``. Internal data that persists across executions is
prefixed with ``.kas_``.


Use Cases
---------

1.  Initial build/setup::

    $ mkdir $PROJECT_DIR
    $ cd $PROJECT_DIR
    $ git clone $PROJECT_URL meta-project
    $ kas build meta-project/kas-project.yml

2.  Update/rebuild::

    $ cd $PROJECT_DIR/meta-project
    $ git pull
    $ kas build kas-project.yml

3.  Interactive configuration::

    $ cd $PROJECT_DIR/meta-project
    $ kas menu
    $ kas build  # optional, if not triggered via kas menu