pmbootstrap-meow/pmb/export/frontend.py
Daniele Debernardi 827a60cd25 Add install flag to generate separate boot and system images (#1442)
* Usage: pmbootstrap install --split
* Make obvious that export is the next step when split images are created
* Fix note for missing rootfs image on export
  * Change wording from "system image" to "rootfs image"
  * The idea was to show the note only when the rootfs image was not
    generated yet. But this was broken, because the path we checked for
    was missing the chroot path prefix (which is added now).
  * Also don't display the message, when the split image files exist
2018-05-01 00:18:40 +00:00

32 lines
1,017 B
Python

import glob
import logging
import os
import pmb.helpers.run
import pmb.helpers.frontend
import pmb.chroot.initfs
import pmb.export
def frontend(args):
# Create the export folder
target = args.export_folder
if not os.path.exists(target):
pmb.helpers.run.user(args, ["mkdir", "-p", target])
# Rootfs image note
chroot = args.work + "/chroot_native"
pattern = chroot + "/home/pmos/rootfs/" + args.device + "*.img"
if not glob.glob(pattern):
logging.info("NOTE: To export the rootfs image, run 'pmbootstrap"
" install' first (without the 'sdcard' parameter).")
# Rebuild the initramfs, just to make sure (see #69)
flavor = pmb.helpers.frontend._parse_flavor(args)
pmb.chroot.initfs.build(args, flavor, "rootfs_" + args.device)
# Do the export, print all files
logging.info("Export symlinks to: " + target)
if args.odin_flashable_tar:
pmb.export.odin(args, flavor, target)
pmb.export.symlinks(args, flavor, target)