On 22/05/18 19:04, Pierre Lebleu wrote:
In order to allow the mounting of the filesystem with the zlib compression,
a new CMake option (eg: CMAKE_OVL_MOUNT_COMPRESS_ZLIB) has been added.

Signed-off-by: Pierre Lebleu <pme.leb...@gmail.com>
---
v2: change the option name
  CMakeLists.txt       | 6 ++++++
  libfstools/overlay.c | 2 +-
  2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9e855bd..6b98ba6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,6 +52,12 @@ INSTALL(FILES libubi/libubi-tiny.h libubi/libubi.h 
libubi/ubi-media.h
        DESTINATION include
  )
+IF(DEFINED CMAKE_OVL_MOUNT_COMPRESS_ZLIB)
+       ADD_DEFINITIONS(-DOVL_MOUNT_OPTION="compr=zlib")
+ELSE(DEFINED CMAKE_OVL_MOUNT_COMPRESS_ZLIB)
+       ADD_DEFINITIONS(-DOVL_MOUNT_OPTION=NULL)
+ENDIF(DEFINED CMAKE_OVL_MOUNT_COMPRESS_ZLIB)

modifying code like this is sub optimal. I'd prefer if we did a -DOVL_COMPR_ZLIB only

+
  ADD_EXECUTABLE(mount_root mount_root.c)
  TARGET_LINK_LIBRARIES(mount_root fstools)
  INSTALL(TARGETS mount_root RUNTIME DESTINATION sbin)
diff --git a/libfstools/overlay.c b/libfstools/overlay.c
index ebc43f7..5d5a985 100644
--- a/libfstools/overlay.c
+++ b/libfstools/overlay.c
@@ -341,7 +341,7 @@ static int overlay_mount_fs(struct volume *v)
                return -1;
        }
- if (mount(v->blk, "/tmp/overlay", fstype, MS_NOATIME, NULL)) {
+       if (mount(v->blk, "/tmp/overlay", fstype, MS_NOATIME, 
OVL_MOUNT_OPTION)) {

if (mount(v->blk, "/tmp/overlay", fstype, MS_NOATIME,
#ifdef OVL_COMPR_ZLIB
          "compr=zlib"
#else
          NULL
#endif
          ))

        John

                ULOG_ERR("failed to mount -t %s %s /tmp/overlay: %m\n",
                         fstype, v->blk);
                return -1;


_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel

Reply via email to