Skip to content

Commit a04faa5

Browse files
authored
Merge pull request #13 from cloudlinux/clos-2631-backport-xfs-fixes
Backport overlayfs creation approach from v19
2 parents 69a7fbf + 0be27ee commit a04faa5

File tree

3 files changed

+559
-72
lines changed

3 files changed

+559
-72
lines changed

repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,11 +739,13 @@ def perform():
739739

740740
indata = _InputData()
741741
prod_cert_path = _get_product_certificate_path()
742+
reserve_space = overlaygen.get_recommended_leapp_free_space(_get_target_userspace())
742743
with overlaygen.create_source_overlay(
743744
mounts_dir=constants.MOUNTS_DIR,
744745
scratch_dir=constants.SCRATCH_DIR,
745746
storage_info=indata.storage_info,
746-
xfs_info=indata.xfs_info) as overlay:
747+
xfs_info=indata.xfs_info,
748+
scratch_reserve=reserve_space) as overlay:
747749
with overlay.nspawn() as context:
748750
target_repoids = _gather_target_repositories(context, indata, prod_cert_path)
749751
_create_target_userspace(context, indata.packages, indata.files, target_repoids)

repos/system_upgrade/common/libraries/dnfplugin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,14 @@ def perform_transaction_install(target_userspace_info, storage_info, used_repos,
361361

362362
@contextlib.contextmanager
363363
def _prepare_perform(used_repos, target_userspace_info, xfs_info, storage_info):
364+
reserve_space = overlaygen.get_recommended_leapp_free_space(target_userspace_info.path)
364365
with _prepare_transaction(used_repos=used_repos,
365366
target_userspace_info=target_userspace_info
366367
) as (context, target_repoids, userspace_info):
367368
with overlaygen.create_source_overlay(mounts_dir=userspace_info.mounts, scratch_dir=userspace_info.scratch,
368369
xfs_info=xfs_info, storage_info=storage_info,
369-
mount_target=os.path.join(context.base_dir, 'installroot')) as overlay:
370+
mount_target=os.path.join(context.base_dir, 'installroot'),
371+
scratch_reserve=reserve_space) as overlay:
370372
yield context, overlay, target_repoids
371373

372374

0 commit comments

Comments
 (0)