diff --git a/pmb/build/_package.py b/pmb/build/_package.py index 16d1897d..f031bf2c 100644 --- a/pmb/build/_package.py +++ b/pmb/build/_package.py @@ -198,7 +198,7 @@ def is_necessary_warn_depends(args: PmbArgs, apkbuild, arch, force, depends_buil def init_buildenv(args: PmbArgs, apkbuild, arch, strict=False, force=False, cross=None, - suffix: Chroot = Chroot.native(), skip_init_buildenv=False, src=None): + chroot: Chroot = Chroot.native(), skip_init_buildenv=False, src=None): """Build all dependencies. Check if we need to build at all (otherwise we've @@ -227,22 +227,22 @@ def init_buildenv(args: PmbArgs, apkbuild, arch, strict=False, force=False, cros # Install and configure abuild, ccache, gcc, dependencies if not skip_init_buildenv: - pmb.build.init(args, suffix) - pmb.build.other.configure_abuild(args, suffix) + pmb.build.init(args, chroot) + pmb.build.other.configure_abuild(args, chroot) if args.ccache: - pmb.build.other.configure_ccache(args, suffix) + pmb.build.other.configure_ccache(args, chroot) if "rust" in depends or "cargo" in depends: - pmb.chroot.apk.install(args, ["sccache"], suffix) + pmb.chroot.apk.install(args, ["sccache"], chroot) if not strict and "pmb:strict" not in apkbuild["options"] and len(depends): - pmb.chroot.apk.install(args, depends, suffix) + pmb.chroot.apk.install(args, depends, chroot) if src: - pmb.chroot.apk.install(args, ["rsync"], suffix) + pmb.chroot.apk.install(args, ["rsync"], chroot) # Cross-compiler init if cross: pmb.build.init_compiler(args, depends, cross, arch) if cross == "crossdirect": - pmb.chroot.mount_native_into_foreign(args, suffix) + pmb.chroot.mount_native_into_foreign(args, chroot) return True diff --git a/pmb/build/init.py b/pmb/build/init.py index d138fb38..5d71d980 100644 --- a/pmb/build/init.py +++ b/pmb/build/init.py @@ -129,4 +129,4 @@ def init_compiler(args: PmbArgs, depends, cross, arch): # native macros / build scripts cross_pkgs += depends - pmb.chroot.apk.install(args, cross_pkgs) + pmb.chroot.apk.install(args, cross_pkgs, Chroot.native()) diff --git a/pmb/chroot/apk.py b/pmb/chroot/apk.py index 0d27b008..298132f7 100644 --- a/pmb/chroot/apk.py +++ b/pmb/chroot/apk.py @@ -219,7 +219,7 @@ def install_run_apk(args: PmbArgs, to_add, to_add_local, to_del, chroot: Chroot) chroot=chroot) -def install(args: PmbArgs, packages, chroot: Chroot=Chroot.native(), build=True): +def install(args: PmbArgs, packages, chroot: Chroot, build=True): """ Install packages from pmbootstrap's local package index or the pmOS/Alpine binary package mirrors. Iterate over all dependencies recursively, and diff --git a/pmb/chroot/binfmt.py b/pmb/chroot/binfmt.py index 8c48957e..8a0155ab 100644 --- a/pmb/chroot/binfmt.py +++ b/pmb/chroot/binfmt.py @@ -23,7 +23,7 @@ def register(args: PmbArgs, arch): # always make sure the qemu- binary is installed, since registering # may happen outside of this method (e.g. by OS) if f"qemu-{arch_qemu}" not in pmb.chroot.apk.installed(args): - pmb.chroot.apk.install(args, ["qemu-" + arch_qemu]) + pmb.chroot.apk.install(args, ["qemu-" + arch_qemu], Chroot.native()) if is_registered(arch_qemu): return diff --git a/pmb/flasher/init.py b/pmb/flasher/init.py index 62e4f3dc..6c5e56e3 100644 --- a/pmb/flasher/init.py +++ b/pmb/flasher/init.py @@ -40,7 +40,7 @@ def install_depends(args: PmbArgs): depends = pmaports_cfg.get("supported_mtkclient_depends", "mtkclient,android-tools").split(",") - pmb.chroot.apk.install(args, depends) + pmb.chroot.apk.install(args, depends, Chroot.native()) def init(args: PmbArgs): diff --git a/pmb/install/_install.py b/pmb/install/_install.py index 8a204a21..a9791f01 100644 --- a/pmb/install/_install.py +++ b/pmb/install/_install.py @@ -134,7 +134,7 @@ def copy_files_from_chroot(args: PmbArgs, chroot: Chroot): # Update or copy all files if args.rsync: - pmb.chroot.apk.install(args, ["rsync"]) + pmb.chroot.apk.install(args, ["rsync"], Chroot.native()) rsync_flags = "-a" if args.verbose: rsync_flags += "vP" @@ -883,7 +883,7 @@ def install_system_image(args: PmbArgs, size_reserve, chroot: Chroot, step, step if sparse and not split and not disk: workdir = Path("/home/pmos/rootfs") logging.info("(native) make sparse rootfs") - pmb.chroot.apk.install(args, ["android-tools"]) + pmb.chroot.apk.install(args, ["android-tools"], Chroot.native()) sys_image = args.device + ".img" sys_image_sparse = args.device + "-sparse.img" pmb.chroot.user(args, ["img2simg", sys_image, sys_image_sparse], @@ -895,7 +895,7 @@ def install_system_image(args: PmbArgs, size_reserve, chroot: Chroot, step, step samsungify_strategy = args.deviceinfo["flash_sparse_samsung_format"] if samsungify_strategy: logging.info("(native) convert sparse image into Samsung's sparse image format") - pmb.chroot.apk.install(args, ["sm-sparse-image-tool"]) + pmb.chroot.apk.install(args, ["sm-sparse-image-tool"], Chroot.native()) sys_image = f"{args.device}.img" sys_image_patched = f"{args.device}-patched.img" pmb.chroot.user(args, ["sm_sparse_image_tool", "samsungify", "--strategy", @@ -1302,7 +1302,7 @@ def install(args: PmbArgs): # Install required programs in native chroot step = 1 logging.info(f"*** ({step}/{steps}) PREPARE NATIVE CHROOT ***") - pmb.chroot.apk.install(args, pmb.config.install_native_packages, + pmb.chroot.apk.install(args, pmb.config.install_native_packages, Chroot.native(), build=False) step += 1 diff --git a/pmb/parse/bootimg.py b/pmb/parse/bootimg.py index 5ae1c4ec..75e2fb0f 100644 --- a/pmb/parse/bootimg.py +++ b/pmb/parse/bootimg.py @@ -8,6 +8,7 @@ import pmb.helpers.run import pmb.chroot.root import pmb.chroot.user import pmb.chroot.other +import pmb.chroot.apk from pmb.core import Chroot @@ -79,7 +80,7 @@ def bootimg(args: PmbArgs, path: Path): logging.info("NOTE: You will be prompted for your sudo/doas password, so" " we can set up a chroot to extract and analyze your" " boot.img file") - pmb.chroot.apk.install(args, ["file", "unpackbootimg"]) + pmb.chroot.apk.install(args, ["file", "unpackbootimg"], Chroot.native()) temp_path = pmb.chroot.other.tempfolder(args, Path("/tmp/bootimg_parser")) bootimg_path = Chroot.native() / temp_path / "boot.img" diff --git a/pmb/qemu/run.py b/pmb/qemu/run.py index dd314131..37a19421 100644 --- a/pmb/qemu/run.py +++ b/pmb/qemu/run.py @@ -325,7 +325,7 @@ def install_depends(args: PmbArgs, arch): if args.efi: depends.append("ovmf") - pmb.chroot.apk.install(args, depends) + pmb.chroot.apk.install(args, depends, Chroot.native()) def run(args: PmbArgs):