Ask for additional space in pmbootstrap init (proper workaround for "no space left")
pmbootstrap install creates a chroot that will become the device rootfs. It tires to calculate the size, then creates an image file of that size, mounts it, and copies all of the rootfs into the image. The image is not much bigger than the rootfs, and will be resized to the target partition size after it was flashed and booted into. Otherwise we would have huge images (think of 32gb SD cards).
The problem is, that the size calculation is not as trivial as one may think, and depending on the file system etc it seems to be just impossible to get it right. We had several issues about this, e.g. #928 (closed) and #1826 (closed) and adjusted the pmbootstrap code quite a few times.
The implementation we have right now seems to work for almost everybody. But from time to time somebody runs into the "no space left issue".
I propose to do the following: create a new "additional option" in "pmbootstrap init" to add additional space in the image calculation. Right now, we have:
$ pmbootstrap init
...
[00:07:11] Build options: Parallel jobs: 5, ccache per arch: 5G
[00:07:11] Change them? (y/n) [n]:
...
Change this to something like:
$ pmbootstrap init
...
[00:07:11] Additional options: Extra free space: 0 MB, Parallel jobs: 5, ccache per arch: 5G
[00:07:11] Change them? (y/n) [n]:
...
Then everybody who is not affected by the problem can simply skip it, and people who need the workaround can set it here once in pmbootstrap init to a value that works for them.
So if anybody has the problem, please work on the solution proposed here. It should not be so hard, even if you are new to the pmbootstrap codebase. Join #postmarketos-devel if you're working on it and need help!
Related issue: #1885 (comment 339638941) (ask for boot partition size)