Hostnamectlがarm64を返しますが、unameがaarch64を返すのはなぜですか? (ラズベリーパイのUbuntu 20.04.2)

Hostnamectlがarm64を返しますが、unameがaarch64を返すのはなぜですか? (ラズベリーパイのUbuntu 20.04.2)

Ubuntu 20.04.3 LTSを実行するRaspberry Piがあります。コマンドによって、2 つの異なるアーキテクチャが返されます。建築 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

ありがとうございます! (これが問題の原因だと思います。何かをインストールしようとしましたが、arch64を探していましたが見つかりませんでしたが、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

おすすめ記事