Merge "Enable io_uring feature for virtual A/B OTA"
diff --git a/core/binary.mk b/core/binary.mk
index cf47374..94e3a0f 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -32,6 +32,12 @@
endif
endif
+# Third party code has additional no-override flags.
+is_third_party :=
+ifneq ($(filter external/% hardware/% vendor/%,$(LOCAL_PATH)),)
+ is_third_party := true
+endif
+
my_soong_problems :=
# The following LOCAL_ variables will be modified in this file.
@@ -48,6 +54,10 @@
my_cppflags := $(LOCAL_CPPFLAGS)
my_cflags_no_override := $(GLOBAL_CLANG_CFLAGS_NO_OVERRIDE)
my_cppflags_no_override := $(GLOBAL_CLANG_CPPFLAGS_NO_OVERRIDE)
+ifdef is_third_party
+ my_cflags_no_override += $(GLOBAL_CLANG_EXTERNAL_CFLAGS_NO_OVERRIDE)
+ my_cppflags_no_override += $(GLOBAL_CLANG_EXTERNAL_CFLAGS_NO_OVERRIDE)
+endif
my_ldflags := $(LOCAL_LDFLAGS)
my_ldlibs := $(LOCAL_LDLIBS)
my_asflags := $(LOCAL_ASFLAGS)
diff --git a/core/board_config.mk b/core/board_config.mk
index 5fb007e..405fea6 100644
--- a/core/board_config.mk
+++ b/core/board_config.mk
@@ -242,6 +242,7 @@
--mode=write -r --outdir $(OUT_DIR)/rbc \
--boardlauncher=$(OUT_DIR)/rbc/boardlauncher.rbc \
--input_variables=$(OUT_DIR)/rbc/make_vars_pre_board_config.mk \
+ --makefile_list=$(OUT_DIR)/.module_paths/configuration.list \
$(board_config_mk))
ifneq ($(.SHELLSTATUS),0)
$(error board configuration converter failed: $(.SHELLSTATUS))
diff --git a/core/proguard_basic_keeps.flags b/core/proguard_basic_keeps.flags
index 28ec2d0..30c2341 100644
--- a/core/proguard_basic_keeps.flags
+++ b/core/proguard_basic_keeps.flags
@@ -9,7 +9,7 @@
}
# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
--keepclasseswithmembernames class * {
+-keepclasseswithmembernames,includedescriptorclasses class * {
native <methods>;
}
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index 051de62..4dbc941 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -85,7 +85,7 @@
# It must be of the form "YYYY-MM-DD" on production devices.
# It must match one of the Android Security Patch Level strings of the Public Security Bulletins.
# If there is no $PLATFORM_SECURITY_PATCH set, keep it empty.
- PLATFORM_SECURITY_PATCH := 2022-01-05
+ PLATFORM_SECURITY_PATCH := 2022-02-05
endif
.KATI_READONLY := PLATFORM_SECURITY_PATCH
diff --git a/envsetup.sh b/envsetup.sh
index a23bbad..87e6e0a 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -625,7 +625,7 @@
return
fi
- echo "Lunch menu... pick a combo:"
+ echo "Lunch menu .. Here are the common combinations:"
local i=1
local choice
@@ -647,12 +647,16 @@
return 1
fi
+ local used_lunch_menu=0
+
if [ "$1" ]; then
answer=$1
else
print_lunch_menu
- echo -n "Which would you like? [aosp_arm-eng] "
+ echo "Which would you like? [aosp_arm-eng]"
+ echo -n "Pick from common choices above (e.g. 13) or specify your own (e.g. aosp_barbet-eng): "
read answer
+ used_lunch_menu=1
fi
local selection=
@@ -717,6 +721,11 @@
fi
export TARGET_BUILD_TYPE=release
+ if [ $used_lunch_menu -eq 1 ]; then
+ echo
+ echo "Hint: next time you can simply run 'lunch $selection'"
+ fi
+
[[ -n "${ANDROID_QUIET_BUILD:-}" ]] || echo
set_stuff_for_environment
diff --git a/target/product/telephony_vendor.mk b/target/product/telephony_vendor.mk
index 86dbcc9..94887cf 100644
--- a/target/product/telephony_vendor.mk
+++ b/target/product/telephony_vendor.mk
@@ -20,5 +20,3 @@
# /vendor packages
PRODUCT_PACKAGES := \
rild \
-
-PRODUCT_COPY_FILES := \
diff --git a/tools/compliance/cmd/htmlnotice/htmlnotice.go b/tools/compliance/cmd/htmlnotice/htmlnotice.go
index 938bb7d..0e3ba09 100644
--- a/tools/compliance/cmd/htmlnotice/htmlnotice.go
+++ b/tools/compliance/cmd/htmlnotice/htmlnotice.go
@@ -35,6 +35,7 @@
outputFile = flag.String("o", "-", "Where to write the NOTICE text file. (default stdout)")
depsFile = flag.String("d", "", "Where to write the deps file")
includeTOC = flag.Bool("toc", true, "Whether to include a table of contents.")
+ product = flag.String("product", "", "The name of the product for which the notice is generated.")
stripPrefix = newMultiString("strip_prefix", "Prefix to remove from paths. i.e. path to root (multiple allowed)")
title = flag.String("title", "", "The title of the notice file.")
@@ -47,6 +48,7 @@
stderr io.Writer
rootFS fs.FS
includeTOC bool
+ product string
stripPrefix []string
title string
deps *[]string
@@ -57,7 +59,7 @@
if strings.HasPrefix(installPath, prefix) {
p := strings.TrimPrefix(installPath, prefix)
if 0 == len(p) {
- p = ctx.title
+ p = ctx.product
}
if 0 == len(p) {
continue
@@ -139,7 +141,7 @@
var deps []string
- ctx := &context{ofile, os.Stderr, os.DirFS("."), *includeTOC, *stripPrefix, *title, &deps}
+ ctx := &context{ofile, os.Stderr, os.DirFS("."), *includeTOC, *product, *stripPrefix, *title, &deps}
err := htmlNotice(ctx, flag.Args()...)
if err != nil {
@@ -204,12 +206,16 @@
fmt.Fprintln(ctx.stdout, "</style>")
if 0 < len(ctx.title) {
fmt.Fprintf(ctx.stdout, "<title>%s</title>\n", html.EscapeString(ctx.title))
+ } else if 0 < len(ctx.product) {
+ fmt.Fprintf(ctx.stdout, "<title>%s</title>\n", html.EscapeString(ctx.product))
}
fmt.Fprintln(ctx.stdout, "</head>")
fmt.Fprintln(ctx.stdout, "<body>")
if 0 < len(ctx.title) {
fmt.Fprintf(ctx.stdout, " <h1>%s</h1>\n", html.EscapeString(ctx.title))
+ } else if 0 < len(ctx.product) {
+ fmt.Fprintf(ctx.stdout, " <h1>%s</h1>\n", html.EscapeString(ctx.product))
}
ids := make(map[string]string)
if ctx.includeTOC {
diff --git a/tools/compliance/cmd/htmlnotice/htmlnotice_test.go b/tools/compliance/cmd/htmlnotice/htmlnotice_test.go
index 9863b6d..b8bc47f 100644
--- a/tools/compliance/cmd/htmlnotice/htmlnotice_test.go
+++ b/tools/compliance/cmd/htmlnotice/htmlnotice_test.go
@@ -651,7 +651,7 @@
var deps []string
- ctx := context{stdout, stderr, os.DirFS("."), tt.includeTOC, []string{tt.stripPrefix}, tt.title, &deps}
+ ctx := context{stdout, stderr, os.DirFS("."), tt.includeTOC, "", []string{tt.stripPrefix}, tt.title, &deps}
err := htmlNotice(&ctx, rootFiles...)
if err != nil {
diff --git a/tools/compliance/cmd/textnotice/textnotice.go b/tools/compliance/cmd/textnotice/textnotice.go
index 35c5c24..9e9229f 100644
--- a/tools/compliance/cmd/textnotice/textnotice.go
+++ b/tools/compliance/cmd/textnotice/textnotice.go
@@ -33,6 +33,7 @@
var (
outputFile = flag.String("o", "-", "Where to write the NOTICE text file. (default stdout)")
depsFile = flag.String("d", "", "Where to write the deps file")
+ product = flag.String("product", "", "The name of the product for which the notice is generated.")
stripPrefix = newMultiString("strip_prefix", "Prefix to remove from paths. i.e. path to root (multiple allowed)")
title = flag.String("title", "", "The title of the notice file.")
@@ -44,6 +45,7 @@
stdout io.Writer
stderr io.Writer
rootFS fs.FS
+ product string
stripPrefix []string
title string
deps *[]string
@@ -54,7 +56,7 @@
if strings.HasPrefix(installPath, prefix) {
p := strings.TrimPrefix(installPath, prefix)
if 0 == len(p) {
- p = ctx.title
+ p = ctx.product
}
if 0 == len(p) {
continue
@@ -135,7 +137,7 @@
var deps []string
- ctx := &context{ofile, os.Stderr, os.DirFS("."), *stripPrefix, *title, &deps}
+ ctx := &context{ofile, os.Stderr, os.DirFS("."), *product, *stripPrefix, *title, &deps}
err := textNotice(ctx, flag.Args()...)
if err != nil {
@@ -190,6 +192,9 @@
return fmt.Errorf("Unable to read license text file(s) for %q: %v\n", files, err)
}
+ if 0 < len(ctx.title) {
+ fmt.Fprintf(ctx.stdout, "%s\n\n", ctx.title)
+ }
for h := range ni.Hashes() {
fmt.Fprintln(ctx.stdout, "==============================================================================")
for _, libName := range ni.HashLibs(h) {
diff --git a/tools/compliance/cmd/textnotice/textnotice_test.go b/tools/compliance/cmd/textnotice/textnotice_test.go
index 0ed3394..9d8d0ca 100644
--- a/tools/compliance/cmd/textnotice/textnotice_test.go
+++ b/tools/compliance/cmd/textnotice/textnotice_test.go
@@ -564,7 +564,7 @@
var deps []string
- ctx := context{stdout, stderr, os.DirFS("."), []string{tt.stripPrefix}, "", &deps}
+ ctx := context{stdout, stderr, os.DirFS("."), "", []string{tt.stripPrefix}, "", &deps}
err := textNotice(&ctx, rootFiles...)
if err != nil {
diff --git a/tools/compliance/cmd/xmlnotice/xmlnotice.go b/tools/compliance/cmd/xmlnotice/xmlnotice.go
index eb169f3..1c712cb 100644
--- a/tools/compliance/cmd/xmlnotice/xmlnotice.go
+++ b/tools/compliance/cmd/xmlnotice/xmlnotice.go
@@ -34,6 +34,7 @@
var (
outputFile = flag.String("o", "-", "Where to write the NOTICE xml or xml.gz file. (default stdout)")
depsFile = flag.String("d", "", "Where to write the deps file")
+ product = flag.String("product", "", "The name of the product for which the notice is generated.")
stripPrefix = newMultiString("strip_prefix", "Prefix to remove from paths. i.e. path to root (multiple allowed)")
title = flag.String("title", "", "The title of the notice file.")
@@ -45,6 +46,7 @@
stdout io.Writer
stderr io.Writer
rootFS fs.FS
+ product string
stripPrefix []string
title string
deps *[]string
@@ -55,7 +57,7 @@
if strings.HasPrefix(installPath, prefix) {
p := strings.TrimPrefix(installPath, prefix)
if 0 == len(p) {
- p = ctx.title
+ p = ctx.product
}
if 0 == len(p) {
continue
@@ -137,7 +139,7 @@
var deps []string
- ctx := &context{ofile, os.Stderr, os.DirFS("."), *stripPrefix, *title, &deps}
+ ctx := &context{ofile, os.Stderr, os.DirFS("."), *product, *stripPrefix, *title, &deps}
err := xmlNotice(ctx, flag.Args()...)
if err != nil {
diff --git a/tools/compliance/cmd/xmlnotice/xmlnotice_test.go b/tools/compliance/cmd/xmlnotice/xmlnotice_test.go
index 3a62438..424c95e 100644
--- a/tools/compliance/cmd/xmlnotice/xmlnotice_test.go
+++ b/tools/compliance/cmd/xmlnotice/xmlnotice_test.go
@@ -459,7 +459,7 @@
var deps []string
- ctx := context{stdout, stderr, os.DirFS("."), []string{tt.stripPrefix}, "", &deps}
+ ctx := context{stdout, stderr, os.DirFS("."), "", []string{tt.stripPrefix}, "", &deps}
err := xmlNotice(&ctx, rootFiles...)
if err != nil {
diff --git a/tools/releasetools/add_img_to_target_files.py b/tools/releasetools/add_img_to_target_files.py
index 88e6fd2..7143775 100644
--- a/tools/releasetools/add_img_to_target_files.py
+++ b/tools/releasetools/add_img_to_target_files.py
@@ -54,6 +54,7 @@
import stat
import sys
import uuid
+import tempfile
import zipfile
import build_image
@@ -104,9 +105,10 @@
if self._output_zip:
self._zip_name = os.path.join(*args)
- def Write(self):
+ def Write(self, compress_type=None):
if self._output_zip:
- common.ZipWrite(self._output_zip, self.name, self._zip_name)
+ common.ZipWrite(self._output_zip, self.name,
+ self._zip_name, compress_type=compress_type)
def AddSystem(output_zip, recovery_img=None, boot_img=None):
@@ -134,12 +136,13 @@
"board_uses_vendorimage") == "true"
if (OPTIONS.rebuild_recovery and not board_uses_vendorimage and
- recovery_img is not None and boot_img is not None):
+ recovery_img is not None and boot_img is not None):
logger.info("Building new recovery patch on system at system/vendor")
common.MakeRecoveryPatch(OPTIONS.input_tmp, output_sink, recovery_img,
boot_img, info_dict=OPTIONS.info_dict)
- block_list = OutputFile(output_zip, OPTIONS.input_tmp, "IMAGES", "system.map")
+ block_list = OutputFile(output_zip, OPTIONS.input_tmp,
+ "IMAGES", "system.map")
CreateImage(OPTIONS.input_tmp, OPTIONS.info_dict, "system", img,
block_list=block_list)
return img.name
@@ -167,27 +170,28 @@
return img.name
def output_sink(fn, data):
- ofile = open(os.path.join(OPTIONS.input_tmp, "VENDOR", fn), "w")
- ofile.write(data)
- ofile.close()
+ output_file = os.path.join(OPTIONS.input_tmp, "VENDOR", fn)
+ with open(output_file, "wb") as ofile:
+ ofile.write(data)
if output_zip:
arc_name = "VENDOR/" + fn
if arc_name in output_zip.namelist():
OPTIONS.replace_updated_files_list.append(arc_name)
else:
- common.ZipWrite(output_zip, ofile.name, arc_name)
+ common.ZipWrite(output_zip, output_file, arc_name)
board_uses_vendorimage = OPTIONS.info_dict.get(
"board_uses_vendorimage") == "true"
if (OPTIONS.rebuild_recovery and board_uses_vendorimage and
- recovery_img is not None and boot_img is not None):
+ recovery_img is not None and boot_img is not None):
logger.info("Building new recovery patch on vendor")
common.MakeRecoveryPatch(OPTIONS.input_tmp, output_sink, recovery_img,
boot_img, info_dict=OPTIONS.info_dict)
- block_list = OutputFile(output_zip, OPTIONS.input_tmp, "IMAGES", "vendor.map")
+ block_list = OutputFile(output_zip, OPTIONS.input_tmp,
+ "IMAGES", "vendor.map")
CreateImage(OPTIONS.input_tmp, OPTIONS.info_dict, "vendor", img,
block_list=block_list)
return img.name
@@ -389,15 +393,16 @@
key_path, algorithm, extra_args)
for img_name in OPTIONS.info_dict.get(
- "avb_{}_image_list".format(partition_name)).split():
- custom_image = OutputFile(output_zip, OPTIONS.input_tmp, "IMAGES", img_name)
+ "avb_{}_image_list".format(partition_name)).split():
+ custom_image = OutputFile(
+ output_zip, OPTIONS.input_tmp, "IMAGES", img_name)
if os.path.exists(custom_image.name):
continue
custom_image_prebuilt_path = os.path.join(
OPTIONS.input_tmp, "PREBUILT_IMAGES", img_name)
assert os.path.exists(custom_image_prebuilt_path), \
- "Failed to find %s at %s" % (img_name, custom_image_prebuilt_path)
+ "Failed to find %s at %s" % (img_name, custom_image_prebuilt_path)
shutil.copy(custom_image_prebuilt_path, custom_image.name)
@@ -499,7 +504,9 @@
build_image.BuildImage(user_dir, image_props, img.name)
common.CheckSize(img.name, "userdata.img", OPTIONS.info_dict)
- img.Write()
+ # Always use compression for useradata image.
+ # As it's likely huge and consist of lots of 0s.
+ img.Write(zipfile.ZIP_DEFLATED)
def AddVBMeta(output_zip, partitions, name, needed_partitions):
@@ -696,11 +703,11 @@
return ((os.path.isdir(
os.path.join(OPTIONS.input_tmp, partition_name.upper())) and
- OPTIONS.info_dict.get(
- "building_{}_image".format(partition_name)) == "true") or
- os.path.exists(
- os.path.join(OPTIONS.input_tmp, "IMAGES",
- "{}.img".format(partition_name))))
+ OPTIONS.info_dict.get(
+ "building_{}_image".format(partition_name)) == "true") or
+ os.path.exists(
+ os.path.join(OPTIONS.input_tmp, "IMAGES",
+ "{}.img".format(partition_name))))
def AddApexInfo(output_zip):
@@ -732,7 +739,7 @@
boot_container = boot_images and (
len(boot_images.split()) >= 2 or boot_images.split()[0] != 'boot.img')
if (OPTIONS.info_dict.get("avb_enable") == "true" and not boot_container and
- OPTIONS.info_dict.get("avb_building_vbmeta_image") == "true"):
+ OPTIONS.info_dict.get("avb_building_vbmeta_image") == "true"):
avbtool = OPTIONS.info_dict["avb_avbtool"]
digest = verity_utils.CalculateVbmetaDigest(OPTIONS.input_tmp, avbtool)
vbmeta_digest_txt = os.path.join(OPTIONS.input_tmp, "META",
@@ -820,7 +827,7 @@
boot_images = OPTIONS.info_dict.get("boot_images")
if boot_images is None:
boot_images = "boot.img"
- for index,b in enumerate(boot_images.split()):
+ for index, b in enumerate(boot_images.split()):
# common.GetBootableImage() returns the image directly if present.
boot_image = common.GetBootableImage(
"IMAGES/" + b, b, OPTIONS.input_tmp, "BOOT")
@@ -841,7 +848,8 @@
init_boot_image = common.GetBootableImage(
"IMAGES/init_boot.img", "init_boot.img", OPTIONS.input_tmp, "INIT_BOOT")
if init_boot_image:
- partitions['init_boot'] = os.path.join(OPTIONS.input_tmp, "IMAGES", "init_boot.img")
+ partitions['init_boot'] = os.path.join(
+ OPTIONS.input_tmp, "IMAGES", "init_boot.img")
if not os.path.exists(partitions['init_boot']):
init_boot_image.WriteToDir(OPTIONS.input_tmp)
if output_zip:
@@ -968,7 +976,7 @@
if OPTIONS.info_dict.get("build_super_partition") == "true":
if OPTIONS.info_dict.get(
- "build_retrofit_dynamic_partitions_ota_package") == "true":
+ "build_retrofit_dynamic_partitions_ota_package") == "true":
banner("super split images")
AddSuperSplit(output_zip)
@@ -1005,6 +1013,35 @@
OPTIONS.replace_updated_files_list)
+def OptimizeCompressedEntries(zipfile_path):
+ """Convert files that do not compress well to uncompressed storage
+
+ EROFS images tend to be compressed already, so compressing them again
+ yields little space savings. Leaving them uncompressed will make
+ downstream tooling's job easier, and save compute time.
+ """
+ if not zipfile.is_zipfile(zipfile_path):
+ return
+ entries_to_store = []
+ with tempfile.TemporaryDirectory() as tmpdir:
+ with zipfile.ZipFile(zipfile_path, "r", allowZip64=True) as zfp:
+ for zinfo in zfp.filelist:
+ if not zinfo.filename.startswith("IMAGES/") and not zinfo.filename.startswith("META"):
+ continue
+ # Don't try to store userdata.img uncompressed, it's usually huge.
+ if zinfo.filename.endswith("userdata.img"):
+ continue
+ if zinfo.compress_size > zinfo.file_size * 0.80 and zinfo.compress_type != zipfile.ZIP_STORED:
+ entries_to_store.append(zinfo)
+ zfp.extract(zinfo, tmpdir)
+ # Remove these entries, then re-add them as ZIP_STORED
+ common.RunAndCheckOutput(
+ ["zip", "-d", zipfile_path] + [entry.filename for entry in entries_to_store])
+ with zipfile.ZipFile(zipfile_path, "a", allowZip64=True) as zfp:
+ for entry in entries_to_store:
+ zfp.write(os.path.join(tmpdir, entry.filename), entry.filename, compress_type=zipfile.ZIP_STORED)
+
+
def main(argv):
def option_handler(o, a):
if o in ("-a", "--add_missing"):
@@ -1036,8 +1073,10 @@
common.InitLogging()
AddImagesToTargetFiles(args[0])
+ OptimizeCompressedEntries(args[0])
logger.info("done.")
+
if __name__ == '__main__':
try:
common.CloseInheritedPipes()
diff --git a/tools/releasetools/apex_utils.py b/tools/releasetools/apex_utils.py
index ee0feae..2a39f65 100644
--- a/tools/releasetools/apex_utils.py
+++ b/tools/releasetools/apex_utils.py
@@ -102,14 +102,14 @@
' %s', entry)
payload_dir, has_signed_content = self.ExtractApexPayloadAndSignContents(
- apk_entries, apk_keys, payload_key)
+ apk_entries, apk_keys, payload_key, signing_args)
if not has_signed_content:
logger.info('No contents has been signed in %s', self.apex_path)
return self.apex_path
return self.RepackApexPayload(payload_dir, payload_key, signing_args)
- def ExtractApexPayloadAndSignContents(self, apk_entries, apk_keys, payload_key):
+ def ExtractApexPayloadAndSignContents(self, apk_entries, apk_keys, payload_key, signing_args):
"""Extracts the payload image and signs the containing apk files."""
if not os.path.exists(self.debugfs_path):
raise ApexSigningError(
@@ -143,7 +143,12 @@
if self.sign_tool:
logger.info('Signing payload contents in apex %s with %s', self.apex_path, self.sign_tool)
- cmd = [self.sign_tool, '--avbtool', self.avbtool, payload_key, payload_dir]
+ # Pass avbtool to the custom signing tool
+ cmd = [self.sign_tool, '--avbtool', self.avbtool]
+ # Pass signing_args verbatim which will be forwarded to avbtool (e.g. --signing_helper=...)
+ if signing_args:
+ cmd.extend(['--signing_args', '"{}"'.format(signing_args)])
+ cmd.extend([payload_key, payload_dir])
common.RunAndCheckOutput(cmd)
has_signed_content = True
diff --git a/tools/releasetools/check_target_files_signatures.py b/tools/releasetools/check_target_files_signatures.py
index 0f56fb9..d935607 100755
--- a/tools/releasetools/check_target_files_signatures.py
+++ b/tools/releasetools/check_target_files_signatures.py
@@ -237,9 +237,11 @@
# Signer #1 certificate DN: ...
# Signer #1 certificate SHA-256 digest: ...
# Signer #1 certificate SHA-1 digest: ...
+ # Signer (minSdkVersion=24, maxSdkVersion=32) certificate SHA-256 digest: 56be132b780656fe2444cd34326eb5d7aac91d2096abf0fe673a99270622ec87
+ # Signer (minSdkVersion=24, maxSdkVersion=32) certificate SHA-1 digest: 19da94896ce4078c38ca695701f1dec741ec6d67
# ...
certs_info = {}
- certificate_regex = re.compile(r"(Signer #[0-9]+) (certificate .*):(.*)")
+ certificate_regex = re.compile(r"(Signer (?:#[0-9]+|\(.*\))) (certificate .*):(.*)")
for line in output.splitlines():
m = certificate_regex.match(line)
if not m:
@@ -342,8 +344,8 @@
apk = APK(fullname, displayname)
self.apks[apk.filename] = apk
self.apks_by_basename[os.path.basename(apk.filename)] = apk
-
- self.max_pkg_len = max(self.max_pkg_len, len(apk.package))
+ if apk.package:
+ self.max_pkg_len = max(self.max_pkg_len, len(apk.package))
self.max_fn_len = max(self.max_fn_len, len(apk.filename))
def CheckSharedUids(self):
@@ -396,7 +398,8 @@
by_digest = {}
for apk in self.apks.values():
for digest in apk.cert_digests:
- by_digest.setdefault(digest, []).append((apk.package, apk))
+ if apk.package:
+ by_digest.setdefault(digest, []).append((apk.package, apk))
order = [(-len(v), k) for (k, v) in by_digest.items()]
order.sort()
diff --git a/tools/releasetools/non_ab_ota.py b/tools/releasetools/non_ab_ota.py
index 471ef25..9732cda 100644
--- a/tools/releasetools/non_ab_ota.py
+++ b/tools/releasetools/non_ab_ota.py
@@ -74,7 +74,7 @@
block_diff_dict = collections.OrderedDict()
partition_names = ["system", "vendor", "product", "odm", "system_ext",
- "vendor_dlkm", "odm_dlkm"]
+ "vendor_dlkm", "odm_dlkm", "system_dlkm"]
for partition in partition_names:
if not HasPartition(target_zip, partition):
continue
diff --git a/tools/releasetools/verity_utils.py b/tools/releasetools/verity_utils.py
index a08ddbe..d55ad88 100644
--- a/tools/releasetools/verity_utils.py
+++ b/tools/releasetools/verity_utils.py
@@ -379,6 +379,11 @@
self.avbtool = avbtool
self.algorithm = algorithm
self.key_path = key_path
+ if key_path and not os.path.exists(key_path) and OPTIONS.search_path:
+ new_key_path = os.path.join(OPTIONS.search_path, key_path)
+ if os.path.exists(new_key_path):
+ self.key_path = new_key_path
+
self.salt = salt
self.signing_args = signing_args
self.image_size = None