From 08d49bc0b274b23557bdf57e568705191e8dea96 Mon Sep 17 00:00:00 2001 From: "pr.jung" Date: Tue, 29 Mar 2016 19:53:23 +0900 Subject: [PATCH] Merge storage and block Change-Id: I47f7a932710126857a94e7e4ed8a6a61ccc726b3 Signed-off-by: pr.jung --- CMakeLists.txt | 12 ++---------- packaging/deviced.spec | 8 ++------ src/{storage => block}/storage.c | 8 ++++---- src/{storage => block}/storage.conf | 0 4 files changed, 8 insertions(+), 20 deletions(-) rename src/{storage => block}/storage.c (97%) rename src/{storage => block}/storage.conf (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7dd055d..8c9741a 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,11 +110,6 @@ IF(LED_MODULE STREQUAL on) SET(SRCS ${SRCS} ${LED_SRCS}) ENDIF() -IF(STORAGE_MODULE STREQUAL on) - ADD_SOURCE(src/storage STORAGE_SRCS) - SET(SRCS ${SRCS} ${STORAGE_SRCS}) -ENDIF() - IF(TOUCHSCREEN_MODULE STREQUAL on) ADD_SOURCE(src/touchscreen TOUCHSCREEN_SRCS) SET(SRCS ${SRCS} ${TOUCHSCREEN_SRCS}) @@ -184,7 +179,7 @@ IF(DISPLAY_MODULE STREQUAL on) ENDIF() SET(PKG_MODULES ${PKG_MODULES} libinput capi-system-sensor) ENDIF() -IF(STORAGE_MODULE STREQUAL on) +IF(BLOCK_MODULE STREQUAL on) SET(PKG_MODULES ${PKG_MODULES} storage) ENDIF() IF(TELEPHONY_MODULE STREQUAL on) @@ -244,6 +239,7 @@ IF(BATTERY_MODULE STREQUAL on) ENDIF() IF(BLOCK_MODULE STREQUAL on) INSTALL_CONF(src/block block) + INSTALL_CONF(src/block storage) IF(BLOCK_SET_PERMISSION STREQUAL on) INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/mmc-smack-label DESTINATION bin) ENDIF(BLOCK_SET_PERMISSION STREQUAL on) @@ -253,10 +249,6 @@ IF(DISPLAY_MODULE STREQUAL on) INSTALL_CONF(src/display display) ENDIF() -IF(STORAGE_MODULE STREQUAL on) - INSTALL_CONF(src/storage storage) -ENDIF() - # USB connection IF(${USB_MODULE} STREQUAL on) INSTALL_CONF(src/usb usb-setting) diff --git a/packaging/deviced.spec b/packaging/deviced.spec index 0c3645a..f44dcf6 100644 --- a/packaging/deviced.spec +++ b/packaging/deviced.spec @@ -14,7 +14,6 @@ %define ir_module off %define led_module off %define power_module on -%define storage_module on %define telephony_module off %define touchscreen_module off %define tzip_module off @@ -86,7 +85,7 @@ BuildRequires: pkgconfig(xext) BuildRequires: pkgconfig(libinput) BuildRequires: pkgconfig(capi-system-sensor) %endif -%if %{?storage_module} == on +%if %{?block_module} == on BuildRequires: pkgconfig(storage) %endif %if %{?telephony_module} == on @@ -181,7 +180,6 @@ Deviced library for device control (devel) -DIR_MODULE=%{ir_module} \ -DLED_MODULE=%{led_module} \ -DPOWER_MODULE=%{power_module} \ - -DSTORAGE_MODULE=%{storage_module} \ -DTELEPHONY_MODULE=%{telephony_module} \ -DTOUCHSCREEN_MODULE=%{touchscreen_module} \ -DTZIP_MODULE=%{tzip_module} \ @@ -254,13 +252,11 @@ systemctl daemon-reload %{_bindir}/mmc-smack-label %endif %config %{_sysconfdir}/deviced/block.conf +%config %{_sysconfdir}/deviced/storage.conf %endif %if %{?display_module} == on %config %{_sysconfdir}/deviced/display.conf %endif -%if %{?storage_module} == on -%config %{_sysconfdir}/deviced/storage.conf -%endif %if %{?usb_module} == on %config %{_sysconfdir}/deviced/usb-setting.conf %config %{_sysconfdir}/deviced/usb-operation.conf diff --git a/src/storage/storage.c b/src/block/storage.c similarity index 97% rename from src/storage/storage.c rename to src/block/storage.c index 97d47ec..1013a84 100755 --- a/src/storage/storage.c +++ b/src/block/storage.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "device-node.h" #include "core/log.h" @@ -40,7 +41,6 @@ #define MEMORY_STATUS_TMP_PATH "/tmp" #define MEMNOTI_TMP_CRITICAL_VALUE (20) -#define MEMORY_STATUS_USR_PATH "/opt/usr" #define MEMORY_MEGABYTE_VALUE 1048576 #define MEMNOTI_WARNING_VALUE (5) /* 5% under */ @@ -187,7 +187,7 @@ static int storage_get_memory_size(char *path, struct statvfs *s) static void get_storage_status(char *path, struct statvfs *s) { - if (strcmp(path, MEMORY_STATUS_USR_PATH) == 0) + if (strcmp(path, tzplatform_getenv(TZ_SYS_HOME)) == 0) storage_get_internal_memory_size(s); else storage_get_memory_size(path, s); @@ -249,7 +249,7 @@ static Eina_Bool check_storage_status(void *data) static int init_storage_config_info_all(void) { - init_storage_config_info(MEMORY_STATUS_USR_PATH, &storage_internal_info); + init_storage_config_info(tzplatform_getenv(TZ_SYS_HOME), &storage_internal_info); init_storage_config_info(MEMORY_STATUS_TMP_PATH, &storage_tmp_info); memnoti_timer = ecore_timer_add(MEMNOTI_TIMER_INTERVAL, check_storage_status, NULL); @@ -295,7 +295,7 @@ static DBusMessage *edbus_get_storage_status(E_DBus_Object *obj, DBusMessage *ms goto out; } - if (!strcmp(path, MEMORY_STATUS_USR_PATH)) + if (!strcmp(path, tzplatform_getenv(TZ_SYS_HOME))) storage_get_internal_memory_size(&s); else storage_get_memory_size(path, &s); diff --git a/src/storage/storage.conf b/src/block/storage.conf similarity index 100% rename from src/storage/storage.conf rename to src/block/storage.conf -- 2.7.4