Skip to content
Snippets Groups Projects
Unverified Commit 2a5bd848 authored by Clayton Craft's avatar Clayton Craft :speech_balloon:
Browse files

pmb/export/symlinks: add support for a single 'flavor'

parent 04809a99
No related branches found
No related tags found
No related merge requests found
......@@ -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 = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment