Hostnamectl이 arm64를 반환하지만 uname이 aarch64를 반환하는 이유는 무엇입니까? (라즈베리 파이의 우분투 20.04.2)

Hostnamectl이 arm64를 반환하지만 uname이 aarch64를 반환하는 이유는 무엇입니까? (라즈베리 파이의 우분투 20.04.2)

Ubuntu 20.04.3 LTS를 실행하는 Raspberry Pi가 있습니다. 명령에 따라 두 가지 다른 아키텍처가 반환됩니다.건축 64그리고ARM64. 왜?

CPU 이름

ubuntu@ubuntu:~$ hostnamectl
   Static hostname: plex
         Icon name: computer
        Machine ID: 5d1b763f15314c999d1b33e60d8d556f
           Boot ID: bdd535b62f134f6a9216543b36deb678
  Operating System: Ubuntu 20.04.3 LTS
            Kernel: Linux 5.4.0-1047-raspi
      Architecture: arm64

이름을 밝히다

ubuntu@ubuntu:~$ uname --all
Linux plex 5.4.0-1047-raspi #52-Ubuntu SMP PREEMPT Wed Nov 24 08:16:38 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

감사합니다! (이것이 문제의 원인이라고 생각합니다. 뭔가 설치를 시도했는데 aarch64를 찾고 있었지만 찾지 못했지만 amd64용 버전이 있는 것을 알 수 있습니다.

답변1

aarch64그리고 arm64그것은 정확히 동일한 아키텍처입니다. 대부분의 패키저와 패키지 관리자는 aarch64이름을 사용하지만 systemd의 경우 arm64여기에서 자세한 정보를 찾을 수 있습니다.

https://github.com/systemd/systemd/blob/db58f6a9338d30935aa219bec9a8a853cc807756/src/basic/architecture.c

이 코드에서는 Arm64 아키텍처의 aarch64매뉴얼 arm64페이지가 표준 지정자에도 사용됩니다(어떤 매뉴얼 페이지인지는 모르겠지만 코드는 다음과 같습니다.https://github.com/systemd/systemd/blob/5efbd0bf897a990ebe43d7dc69141d87c404ac9a/man/standard-specifiers.xml).

이 페이지는 해당 아키텍처가 systemd.unit 매뉴얼 페이지에 나열되어 있음을 알려줍니다. 여기에 추출물이 있습니다 man 5 systemd.unit.

       ConditionArchitecture=
           Check whether the system is running on a specific
           architecture. Takes one of "x86", "x86-64", "ppc", "ppc-le",
           "ppc64", "ppc64-le", "ia64", "parisc", "parisc64", "s390",
           "s390x", "sparc", "sparc64", "mips", "mips-le", "mips64",
           "mips64-le", "alpha", "arm", "arm-be", "arm64", "arm64-be",
           "sh", "sh64", "m68k", "tilegx", "cris", "arc", "arc-be", or
           "native".

           The architecture is determined from the information returned
           by uname(2) and is thus subject to personality(2). Note that
           a Personality= setting in the same unit file has no effect on
           this condition. A special architecture name "native" is
           mapped to the architecture the system manager itself is
           compiled for. The test may be negated by prepending an
           exclamation mark.

이 간단한 조사를 통해 나는 systemd가 uname시스템 호출을 사용하여 내부적으로 인쇄 aarch64하고 변경한다는 것을 추론했습니다 arm64.

관련 정보