diff options
author | Daniil Baturin <daniil@baturin.org> | 2014-03-10 03:57:50 +0100 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2014-03-10 03:57:50 +0100 |
commit | 70adcee7b6561c4e9122858c4dca0fa5ee6af52a (patch) | |
tree | 6522eb5b6754fd045d15155b5a45599adb892c37 /src/cstore | |
parent | c1ecd5aca9d7ad1dfbf036d3d1f0da8a99ef1ac5 (diff) | |
download | vyatta-cfg-70adcee7b6561c4e9122858c4dca0fa5ee6af52a.tar.gz vyatta-cfg-70adcee7b6561c4e9122858c4dca0fa5ee6af52a.zip |
Import and adapt Kim Hagen's changes for union-fs support.
Diffstat (limited to 'src/cstore')
-rw-r--r-- | src/cstore/unionfs/cstore-unionfs.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/cstore/unionfs/cstore-unionfs.cpp b/src/cstore/unionfs/cstore-unionfs.cpp index e21e660..938436e 100644 --- a/src/cstore/unionfs/cstore-unionfs.cpp +++ b/src/cstore/unionfs/cstore-unionfs.cpp @@ -1477,6 +1477,23 @@ bool UnionfsCstore::do_mount(const FsPath& rwdir, const FsPath& rdir, const FsPath& mdir) { +#ifdef USE_UNIONFSFUSE + string mopts = "/usr/bin/unionfs-fuse "; + mopts += "-o cow -o allow_other "; + mopts += rwdir.path_cstr(); + mopts += "=RW:"; + mopts += rdir.path_cstr(); + mopts += "=RO"; + mopts += " "; + mopts += mdir.path_cstr(); + + if (system(mopts.c_str()) != 0) + { + output_internal("union mount failed [%s][%s][%s]\n", + strerror(errno), mdir.path_cstr(), mopts.c_str()); + return false; + } +#else string mopts = "dirs="; mopts += rwdir.path_cstr(); mopts += "=rw:"; @@ -1487,6 +1504,7 @@ UnionfsCstore::do_mount(const FsPath& rwdir, const FsPath& rdir, strerror(errno), mdir.path_cstr()); return false; } +#endif return true; } |