fix(seed): Add opkg lock wait before install retries
Wait for /var/lock/opkg.lock to be released before retrying package installation to avoid "Resource temporarily unavailable" errors. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
33c413c893
commit
355c050700
@ -272,6 +272,11 @@ install_pkg() {
|
|||||||
# Retry up to 3 times (GitHub Pages CDN can be flaky)
|
# Retry up to 3 times (GitHub Pages CDN can be flaky)
|
||||||
local retry=0
|
local retry=0
|
||||||
while [ $retry -lt 3 ]; do
|
while [ $retry -lt 3 ]; do
|
||||||
|
# Wait for opkg lock to be released
|
||||||
|
while [ -f /var/lock/opkg.lock ]; do
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
if opkg install "$pkg" 2>&1; then
|
if opkg install "$pkg" 2>&1; then
|
||||||
log_ok "$pkg installed successfully"
|
log_ok "$pkg installed successfully"
|
||||||
return 0
|
return 0
|
||||||
@ -280,7 +285,7 @@ install_pkg() {
|
|||||||
retry=$((retry + 1))
|
retry=$((retry + 1))
|
||||||
if [ $retry -lt 3 ]; then
|
if [ $retry -lt 3 ]; then
|
||||||
log_warn "$pkg download failed, retry $retry/3..."
|
log_warn "$pkg download failed, retry $retry/3..."
|
||||||
sleep 2
|
sleep 3
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user