ツリーに/sys/class/hwmonが完全にリストされていないのはなぜですか?どうすればいいですか?

ツリーに/sys/class/hwmonが完全にリストされていないのはなぜですか?どうすればいいですか?

私が正しく理解しているなら、Linuxでは、すべてがすべてのハードウェアに至るパスです。私はセンサー構造に関する情報を取得したいので、ツリーを使ってhwmonディレクトリのすべてをマップする必要があると思いました。ただし、このディレクトリではツリーは以前とは異なる動作をします。

通常のディレクトリでツリーを実行すると、-Rまたは-Lフラグを使用せずにサブディレクトリ構造を取得します。

$ tree /home
/home
└── boss
    ├── clones
    ├── Desktop
    ├── Documents
    │   ├── modules.txt
    │   ├── old_docs
    │   │   └── assorted
    │   └── prepscript.txt
    ├── Downloads
    ├── Music
    ├── Pictures
    ├── Public
    ├── Templates
    └── Videos

12 directories, 2 files

しかし、HWmonでも同じことをしようとしています。 -Rフラグを使用し、より深い内容があるにもかかわらず、1レベルの深さにのみ進みます。

$ tree /sys/class/hwmon/
/sys/class/hwmon/
├── hwmon0 -> ../../devices/pci0000:40/0000:40:01.3/0000:43:00.0/hwmon/hwmon0
├── hwmon1 -> ../../devices/pci0000:00/0000:00:01.3/0000:09:00.0/hwmon/hwmon1
├── hwmon2 -> ../../devices/pci0000:40/0000:40:03.1/0000:44:00.0/hwmon/hwmon2
├── hwmon3 -> ../../devices/pci0000:00/0000:00:18.3/hwmon/hwmon3
├── hwmon4 -> ../../devices/pci0000:00/0000:00:19.3/hwmon/hwmon4
├── hwmon5 -> ../../devices/virtual/thermal/thermal_zone0/hwmon5
└── hwmon6 -> ../../devices/platform/nct6775.656/hwmon/hwmon6

7 directories, 0 files
$ tree /sys/class/hwmon/hwmon0
/sys/class/hwmon/hwmon0
├── device -> ../../../0000:43:00.0
├── fan1_input
├── name
├── power
│   ├── async
│   ├── autosuspend_delay_ms
│   ├── control
│   ├── runtime_active_kids
│   ├── runtime_active_time
│   ├── runtime_enabled
│   ├── runtime_status
│   ├── runtime_suspended_time
│   └── runtime_usage
├── pwm1
├── pwm1_enable
├── pwm1_max
├── pwm1_min
├── subsystem -> ../../../../../../class/hwmon
├── temp1_auto_point1_pwm
├── temp1_auto_point1_temp
├── temp1_auto_point1_temp_hyst
├── temp1_crit
├── temp1_crit_hyst
├── temp1_emergency
├── temp1_emergency_hyst
├── temp1_input
├── temp1_max
├── temp1_max_hyst
├── uevent
└── update_interval

3 directories, 27 files

これらの行動の違いの原因は何ですか?すべてのデバイスの簡単なツリーを取得できますか?

ベストアンサー1

treeこれは、基本的にシンボリックリンクを逆参照しないためです。この-lオプションは次のように変更されます。

tree -l /sys/class/hwmon/

しかし、あなたはすべての結果を理解することを嬉しく思います。

おすすめ記事