Commit Graph

11 Commits

Author SHA1 Message Date
Alexander Kanavin
fc78d37ff0
meta-openembedded/all: adapt to UNPACKDIR changes
Please see
https://git.yoctoproject.org/poky/commit/?id=4dd321f8b83afecd962393101b2a6861275b5265
for what changes are needed, and sed commands that can be used to make them en masse.

I've verified that bitbake -c patch world works with these, but did not run a world
build; the majority of recipes shouldn't need further fixups, but if there are
some that still fall out, they can be fixed in followups.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-06-25 06:44:52 -07:00
Bastian Krause
0c3c7bc9f4
fitimage.bbclass: warn if kernel is compressed, but no compression specified
If the kernel build type uses compression, the bootloader needs to take
care of decompression. This must be configured in the FIT image via
FITIMAGE_IMAGE_myimage[comp]. So warn if the FIT image kernel compression
is not specified in such a case.

Signed-off-by: Bastian Krause <bst@pengutronix.de>
2025-04-16 08:04:42 -07:00
Enrico Jörns
24dd46daf8
fitimage.bbclass: error-out for empty configurations
Otherwise mkimage will, but with a way less helpful error message.

Signed-off-by: Enrico Jörns <ejo@pengutronix.de>
2025-04-16 08:04:42 -07:00
Enrico Jörns
5bff8f5b3b
fitimage.bbclass: fix configurations node naming
Similar to e152f01d, this fixes another occurence of the config section
name to contain the 'conf_prefix'.
Luckily, this one is only debug output.

Signed-off-by: Enrico Jörns <ejo@pengutronix.de>
2025-04-16 08:04:42 -07:00
Enrico Jörns
69dbad5529
fitimage.bbclass: fail early for unsupported image types
A given image type should be valid. Thus fail early here instead of
randomly failing later during mkimage call.

Signed-off-by: Enrico Jörns <ejo@pengutronix.de>
2025-04-16 08:04:42 -07:00
Enrico Jörns
62eba951c7
fitimage.bbclass: let image type default to 'kernel'
When no type is set, we simply pick 'kernel' as the default since it
is still the most common to be used for FIT images.

Signed-off-by: Enrico Jörns <ejo@pengutronix.de>
2025-04-16 08:04:42 -07:00
Enrico Jörns
71e6160da0
fitimage.bbclass: fix error handling for missing recipe
The 'image' name should be printed rather than the (unset) 'recipe'.
Also use f-strings for better readability.

Since a missing recipe configuration is fatal to a proper generation,
abort the parsing with bb.fatal instead of continuing with a broken
configuration.

Signed-off-by: Enrico Jörns <ejo@pengutronix.de>
2025-04-16 08:04:42 -07:00
John Ripple
90f3c21186
fitimage.bbclass: Add missing punctuation
The functions related to signing the fitimage had missing quotations and
newlines. Without this punctuation, the signing class would fail to
generate a signed fitimage.

To test this change just create a fitImage using this class and set
FITIMAGE_SIGN to 1. The resulting fitImage its file should have one
property per line with quotes around the property values.

Signed-off-by: John Ripple <john.ripple@keysight.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-03-13 22:09:36 -07:00
Akash Hadke
59614eafb0
fitimage.bbclass: Remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Signed-off-by: Akash Hadke <akash.hadke27@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-01-10 09:33:53 -08:00
Ulrich Ölmann
e152f01daf
fitimage: fix name of default configuration
The new fitimage.bbclass was introduced via GitHub pullrequest [1]. There was a
small force-push which implemented a prefix for the names of the configuration
nodes to harmonize the class with the mechanism found in OE-core (see [2] & [3]).
Unfortunately it was forgotten to also apply that prefix to the name of the
configuration to utilize by default - fix that.

[1] https://github.com/openembedded/meta-openembedded/pull/882
[2] https://github.com/openembedded/meta-openembedded/pull/882#issuecomment-2402218973
[3] 0773f63e82..32e7947154

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2024-10-16 08:16:06 -07:00
Marco Felsch
b20be52a4e
fitimage: add support to build arbitrary FIT images
The FIT image support in OE is quite limited:
 1) No support to build an arbitrary number of FIT images since the FIT
    image generation is tightly coupled to the kernel image.
 2) A lot of U_BOOT-specific variables which may not be necessary for
    other bootloaders.
 3) No usage of the meta-oe signing.bbclass for signed FIT images.

This alternative class is added to solve the above-mentioned problems:
 1) The class can be inherited by an arbitrary number of
    <fit-image-name>.bb recipes to generate FIT images
 2) No U_BOOT-specific variables are used
 3) <fit-image-name>.bb recipes can prepend the do_fitimage() to
    provide the key using the signing.bbclass e.g.:

    do_fitimage:prepend() {
        signing_prepare
        signing_use_role "${FITIMAGE_SIGNING_KEY_ROLE}"
    }

    Then enable and configure signing as follows:

    FITIMAGE_SIGN = "1"
    FITIMAGE_MKIMAGE_EXTRA_ARGS = "--engine pkcs11"
    FITIMAGE_SIGN_KEYDIR = "${PKCS11_URI}

This class is inspired by the meta-phytec fitimage.bbclass [1].

[1] https://git.phytec.de/meta-phytec/tree/classes/fitimage.bbclass

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Enrico Jörns <ejo@pengutronix.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2024-10-09 15:47:23 -07:00