Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion tools/gen_ota_zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import filecmp
import configparser
import re
import subprocess

program_description = \
'''
Expand Down Expand Up @@ -43,6 +44,7 @@
patch_path = []
bin_list = []
tools_path=''
avbtool_path=os.path.abspath(os.path.dirname(sys.argv[0]) + '/../../../../external/avb/avb/avbtool')
speed_dict = {}
logging.basicConfig(format = "[%(levelname)s]%(message)s")
logger = logging.getLogger()
Expand Down Expand Up @@ -326,7 +328,12 @@ def gen_full_sh(path_list, bin_list, args, tmp_folder):

i = 0
while i < path_cnt:
str = \
str = ''
ret = subprocess.Popen("%s info_image --image %s/%s --rollback_index" % (avbtool_path, args.bin_path[0], bin_list[i]), shell=True, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL);
idx = ret.communicate()
if (ret.returncode == 0) and (int(idx[0]) != 0):
logger.debug("Enabled update verification for %s" % bin_list[i])
str += \
'''
avb_verify -U /ota/%s %s /etc/key.avb
if [ $? -ne 0 ]
Expand Down Expand Up @@ -538,6 +545,9 @@ def gen_full_ota(args):
if inputstr != 'Y' and inputstr != 'y':
exit()

if not os.path.exists(avbtool_path):
logger.error("avbtool: %s: No such file or directory", avbtool_path)
exit()
if len((args.bin_path)) == 2:
os.chdir(tools_path)
if not os.path.exists("ddelta_generate"):
Expand Down