diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2020-09-30 12:33:43 -0400 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2020-11-05 14:39:32 -0500 |
commit | afef7f063536d1e6519e425f654c986815f38a6a (patch) | |
tree | 6822a041acc94cb795c03c23d67df5caaec54716 | |
parent | e9a8756758e44a9fbf0dad7e1b7b197a24355584 (diff) | |
download | meta-virtualization-afef7f063536d1e6519e425f654c986815f38a6a.tar.gz |
container-base: make CONTAINER_SHELL a conditional image install
In some scenarios (and package managers), packages post install
scripts may have references to /bin/sh.
The package manager doesn't know if the scripts will run on the
build host or target, so we get a calculated redepnds on /bin/sh
base-files and base-passwd fall into this category of having
post installs, but no need for /bin/sh on the target.
If you know what you are installing, and want the smallest
container possible, this package will satisfy the dependency when
assembling the rootfs.
To enable it, put the following in a configuration file (local.conf
or otherwise):
PACKAGE_EXTRA_ARCHS_append = " container-dummy-provides"
This image will detect if the dummy provides arch is set, and will
automatically install the providing recipe, otherwise, busybox is
installed.
If you have a custom shell or want a different behaviour, the
CONTAINER_SHELL variable can be overriden.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r-- | recipes-extended/images/container-base.bb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/recipes-extended/images/container-base.bb b/recipes-extended/images/container-base.bb index 434239a8..acce0411 100644 --- a/recipes-extended/images/container-base.bb +++ b/recipes-extended/images/container-base.bb | |||
@@ -18,8 +18,20 @@ IMAGE_INSTALL = " \ | |||
18 | base-files \ | 18 | base-files \ |
19 | base-passwd \ | 19 | base-passwd \ |
20 | netbase \ | 20 | netbase \ |
21 | ${CONTAINER_SHELL} \ | ||
21 | " | 22 | " |
22 | 23 | ||
24 | # If the following is configured in local.conf (or the distro): | ||
25 | # PACKAGE_EXTRA_ARCHS_append = " container-dummy-provides" | ||
26 | # | ||
27 | # it has been explicitly # indicated that we don't want or need a shell, so we'll | ||
28 | # add the dummy provides. | ||
29 | # | ||
30 | # This is required, since there are postinstall scripts in base-files and base-passwd | ||
31 | # that reference /bin/sh and we'll get a rootfs error if there's no shell or no dummy | ||
32 | # provider. | ||
33 | CONTAINER_SHELL ?= "${@bb.utils.contains('PACKAGE_EXTRA_ARCHS', 'container-dummy-provides', 'container-dummy-provides', 'busybox', d)}" | ||
34 | |||
23 | # Allow build with or without a specific kernel | 35 | # Allow build with or without a specific kernel |
24 | IMAGE_CONTAINER_NO_DUMMY = "1" | 36 | IMAGE_CONTAINER_NO_DUMMY = "1" |
25 | 37 | ||