From 7a18aa633143a9a0397ef7c6fe558d7497aa3db9 Mon Sep 17 00:00:00 2001 From: Erfan Abdi Date: Tue, 19 Oct 2021 06:18:31 +0330 Subject: [PATCH] lxc: Add more sphal paths to find_hal --- tools/helpers/lxc.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/tools/helpers/lxc.py b/tools/helpers/lxc.py index 4228684..9caff23 100644 --- a/tools/helpers/lxc.py +++ b/tools/helpers/lxc.py @@ -152,19 +152,11 @@ def make_base_props(args): "ro.board.platform"] for p in hardware_props: prop = tools.helpers.props.host_get(args, p) - hal_prop = "" if prop != "": - for lib in ["lib", "lib64"]: - hal_file = "/vendor/" + lib + "/hw/" + hardware + "." + prop + ".so" - command = ["readlink", "-f", hal_file] - hal_file_path = tools.helpers.run.user(args, command, output_return=True).strip() - if os.path.isfile(hal_file_path): - hal_prop = re.sub(".*" + hardware + ".", "", hal_file_path) - hal_prop = re.sub(".so", "", hal_prop) - if hal_prop != "": - return hal_prop - if hal_prop != "": - return hal_prop + for lib in ["/odm/lib", "/odm/lib64", "/vendor/lib", "/vendor/lib64", "/system/lib", "/system/lib64"]: + hal_file = lib + "/hw/" + hardware + "." + prop + ".so" + if os.path.isfile(hal_file): + return prop return "" props = [] -- 2.47.3