import glob
import shutil
import platform
+import gbinder
import tools.config
import tools.helpers.run
elif lxc_ver <= 2:
config_file = "config_1"
config_path = tools.config.tools_src + "/data/configs/" + config_file
+ seccomp_profile = tools.config.tools_src + "/data/configs/waydroid.seccomp"
command = ["mkdir", "-p", lxc_path]
tools.helpers.run.user(args, command)
tools.helpers.run.user(args, command)
command = ["sed", "-i", "s/LXCARCH/{}/".format(platform.machine()), lxc_path + "/config"]
tools.helpers.run.user(args, command)
+ command = ["cp", "-fpr", seccomp_profile, lxc_path + "/waydroid.seccomp"]
+ tools.helpers.run.user(args, command)
nodes = generate_nodes_lxc_config(args)
config_nodes_tmp_path = args.work + "/config_nodes"
return prop
return ""
+ def find_hidl(intf):
+ if args.vendor_type == "MAINLINE":
+ return False
+
+ try:
+ sm = gbinder.ServiceManager("/dev/hwbinder")
+ return intf in sm.list_sync()
+ except:
+ return False
+
props = []
if not os.path.exists("/dev/ashmem"):
dri = tools.helpers.gpu.getDriNode(args)
gralloc = find_hal("gralloc")
- if gralloc == "":
+ if not gralloc:
+ if find_hidl("android.hardware.graphics.allocator@4.0::IAllocator/default"):
+ gralloc = "android"
+ if not gralloc:
if dri:
gralloc = "gbm"
egl = "mesa"