mirror of
https://github.com/systemd/systemd
synced 2026-04-04 06:04:51 +02:00
Compare commits
5 Commits
8b212f3596
...
a704137c20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a704137c20 | ||
|
|
9133c1877f | ||
|
|
e2b777f821 | ||
|
|
c6dce5720c | ||
|
|
e6cbe6970f |
@ -302,7 +302,7 @@ try_acpi:
|
|||||||
}
|
}
|
||||||
|
|
||||||
try_devicetree:
|
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) {
|
if (r < 0) {
|
||||||
log_debug_errno(r, "Failed to read device-tree chassis type, ignoring: %m");
|
log_debug_errno(r, "Failed to read device-tree chassis type, ignoring: %m");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@ -219,7 +219,7 @@ int id128_get_product(sd_id128_t *ret) {
|
|||||||
|
|
||||||
r = id128_read("/sys/class/dmi/id/product_uuid", ID128_UUID, &uuid);
|
r = id128_read("/sys/class/dmi/id/product_uuid", ID128_UUID, &uuid);
|
||||||
if (r == -ENOENT)
|
if (r == -ENOENT)
|
||||||
r = id128_read("/sys/firmware/devicetree/base/vm,uuid", ID128_UUID, &uuid);
|
r = id128_read("/proc/device-tree/vm,uuid", ID128_UUID, &uuid);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
|||||||
@ -509,7 +509,7 @@ static int condition_test_architecture(Condition *c, char **env) {
|
|||||||
return a == b;
|
return a == b;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DTCOMPAT_FILE "/sys/firmware/devicetree/base/compatible"
|
#define DTCOMPAT_FILE "/proc/device-tree/compatible"
|
||||||
static int condition_test_firmware_devicetree_compatible(const char *dtcarg) {
|
static int condition_test_firmware_devicetree_compatible(const char *dtcarg) {
|
||||||
int r;
|
int r;
|
||||||
_cleanup_free_ char *dtcompat = NULL;
|
_cleanup_free_ char *dtcompat = NULL;
|
||||||
@ -530,11 +530,8 @@ static int condition_test_firmware_devicetree_compatible(const char *dtcarg) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* /proc/device-tree/compatible consists of one or more strings, each ending in '\0'.
|
||||||
* /sys/firmware/devicetree/base/compatible consists of one or more
|
* So the last character in dtcompat must be a '\0'. */
|
||||||
* strings, each ending in '\0'. So the last character in dtcompat must
|
|
||||||
* be a '\0'.
|
|
||||||
*/
|
|
||||||
if (dtcompat[size - 1] != '\0') {
|
if (dtcompat[size - 1] != '\0') {
|
||||||
log_debug("%s is in an unknown format, assuming machine is incompatible", DTCOMPAT_FILE);
|
log_debug("%s is in an unknown format, assuming machine is incompatible", DTCOMPAT_FILE);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -67,7 +67,7 @@ int net_get_unique_predictable_data(sd_device *device, bool use_sysname, uint64_
|
|||||||
|
|
||||||
log_device_debug(device, "Using \"%s\" as stable identifying information", name);
|
log_device_debug(device, "Using \"%s\" as stable identifying information", name);
|
||||||
|
|
||||||
return net_get_unique_predictable_data_from_name(name, NULL, ret);
|
return net_get_unique_predictable_data_from_name(name, &HASH_KEY, ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
int net_get_unique_predictable_data_from_name(
|
int net_get_unique_predictable_data_from_name(
|
||||||
@ -80,11 +80,9 @@ int net_get_unique_predictable_data_from_name(
|
|||||||
int r;
|
int r;
|
||||||
|
|
||||||
assert(name);
|
assert(name);
|
||||||
|
assert(key);
|
||||||
assert(ret);
|
assert(ret);
|
||||||
|
|
||||||
if (!key)
|
|
||||||
key = &HASH_KEY;
|
|
||||||
|
|
||||||
l = strlen(name);
|
l = strlen(name);
|
||||||
sz = sizeof(sd_id128_t) + l;
|
sz = sizeof(sd_id128_t) + l;
|
||||||
v = newa(uint8_t, sz);
|
v = newa(uint8_t, sz);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user