diff --git a/scripts/ubireader_extract_images b/scripts/ubireader_extract_images index 9e7400f..e8ff9e9 100755 --- a/scripts/ubireader_extract_images +++ b/scripts/ubireader_extract_images @@ -75,6 +75,9 @@ if __name__=='__main__': parser.add_argument('-f', '--u-boot-fix', action='store_true', dest='uboot_fix', help='Assume blocks with image_seq 0 are because of older U-boot implementations and include them. (default: False)') + parser.add_argument('--no-basename-subdir', action='store_true', dest='no_basename_subdir', + help='Extract image within output-dir rather than in output-dir/basename(filepath). (default: False)') + parser.add_argument('-o', '--output-dir', dest='outpath', help='Specify output directory path.') @@ -117,7 +120,8 @@ if __name__=='__main__': if filetype != UBI_EC_HDR_MAGIC: parser.error('File does not look like UBI data.') - img_name = os.path.basename(path) + img_name = "" if args.no_basename_subdir else os.path.basename(path) + if args.outpath: outpath = os.path.abspath(os.path.join(args.outpath, img_name)) else: