Commit Graph

20 Commits

Author SHA1 Message Date
Claudius Heine
06240c23da kas-container: mount /repo as read-write for shell command
There are some bitbake commands like `recipetool` that allows to easily
create new or append to existing recipes. This of course only works if
the main repository that is worked with is writeable.

However it is mounted into the container only as read-only.

This patch mounts the repository writeable when the `shell` command is use
and read-only in case of the `build` command.

It also adds `--repo-ro` and `--repo-rw` to allow overwriting the
default behaviour.

Signed-off-by: Claudius Heine <ch@denx.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2021-04-16 08:04:31 +02:00
Jan Kiszka
3f98520ab6 kas-container: Improve KAS_WORK/BUILD_DIR retrieval
Perform link resolution unconditionally to account for cases when the
default paths are links. Use default values to simplify the assignments.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2021-03-21 09:17:30 +01:00
Peter Hatina
f32290d425 Introduce KAS_BUILD_DIR environment variable
This variable can override default build path `${KAS_WORK_DIR}/build`.

Signed-off-by: Peter Hatina <peter@hatina.eu>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2021-03-10 07:53:09 +01:00
Henning Schild
6b52357dc7 kas-container: add an argument to get version information
This script is deployed in many copies, give people a way to identify
which one they have cached/installed.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
[Jan: simplify and use basename for the program]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2021-02-25 21:19:02 +01:00
Jan Kiszka
8fe75298e4 Release 2.4 2021-02-25 19:09:02 +01:00
Jan Kiszka
6c5e77800c kas-container: Simplify docker arguments
--privileged implies all caps, so no need to list some explicitly.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2021-02-16 10:36:14 +01:00
Henning Schild
111906f804 kas-container: make sure that we pass shellcheck
There is one actual change where code gets touched, the rest are just
comments to satisfy shellcheck.
All the lines with the ignores should be reviewed later, there might be
problems behind the findings.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
[Jan: add one more SC2086 suppression]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2021-01-29 20:42:49 +01:00
Jan Kiszka
4042ef4859 kas-container: Add support for multi-word --command arguments
Yet another special dance needed to preserve argument boundaries while
moving them around: This trick enables

kas-container shell kas.yml --command "echo it works."

by keeping the command argument separate and injecting it via
appropriate quoting into the argument array.

Closes: #42
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2021-01-29 20:29:56 +01:00
Jan Kiszka
368cdffc24 Release 2.3.3 2020-11-28 12:36:46 +01:00
Jan Kiszka
ba439d4200 Release 2.3.2 2020-11-20 12:20:24 +01:00
Jan Kiszka
6a8abf277c Add build_system property to config file
This allows to pre-select the build system, specifically avoiding
confusion when kas-container is accidentally not called with --isar for
an isar config. For that, build_system needs to be defined in the
lop-level config file passed to kas-container.

Theoretically, this also allows to combine layers which have both
oe-init-build-env and isar-init-build-env scripts.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2020-11-16 11:53:25 +01:00
Claudius Heine
36ab0549ce kas-container: allow the -d/-v of kas-container to set -d on kas
Currently kas-container did not allow to set the `-d` parameter of kas,
this patch changes that and allows to set it via the `-d` or `-v`
parameter of kas-container.

Signed-off-by: Claudius Heine <ch@denx.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2020-10-22 08:40:37 +02:00
Claudius Heine
b719fc9f6a kas-container: rename -v to -d and deprecate -v
kas itself has a `-d` parameter that allows to print debug information,
while kas-container has the `-v` parameter. Since the `-d` parameter of
kas was first, rename the `-v` parameter of kas-container to fit kas.

Signed-off-by: Claudius Heine <ch@denx.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2020-10-22 08:40:25 +02:00
Jan Kiszka
3403ba4923 kas-container: Drop container image prefix
The current default causes spurious pulls even when the image is already
locally available, at least with podman 2.0.x. Looking through podman
how-tos, none mentions that this prefix is required, and the
image_default_transport in containers.con is generally "docker://". So
it's safe to drop it for better default behavior.

If a custom local setup deviate, users can still override
KAS_CONTAINER_IMAGE_PATH, prepending what is desired.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2020-10-18 23:21:20 +02:00
Claudius Heine
7e22208849 kas-container: Fix help output
Signed-off-by: Claudius Heine <ch@denx.de>
[Jan: further massaging]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2020-10-02 08:44:04 +02:00
Jan Kiszka
1e4b4c7363 kas-container: Fix trailing whitespace
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2020-09-29 08:36:07 +02:00
Claudius Heine
503cf183b1 kas-container: make container image variables overwritable
This patch introduces new and improved ways to overwrite kas-container
variables that specify which image should be used.

`KAS_CONTAINER_IMAGE_PREFIX`: can be used to overwrite image sources.
For instance if podman is used, the default value `docker://` is used as
a prefix. But it still allows to overwrite it, by setting a custom
variable.

`KAS_CONTAINER_IMAGE_PATH`: can be used to customize the image source
path.

`KAS_CONTAINER_IMAGE_NAME`: can be set to change the container image
name.  For instance if `--isar` is used, the default value is
`kas-isar`, as with `KAS_CONTAINER_IMAGE_PREFIX` this default value can
still be overwritten by setting a custom value.

And last `KAS_IMAGE_VERSION`: It was possible to overwrite this value
before this patch and its still possible. The default value is the
current release version. Setting it for instance to `latest`, would
allow to used the most recent version of the image.

Signed-off-by: Claudius Heine <ch@denx.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2020-09-29 08:35:04 +02:00
Claudius Heine
8d24d00bb3 kas-container: prefix variables with 'KAS_' to avoid conflicts
Some variables used by the `kas-container` script have rather generic
terms, that might be used in bitbake recipes. This change prefixes all
variables with `KAS_` to avoid those possible variable name conflicts.

Signed-off-by: Claudius Heine <ch@denx.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2020-09-29 08:34:00 +02:00
Claudius Heine
c876548759 kas-container: rename 'docker' mentions more generic terms
Signed-off-by: Claudius Heine <ch@denx.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2020-09-29 08:33:30 +02:00
Claudius Heine
52adce2387 rename kas-docker to kas-container, leave symlink in place
Signed-off-by: Claudius Heine <ch@denx.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2020-09-29 08:30:10 +02:00