fix(openwrt): use full opkg path and pre-check availability

`channel.exec()` doesn't source the shell profile, so PATH may not
include /usr/bin on some routers. Using /usr/bin/opkg explicitly
avoids exit-127 surprises. Added opkg_check() to give a clear error
("firmware may not support package management") before attempting
opkg_update, rather than a confusing "command not found" exit code.
Also split the BusyBox-hostile `grep -v 'all\|noarch'` into two
separate greps for the arch-detection fallback.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-30 17:12:57 +00:00
co-authored by Claude Sonnet 4.6
parent 4c56e1bb96
commit bc1ec9aa3e
3 changed files with 19 additions and 6 deletions
+1
View File
@@ -19,6 +19,7 @@ use crate::Router;
pub async fn provision(router: &Router, config: &TollGateConfig) -> Result<()> {
info!("[{}] Starting TollGate provisioning", router.host);
router.opkg_check()?;
router.opkg_update()?;
install_tollgate(router)?;
config::apply(router, config)?;