]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
condition: fix device-tree firmware path
authorDaniel Braunwarth <daniel@braunwarth.dev>
Sun, 28 Aug 2022 18:02:50 +0000 (20:02 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 29 Aug 2022 04:47:56 +0000 (13:47 +0900)
The path /sys/firmware/device-tree doesn't exist. This should be either
/proc/device-tree or /sys/firmware/devicetree.

The first path is only a link. So lets use the second path.

See https://github.com/torvalds/linux/blob/v4.14/drivers/of/base.c#L218.

src/shared/condition.c

index 5c6e383679f5a9d98e983e07c5dad19dd6570875..27a0a465be697cc10818f42639ca22eda1c49b04 100644 (file)
@@ -649,9 +649,9 @@ static int condition_test_firmware(Condition *c, char **env) {
         assert(c->type == CONDITION_FIRMWARE);
 
         if (streq(c->parameter, "device-tree")) {
-                if (access("/sys/firmware/device-tree/", F_OK) < 0) {
+                if (access("/sys/firmware/devicetree/", F_OK) < 0) {
                         if (errno != ENOENT)
-                                log_debug_errno(errno, "Unexpected error when checking for /sys/firmware/device-tree/: %m");
+                                log_debug_errno(errno, "Unexpected error when checking for /sys/firmware/devicetree/: %m");
                         return false;
                 } else
                         return true;