forked from Mirror/pmbootstrap
Fix bootimg_analyze error (MR 2339)
Fix error: rm: can't remove '/tmp/bootimg_parser': No such file or directory Fixes #2379
This commit is contained in:
parent
3a9284da8a
commit
0c932c273d
2 changed files with 2 additions and 17 deletions
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue