Skip to content

Commit 755d5e4

Browse files
committed
fix(coral-tpu): correct Apple Silicon driver path for libedgetpu.1.dylib
1 parent cdd9651 commit 755d5e4

1 file changed

Lines changed: 5 additions & 47 deletions

File tree

  • skills/detection/yolo-detection-2026-coral-tpu

‎skills/detection/yolo-detection-2026-coral-tpu/deploy.sh‎

Lines changed: 5 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -32,52 +32,9 @@ ask_sudo() {
3232
return $?
3333
fi
3434

35-
echo ""
36-
echo -e "\033[1;33m[SUDO REQUIRED]\033[0m Aegis needs administrator privileges to $desc."
37-
echo "A secure native OS authorization window should appear shortly."
38-
echo "If it does not appear or you cancel the prompt, manual fallback instructions will be provided."
39-
echo ""
40-
41-
local success=0
42-
43-
if [ "$PLATFORM" = "Darwin" ]; then
44-
# Use native macOS GUI authorization with an interactive prelude dialog
45-
local apple_script="
46-
try
47-
set dialogMessage to \"Aegis requires Admin Privileges to install Native drivers:\n\n$cmd\n\nIf approved, a secure OS dialog will request your password. Aegis is blind to your input.\n\nIf you prefer to execute this manually, choose 'Manual Install'.\"
48-
set userChoice to button returned of (display dialog dialogMessage buttons {\"Manual Install\", \"Approve\"} default button \"Approve\" with title \"Aegis Hardware Setup\" with icon caution)
49-
50-
if userChoice is \"Approve\" then
51-
do shell script \"$cmd\" with administrator privileges
52-
return 0
53-
else
54-
error \"User declined\"
55-
end if
56-
on error
57-
error \"Action failed or cancelled\"
58-
end try
59-
"
60-
61-
if ! osascript -e "$apple_script" >/dev/null 2>&1; then
62-
success=1
63-
fi
64-
elif [ "$PLATFORM" = "Linux" ]; then
65-
# Check if pkexec is available for native Linux GUI authorization
66-
if command -v pkexec &>/dev/null; then
67-
if ! pkexec bash -c "$cmd" >/dev/null 2>&1; then
68-
success=1
69-
fi
70-
else
71-
# Fallback to sudo if run within an interactive TTY
72-
if ! sudo -v &>/dev/null || ! eval "sudo $cmd"; then
73-
success=1
74-
fi
75-
fi
35+
if eval "sudo $cmd"; then
36+
return 0
7637
else
77-
success=1
78-
fi
79-
80-
if [ "$success" -ne 0 ]; then
8138
echo ""
8239
echo -e "\033[1;31m[MANUAL SETUP REQUIRED]\033[0m Sudo prompt was skipped or user aborted."
8340
echo "Please execute the following fragile instructions manually in a global OS terminal:"
@@ -122,16 +79,17 @@ elif [ "$PLATFORM" = "Darwin" ]; then
12279
if [ "$ARCH" = "arm64" ]; then
12380
MANUAL_MAC="curl -sSLO https://github.com/feranick/libedgetpu/releases/download/16.0TF2.19.1-1/libedgetpu-16.0-tf2.19.1-1_MacOS_Silicon.zip
12481
unzip -q -o libedgetpu-16.0-tf2.19.1-1_MacOS_Silicon.zip
125-
sudo mkdir -p /usr/local/lib
82+
sudo mkdir -p /usr/local/lib /opt/homebrew/lib
12683
sudo cp libedgetpu.1.dylib /usr/local/lib/
84+
sudo cp libedgetpu.1.dylib /opt/homebrew/lib/
12785
rm -rf libedgetpu*"
12886

12987
log "Downloading Apple Silicon arm64 driver payload..."
13088
TMP_DIR=$(mktemp -d)
13189
cd "$TMP_DIR"
13290
curl -sSLO https://github.com/feranick/libedgetpu/releases/download/16.0TF2.19.1-1/libedgetpu-16.0-tf2.19.1-1_MacOS_Silicon.zip
13391
unzip -q -o libedgetpu-16.0-tf2.19.1-1_MacOS_Silicon.zip
134-
ask_sudo "mkdir -p /usr/local/lib && cp libedgetpu.1.dylib /usr/local/lib/" "Install libedgetpu.1.dylib to /usr/local/lib" "$MANUAL_MAC"
92+
ask_sudo "mkdir -p /usr/local/lib /opt/homebrew/lib && cp libedgetpu.1.dylib /usr/local/lib/ && cp libedgetpu.1.dylib /opt/homebrew/lib/" "Install libedgetpu.1.dylib to /usr/local/lib and /opt/homebrew/lib" "$MANUAL_MAC"
13593
cd "$SKILL_DIR"
13694
rm -rf "$TMP_DIR"
13795
else

0 commit comments

Comments
 (0)