Fix #162: flash_system: meaningful error for missing image
This commit is contained in:
parent
56b34212f6
commit
5651c28b41
|
@ -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
|
||||||
|
|
|
@ -78,7 +78,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 +122,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 +137,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 +145,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