From 78d07cd3a543539bb7ba3a9cfccf9894e0fddb33 Mon Sep 17 00:00:00 2001 From: tteckster Date: Sat, 21 Jan 2023 14:01:43 -0500 Subject: [PATCH] Update casaos-v5.sh If the LXC is created Privileged, the script will automatically set up USB passthrough --- ct/casaos-v5.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ct/casaos-v5.sh b/ct/casaos-v5.sh index 740930aa..809f3d74 100644 --- a/ct/casaos-v5.sh +++ b/ct/casaos-v5.sh @@ -377,6 +377,17 @@ cat <>$LXC_CONFIG lxc.cgroup2.devices.allow: a lxc.cap.drop: EOF +if [ "$CT_TYPE" == "0" ]; then +cat <>$LXC_CONFIG +lxc.cgroup2.devices.allow: c 188:* rwm +lxc.cgroup2.devices.allow: c 189:* rwm +lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir +lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file +lxc.mount.entry: /dev/ttyUSB1 dev/ttyUSB1 none bind,optional,create=file +lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file +lxc.mount.entry: /dev/ttyACM1 dev/ttyACM1 none bind,optional,create=file +EOF +fi msg_info "Starting LXC Container" pct start $CTID msg_ok "Started LXC Container"