diff options
author | James Davidson <james.davidson@vyatta.com> | 2012-10-19 15:59:56 -0700 |
---|---|---|
committer | Kim Hagen <khagen@multi-development.com> | 2014-04-25 20:28:18 +0200 |
commit | b4cf6641f3402a17dc83592abd8fe5e8ff0de802 (patch) | |
tree | 3ad3f1455e4d468a6437a8e5febc108d732837e9 /scripts/install/install-functions | |
parent | 54ebd5693d7ff6f2847f6069570e3e33f90c92d4 (diff) | |
download | vyatta-cfg-system-b4cf6641f3402a17dc83592abd8fe5e8ff0de802.tar.gz vyatta-cfg-system-b4cf6641f3402a17dc83592abd8fe5e8ff0de802.zip |
Support and switch to overlayfs
Diffstat (limited to 'scripts/install/install-functions')
-rwxr-xr-x | scripts/install/install-functions | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/scripts/install/install-functions b/scripts/install/install-functions index 0c2210fb..1929d1b3 100755 --- a/scripts/install/install-functions +++ b/scripts/install/install-functions @@ -285,7 +285,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 @@ -328,6 +328,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 () |