# Build libdeviced-common-private.so
ADD_SUBDIRECTORY(src/shared)
-SET(deviced_LDFLAGS ${REQUIRED_PKGS_LDFLAGS})
-
-if(${ENABLE_UNIFIED_SYSTEM_SERVICE})
-SET(LIBRARY_NAME "unified-system-service-deviced")
-ADD_LIBRARY(${LIBRARY_NAME} SHARED ${SRCS})
-TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${REQUIRED_PKGS_LDFLAGS} "-lrt -ldl -lm" deviced-common-private)
-INSTALL(TARGETS ${LIBRARY_NAME} DESTINATION ${LIB_INSTALL_DIR}/system/plugin/ COMPONENT RuntimeLibraries)
-else()
ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+SET(deviced_LDFLAGS ${REQUIRED_PKGS_LDFLAGS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${REQUIRED_PKGS_LDFLAGS} "-lrt -ldl -lm" deviced-common-private)
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
-endif()
INSTALL(DIRECTORY DESTINATION ${MAKE_INSTALL_PREFIX}${DD_PLUGIN_PATH})
-
IF(POWER_MODULE STREQUAL on)
ADD_EXECUTABLE(deviced-shutdown src/power-shutdown/shutdown.c src/shared/common.c)
SET(deviced-shutdown_LDFLAGS ${REQUIRED_PKGS_LDFLAGS})
CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
-if(${ENABLE_UNIFIED_SYSTEM_SERVICE})
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/conf/org.tizen.system.deviced-unified-system-service.conf DESTINATION /etc/dbus-1/system.d)
-else()
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/conf/org.tizen.system.deviced.conf DESTINATION /etc/dbus-1/system.d)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/deviced.service DESTINATION /usr/lib/systemd/system)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/org.tizen.system.deviced.service DESTINATION /usr/share/dbus-1/system-services)
-endif()
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/deviced.service DESTINATION /usr/lib/systemd/system)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/usb-host-ffs-test-daemon.service DESTINATION /usr/lib/systemd/system)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/usb-host-test.socket DESTINATION /usr/lib/systemd/system)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/strs DESTINATION /etc/mtp-responder-dummy)
+++ /dev/null
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <policy user="root">
- <allow own="org.tizen.system.deviced"/>
- <allow send_destination="org.tizen.system.deviced"/>
- <allow send_type="signal" send_path="/Org/Tizen/System/DeviceD/Display" send_interface="org.tizen.system.deviced.display"/>
- <allow send_type="signal" send_path="/Org/Tizen/System/DeviceD/Time" send_interface="org.tizen.system.deviced.Time"/>
- <allow send_type="signal" send_path="/Org/Tizen/System/DeviceD/Battery" send_interface="org.tizen.system.deviced.Battery"/>
- </policy>
-
- <policy user="service_fw">
- <allow send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.BatteryMonitor" send_member="GetBMData"/>
- </policy>
-
- <policy user="system_fw">
- <allow send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.Battery" send_member="power_supply"/>
- <allow send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.ExtCon"/>
- <allow send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.display" send_member="AutoBrightnessChanged"/>
- <allow send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.SysNoti" send_member="udev"/>
- </policy>
-
- <policy user="security_fw">
- <allow send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.SysNoti" send_member="getcontrol"/>
- <allow send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.SysNoti" send_member="control"/>
- </policy>
-
- <policy user="app_fw">
- <allow send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.Tzip"/>
- </policy>
-
- <policy group="users">
- <allow send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.Tzip"/>
- </policy>
-
- <policy context="default">
- <deny own="org.tizen.system.deviced"/>
- <allow send_destination="org.tizen.system.deviced" send_interface="org.freedesktop.DBus.Properties" send_member="GetAll"/>
-
- <check send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.display"
- privilege="http://tizen.org/privilege/display"/>
- <check send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.Power"
- privilege="http://tizen.org/privilege/power"/>
- <check send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.PowerOff"
- privilege="http://tizen.org/privilege/reboot"/>
- <check send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.Led"
- privilege="http://tizen.org/privilege/led"/>
- <check send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.ir"
- privilege="http://tizen.org/privilege/use_ir"/>
- <check send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.Usbhost"
- privilege="http://tizen.org/privilege/usb.host"/>
- <check send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.touch"
- privilege="http://tizen.org/privilege/internal/default/platform"/>
- <check send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.Csa"
- privilege="http://tizen.org/privilege/internal/default/platform"/>
-
- <allow send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.input"/>
- <allow send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.Battery"/>
- <deny send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.Battery" send_member="power_supply"/>
- <check send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.Battery" send_member="SetLowbatLevel"
- privilege="http://tizen.org/privilege/systemsettings.admin"/>
- <allow send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.Core"/>
- <deny send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.ExtCon"/>
-
- <allow send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.SysNoti"/>
- <deny send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.SysNoti" send_member="getcontrol"/>
- <deny send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.SysNoti" send_member="control"/>
- <deny send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.SysNoti" send_member="udev"/>
-
- <deny send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.Tzip"/>
- <allow send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.Usb"/>
- <allow send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.UsbHostTest"/>
- <check send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.PmQos"
- privilege="http://tizen.org/privilege/internal/default/platform"/>
- <allow send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.temperature"/>
- <allow send_destination="org.tizen.system.deviced" send_interface="org.tizen.system.deviced.Board"/>
-
- <deny send_type="signal"
- send_path="/Org/Tizen/System/DeviceD/Display"
- send_interface="org.tizen.system.deviced.display"/>
- <deny send_type="signal"
- send_path="/Org/Tizen/System/DeviceD/Time"
- send_interface="org.tizen.system.deviced.Time"/>
- <deny send_type="signal"
- send_path="/Org/Tizen/System/DeviceD/Battery"
- send_interface="org.tizen.system.deviced.Battery"/>
- </policy>
-</busconfig>
#Just For debugging
%define sdb_prestart off
-%define enable_unified_system_service 0
Name: deviced
Summary: Deviced
BuildRequires: pkgconfig(gtest)
BuildRequires: pkgconfig(gmock)
BuildRequires: pkgconfig(security-manager)
-BuildRequires: pkgconfig(hal-api-common)
Requires: %{name}-tools = %{version}-%{release}
%{?systemd_requires}
-DDEVICE_BOARD_MODULE=on \
-DDEVICE_INPUT_MODULE=on \
-DCRITICAL_LOG_MODULE=on \
- -DENABLE_UNIFIED_SYSTEM_SERVICE=%{enable_unified_system_service} \
#eol
%build
rm -rf %{buildroot}
%make_install
-%if %{enable_unified_system_service} != 1
%install_service multi-user.target.wants deviced.service
-%endif
# usb_module condition is removed because it is always on
%if %{?sdb_prestart} == on
%install_service basic.target.wants sdb-prestart.service
install -m 775 scripts/dump_pmstate_log.sh %{buildroot}%{TZ_SYS_DUMPGEN}/dump_pmstate_log.sh
%post
-%if %{enable_unified_system_service}
-mv %{_sysconfdir}/dbus-1/system.d/org.tizen.system.deviced-unified-system-service.conf \
- %{_sysconfdir}/dbus-1/system.d/org.tizen.system.deviced.conf
-%endif
# Assume power module is on (-DPOWER_MODULE=on)
update-alternatives --install %{_prefix}/lib/systemd/systemd-shutdown systemd-shutdown %{_prefix}/lib/systemd/deviced-shutdown 500
%manifest %{name}.manifest
%license LICENSE.Apache-2.0
%license LICENSE.MIT
-%{_libdir}/libdeviced-common-private.so
-%if %{enable_unified_system_service}
-%{_libdir}/system/plugin/libunified-system-service-deviced.so
-%config %{_sysconfdir}/dbus-1/system.d/org.tizen.system.deviced-unified-system-service.conf
-%else
%{_bindir}/deviced
+%{_libdir}/libdeviced-common-private.so
%{_unitdir}/multi-user.target.wants/deviced.service
%{_unitdir}/deviced.service
%{_datadir}/dbus-1/system-services/org.tizen.system.deviced.service
-%config %{_sysconfdir}/dbus-1/system.d/org.tizen.system.deviced.conf
-%endif
%dir %{plugindir}
%if %{?sdb_prestart} == on
%{_unitdir}/sdb-prestart.service
%{_unitdir}/basic.target.wants/sdb-prestart.service
%endif
+%config %{_sysconfdir}/dbus-1/system.d/org.tizen.system.deviced.conf
%config %{_sysconfdir}/deviced/init.conf
%config %{_sysconfdir}/deviced/display.conf
%if %{?battery_module} == on
#include <device/board-internal.h>
#include <argos.h>
-#include <unified-system-service-common.h>
-
#include "core.h"
#include "log.h"
#include "resource.h"
return G_SOURCE_CONTINUE;
}
-static int deviced_early_init(void *data)
-{
- writepid(PIDFILE_PATH);
- return 0;
-}
-
-static int deviced_init(void *data)
+static int deviced_main(int argc, char **argv)
{
int ret;
guint timer;
int retval;
CRITICAL_LOG("Initializing deviced.");
+ mainloop = g_main_loop_new(NULL, FALSE);
ret = poweroff_check_revived();
if (is_poweroff_state(ret)) {
_E("aw_register failed.");
}
+ /* g_main_loop */
CRITICAL_LOG("Starting deviced.");
-
- return 0;
-}
-
-static int deviced_exit(void *data)
-{
- int ret = 0;
+ g_main_loop_run(mainloop);
+ g_main_loop_unref(mainloop);
devices_exit(NULL);
resource_exit();
return 0;
}
-static int deviced_main(int argc, char **argv)
-{
- mainloop = g_main_loop_new(NULL, FALSE);
-
- deviced_init(NULL);
-
- g_main_loop_run(mainloop);
- g_main_loop_unref(mainloop);
-
- deviced_exit(NULL);
-
- return 0;
-}
-
int main(int argc, char **argv)
{
- deviced_early_init(NULL);
+ writepid(PIDFILE_PATH);
return deviced_main(argc, argv);
}
-
-__attribute__ ((visibility("default")))
-unified_system_service unified_system_service_deviced_data = {
- .name = "unified-system-service-deviced",
- .early_init = deviced_early_init,
- .init = deviced_init,
- .exit = deviced_exit,
- .late_exit = NULL,
-};