Skip to content

Commit c9194b4

Browse files
committed
Normalize sysinfo architecture names
Ensure telemetry reports a consistent architecture value regardless of whether it comes from `dpkg` or `uname`. The sysinfo collector now maps `x86_64`, `aarch64`, and related variants to the dpkg-style names already used elsewhere in the project, avoiding split reporting buckets for the same hardware.
1 parent 1aa8216 commit c9194b4

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

api/sysinfo.func

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,20 @@ telemetry_collect_sysinfo() {
250250
[[ -z "${RAM_SPEED+x}" ]] && detect_ram
251251
[[ -z "${HAS_ARM:-}" ]] && detect_arm
252252

253-
TM_ARCH="$(dpkg --print-architecture 2>/dev/null || uname -m || echo unknown)"
253+
# One vocabulary, not two. dpkg says amd64/arm64 and uname says x86_64/aarch64,
254+
# so which one a run reported depended on whether dpkg existed -- an Alpine
255+
# host landed in a different bucket from a Debian one for the same hardware.
256+
# The first data carrying this field showed all four names side by side.
257+
#
258+
# Normalised to dpkg's spelling, because that is what the rest of the project
259+
# already uses: var_arm64, the container templates, the release assets.
260+
TM_ARCH="$(dpkg --print-architecture 2>/dev/null || uname -m 2>/dev/null || echo unknown)"
261+
case "$TM_ARCH" in
262+
x86_64) TM_ARCH="amd64" ;;
263+
aarch64) TM_ARCH="arm64" ;;
264+
armv7* | armhf) TM_ARCH="armhf" ;;
265+
i386 | i686) TM_ARCH="i386" ;;
266+
esac
254267

255268
# Virtualization platform: pve (Proxmox VE) or incus.
256269
# Containers inherit TELEMETRY_PLATFORM from the host environment.

0 commit comments

Comments
 (0)