Skip to content

Commit

Permalink
genimage.bbclass: Add explicit error when used in a rootfs image
Browse files Browse the repository at this point in the history
In contrast to wic, the genimage.bbclass is meant to be used from a
separate recipe and should thus not be inherited from a rootfs image
recipe.

A proper check for this is to verify whether the 'image' class is
inherited and abort parsing with an explicit error message.

Signed-off-by: Enrico Jörns <[email protected]>
  • Loading branch information
ejoerns committed Sep 9, 2024
1 parent e2c9004 commit ac2be76
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions classes-recipe/genimage.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ PACKAGES = ""

PACKAGE_ARCH = "${MACHINE_ARCH}"

python () {
if bb.data.inherits_class('image', d):
bb.fatal("genimage.bbclass is not designed to be inherited by a rootfs image recipe!")
}

S = "${WORKDIR}/sources"
UNPACKDIR = "${S}"

Expand Down

0 comments on commit ac2be76

Please sign in to comment.