fstab-generator: fix check for /sys
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 4 Dec 2018 13:00:19 +0000 (14:00 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 12 Dec 2018 20:58:00 +0000 (21:58 +0100)
It would work when the generator was run by systemd, since generators
are always started in "/", but when running the generator for debugging
purposes the result would be ... different.

src/fstab-generator/fstab-generator.c

index d5e5412..616b42f 100644 (file)
@@ -539,7 +539,7 @@ static int parse_fstab(bool initrd) {
                 if (!what)
                         return log_oom();
 
-                if (is_device_path(what) && path_is_read_only_fs("sys") > 0) {
+                if (is_device_path(what) && path_is_read_only_fs("/sys") > 0) {
                         log_info("Running in a container, ignoring fstab device entry for %s.", what);
                         continue;
                 }