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/common | |
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/common')
-rw-r--r-- | src/common/unionfs.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/common/unionfs.c b/src/common/unionfs.c index d8b7626..dff20e6 100644 --- a/src/common/unionfs.c +++ b/src/common/unionfs.c @@ -70,12 +70,26 @@ sys_umount_session(void) static inline void sys_mount_session(void) { +#ifdef USE_UNIONFSFUSE + char mopts[MAX_LENGTH_DIR_PATH * 2]; + const char *fstype; + const char *moptfmt; + int local_errno; + fstype = "/usr/bin/unionfs-fuse -o cow -o allow_other"; + moptfmt = "%s %s=RW:%s=RO %s"; + snprintf(mopts, MAX_LENGTH_DIR_PATH * 4, moptfmt, + fstype, get_cdirp(), get_adirp(), get_mdirp()); + if (system(mopts) != 0) { + perror("system"); + } +#else char mopts[MAX_LENGTH_DIR_PATH * 2]; snprintf(mopts, MAX_LENGTH_DIR_PATH * 2, "dirs=%s=rw:%s=ro", get_cdirp(), get_adirp()); if (mount("unionfs", get_mdirp(), "unionfs", 0, mopts) != 0) { perror("mount"); } +#endif } void |