mkosi icon indicating copy to clipboard operation
mkosi copied to clipboard

Set squashFS minimum partition size to RootSize

Open mcassaniti opened this issue 3 years ago • 1 comments

When building with SquashFS (and potentially other FS types) the partition size inserted is the size of the file system blob when the partition needs to be generated (i.e.: is_generated_root() is true). For SquashFS this may be much smaller than the value specified for RootSize. In general this isn't an issue but it becomes a problem when we have the following layout:

  1. An EFI partition
  2. A SquashFS root or /usr partition
  3. A verity partition for the previous partition

If the SquashFS partition is ever updated (like A/B updates) and the new partition doesn't fit within the allocated space then there's an issue. sysetmd-repart will not assist here to resize the SquashFS partition either because that would require moving data around.

I mainly wanted feedback before I start a PR on this one. It seems adjusting the minimum size when inserting the partition based on the partition type and file system would be sufficient.

mcassaniti avatar Jul 27 '22 23:07 mcassaniti

I decided to have a go anyway.

mcassaniti avatar Jul 28 '22 22:07 mcassaniti