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
This commit is contained in:
Daniele Debernardi 2018-05-01 02:18:40 +02:00 committed by Oliver Smith
parent 4e665a2190
commit 827a60cd25
5 changed files with 79 additions and 46 deletions

View file

@ -1,3 +1,4 @@
import glob
import logging
import os
@ -13,10 +14,11 @@ def frontend(args):
if not os.path.exists(target):
pmb.helpers.run.user(args, ["mkdir", "-p", target])
# System image note
img_path = "/home/pmos/rootfs/" + args.device + ".img"
if not os.path.exists(args.work + "/chroot_native" + img_path):
logging.info("NOTE: To export the system image, run 'pmbootstrap"
# 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)