mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-12 19:09:56 +03:00
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
40 lines
1.2 KiB
Python
40 lines
1.2 KiB
Python
# Copyright 2017 Oliver Smith
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
from pmb.core.context import get_context
|
|
from pmb.helpers import logging
|
|
import os
|
|
|
|
from pmb.types import PmbArgs
|
|
import pmb.helpers.run
|
|
import pmb.helpers.frontend
|
|
import pmb.chroot.initfs
|
|
import pmb.export
|
|
from pmb.core import Chroot, ChrootType
|
|
|
|
|
|
def frontend(args: PmbArgs) -> None: # FIXME: ARGS_REFACTOR
|
|
config = get_context().config
|
|
# Create the export folder
|
|
target = args.export_folder
|
|
if not os.path.exists(target):
|
|
pmb.helpers.run.user(["mkdir", "-p", target])
|
|
|
|
# Rootfs image note
|
|
chroot = Chroot.native()
|
|
rootfs_dir = chroot / "home/pmos/rootfs" / config.device
|
|
if not rootfs_dir.glob("*.img"):
|
|
logging.info(
|
|
"NOTE: To export the rootfs image, run 'pmbootstrap"
|
|
" install' first (without the 'disk' parameter)."
|
|
)
|
|
|
|
# Rebuild the initramfs, just to make sure (see #69)
|
|
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, target)
|
|
pmb.export.symlinks(target)
|