mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-13 11:29:46 +03:00
* Allow to specify a custom username in "pmbootstrap init" * Build chroots have "pmos" instead of "user" as username now * Installation user UID is 1000 now (as in all other Linux distributions) * Adjust autologins * postmarketos-base: enable wheel group for sudo, removed previous sudoers file * Implement safe upgrade path: We save the version of the work folder format now, in $WORK/version. When this file does not exist, it defaults to 0. In case it does not match the currently required version (pmb.config.work_version), then ask the user if it should automatically be upgraded.
30 lines
991 B
Python
30 lines
991 B
Python
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])
|
|
|
|
# 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"
|
|
" 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)
|