Commit 64edd185 authored by Julian Rother's avatar Julian Rother
Browse files

patches: Updated overlayfs mounts to new syntax

parent c6b11b19
......@@ -9,7 +9,7 @@
ip=*)
STATICIP=${x#ip=}
if [ "${STATICIP}" = "" ]; then
@@ -426,6 +428,13 @@
@@ -490,6 +492,13 @@
continue
fi
......@@ -23,45 +23,43 @@
if [ -d "${image}" ]; then
# it is a plain directory: do nothing
rofsstring="${image}=${roopt}:${rofsstring}"
@@ -461,6 +470,10 @@
fi
mount -t ${cow_fstype} -o ${cow_mountopt} ${cowdevice} /cow || panic "Can not mount $cowdevice on /cow"
+
+ overlay_mount_dir=/overlay
+ mkdir -p "$overlay_mount_dir"
+
case ${UNIONFS} in
unionfs-fuse)
@@ -475,7 +488,9 @@
# Mount the layers pairwise from the bottom onto rootmnt,
# for the second and later layers rootmnt forms the lower layer.
@@ -519,26 +528,18 @@
mount -t ${UNIONFS} -o noatime,dirs=/cow/upper=rw:$rofsstring ${UNIONFS} "$rootmnt" || panic "${UNIONFS} mount failed"
;;
overlay|overlayfs)
- # Mount the layers pairwise from the bottom onto rootmnt,
- # for the second and later layers rootmnt forms the lower layer.
mounts=""
- for mount in /cow $rofslist
+
+ #overlay all readonly file systems first
+ for mount in $rofslist
do
mounts="$mount $mounts"
done
@@ -487,9 +502,13 @@
continue
fi
mount -t overlayfs -o "upperdir=$mount,lowerdir=$lower" \
- "$mount" "$rootmnt"
- mounts="$mount $mounts"
- done
- lower=""
- for mount in $mounts
- do
- if [ "$lower" = "" ]; then
- lower="$mount"
- continue
- fi
- mount -t ${UNIONFS} -o "upperdir=$mount/upper,lowerdir=$lower,workdir=$mount/work" \
- "$mount" "$rootmnt" || \
- mount -t ${UNIONFS} -o "upperdir=$mount/upper,lowerdir=$lower" \
- "$mount" "$rootmnt"
- lower="$rootmnt"
+ "$mount" "$overlay_mount_dir"
+ lower="$overlay_mount_dir"
+ mounts="${mount}:${mounts}"
done
+
+ mount -t overlayfs -o "upperdir=/cow,lowerdir=$lower" \
+ "$mount" "$rootmnt"
+
+ mounts="${mounts%:}"
+ overlay_mount_dir=/overlay
+ mkdir -p "${overlay_mount_dir}"
+ mount -t ${UNIONFS} -o "lowerdir=${mounts}" root "${overlay_mount_dir}"
+ # Stacking multiple overlays leads to "No such device" errors upon access
+ mount -t ${UNIONFS} -o "lowerdir=${overlay_mount_dir},upperdir=/cow/upper,workdir=/cow/work" cowroot "${rootmnt}"
+ lower="${overlay_mount_dir}"
;;
esac
@@ -530,15 +549,17 @@
@@ -579,15 +580,17 @@
fi
# move the first mount; no head in busybox-initramfs
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment