Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Commit

Permalink
don't use aufs if we're allowing nested warden
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Suraci committed Feb 10, 2014
1 parent 32b1f35 commit 076d5cb
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions warden/root/linux/skeleton/lib/common.sh
Expand Up @@ -58,17 +58,35 @@ function current_fs() {
}

function should_use_overlayfs() {
# load it so it's in /proc/filesystems
modprobe -q overlayfs >/dev/null 2>&1 || true

[ "$(current_fs $rootfs_path)" != "aufs" ] && \
grep -q overlayfs /proc/filesystems
# cannot mount overlayfs in aufs
if [ "$(current_fs $rootfs_path)" == "aufs" ]; then
return 1
fi

# check if it's a known filesystem
grep -q overlayfs /proc/filesystems
}

function should_use_aufs() {
# load it so it's in /proc/filesystems
modprobe -q aufs >/dev/null 2>&1 || true

[ "$(current_fs $rootfs_path)" != "aufs" ] && \
grep -q aufs /proc/filesystems
# don't use aufs for nested warden as neither overlayfs nor aufs can mount
# on it
if [ "$allow_nested_warden" == "true" ]; then
return 1
fi

# cannot mount aufs in aufs
if [ "$(current_fs $rootfs_path)" == "aufs" ]; then
return 1
fi

# check if it's a known filesystem
grep -q aufs /proc/filesystems
}

function setup_fs() {
Expand Down

0 comments on commit 076d5cb

Please sign in to comment.