From 5b2bae39489a1746b0cda648aefbd2c853589b9e Mon Sep 17 00:00:00 2001 From: James Davidson Date: Fri, 19 Oct 2012 15:59:56 -0700 Subject: Support and switch to overlayfs --- scripts/install/install-functions | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'scripts/install/install-functions') diff --git a/scripts/install/install-functions b/scripts/install/install-functions index 34ced705..99d39dc9 100755 --- a/scripts/install/install-functions +++ b/scripts/install/install-functions @@ -290,7 +290,7 @@ is_union_install () return 1 fi if grep -q ' /live/image [^ ]\+ rw' /proc/mounts \ - && grep -q 'unionfs / unionfs ' /proc/mounts; then + && egrep -q '(union|overlay)fs / (union|overlay)fs ' /proc/mounts; then return 0 else return 1 @@ -333,6 +333,24 @@ get_new_version () # couldn't find it } +# Generate mount options based on the type of union mount +gen_mopts () +{ + local mnttype=$1 + local upper=$2 + local lower=$3 + local mntpoint=$4 + + case "$1" in + overlayfs) + echo "-t $mnttype -o noatime,upperdir=$upper,lowerdir=$lower $mnttype $mntpoint" + ;; + *) + echo "-t $mnttype -o noatime,dirs=$upper=rw:$lower=ro $mnttype $mntpoint" + ;; + esac +} + # try to mount. log any errors and return the appropriate status. # $1: arguments for mount try_mount () -- cgit v1.2.3