Device = ""
File = ""
Yes = False
+SuperDelivered = False
LOGGING_NOTICE = int((logging.INFO + logging.WARNING) / 2)
def check_args(args):
global Format
global Yes
+ global SuperDelivered
logging.info(f"Device: {args.device}")
else:
Format = False
+ if args.super_delivered:
+ SuperDelivered = True
+
def check_device(args):
global Format
global Device
def do_fuse_image_tarball(tarball, tmpd, target):
with tarfile.open(tarball) as tf:
for entry in tf:
- if target.with_super:
+ if target.with_super and not SuperDelivered:
if entry.name in('hal.img', 'rootfs.img'):
tf.extract(entry, path=tmpd)
continue
do_fuse_image_tarball(b, tmpd, target)
else:
fn = os.path.split(b)[-1]
- if target.with_super and fn in ('rootfs.img', 'hal.img'):
+ if target.with_super and fn in ('rootfs.img', 'hal.img') and not SuperDelivered:
shutil.copy(b, os.path.join(tmpd, fn))
else:
do_fuse_image(b, target)
- if target.with_super:
+ if target.with_super and not SuperDelivered:
do_fuse_image_super(tmpd, target)
def logger_notice(self, msg, *args, **kws):
version=f"%(prog)s {__version__}")
parser.add_argument("--YES", action="store_true",
help="agree to destroy data on the DEVICE")
+ parser.add_argument("--super_delivered", action="store_true",
+ help="indicate that super.img is already in tarball and doesn't have to be created during fusing")
args = parser.parse_args()
if args.target == 'list':