Commit Graph

17 Commits

Author SHA1 Message Date
Christopher Clark
19347a7c4e qemuboot, xen-image-minimal: enable runqemu for qemuarm64 Xen images
The Xen hypervisor built for Arm 64-bit targets can be launched with
runqemu by providing a Device Tree binary and configuration for Qemu,
which enables interactive testing of Xen images.

Add qemuboot-xen-dtb.bbclass to add a new bitbake task for generating
the dtb file by using lopper on a device tree produced by Qemu.

Add qemuboot-xen-defaults.bbclass to supply working default parameters
for the qemuarm64 machine and general support for qemuboot for Xen,
and adjust the defaults as needed to boot successfully in testing.

Development aided by this script by Stewart Hildebrand of DornerWorks:
https://gist.github.com/stewdk/110f43e0cc1d905fc6ed4c7e10d8d35e

Signed-off-by: Christopher Clark <christopher.clark@starlab.io>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2021-07-29 10:55:56 -04:00
Bruce Ashfield
96c47ad0b8 oci-images: create backend .inc files
As part of allowing different types of oci images to be created,
we split our IMG_cmd into .inc files that can then be specific to
the selected type.

For the umoci backend: We can take the same options as sloci
expects and use umoci to create images.

The resulting OCI image is similar, but by using umoci, we set
the stage to do multi-tag, or multi-layer images in the future.

But for now, we are functionally equivalent to the sloci backend.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2021-07-19 13:36:17 -04:00
Bruce Ashfield
3e66fce9ac cni: introduce cni networking bbclass
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2021-03-15 23:15:42 -04:00
Christopher Clark
b34307e2f4 xen: retire the Raspberry Pi sdcard class
The sdcard class in the meta-raspberrypi layer is now extensible with
support for adding files such as hypervisor binaries to the boot
partition, so this layer can switch to use that and drop the custom
sdcard bbclass.

Uses the new RPI_SDIMG_EXTRA_DEPENDS and DEPLOYPAYLOAD variables,
and: IMAGE_CLASS: sdcard_image-rpi-xen => sdcard_image-rpi
    IMAGE_FSTYPE: rpi-xen-sdimg => rpi-sdimg

Please note that the filename suffix of the image is changed by this.

Also apply _raspberrypi4-64 scoping to the Raspberry Pi settings.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2020-08-11 15:58:37 -04:00
Christopher Clark
e6e471f3fb xen, raspberry pi: add Xen-specific SD card class
At the moment the regular meta-raspberrypi SD card class does not allow
for optional inclusion of extra files in the SD card boot partition
without requiring those same files be present in the root filesystem.
This affects hypervisor binaries, such as Xen, which do not necessarily
belong within the guest filesystem.

As a workaround, inherit the sdcard_image-rpi.bbclass and clone the
main IMAGE_CMD function, adding the Xen-specific deploy that is needed.
This can be retired when the parent class has extensibility added.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2020-07-06 16:25:56 -04:00
Christopher Clark
7f6f115d7d xen: apply layer settings when xen DISTRO_FEATURE is enabled
These settings are necessary for Xen and enabling them here, using the
same mechanism that is used by k8s in this layer, simplifies building
images for Xen.

- Ensure that Xen mode is enabled in QEMU.
- On ARM platforms: enable Flattened Device Tree (FDT) support.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2020-07-06 16:25:55 -04:00
Bruce Ashfield
3a7d446fa9 conf: defer DISTRO_FEATURE check to bbclass processing
We were using USER_CLASS loading to allow conditional checking
on DISTRO_FEATURES, which triggered distro feature specific version
pinning.

It was found that DISTRO_FEATURES set in local.conf is not
consistently available at layer.conf parse time, hence our checks
were not always working as expected (i.e. the version files are
not included).

If we move the DISTRO_FEATURE check to the bbclasses, and use it
to trigger the include, we should have a consistent set of variable
resolution and consistent behaviour.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2020-02-10 10:28:38 -05:00
Bruce Ashfield
c31e46fce7 conf: add k8s distro feature
Add support for a new distro feature to control kubernetes versions
and related configuration.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2019-12-10 02:25:21 -05:00
Bruce Ashfield
b4dfe90a5e conf: fix meta-virt version / config include
As was reported:

https://lists.yoctoproject.org/g/meta-virtualization/message/4173?p=,,,20,0,0,0::Created,,conf%2Flayer.conf+is+broken,20,2,0,61269733

The conditional include of the meta-virt versions and config was not
working properly due to parse time constraints.

