summaryrefslogtreecommitdiff
path: root/src/hostname
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-11-09 10:21:23 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-11-11 04:42:50 +0900
commite6cbe6970f8e642a2229e0631eaa743fa86fcd29 (patch)
tree8e4fa589657ed8ae1a516bafb950442a6442dbc8 /src/hostname
parent227e2fc1a79cf52aacba605199eb48140450b138 (diff)
downloadsystemd-e6cbe6970f8e642a2229e0631eaa743fa86fcd29.tar.gz
hostnamed: use /proc/device-tree to get chassis type
From https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-firmware-ofw --- Userspace must not use the /sys/firmware/devicetree/base path directly, but instead should follow /proc/device-tree symlink. It is possible that the absolute path will change in the future, but the symlink is the stable ABI. --- Addresses the comment https://github.com/systemd/systemd/pull/20731#discussion_r744095262.
Diffstat (limited to 'src/hostname')
-rw-r--r--src/hostname/hostnamed.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c
index bcd2449861..e2c9f8ab67 100644
--- a/src/hostname/hostnamed.c
+++ b/src/hostname/hostnamed.c
@@ -302,7 +302,7 @@ try_acpi:
}
try_devicetree:
- r = read_one_line_file("/sys/firmware/devicetree/base/chassis-type", &type);
+ r = read_one_line_file("/proc/device-tree/chassis-type", &type);
if (r < 0) {
log_debug_errno(r, "Failed to read device-tree chassis type, ignoring: %m");
return NULL;