From 3a69f8d4b754f5c209688a4d19a8af4c9a857ee8 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Wed, 2 Oct 2024 13:03:18 -0700 Subject: [PATCH] trivial: provide a little more context for disk size failures While trying to build a new CI job, I came to realize that the default image was too small, and the block-device-efi-lvm element example wants 40GB by default. Even though that can be easily resolved, it kind of requires taking a look at the code to understand what is going on. So instead, we'll now log an error as a hint. Change-Id: I05bfeae1a2b9aef01f781115fdbd5046c80437f0 --- diskimage_builder/block_device/level1/partitioning.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/diskimage_builder/block_device/level1/partitioning.py b/diskimage_builder/block_device/level1/partitioning.py index d3ea2a637..08d3472bc 100644 --- a/diskimage_builder/block_device/level1/partitioning.py +++ b/diskimage_builder/block_device/level1/partitioning.py @@ -152,6 +152,9 @@ class Partitioning(PluginBase): # megabytes so it can align on sensible boundaries. And # create partitions right after previous so no need to # calculate start/end - just size. + if not size <= disk_free: + logger.error('The requested size of the image is smaller ' + 'than the block device configuration.') assert size <= disk_free args['size'] = size // (1024 * 1024)