Skip to content

Commit

Permalink
cmdlib: Ensure bare-user tmpdir is in $workdir/tmp
Browse files Browse the repository at this point in the history
Linux `tmpfs` still doesn't support `user.` xattrs, and so for
toolbox-like containers that use a (proper!) `tmpfs` for `/tmp`
instead of having it be `overlayfs`, we need to ensure that
we create our tempdir in `$workdir/tmp` - the workdir must have
`user.` xattr support for the `cache/repo-build` anyways.

Closes: #2904
(cherry picked from commit e024805)

dustymabe: This cherry pick needed manual merge conflict resolution.
           The function call for import_ostree_commit() changed in
           816ebae to pass the workdir in. I evaluated the changes
           in e024805 and 816ebae and determined this to be the most
           surgical change.
  • Loading branch information
cgwalters authored and jlebon committed Dec 2, 2022
1 parent d96f929 commit 802cab0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cosalib/cmdlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ def import_ostree_commit(repo, buildpath, buildmeta, force=False):
gid = os.getgid()
subprocess.check_call(['sudo', 'chown', '-hR', f"{uid}:{gid}", repo])
else:
with tempfile.TemporaryDirectory() as tmpd:
tmpdir = os.path.join(os.getcwd(), 'tmp')
with tempfile.TemporaryDirectory(dir=tmpdir) as tmpd:
subprocess.check_call(['ostree', 'init', '--repo', tmpd, '--mode=bare-user'])
subprocess.check_call(['rpm-ostree', 'ex-container', 'import', '--repo', tmpd,
'--write-ref', buildmeta['buildid'], 'ostree-unverified-image:oci-archive:' + tarfile])
Expand Down

0 comments on commit 802cab0

Please sign in to comment.