diff options
Diffstat (limited to 'meta/recipes-core/volatile-binds/files/mount-copybind')
-rwxr-xr-x | meta/recipes-core/volatile-binds/files/mount-copybind | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/meta/recipes-core/volatile-binds/files/mount-copybind b/meta/recipes-core/volatile-binds/files/mount-copybind index ddc4357615..5885880534 100755 --- a/meta/recipes-core/volatile-binds/files/mount-copybind +++ b/meta/recipes-core/volatile-binds/files/mount-copybind | |||
@@ -45,9 +45,11 @@ if [ -d "$mountpoint" ]; then | |||
45 | 45 | ||
46 | # Fast version of calculating `dirname ${spec}`/.`basename ${spec}`-work | 46 | # Fast version of calculating `dirname ${spec}`/.`basename ${spec}`-work |
47 | overlay_workdir="${spec%/*}/.${spec##*/}-work" | 47 | overlay_workdir="${spec%/*}/.${spec##*/}-work" |
48 | mkdir "${overlay_workdir}" | 48 | if [ "$MOUNT_COPYBIND_AVOID_OVERLAYFS" != 1 ]; then |
49 | mkdir "${overlay_workdir}" | ||
50 | fi | ||
49 | 51 | ||
50 | # Try to mount using overlay, which is must faster than copying files. | 52 | # Try to mount using overlay, which is much faster than copying files. |
51 | # If that fails, fall back to slower copy. | 53 | # If that fails, fall back to slower copy. |
52 | if command -v selinuxenabled > /dev/null 2>&1; then | 54 | if command -v selinuxenabled > /dev/null 2>&1; then |
53 | if selinuxenabled; then | 55 | if selinuxenabled; then |
@@ -55,6 +57,7 @@ if [ -d "$mountpoint" ]; then | |||
55 | fi | 57 | fi |
56 | fi | 58 | fi |
57 | if [ "$MOUNT_COPYBIND_AVOID_OVERLAYFS" = 1 ] || ! mount -t overlay overlay -olowerdir="$mountpoint",upperdir="$spec",workdir="$overlay_workdir""$mountcontext" "$mountpoint" > /dev/null 2>&1; then | 59 | if [ "$MOUNT_COPYBIND_AVOID_OVERLAYFS" = 1 ] || ! mount -t overlay overlay -olowerdir="$mountpoint",upperdir="$spec",workdir="$overlay_workdir""$mountcontext" "$mountpoint" > /dev/null 2>&1; then |
60 | rm -rf "$overlay_workdir" | ||
58 | 61 | ||
59 | if [ "$specdir_existed" != "yes" ]; then | 62 | if [ "$specdir_existed" != "yes" ]; then |
60 | cp -aPR "$mountpoint"/. "$spec/" | 63 | cp -aPR "$mountpoint"/. "$spec/" |