forked from Mirror/pmbootstrap
pmb/export/symlinks: add support for a single 'flavor' (MR 2093)
This commit is contained in:
parent
91bb682755
commit
453ce35b8c
1 changed files with 29 additions and 20 deletions
|
@ -7,6 +7,7 @@ import glob
|
|||
import pmb.build
|
||||
import pmb.chroot.apk
|
||||
import pmb.config
|
||||
import pmb.config.pmaports
|
||||
import pmb.flasher
|
||||
import pmb.helpers.file
|
||||
|
||||
|
@ -16,35 +17,43 @@ def symlinks(args, flavor, folder):
|
|||
Create convenience symlinks to the rootfs and boot files.
|
||||
"""
|
||||
|
||||
# Backwards compatibility with old mkinitfs (pma#660)
|
||||
suffix = f"-{flavor}"
|
||||
pmaports_cfg = pmb.config.pmaports.read_config(args)
|
||||
if pmaports_cfg.get("supported_mkinitfs_without_flavors", False):
|
||||
suffix = ""
|
||||
|
||||
# File descriptions
|
||||
info = {
|
||||
"boot.img-" + flavor: "Fastboot compatible boot.img file,"
|
||||
" contains initramfs and kernel",
|
||||
f"boot.img{suffix}": ("Fastboot compatible boot.img file,"
|
||||
" contains initramfs and kernel"),
|
||||
"dtbo.img": "Fastboot compatible dtbo image",
|
||||
"initramfs-" + flavor: "Initramfs",
|
||||
"initramfs-" + flavor + "-extra": "Extra initramfs files in /boot",
|
||||
"uInitrd-" + flavor: "Initramfs, legacy u-boot image format",
|
||||
"uImage-" + flavor: "Kernel, legacy u-boot image format",
|
||||
"vmlinuz-" + flavor: "Linux kernel",
|
||||
args.device + ".img": "Rootfs with partitions for /boot and /",
|
||||
args.device + "-boot.img": "Boot partition image",
|
||||
args.device + "-root.img": "Root partition image",
|
||||
"pmos-" + args.device + ".zip": "Android recovery flashable zip",
|
||||
f"initramfs{suffix}": "Initramfs",
|
||||
f"initramfs{suffix}-extra": "Extra initramfs files in /boot",
|
||||
f"uInitrd{suffix}": "Initramfs, legacy u-boot image format",
|
||||
f"uImage{suffix}": "Kernel, legacy u-boot image format",
|
||||
f"vmlinuz{suffix}": "Linux kernel",
|
||||
f"{args.device}.img": "Rootfs with partitions for /boot and /",
|
||||
f"{args.device}-boot.img": "Boot partition image",
|
||||
f"{args.device}-root.img": "Root partition image",
|
||||
f"pmos-{args.device}.zip": "Android recovery flashable zip",
|
||||
}
|
||||
|
||||
# Generate a list of patterns
|
||||
path_native = args.work + "/chroot_native"
|
||||
path_boot = args.work + "/chroot_rootfs_" + args.device + "/boot"
|
||||
path_buildroot = args.work + "/chroot_buildroot_" + args.deviceinfo["arch"]
|
||||
patterns = [path_boot + "/*-" + flavor,
|
||||
path_boot + "/*-" + flavor + "-extra",
|
||||
path_boot + "/dtbo.img",
|
||||
path_native + "/home/pmos/rootfs/" + args.device + ".img",
|
||||
path_native + "/home/pmos/rootfs/" + args.device + "-boot.img",
|
||||
path_native + "/home/pmos/rootfs/" + args.device + "-root.img",
|
||||
path_buildroot +
|
||||
"/var/lib/postmarketos-android-recovery-installer/pmos-" +
|
||||
args.device + ".zip"]
|
||||
patterns = [f"{path_boot}/boot.img{suffix}",
|
||||
f"{path_boot}/initramfs{suffix}*",
|
||||
f"{path_boot}/uInitrd{suffix}",
|
||||
f"{path_boot}/uImage{suffix}",
|
||||
f"{path_boot}/vmlinuz{suffix}",
|
||||
f"{path_boot}/dtbo.img",
|
||||
f"{path_native}/home/pmos/rootfs/{args.device}.img",
|
||||
f"{path_native}/home/pmos/rootfs/{args.device}-boot.img",
|
||||
f"{path_native}/home/pmos/rootfs/{args.device}-root.img",
|
||||
f"{path_buildroot}/var/lib/postmarketos-android-recovery-" +
|
||||
f"installer/pmos-{args.device}.zip"]
|
||||
|
||||
# Generate a list of files from the patterns
|
||||
files = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue