]> glassweightruler.freedombox.rocks Git - waydroid.git/blobdiff - tools/helpers/lxc.py
Upver to 1.4.3
[waydroid.git] / tools / helpers / lxc.py
index 76cfd7440ec25d91df0eecdcdc2f9a82eee5325a..c2ca4e7bf77fc1f127ddd88cfd3859ad08c3edcb 100644 (file)
@@ -74,7 +74,7 @@ def generate_nodes_lxc_config(args):
     if args.vendor_type != "MAINLINE":
         if not make_entry("/dev/hwbinder", "dev/host_hwbinder"):
             raise OSError('Binder node "hwbinder" of host not found')
-        make_entry("/vendor", "vendor_extra", options="bind,optional 0 0")
+        make_entry("/vendor", "vendor_extra", options="rbind,optional 0 0")
 
     # Necessary device nodes for adb
     make_entry("none", "dev/pts", "devpts", "defaults,mode=644,ptmxmode=666,create=dir 0 0", False)
@@ -190,15 +190,18 @@ def generate_session_lxc_config(args, session):
         return add_node_entry(nodes, src, dist, mnt_type, options, check=False)
 
     # Make sure XDG_RUNTIME_DIR exists
-    if not make_entry("tmpfs", session["xdg_runtime_dir"], options="create=dir 0 0"):
+    if not make_entry("tmpfs", tools.config.defaults["container_xdg_runtime_dir"], options="create=dir 0 0"):
         raise OSError("Failed to create XDG_RUNTIME_DIR mount point")
 
-    wayland_socket = os.path.realpath(os.path.join(session["xdg_runtime_dir"], session["wayland_display"]))
-    if not make_entry(wayland_socket):
+    wayland_host_socket = os.path.realpath(os.path.join(session["xdg_runtime_dir"], session["wayland_display"]))
+    wayland_container_socket = os.path.realpath(os.path.join(tools.config.defaults["container_xdg_runtime_dir"], tools.config.defaults["container_wayland_display"]))
+    if not make_entry(wayland_host_socket, wayland_container_socket[1:]):
         raise OSError("Failed to bind Wayland socket")
 
-    pulse_socket = os.path.join(session["pulse_runtime_path"], "native")
-    make_entry(pulse_socket)
+    # Make sure PULSE_RUNTIME_DIR exists
+    pulse_host_socket = os.path.join(session["pulse_runtime_path"], "native")
+    pulse_container_socket = os.path.join(tools.config.defaults["container_pulse_runtime_path"], "native")
+    make_entry(pulse_host_socket, pulse_container_socket[1:])
 
     if not make_entry(session["waydroid_data"], "data", options="rbind 0 0"):
         raise OSError("Failed to bind userdata")