"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 = []
def setup_host_perms(args):
+ if not os.path.exists(tools.config.defaults["host_perms"]):
+ os.mkdir(tools.config.defaults["host_perms"])
+
+ treble = tools.helpers.props.host_get(args, "ro.treble.enabled")
+ if treble != "true":
+ return
+
sku = tools.helpers.props.host_get(args, "ro.boot.product.hardware.sku")
copy_list = []
copy_list.extend(
copy_list.append(
"/odm/etc/permissions/sku_{}/android.hardware.consumerir.xml".format(sku))
- if not os.path.exists(tools.config.defaults["host_perms"]):
- os.mkdir(tools.config.defaults["host_perms"])
-
for filename in copy_list:
shutil.copy(filename, tools.config.defaults["host_perms"])
command.append(args.COMMAND)
else:
command.append("/system/bin/sh")
- subprocess.run(command, env={"PATH": os.environ['PATH'] + "/system/bin:/vendor/bin"})
+ subprocess.run(command, env={"PATH": os.environ['PATH'] + ":/system/bin:/vendor/bin"})
def logcat(args):
if status(args) != "RUNNING":