blob: 64655e0b42a6809277f813ff5e58aa50fec753b3 (
plain)
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
|
#
# Based on examples from Scott Murray (Building Container Images with
# OpenEmbedded and the Yocto Project) ELCe 2018
#
SUMMARY = "Basic container image"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
IMAGE_FSTYPES = "container oci"
inherit image
inherit image-oci
IMAGE_FEATURES = ""
IMAGE_LINGUAS = ""
NO_RECOMMENDATIONS = "1"
IMAGE_INSTALL = " \
base-files \
base-passwd \
netbase \
${CONTAINER_SHELL} \
"
# Keep the entrypoint empty so that this image can be easily be
# inherted and re-used for interactive or non interactive images
OCI_IMAGE_ENTRYPOINT ?= ""
# If the following is configured in local.conf (or the distro):
# PACKAGE_EXTRA_ARCHS:append = " container-dummy-provides"
#
# it has been explicitly # indicated that we don't want or need a shell, so we'll
# add the dummy provides.
#
# This is required, since there are postinstall scripts in base-files and base-passwd
# that reference /bin/sh and we'll get a rootfs error if there's no shell or no dummy
# provider.
CONTAINER_SHELL ?= "${@bb.utils.contains('PACKAGE_EXTRA_ARCHS', 'container-dummy-provides', 'container-dummy-provides', 'busybox', d)}"
# Allow build with or without a specific kernel
IMAGE_CONTAINER_NO_DUMMY = "1"
# Workaround /var/volatile for now
# This is required because the lack of post-install scripts means volatile
# directories (/var/volatile/*, etc.) are not created, so we do that ourselves
# in a minimal way below. We could bootstrap and run some of the more standard
# scripts that do it at boot, but we avoid that until needed.
ROOTFS_POSTPROCESS_COMMAND += "rootfs_fixup_var_volatile ; "
# This :remove is required, because it comes along and deletes our /var/volatile/
# fixups!
ROOTFS_POSTPROCESS_COMMAND:remove = "empty_var_volatile"
rootfs_fixup_var_volatile () {
install -m 1777 -d ${IMAGE_ROOTFS}/${localstatedir}/volatile/tmp
install -m 755 -d ${IMAGE_ROOTFS}/${localstatedir}/volatile/log
}
|