aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-09-21 17:41:07 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-09-21 17:41:07 +0000
commit7cf832486bf7ac59dfb1c6b3254b6ccabaa95f67 (patch)
tree913e235cf3e9ad8fbae78950384c0cbaddf76107
parentc038f97df01a198d1d0e4c9de04e22d42f4d41bf (diff)
downloadmaster-187ad058-7cf832486bf7ac59dfb1c6b3254b6ccabaa95f67.tar.gz
master-187ad058-7cf832486bf7ac59dfb1c6b3254b6ccabaa95f67.tar.bz2
master-187ad058-7cf832486bf7ac59dfb1c6b3254b6ccabaa95f67.zip
base-files: fix ramoverlay function with kernels 3.18+
Even though there are not many users left within the OpenWrt tree it seems this function broke during the kernel 3.18 transition. Fix it by providing a workdir as required by overlayfs. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47015 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--package/base-files/files/lib/functions/preinit.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/package/base-files/files/lib/functions/preinit.sh b/package/base-files/files/lib/functions/preinit.sh
index db1f298c8b..57862a11f3 100644
--- a/package/base-files/files/lib/functions/preinit.sh
+++ b/package/base-files/files/lib/functions/preinit.sh
@@ -75,13 +75,14 @@ pivot() { # <new_root> <old_root>
}
}
-fopivot() { # <rw_root> <ro_root> <dupe?>
- /bin/mount -o noatime,lowerdir=/,upperdir=$1 -t overlayfs "overlayfs:$1" /mnt
- pivot /mnt $2
+fopivot() { # <rw_root> <work_dir> <ro_root> <dupe?>
+ /bin/mount -o noatime,lowerdir=/,upperdir=$1,workdir=$2 -t overlay "overlayfs:$1" /mnt
+ pivot /mnt $3
}
ramoverlay() {
mkdir -p /tmp/root
/bin/mount -t tmpfs -o noatime,mode=0755 root /tmp/root
- fopivot /tmp/root /rom 1
+ mkdir -p /tmp/root/root /tmp/root/work
+ fopivot /tmp/root/root /tmp/root/work /rom 1
}