SET(CMAKE_VERBOSE_MAKEFILE OFF)
SET(STORAGED_APPS ${CMAKE_SOURCE_DIR}/apps)
+SET(LIBRARY_NAME "hal-backend-service-storaged")
SET(SRCS
src/core/main.c
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${${PROJECT_NAME}_pkgs_LDFLAGS} "-ldl" "-lm")
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
+ADD_LIBRARY(${LIBRARY_NAME} SHARED ${SRCS})
+TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${${PROJECT_NAME}_pkgs_LDFLAGS} "-ldl" "-lm")
+INSTALL(TARGETS ${LIBRARY_NAME} DESTINATION ${LIB_INSTALL_DIR}/hal COMPONENT RuntimeLibraries)
+
INSTALL(FILES ${CMAKE_SOURCE_DIR}/conf/org.tizen.system.storage.conf DESTINATION /etc/dbus-1/system.d)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/conf/block.conf DESTINATION /etc/storaged)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/conf/storage.conf DESTINATION /etc/storaged)
%if %{extended_storage}
BuildRequires: pkgconfig(ode)
%endif
+BuildRequires: pkgconfig(hal-api-common)
#For /usr/bin/msgfmt
BuildRequires: gettext-tools
%if "%{asan}" == "1"
%{_unitdir}/storaged.service.d/storaged.asan.conf
%endif
+%{_libdir}/hal/libhal-backend-service-storaged.so
%files module_block
%manifest %{name}.manifest
#include <sys/types.h>
#include <sys/stat.h>
+#include <hal/hal-common.h>
+
#include "log.h"
#include "modules.h"
#include "storaged_common.h"
return 0;
}
+
+static int storaged_exit(void *data)
+{
+ modules_deinit(NULL);
+
+ return 0;
+}
+
+static int storaged_init(void *data)
+{
+ int ret;
+ dbus_handle_h handle = NULL;
+
+ handle = gdbus_get_connection(G_BUS_TYPE_SYSTEM, FALSE);
+ if (!handle)
+ _E("Failed to get dbus connection.");;
+
+ dir_init();
+ modules_init(NULL);
+
+ ret = gdbus_request_name(handle, STORAGED_BUS_NAME, dbus_name_acquired, NULL);
+ if (ret <= 0) {
+ _E("Failed to request bus name.");
+ gdbus_check_name_owner(NULL, STORAGED_BUS_NAME);
+ }
+
+ return 0;
+}
+
+__attribute__ ((visibility("default")))
+hal_backend_service hal_backend_service_storaged_data = {
+ .module = HAL_MODULE_STORAGED,
+ .name = "hal-backend-service-storaged",
+ .early_init = NULL,
+ .init = storaged_init,
+ .exit = storaged_exit,
+ .late_exit = NULL,
+};
[Unit]
Description=System storage daemon
-Requires=dbus.socket
-Wants=wait-mount@opt-usr.service
-After=wait-mount@opt-usr.service dbus.service
[Service]
-Type=notify
-SmackProcessLabel=System::Privileged
-ExecStart=/usr/bin/storaged
-Restart=always
-RestartSec=0
-KillSignal=SIGUSR1
-MemoryMax=20M
+Type=simple
[Install]
WantedBy=delayed.target