This commit fixes that by following the example of the meta-cube layer
and instead using a user bbclass to load the .inc file after
distro/distro features have been resolved by bitbake.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2019-12-06 13:51:57 -05:00
Bruce Ashfield
29c60173e2 containers: introduce image-oci
This image class creates an oci image spec directory from a generated
rootfs. The contents of the rootfs do not matter (i.e. they need not be
container optimized), but by using the container image type and small
footprint images, we can create directly executable container images.

Once the tarball (or oci image directory) has been created of the OCI
image, it can be manipulated by standard tools. For example, to create a
runtime bundle from the oci image, the following can be done:

Assuming the image name is "container-base":

  If the oci image was a tarball, extract it (skip, if a directory is being directly used)
    % tar xvf container-base-<arch>-<stamp>.rootfs-oci-latest-x86_64-linux.oci-image.tar

  And then create the bundle:
    % oci-image-tool create --ref name=latest container-base-<arch>-<stamp>.rootfs-oci container-base-oci-bundle

  Or to copy (push) the oci image to a docker registry, skopeo can be used (vary the
  tag based on the created oci image:

    % skopeo copy --dest-creds <username>:<password> oci:container-base-<arch>-<stamp>:latest docker://zeddii/container-base

The following image variables are available to customize the details
of the constructed image (defaults as shown):

   OCI_IMAGE_AUTHOR ?= "${PATCH_GIT_USER_NAME}"
   OCI_IMAGE_AUTHOR_EMAIL ?= "${PATCH_GIT_USER_EMAIL}"

   OCI_IMAGE_TAG ?= "latest"
   OCI_IMAGE_RUNTIME_UID ?= ""

   OCI_IMAGE_ARCH ?= "${TARGET_ARCH}"
   OCI_IMAGE_SUBARCH ?= "${@oci_map_subarch(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}"

   OCI_IMAGE_ENTRYPOINT ?= "sh"
   OCI_IMAGE_ENTRYPOINT_ARGS ?= ""
   OCI_IMAGE_WORKINGDIR ?= ""

   //List of ports to expose from a container running this image:
   //PORT[/PROT]
   //  format: <port>/tcp, <port>/udp, or <port> (same as <port>/tcp).
   OICI_IMAGE_PORTS ?= ""

   // key=value list of labels
   OCI_IMAGE_LABELS ?= ""
   // key=value list of environment variables
   OCI_IMAGE_ENV_VARS ?= ""

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2019-02-27 11:46:25 -05:00
Paul Barker
638ba96208 sanity-meta-virt: Watch for SanityCheck event
The ConfigParsed event is raised multiple times during a build which resulted
in the sanity warning appearing up to 4 times per build. Instead we should be
watching for the SanityCheck event (this is what the sanity checks in oe-core
watch for).

Signed-off-by: Paul Barker <pbarker@toganlabs.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2017-10-12 21:59:51 -04:00
Paul Barker
1e4530c283 sanity-meta-virt: Make skip variable name layer specific
The variable used to skip the sanity check should be named in a layer specific
way. This will ensure there is no confusion if other layers use a similar sanity
check.

Signed-off-by: Paul Barker <pbarker@toganlabs.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2017-10-12 21:59:51 -04:00
Chen Qi
bfba140b83 sanity-meta-virt.bbclass: add class for bbappend files checking
Add a new class, sanity-meta-virt.bbclass, to check for whether necessary
settings are available for bbappend files in this layer to be effective,
and warn users if not.

In addition, a variable SKIP_SANITY_BBAPPEND_CHECK is added to enable users
to explicitly skip the checking to avoid unwanted warnings.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2017-10-02 09:39:26 -04:00
Mark Asselstine
a20d51d5c6 housekeeping: swap out go-osarchmap in favor of goarch
Continue work to use go infra in oe-core instead of the support for go
previously found in meta-virt. This is a 1:1 drop in replacement and
removes one more go piece from meta-virt in favor of the common
support found in oe-core.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2017-04-11 23:09:01 -04:00
Paul Barker
e64f378b93 Remove True option to getVar calls
getVar() now defaults to expanding by default.

Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2017-01-03 10:28:33 -05:00
Paul Barker
b0a72cd343 go-osarchmap: Skip golang recipes for unsupported architectures
Building any recipe for a mips-based machine like arduino-yun currently leads
to errors in go_map_arch(). Instead, errors should only be raised if a recipe
which uses golang is built. This is achieved using the same error handling seen
in recipes-extended/xen.

Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2017-01-03 10:28:33 -05:00
Zongchun Yu
12c601cd2d go-cross: uprev to 1.5.2
* Add go-native as build bootstrap for go-cross.
* Upgrade go-cross to v1.5.2

Signed-off-by: Zongchun Yu <zongchun.yu@nxp.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2016-04-19 15:51:10 -04:00