parser.error("File path doesn't exist.") if args.output_path: output_path = args.output_path else: img_name = os.path.splitext(os.path.basename(path))[0] output_path = os.path.join(output_dir, img_name) if args.logpath: log_to_file = True log_file = args.logpath else: log_to_file = None log_file = None if args.block_size: block_size = args.block_size else: block_size = get_peb_size(path) perms = args.permissions quiet = args.quiet if not os.path.exists(output_path): os.makedirs(output_path) ufile = ubi_file(path, block_size) uubi = ubi(ufile) for image in uubi.images: for volume in image.volumes: vol_out_path = os.path.join(output_path, volume) if not os.path.exists(vol_out_path): os.makedirs(vol_out_path) elif os.listdir(vol_out_path): parser.error('Volume output directory is not empty. %s' % vol_out_path) ufsfile = leb_virtual_file(uubi, image.volumes[volume])
parser.error("File path doesn't exist.") if args.output_path: output_path = args.output_path else: img_name = os.path.splitext(os.path.basename(path))[0] output_path = os.path.join(output_dir, img_name) if args.logpath: log_to_file = True log_file = args.logpath else: log_to_file = None log_file = None if args.block_size: block_size = args.block_size else: block_size = get_peb_size(path) perms = args.permissions quiet = args.quiet if not os.path.exists(output_path): os.makedirs(output_path) ufile = ubi_file(path, block_size) uubi = ubi(ufile) for image in uubi.images: for volume in image.volumes: vol_out_path = os.path.join(output_path, volume) if not os.path.exists(vol_out_path): os.makedirs(vol_out_path) elif os.listdir(vol_out_path): parser.error('Volume output directory is not empty. %s' % vol_out_path) ufsfile = leb_virtual_file(uubi, image.volumes[volume]) uubifs = ubifs(ufsfile)