Update devcontainer startup to consistently chown passed-thru usb devices

This commit is contained in:
Allen Hill
2026-06-22 17:33:58 -07:00
parent 8141bd3f15
commit d4e05a6da9
3 changed files with 8 additions and 6 deletions
+1
View File
@@ -10,6 +10,7 @@
// "forwardPorts": [], // "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created. // Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "bash scripts/install-toolchain.sh", "postCreateCommand": "bash scripts/install-toolchain.sh",
"postAttachCommand": "bash scripts/chown-usb.sh",
// Configure tool-specific properties. // Configure tool-specific properties.
"customizations": { "customizations": {
"vscode": { "vscode": {
+6
View File
@@ -0,0 +1,6 @@
if [[ -c /dev/ttyUSB0 ]]; then
sudo chown root:$(id -gn $(whoami)) /dev/ttyUSB0
fi
if [[ -c /dev/ttyUSB1 ]]; then
sudo chown root:$(id -gn $(whoami)) /dev/ttyUSB1
fi
+1 -6
View File
@@ -1,7 +1,2 @@
sudo apk add make cmake avrdude avr-libc gcc-avr sudo apk add make cmake avrdude avr-libc gcc-avr
if [[ -c /dev/ttyUSB0 ]]; then
sudo chown root:$(id -gn $(whoami)) /dev/ttyUSB0
fi
if [[ -c /dev/ttyUSB1 ]]; then
sudo chown root:$(id -gn $(whoami)) /dev/ttyUSB1
fi