diff --git a/pmb/flasher/frontend.py b/pmb/flasher/frontend.py index 96684b0a..b8883c40 100644 --- a/pmb/flasher/frontend.py +++ b/pmb/flasher/frontend.py @@ -88,7 +88,7 @@ def sideload(deviceinfo: Deviceinfo, method: str): # Missing recovery zip error if not ( - Chroot.native() + chroot / mountpoint / "var/lib/postmarketos-android-recovery-installer" / f"pmos-{deviceinfo.codename}.zip" diff --git a/pmb/helpers/mount.py b/pmb/helpers/mount.py index 45f0d0d4..535f9850 100644 --- a/pmb/helpers/mount.py +++ b/pmb/helpers/mount.py @@ -101,14 +101,15 @@ def umount_all(folder: Path): raise RuntimeError(f"Failed to umount: {mountpoint}") -def mount_device_rootfs(chroot_rootfs: Chroot) -> PurePath: +def mount_device_rootfs(chroot_rootfs: Chroot, chroot_base: Chroot = Chroot.native()) -> PurePath: """ Mount the device rootfs. :param chroot_rootfs: the chroot where the rootfs that will be installed on the device has been created (e.g. "rootfs_qemu-amd64") - :returns: the mountpoint (relative to the native chroot) + :param chroot_base: the chroot rootfs mounted to + :returns: the mountpoint (relative to the chroot) """ mountpoint = PurePath("/mnt", str(chroot_rootfs)) - pmb.helpers.mount.bind(chroot_rootfs.path, Chroot.native() / mountpoint) + pmb.helpers.mount.bind(chroot_rootfs.path, chroot_base / mountpoint) return mountpoint diff --git a/pmb/install/_install.py b/pmb/install/_install.py index c711ff88..826a36cd 100644 --- a/pmb/install/_install.py +++ b/pmb/install/_install.py @@ -1040,7 +1040,7 @@ def print_flash_info(device: str, deviceinfo: Deviceinfo, split: bool, have_disk def install_recovery_zip(args: PmbArgs, device: str, arch: Arch, steps): logging.info(f"*** ({steps}/{steps}) CREATING RECOVERY-FLASHABLE ZIP ***") chroot = Chroot(ChrootType.BUILDROOT, arch) - mount_device_rootfs(Chroot.rootfs(device)) + mount_device_rootfs(Chroot.rootfs(device), chroot) pmb.install.recovery.create_zip(args, chroot, device) # Flash information