1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-12 19:09:56 +03:00

export: drop support for initramfs flavor

Official mkinitfs flavors were dropped long ago. v23.12 already
released with "supported_mkinitfs_without_flavors=True". So there is
no need to keep this around anymore.

Follow-up from 527fc9359f
This commit is contained in:
Pablo Correa Gómez 2025-06-16 18:21:47 +02:00
parent e69c3979b7
commit a7885f519c
No known key found for this signature in database
GPG key ID: 7A342565FF635F79
2 changed files with 5 additions and 12 deletions

View file

@ -30,12 +30,11 @@ def frontend(args: PmbArgs) -> None: # FIXME: ARGS_REFACTOR
)
# Rebuild the initramfs, just to make sure (see #69)
flavor = pmb.helpers.frontend._parse_flavor(config.device, args.autoinstall)
if args.autoinstall:
pmb.chroot.initfs.build(Chroot(ChrootType.ROOTFS, config.device))
# Do the export, print all files
logging.info(f"Export symlinks to: {target}")
if args.odin_flashable_tar:
pmb.export.odin(config.device, flavor, target)
pmb.export.odin(config.device, target)
pmb.export.symlinks(target)

View file

@ -11,7 +11,7 @@ import pmb.helpers.file
from pmb.core import Chroot, ChrootType
def odin(device: str, flavor: str, folder: Path) -> None:
def odin(device: str, folder: Path) -> None:
"""
Create Odin flashable tar file with kernel and initramfs
for devices configured with the flasher method 'heimdall-isorec'
@ -21,12 +21,6 @@ def odin(device: str, flavor: str, folder: Path) -> None:
suffix = Chroot(ChrootType.ROOTFS, device)
deviceinfo = pmb.parse.deviceinfo(device)
# Backwards compatibility with old mkinitfs (pma#660)
suffix_flavor = f"-{flavor}"
pmaports_cfg = pmb.config.pmaports.read_config()
if pmaports_cfg.get("supported_mkinitfs_without_flavors", False):
suffix_flavor = ""
# Validate method
method = deviceinfo.flash_method or ""
if not method.startswith("heimdall-"):
@ -60,17 +54,17 @@ def odin(device: str, flavor: str, folder: Path) -> None:
if method == "heimdall-isorec":
handle.write(
# Kernel: copy and append md5
f"cp /boot/vmlinuz{suffix_flavor} {odin_kernel_md5}\n"
f"cp /boot/vmlinuz {odin_kernel_md5}\n"
f"md5sum -t {odin_kernel_md5} >> {odin_kernel_md5}\n"
# Initramfs: recompress with lzop, append md5
f"gunzip -c /boot/initramfs{suffix_flavor}"
f"gunzip -c /boot/initramfs"
f" | lzop > {odin_initfs_md5}\n"
f"md5sum -t {odin_initfs_md5} >> {odin_initfs_md5}\n"
)
elif method == "heimdall-bootimg":
handle.write(
# boot.img: copy and append md5
f"cp /boot/boot.img{suffix_flavor} {odin_kernel_md5}\n"
f"cp /boot/boot.img {odin_kernel_md5}\n"
f"md5sum -t {odin_kernel_md5} >> {odin_kernel_md5}\n"
)
handle.write(