From d42c64d78f4224dd0a0a4effc0754215f2af3851 Mon Sep 17 00:00:00 2001 From: Imre Kaloz Date: Mon, 24 Nov 2014 16:49:02 +0100 Subject: [PATCH] Handle overlayfs' new name in 3.18 overlayfs has been renamed in Linus' tree - try both names in mount.c Signed-off-by: Imre Kaloz --- libfstools/mount.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libfstools/mount.c b/libfstools/mount.c index 903043f..970b9cf 100644 --- a/libfstools/mount.c +++ b/libfstools/mount.c @@ -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; + } } } -- 2.30.2