Handle overlayfs' new name in 3.18
authorImre Kaloz <kaloz@openwrt.org>
Mon, 24 Nov 2014 15:49:02 +0000 (16:49 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 24 Nov 2014 17:17:40 +0000 (18:17 +0100)
overlayfs has been renamed in Linus' tree - try both names in mount.c

Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
libfstools/mount.c

index 903043f940d5b938d0ada1c539b842ddddff7dd9..970b9cfaf81fc3f2a23327f0664f6dfaf7312ff6 100644 (file)
@@ -115,9 +115,13 @@ fopivot(char *rw_root, char *ro_root)
                mkdir(upperdir, 0755);
                mkdir(workdir, 0755);
 
-               if (mount(overlay, "/mnt", "overlayfs", MS_NOATIME, lowerdir)) {
-                       fprintf(stderr, "mount failed: %s, options %s\n", strerror(errno), lowerdir);
-                       return -1;
+               /* Mainlined overlayfs has been renamed to "overlay", try that first */
+               if (mount(overlay, "/mnt", "overlay", MS_NOATIME, lowerdir)) {
+                       if (mount(overlay, "/mnt", "overlayfs", MS_NOATIME, lowerdir)) {
+                               fprintf(stderr, "mount failed: %s, options %s\n",
+                                       strerror(errno), lowerdir);
+                               return -1;
+                       }
                }
        }