Skip to content
Snippets Groups Projects

abicheck: Add option to not exit on errors

Merged Pavel Zhukov requested to merge landgraf/meta-binaryaudit:warnings into oniro/kirkstone
All threads resolved!
3 files
+ 13
5
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 3
3
@@ -35,17 +35,17 @@ def binary_audit_gather_abixml(d):
@@ -35,17 +35,17 @@ def binary_audit_gather_abixml(d):
kv = d.getVar("KERNEL_VERSION")
kv = d.getVar("KERNEL_VERSION")
artifact_dir = d.getVar("IMG_DIR")
artifact_dir = d.getVar("IMG_DIR")
ltree = os.path.join(artifact_dir, "usr", "lib", "modules")
ltree = os.path.join(artifact_dir, "usr", "lib", "modules")
 
warn = d.getVar("BINARY_AUDIT_WARN_ONLY") == "1"
if kv and os.path.isdir(ltree):
if kv and os.path.isdir(ltree):
# XXX This vmlinux lookup method is very vague
# XXX This vmlinux lookup method is very vague
ptr = os.path.join(d.getVar("WORKDIR"), "..", "..", d.getVar("PREFERRED_PROVIDER_virtual/kernel"), "*", "*", "vmlinux")
ptr = os.path.join(d.getVar("WORKDIR"), "..", "..", d.getVar("PREFERRED_PROVIDER_virtual/kernel"), "*", "*", "vmlinux")
vmlinux = glob.glob(ptr)[0]
vmlinux = glob.glob(ptr)[0]
whitelist = None
out, out_fn = abicheck.serialize_kernel_artifacts(abixml_dir, ltree, vmlinux, whitelist, warn)
out, out_fn = abicheck.serialize_kernel_artifacts(abixml_dir, ltree, vmlinux, whitelist)
with open(out_fn, "w") as f:
with open(out_fn, "w") as f:
f.write(out)
f.write(out)
f.close()
f.close()
else:
else:
for out, out_fn in abicheck.serialize_artifacts(abixml_dir, artifact_dir):
for out, out_fn in abicheck.serialize_artifacts(abixml_dir, artifact_dir, warn):
with open(out_fn, "w") as f:
with open(out_fn, "w") as f:
f.write(out)
f.write(out)
f.close()
f.close()
Loading