Skip to content

Conversation

@pothos
Copy link

@pothos pothos commented Jan 23, 2026

When the final image does not contain the rootfs it must be grown before being able to boot it. Since the exact size to grow is not easily known to the user, it's best if the image is already grown to the right size. Also, when flashing to disk it helps to have the image be the minimum size needed because otherwise flashing on a too small disk succeeds but boot will fail. With the right image size it's easier for the user to know whether the disk is large enough.

if context.config.output_size and context.config.output_format == OutputFormat.disk:
output = context.staging / context.config.output_with_format
current_size = output.stat().st_size
if context.config.output_size > current_size:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the implementation, it is clear, that this can only grow the image, and the documentation does mention it, but logging warning in the case we cannot grow the image, would be a nicer UX.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, like that with log_notice?

Copy link
Contributor

@behrmann behrmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Can you rebase for CI to run?

@pothos pothos force-pushed the output-size branch 3 times, most recently from d133c5e to 968c61c Compare February 2, 2026 09:15
When the final image does not contain the rootfs it must be grown before
being able to boot it. Since the exact size to grow is not easily known
to the user, it's best if the image is already grown to the right size.
Also, when flashing to disk it helps to have the image be the minimum
size needed because otherwise flashing on a too small disk succeeds but
boot will fail. With the right image size it's easier for the user to
know whether the disk is large enough.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants