visionA/local-tool/installer/linux/install-udev.sh
jim800121chen c54f16fca0 Initial commit: visionA monorepo with local-tool subproject
local-tool/: visionA-local desktop app
- M1: Wails shell + Go server + Next.js UI + Mock mode (macOS dmg ready)
- M2: i18n (zh-TW/en) + Settings 4-tab refactor
- M3: Embedded Python 3.12 runtime (python-build-standalone) + KneronPLUS wheels
- M4: Windows Inno Setup script (build on Windows runner)
- M5: Linux AppImage script + udev rule (build on Linux runner)
- M6: ffmpeg (GPL, pending legal review) + yt-dlp bundled
- Lifecycle: watchServer health check, fatal native dialog,
            Wails IPC raise endpoint, stale process cleanup

.autoflow/: full PRD / Design Spec / Architecture / Testing docs
            (4 rounds tri-party discussion + cross review)
.github/workflows/: macOS / Windows / Linux build CI

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 22:10:38 +08:00

34 lines
968 B
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# visionA-local — 安裝 Kneron USB udev rule
#
# 使用時機:
# 1. Wails app 在 First-Run 偵測到使用者第一次插 KL 裝置時,主動呼叫
# 2. 使用者手動從終端執行
#
# 需要 sudo / pkexec 權限。
set -euo pipefail
RULE_SRC="$(cd "$(dirname "$0")" && pwd)/99-kneron.rules"
RULE_DEST="/etc/udev/rules.d/99-kneron.rules"
if [ ! -f "$RULE_SRC" ]; then
echo "❌ 找不到 rule 來源:$RULE_SRC"
exit 1
fi
if [ -f "$RULE_DEST" ]; then
echo " udev rule 已存在於 $RULE_DEST,跳過"
exit 0
fi
echo "==> 複製 udev rule 至 $RULE_DEST(需要 sudo"
sudo cp "$RULE_SRC" "$RULE_DEST"
echo "==> 重新載入 udev rules"
sudo udevadm control --reload-rules
sudo udevadm trigger
echo "✅ udev rule 安裝完成"
echo " 若 Kneron 裝置已插入,請拔除後重新插入使新規則生效。"
echo " 若您不在 plugdev 群組可能需要sudo usermod -aG plugdev \$USER"