Skip to content

Commit

Permalink
classes: bundle: use getVarFlag instead .get
Browse files Browse the repository at this point in the history
Make use of .getVarFlags instead of the simple .get to allow bitbake
level variable expansion.

This is useful especially when using bundle variants [1], on a
devicetree based board, where the compatible string - the slot
'name' -  would be constructed from another variable found e.g. in the
machine.conf

Link: https://rauc.readthedocs.io/en/latest/advanced.html#sec-variants
Signed-off-by: Johannes Schneider <[email protected]>
  • Loading branch information
js731ca committed Aug 22, 2024
1 parent 3fb8b63 commit e29b3e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions classes/bundle.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -231,17 +231,17 @@ def write_manifest(d):
for slot in (d.getVar('RAUC_BUNDLE_SLOTS') or "").split():
slotflags = d.getVarFlags('RAUC_SLOT_%s' % slot)
if slotflags and 'name' in slotflags:
slotname = slotflags.get('name')
slotname = d.getVarFlag('RAUC_SLOT_%s' % slot, 'name')
else:
slotname = slot
manifest.write('[image.%s]\n' % slotname)
if slotflags and 'type' in slotflags:
imgtype = slotflags.get('type')
imgtype = d.getVarFlag('RAUC_SLOT_%s' % slot, 'type')
else:
imgtype = 'image'

if slotflags and 'fstype' in slotflags:
img_fstype = slotflags.get('fstype')
img_fstype = d.getVarFlag('RAUC_SLOT_%s' % slot, 'fstype')
else:
img_fstype = d.getVar('RAUC_IMAGE_FSTYPE')

Expand Down

0 comments on commit e29b3e8

Please sign in to comment.