feat: update Docker build for armv7 and refactor architecture detection (#103)

This commit is contained in:
Ilya Pavlushin
2026-10-06 20:10:14 +05:00
committed by GitHub
parent 3cda44ac08
commit 71402c4ae7
2 changed files with 13 additions and 7 deletions
+2 -2
View File
@@ -169,7 +169,7 @@ jobs:
docker:
needs: validate
name: Docker image amd64/arm64
name: Docker image amd64/arm64/armv7
runs-on: ubuntu-latest
permissions:
contents: read
@@ -242,7 +242,7 @@ jobs:
with:
context: .
file: ./probe/Dockerfile
platforms: linux/amd64,linux/arm64
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
+11 -5
View File
@@ -227,11 +227,7 @@ fn detect_platform() -> Result<(PackageKind, String, bool)> {
.any(|line| line.split_whitespace().next() == Some("luci-app-cheburprobe"));
Ok((PackageKind::Opkg, architecture.to_owned(), luci_installed))
} else {
let architecture = match env::consts::ARCH {
"x86_64" => "amd64",
"aarch64" => "arm64",
architecture => bail!("unsupported standalone Linux architecture: {architecture}"),
};
let architecture = standalone_linux_architecture(env::consts::ARCH)?;
Ok((PackageKind::Linux, architecture.to_owned(), false))
}
@@ -239,6 +235,16 @@ fn detect_platform() -> Result<(PackageKind, String, bool)> {
bail!("updates are not supported on this operating system")
}
#[cfg(target_os = "linux")]
fn standalone_linux_architecture(architecture: &str) -> Result<&'static str> {
match architecture {
"x86_64" => Ok("amd64"),
"aarch64" => Ok("arm64"),
"arm" => Ok("armv7"),
architecture => bail!("unsupported standalone Linux architecture: {architecture}"),
}
}
#[cfg(target_os = "linux")]
fn openwrt_apk_arch() -> Result<String> {
if let Ok(architecture) = std::fs::read_to_string("/etc/apk/arch") {