From d16c90b39c2e94f8431349d68b13d82197921220 Mon Sep 17 00:00:00 2001 From: Martijn Braam Date: Wed, 5 Jul 2017 13:39:50 +0200 Subject: [PATCH 1/2] Added flavor to the flash_system command for consistency, This fixes issue #133 --- pmb/flasher/frontend.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pmb/flasher/frontend.py b/pmb/flasher/frontend.py index ee3a7868..a9f2bd8a 100644 --- a/pmb/flasher/frontend.py +++ b/pmb/flasher/frontend.py @@ -73,6 +73,7 @@ def list_flavors(args): def system(args): # Generate system image, install flasher + flavor = parse_flavor_arg(args) img_path = "/home/user/rootfs/" + args.device + ".img" if not os.path.exists(args.work + "/chroot_native" + img_path): setattr(args, "sdcard", None) @@ -81,7 +82,7 @@ def system(args): # Run the flasher logging.info("(native) flash system image") - pmb.flasher.run(args, "flash_system") + pmb.flasher.run(args, "flash_system", flavor) def list_devices(args): From 4cdf51f94ed461673d3ba898882a2865300d0f5f Mon Sep 17 00:00:00 2001 From: Martijn Braam Date: Wed, 5 Jul 2017 14:01:54 +0200 Subject: [PATCH 2/2] Changed flasher.run()s flavor to an optional argument --- pmb/flasher/frontend.py | 3 +-- pmb/flasher/run.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pmb/flasher/frontend.py b/pmb/flasher/frontend.py index a9f2bd8a..ee3a7868 100644 --- a/pmb/flasher/frontend.py +++ b/pmb/flasher/frontend.py @@ -73,7 +73,6 @@ def list_flavors(args): def system(args): # Generate system image, install flasher - flavor = parse_flavor_arg(args) img_path = "/home/user/rootfs/" + args.device + ".img" if not os.path.exists(args.work + "/chroot_native" + img_path): setattr(args, "sdcard", None) @@ -82,7 +81,7 @@ def system(args): # Run the flasher logging.info("(native) flash system image") - pmb.flasher.run(args, "flash_system", flavor) + pmb.flasher.run(args, "flash_system") def list_devices(args): diff --git a/pmb/flasher/run.py b/pmb/flasher/run.py index 3f57f589..286ff91d 100644 --- a/pmb/flasher/run.py +++ b/pmb/flasher/run.py @@ -20,7 +20,7 @@ import pmb.flasher import pmb.chroot.initfs -def run(args, action, flavor): +def run(args, action, flavor=None): pmb.flasher.init(args) # Verify action @@ -39,7 +39,7 @@ def run(args, action, flavor): # Variable setup vars = { "$BOOT": "/mnt/rootfs_" + args.device + "/boot", - "$FLAVOR": flavor, + "$FLAVOR": flavor if flavor is not None else "", "$IMAGE": "/home/user/rootfs/" + args.device + ".img", "$KERNEL_CMDLINE": cmdline, "$OFFSET_KERNEL": args.deviceinfo["flash_offset_kernel"],