diff --git a/pmb/chroot/other.py b/pmb/chroot/other.py index 19712757..10d6d378 100644 --- a/pmb/chroot/other.py +++ b/pmb/chroot/other.py @@ -3,7 +3,6 @@ import os from pmb.core.context import get_context from pmb.helpers import logging -from pathlib import Path import pmb.chroot.apk from pmb.types import PmbArgs import pmb.install @@ -35,21 +34,6 @@ def kernel_flavor_installed(chroot: Chroot, autoinstall=True): return glob_result[0].name if glob_result else None -# FIXME: this function has ONE user, does it need to exist? -def tempfolder(path: Path, chroot: Chroot = Chroot.native()): - """ - Create a temporary folder inside the chroot that belongs to "user". - The folder gets deleted, if it already exists. - - :param path: of the temporary folder inside the chroot - :returns: the path - """ - if chroot / path: - pmb.chroot.root(["rm", "-r", path]) - pmb.chroot.user(["mkdir", "-p", path]) - return path - - def copy_xauthority(args: PmbArgs): """ Copy the host system's Xauthority file to the pmos user inside the chroot, diff --git a/pmb/parse/bootimg.py b/pmb/parse/bootimg.py index 4ae4ce66..4295a2e9 100644 --- a/pmb/parse/bootimg.py +++ b/pmb/parse/bootimg.py @@ -84,7 +84,8 @@ def bootimg(path: Path): ) pmb.chroot.apk.install(["file", "unpackbootimg"], Chroot.native()) - temp_path = pmb.chroot.other.tempfolder(Path("/tmp/bootimg_parser")) + temp_path = Path("/tmp/bootimg_parser") + pmb.chroot.user(["mkdir", "-p", temp_path]) bootimg_path = Chroot.native() / temp_path / "boot.img" # Copy the boot.img into the chroot temporary folder