Skip to content

Fix/wic: Fix TypeError in bootimg-partition by adding sector_size argument#73

Open
albayenes wants to merge 1 commit intoXilinx:rel-v2025.2from
albayenes:fix/wic-bootimg-sector-size-api
Open

Fix/wic: Fix TypeError in bootimg-partition by adding sector_size argument#73
albayenes wants to merge 1 commit intoXilinx:rel-v2025.2from
albayenes:fix/wic-bootimg-sector-size-api

Conversation

@albayenes
Copy link
Copy Markdown

Description

This PR resolves a build failure during the do_image_wic task. The error is caused by a signature mismatch in the bootimg-partition source plugin.

The Issue

When using recent versions of the Yocto Project (Poky), the Wic engine's partition.py calls the plugin's do_prepare_partition method with an additional sector_size keyword argument. Because the meta-xilinx-core local copy of this plugin does not include this parameter in its method definition, the build fails with:

TypeError: BootimgPartitionPlugin.do_prepare_partition() got an unexpected keyword argument 'sector_size'

The Fix

Updated the do_prepare_partition method signature in scripts/lib/wic/plugins/source/bootimg-partition.py to accept the sector_size argument. This ensures compatibility with the upstream Wic engine API.

Testing Performed

Environment: Yocto Project (Poky) with meta-xilinx.

Build Target: petalinux-image-minimal (or your specific machine, e.g., xczu2eg).

Result: do_image_wic completes successfully, and the resulting .wic image is generated without errors.

@albayenes albayenes changed the base branch from master to rel-v2025.2 December 27, 2025 03:48
@Louson
Copy link
Copy Markdown

Louson commented Feb 4, 2026

I also got the issue and was really surprised. Overriding wic in a base layer is quite invasive.
We wish to rely on wic from oe-core, not a vendor fork

But this one from meta-xilinx-core is taking the precedence. We can lower the xilinx priority but could you consider moving your custom wic to a sub layer ?

@twoerner
Copy link
Copy Markdown
Contributor

twoerner commented Feb 4, 2026

@Louson We needed to add several features to wic in order to use it with our EDF workflows. Upstream has agreed to these changes, but getting them into upstream takes time. We needed these changes for our release, which is based on scarthgap. As a stop-gap we added this kludge in order to release. Work is progressing to get these things upstream. Once these changes are integrated upstream, we are looking forward to removing this override as well!

@Louson
Copy link
Copy Markdown

Louson commented Feb 5, 2026 via email

@jmarcoscosta
Copy link
Copy Markdown

Hello,

First, thanks @albayenes for submitting the fix!

@twoerner would there be there any updates on this topic? would you know when this PR will be merged? Thanks!

@twoerner
Copy link
Copy Markdown
Contributor

@albayenes could you please add your SoB line?
Thanks!

@benjarobin
Copy link
Copy Markdown

Hello, maybe check others do_prepare_partition functions. I think all of them should be updated to take this additional parameter

@albayenes albayenes force-pushed the fix/wic-bootimg-sector-size-api branch from 2ddff72 to f916f6a Compare April 1, 2026 15:37
Wic core now passes sector_size as a keyword argument. This update
ensures the meta-xilinx-core local plugin matches the expected
API signature and prevents a TypeError during image generation.

Signed-off-by: Enes Albay <albayenes@gmail.com>
@albayenes albayenes force-pushed the fix/wic-bootimg-sector-size-api branch from f916f6a to 871d875 Compare April 1, 2026 15:38
@albayenes
Copy link
Copy Markdown
Author

@albayenes could you please add your SoB line? Thanks!

Fixed.

@grsandeep85
Copy link
Copy Markdown
Contributor

grsandeep85 commented Apr 1, 2026

@albayenes can you send the patches to mailing lists, We usually don't use Github PR for patches.

See https://github.com/Xilinx/meta-xilinx/blob/master/MAINTAINERS.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants