Make sure we look for packages with the correct architecture

This commit is contained in:
Tim Wilkinson 2023-01-24 22:20:55 -08:00 committed by Joe AE6XE
parent 8817b70b52
commit 4894f42efd
2 changed files with 8 additions and 2 deletions

View File

@ -4,6 +4,7 @@
#will not change existing custom entries
DISTRIB_TARGET=$(grep DISTRIB_TARGET /etc/openwrt_release|cut -d'=' -f2|tr -d "'")
DISTRIB_RELEASE=$(grep DISTRIB_RELEASE /etc/openwrt_release|cut -d'=' -f2|tr -d "'")
DISTRIB_ARCH=$(grep DISTRIB_ARCH /etc/openwrt_release|cut -d'=' -f2|tr -d "'")
SERVER_PREFIX='http://downloads.arednmesh.org/'
SNAPSHOT_PREFIX='snapshots/'
@ -29,7 +30,7 @@ defaultPackageRepos()
if [ "$repo" == "core" ]; then
echo "${SERVER_PREFIX}${BUILD_PREFIX}targets/${DISTRIB_TARGET}/packages"
else
echo "${SERVER_PREFIX}${BUILD_PREFIX}packages/mips_24kc/${repo}"
echo "${SERVER_PREFIX}${BUILD_PREFIX}packages/${DISTRIB_ARCH}/${repo}"
fi
}

View File

@ -47,6 +47,7 @@ local html = aredn.html
local urlprefix
local target = "unknown"
local arch = "unknown"
function defaultPackageRepos(repo)
if not urlprefix then
urlprefix = "http://downloads.arednmesh.org"
@ -61,6 +62,10 @@ function defaultPackageRepos(repo)
if m then
target = m
end
m = line:match("DISTRIB_ARCH='(.*)'")
if m then
arch = m
end
end
local a, b = release:match("^(%d+)%.(%d+)%.")
if a and b then
@ -73,7 +78,7 @@ function defaultPackageRepos(repo)
if repo:match("aredn_core") then
return urlprefix .. "/targets/" .. target .. "/packages"
else
return urlprefix .. "/packages/mips_24kc/" .. repo
return urlprefix .. "/packages/" .. arch .. "/" .. repo
end
end