Add option to specify extra free space in pmbootstrap init (MR 1989)

This adds a new commandline flag -E / --extra-space for
specifying the amount of additional space to be added to
the image size to work around cases where the automatically
determined size turns out to not actually be enough.

The value is also asked for in the "Additional options"
section of the interactive mode.

Fixes: #1904
This commit is contained in:
Johannes Marbach 2020-11-15 17:19:25 +01:00
parent e6543332de
commit 5dea31058d
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
5 changed files with 24 additions and 4 deletions

View file

@ -341,6 +341,7 @@ def ask_for_device(args):
def ask_for_additional_options(args, cfg):
# Allow to skip additional options
logging.info("Additional options:"
f" extra free space: {args.extra_space} MB,"
f" boot partition size: {args.boot_size} MB,"
f" parallel jobs: {args.jobs},"
f" ccache per arch: {args.ccache_size}")
@ -349,6 +350,18 @@ def ask_for_additional_options(args, cfg):
default=False):
return
# Extra space
logging.info("Set extra free space to 0, unless you ran into a 'No space"
" left on device' error. In that case, the size of the"
" rootfs could not be calculated properly on your machine,"
" and we need to add extra free space to make the image big"
" enough to fit the rootfs (pmaports#1904)."
" How much extra free space do you want to add to the image"
" (in MB)?")
answer = pmb.helpers.cli.ask(args, "Extra space size", None,
args.extra_space, validation_regex="[0-9]+")
cfg["pmbootstrap"]["extra_space"] = answer
# Boot size
logging.info("What should be the boot partition size (in MB)?")
answer = pmb.helpers.cli.ask(args, "Boot size", None, args.boot_size,