Merge pull request #218 from postmarketOS/fix/162-install-no-args.add
Install: Small improvements (Fix #162, Close #215)
This commit is contained in:
commit
14f164b8a2
|
@ -84,8 +84,8 @@ def system(args):
|
||||||
# Generate system image, install flasher
|
# Generate system image, install flasher
|
||||||
img_path = "/home/user/rootfs/" + args.device + ".img"
|
img_path = "/home/user/rootfs/" + args.device + ".img"
|
||||||
if not os.path.exists(args.work + "/chroot_native" + img_path):
|
if not os.path.exists(args.work + "/chroot_native" + img_path):
|
||||||
setattr(args, "sdcard", None)
|
raise RuntimeError("The system image has not been generated yet,"
|
||||||
pmb.install.install(args, False)
|
" please run 'pmbootstrap install' first.")
|
||||||
pmb.flasher.init(args)
|
pmb.flasher.init(args)
|
||||||
|
|
||||||
# Run the flasher
|
# Run the flasher
|
||||||
|
|
|
@ -37,6 +37,8 @@ def format_and_mount_root(args):
|
||||||
if args.full_disk_encryption:
|
if args.full_disk_encryption:
|
||||||
logging.info("(native) format " + device + " (root, luks), mount to " +
|
logging.info("(native) format " + device + " (root, luks), mount to " +
|
||||||
mountpoint)
|
mountpoint)
|
||||||
|
logging.info(
|
||||||
|
" *** TYPE IN THE FULL DISK ENCRYPTION PASSWORD (TWICE!) ***")
|
||||||
pmb.chroot.root(args, ["cryptsetup", "luksFormat", "--use-urandom",
|
pmb.chroot.root(args, ["cryptsetup", "luksFormat", "--use-urandom",
|
||||||
"--cipher", args.cipher, "-q", device], log=False)
|
"--cipher", args.cipher, "-q", device], log=False)
|
||||||
pmb.chroot.root(args, ["cryptsetup", "luksOpen", device,
|
pmb.chroot.root(args, ["cryptsetup", "luksOpen", device,
|
||||||
|
|
|
@ -67,6 +67,7 @@ def set_user_password(args):
|
||||||
"""
|
"""
|
||||||
Loop until the passwords for user and root have been changed successfully.
|
Loop until the passwords for user and root have been changed successfully.
|
||||||
"""
|
"""
|
||||||
|
logging.info(" *** SET LOGIN PASSWORD FOR: 'user' ***")
|
||||||
suffix = "rootfs_" + args.device
|
suffix = "rootfs_" + args.device
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
|
@ -78,7 +79,7 @@ def set_user_password(args):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def install(args, show_flash_msg=True):
|
def install(args):
|
||||||
# Install required programs in native chroot
|
# Install required programs in native chroot
|
||||||
logging.info("*** (1/5) PREPARE NATIVE CHROOT ***")
|
logging.info("*** (1/5) PREPARE NATIVE CHROOT ***")
|
||||||
pmb.chroot.apk.install(args, pmb.config.install_native_packages,
|
pmb.chroot.apk.install(args, pmb.config.install_native_packages,
|
||||||
|
@ -122,18 +123,13 @@ def install(args, show_flash_msg=True):
|
||||||
fix_mount_folders(args)
|
fix_mount_folders(args)
|
||||||
pmb.chroot.shutdown(args, True)
|
pmb.chroot.shutdown(args, True)
|
||||||
|
|
||||||
# Flash to target device
|
# Kernel flash information
|
||||||
logging.info("*** (5/5) FLASHING TO DEVICE ***")
|
logging.info("*** (5/5) FLASHING TO DEVICE ***")
|
||||||
if show_flash_msg:
|
|
||||||
logging.info("Run the following to flash your installation to the"
|
logging.info("Run the following to flash your installation to the"
|
||||||
" target device:")
|
" target device:")
|
||||||
logging.info("* pmbootstrap flasher flash_kernel")
|
logging.info("* pmbootstrap flasher flash_kernel")
|
||||||
logging.info(" Flashes the kernel + initramfs to your device:")
|
logging.info(" Flashes the kernel + initramfs to your device:")
|
||||||
logging.info(
|
logging.info(" " + args.work + "/chroot_rootfs_" + args.device +
|
||||||
" " +
|
|
||||||
args.work +
|
|
||||||
"/chroot_rootfs_" +
|
|
||||||
args.device +
|
|
||||||
"/boot")
|
"/boot")
|
||||||
method = args.deviceinfo["flash_methods"]
|
method = args.deviceinfo["flash_methods"]
|
||||||
if (method in pmb.config.flashers and "boot" in
|
if (method in pmb.config.flashers and "boot" in
|
||||||
|
@ -142,6 +138,7 @@ def install(args, show_flash_msg=True):
|
||||||
" the kernel/initramfs directly without flashing."
|
" the kernel/initramfs directly without flashing."
|
||||||
" Use 'pmbootstrap flasher boot' to do that.)")
|
" Use 'pmbootstrap flasher boot' to do that.)")
|
||||||
|
|
||||||
|
# System flash information
|
||||||
if not args.sdcard:
|
if not args.sdcard:
|
||||||
logging.info("* pmbootstrap flasher flash_system")
|
logging.info("* pmbootstrap flasher flash_system")
|
||||||
logging.info(" Flashes the system image, that has been"
|
logging.info(" Flashes the system image, that has been"
|
||||||
|
@ -149,5 +146,9 @@ def install(args, show_flash_msg=True):
|
||||||
logging.info(" " + args.work + "/chroot_native/home/user/rootfs/" +
|
logging.info(" " + args.work + "/chroot_native/home/user/rootfs/" +
|
||||||
args.device + ".img")
|
args.device + ".img")
|
||||||
logging.info(" (NOTE: This file has a partition table,"
|
logging.info(" (NOTE: This file has a partition table,"
|
||||||
" which contains one currently unused boot"
|
" which contains a boot- and root subpartition.)")
|
||||||
" partition, and the root partition.)")
|
|
||||||
|
# Export information
|
||||||
|
logging.info("* If the above steps do not work, you can also create"
|
||||||
|
" symlinks to the generated files with 'pmbootstrap flasher"
|
||||||
|
" export <target_dir>' and flash outside of pmbootstrap.")
|
||||||
|
|
Loading…
Reference in New Issue