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>

SVN-Revision: 47015
v19.07.3_mercusys_ac12_duma
Felix Fietkau 9 years ago
parent d4760cd9b4
commit b38194406f

@ -75,13 +75,14 @@ pivot() { # <new_root> <old_root>
} }
} }
fopivot() { # <rw_root> <ro_root> <dupe?> fopivot() { # <rw_root> <work_dir> <ro_root> <dupe?>
/bin/mount -o noatime,lowerdir=/,upperdir=$1 -t overlayfs "overlayfs:$1" /mnt /bin/mount -o noatime,lowerdir=/,upperdir=$1,workdir=$2 -t overlay "overlayfs:$1" /mnt
pivot /mnt $2 pivot /mnt $3
} }
ramoverlay() { ramoverlay() {
mkdir -p /tmp/root mkdir -p /tmp/root
/bin/mount -t tmpfs -o noatime,mode=0755 root /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
} }

Loading…
Cancel
Save