forked from Mirror/pmbootstrap
pmb.aportgen.core: Initialize chroot properly
Make sure to initialize the native chroot before trying to run a command in it. Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2610
This commit is contained in:
parent
47be020c7a
commit
f1a6f0034b
1 changed files with 4 additions and 2 deletions
|
@ -249,10 +249,12 @@ def prepare_tempdir() -> Path:
|
||||||
:returns: Path to a temporary directory for aportgen to work within.
|
:returns: Path to a temporary directory for aportgen to work within.
|
||||||
"""
|
"""
|
||||||
# Prepare aportgen tempdir inside and outside of chroot
|
# Prepare aportgen tempdir inside and outside of chroot
|
||||||
|
chroot = Chroot.native()
|
||||||
|
pmb.chroot.init(chroot)
|
||||||
tempdir = Path("/tmp/aportgen")
|
tempdir = Path("/tmp/aportgen")
|
||||||
aportgen = get_context().config.work / "aportgen"
|
aportgen = get_context().config.work / "aportgen"
|
||||||
pmb.chroot.root(["rm", "-rf", tempdir])
|
pmb.chroot.root(["rm", "-rf", tempdir], chroot)
|
||||||
pmb.helpers.run.user(["mkdir", "-p", aportgen, Chroot.native() / tempdir])
|
pmb.helpers.run.user(["mkdir", "-p", aportgen, chroot / tempdir])
|
||||||
|
|
||||||
return tempdir
|
return tempdir
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue