Skip to content

Commit

Permalink
Merge pull request #13 from cloudlinux/clos-2631-backport-xfs-fixes
Browse files Browse the repository at this point in the history
Backport overlayfs creation approach from v19
  • Loading branch information
prilr authored May 20, 2024
2 parents 69a7fbf + 0be27ee commit a04faa5
Show file tree
Hide file tree
Showing 3 changed files with 559 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -739,11 +739,13 @@ def perform():

indata = _InputData()
prod_cert_path = _get_product_certificate_path()
reserve_space = overlaygen.get_recommended_leapp_free_space(_get_target_userspace())
with overlaygen.create_source_overlay(
mounts_dir=constants.MOUNTS_DIR,
scratch_dir=constants.SCRATCH_DIR,
storage_info=indata.storage_info,
xfs_info=indata.xfs_info) as overlay:
xfs_info=indata.xfs_info,
scratch_reserve=reserve_space) as overlay:
with overlay.nspawn() as context:
target_repoids = _gather_target_repositories(context, indata, prod_cert_path)
_create_target_userspace(context, indata.packages, indata.files, target_repoids)
Expand Down
4 changes: 3 additions & 1 deletion repos/system_upgrade/common/libraries/dnfplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,14 @@ def perform_transaction_install(target_userspace_info, storage_info, used_repos,

@contextlib.contextmanager
def _prepare_perform(used_repos, target_userspace_info, xfs_info, storage_info):
reserve_space = overlaygen.get_recommended_leapp_free_space(target_userspace_info.path)
with _prepare_transaction(used_repos=used_repos,
target_userspace_info=target_userspace_info
) as (context, target_repoids, userspace_info):
with overlaygen.create_source_overlay(mounts_dir=userspace_info.mounts, scratch_dir=userspace_info.scratch,
xfs_info=xfs_info, storage_info=storage_info,
mount_target=os.path.join(context.base_dir, 'installroot')) as overlay:
mount_target=os.path.join(context.base_dir, 'installroot'),
scratch_reserve=reserve_space) as overlay:
yield context, overlay, target_repoids


Expand Down
Loading

0 comments on commit a04faa5

Please sign in to comment.