Detection of SFOS armv7hl vs SFOS aarch64

Ahoi, whats the best way to detect the current platform of SFOS. Right now, my configuration management detects both devices (Xperia 10 and 10 II) as “aarch64”. So, some stuff fails
because for example “/usr/lib” vs “/usr/lib64”. What conditional check would be appropriate here?

On Xperia 10

$ uname -p
unknown
$ uname -i
unknown
$ lscpu |grep ^A
Architecture: aarch64

Any hint?

FYI, Patchmanager (since v3.2.0) uses /usr/bin/getconf LONG_BIT

1 Like

Olfs answer is correct and probably the most portable for detecting userland architecture.

If you use uname -m that is also correct but detects kernel architecture which has always been aarch64.

3 Likes

Indeed getconf is absolutely the closes solution. Its part of glibc and thats what defines the OS arch.

In the meantime I was using rpm --eval “%{_arch}” but will switch to getconf. Thank you very much.