feat(freebsd): full FreeBSD 15.0 compatibility
- board: detect cuaU* serial ports in fallback scanner, filter .init/.lock nodes - board: fall through to OS scan when arduino-cli returns empty (serial-discovery uses unsupported Linux syscalls on FreeBSD) - board: recognize cuaU* port names as USB in is_usb() - upload.sh: fix silent exit under set -euo pipefail when vid_pid grep finds nothing (|| true on LOCAL_PORT and LOCAL_VID_PID greps) - upload.sh: add cuaU to auto-detect port pattern - doctor: detect dialer and operator group membership, offer --fix for both - doctor: detect avr-size installed but not on PATH, offer --fix to add to shell rc file via detect_shell_rc() - doctor: context-aware hardware section (suppress misleading messages when groups not yet applied) - doctor: FreeBSD-specific troubleshooting hints throughout - devices: suppress arduino-cli board detection section on FreeBSD (broken due to serial-discovery syscall issues) - devices: always show USB hub tip on FreeBSD - devices: FreeBSD-specific troubleshooting checklist with sequential numbering on all platforms
This commit is contained in:
@@ -39,8 +39,29 @@ toml_get() {
|
||||
}
|
||||
|
||||
toml_array() {
|
||||
(grep "^$1 " "$CONFIG" 2>/dev/null || true) | head -1 \
|
||||
| sed 's/.*\[//; s/\].*//; s/"//g; s/,/ /g' | tr -s ' '
|
||||
# Handles both single-line: key = ["a", "b"]
|
||||
# and multiline: key = [
|
||||
# "a",
|
||||
# "b",
|
||||
# ]
|
||||
awk -v key="$1" '
|
||||
$0 ~ ("^" key " *= *\\[") {
|
||||
collecting = 1
|
||||
buf = $0
|
||||
if (index($0, "]") > 0) { collecting = 0 }
|
||||
}
|
||||
collecting && NR > 1 { buf = buf " " $0 }
|
||||
collecting && index($0, "]") > 0 && NR > 1 { collecting = 0 }
|
||||
!collecting && buf != "" {
|
||||
gsub(/.*\[/, "", buf)
|
||||
gsub(/\].*/, "", buf)
|
||||
gsub(/"/, "", buf)
|
||||
gsub(/,/, " ", buf)
|
||||
print buf
|
||||
buf = ""
|
||||
exit
|
||||
}
|
||||
' "$CONFIG" | tr -s " "
|
||||
}
|
||||
|
||||
toml_section_get() {
|
||||
@@ -195,7 +216,7 @@ if [[ -z "$PORT" ]]; then
|
||||
PORT=$(arduino-cli board list 2>/dev/null \
|
||||
| grep -i "serial" \
|
||||
| awk '{print $1}' \
|
||||
| grep -E 'ttyUSB|ttyACM|COM' \
|
||||
| grep -E 'ttyUSB|ttyACM|cuaU|COM' \
|
||||
| head -1)
|
||||
|
||||
if [[ -z "$PORT" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user