1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-13 11:29:46 +03:00

Fix pmbootstrap install --android-recovery-zip (MR 2368)

Tweaked-By: Oliver Smith <ollieparanoid@postmarketos.org>
This commit is contained in:
HenriDellal 2024-07-14 17:20:40 +00:00 committed by Oliver Smith
parent d8e174b04c
commit 2b577a8694
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
3 changed files with 6 additions and 5 deletions

View file

@ -88,7 +88,7 @@ def sideload(deviceinfo: Deviceinfo, method: str):
# Missing recovery zip error # Missing recovery zip error
if not ( if not (
Chroot.native() chroot
/ mountpoint / mountpoint
/ "var/lib/postmarketos-android-recovery-installer" / "var/lib/postmarketos-android-recovery-installer"
/ f"pmos-{deviceinfo.codename}.zip" / f"pmos-{deviceinfo.codename}.zip"

View file

@ -101,14 +101,15 @@ def umount_all(folder: Path):
raise RuntimeError(f"Failed to umount: {mountpoint}") 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. Mount the device rootfs.
:param chroot_rootfs: the chroot where the rootfs that will be :param chroot_rootfs: the chroot where the rootfs that will be
installed on the device has been created (e.g. installed on the device has been created (e.g.
"rootfs_qemu-amd64") "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)) 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 return mountpoint

View file

@ -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): def install_recovery_zip(args: PmbArgs, device: str, arch: Arch, steps):
logging.info(f"*** ({steps}/{steps}) CREATING RECOVERY-FLASHABLE ZIP ***") logging.info(f"*** ({steps}/{steps}) CREATING RECOVERY-FLASHABLE ZIP ***")
chroot = Chroot(ChrootType.BUILDROOT, arch) 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) pmb.install.recovery.create_zip(args, chroot, device)
# Flash information # Flash information