From: Yunhee Seo Date: Thu, 5 Jun 2025 04:38:32 +0000 (+0900) Subject: Revert changes for supporting unified-system-plugin package X-Git-Tag: accepted/tizen/unified/20250611.121122~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ad1fa43e89b5e59b37ae7fa02b54f6a30ff04cc8;p=platform%2Fcore%2Fsystem%2Fdeviced.git Revert changes for supporting unified-system-plugin package Since the 'run multiple services in one process' feature will be implemented with united-service, previous implementations should be removed. This reverts commits below(old to new): * 4ce7e101477a88eea5f4cfef1d27a15be877b3f8 * 500839923eb9e1f664282b24b6d8b1b471802d68 * 357625bc564a9f35db05a0471f507fdb9ab28440 Change-Id: I99d3a1b11090424dff16bbf5df1b5b500363751d Signed-off-by: Yunhee Seo --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b0d4813..f36ea414 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -247,22 +247,13 @@ ADD_DEFINITIONS("-DDEBUG") # 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}) @@ -325,13 +316,9 @@ ENDIF() 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) diff --git a/conf/org.tizen.system.deviced-unified-system-service.conf b/conf/org.tizen.system.deviced-unified-system-service.conf deleted file mode 100644 index 9ceb4784..00000000 --- a/conf/org.tizen.system.deviced-unified-system-service.conf +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packaging/deviced.spec b/packaging/deviced.spec index cf0bee61..be19af1e 100644 --- a/packaging/deviced.spec +++ b/packaging/deviced.spec @@ -2,7 +2,6 @@ #Just For debugging %define sdb_prestart off -%define enable_unified_system_service 0 Name: deviced Summary: Deviced @@ -49,7 +48,6 @@ BuildRequires: pkgconfig(cmocka) BuildRequires: pkgconfig(gtest) BuildRequires: pkgconfig(gmock) BuildRequires: pkgconfig(security-manager) -BuildRequires: pkgconfig(hal-api-common) Requires: %{name}-tools = %{version}-%{release} %{?systemd_requires} @@ -179,7 +177,6 @@ It can test resource-driver and plugin backend call test for deviced. -DDEVICE_BOARD_MODULE=on \ -DDEVICE_INPUT_MODULE=on \ -DCRITICAL_LOG_MODULE=on \ - -DENABLE_UNIFIED_SYSTEM_SERVICE=%{enable_unified_system_service} \ #eol %build @@ -201,9 +198,7 @@ sed -ie s,"##PLUGIN_LIB_DIR##,$DD_PLUGIN_PATH,g" isu/usr-lib-deviced.mount 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 @@ -213,10 +208,6 @@ mkdir -p %{buildroot}%{TZ_SYS_DUMPGEN} 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 @@ -288,22 +279,17 @@ mv %{_libdir}/tv-display.so %{_libdir}/deviced/display.so %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 diff --git a/src/core/main.c b/src/core/main.c index b235dd33..807ff526 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -27,8 +27,6 @@ #include #include -#include - #include "core.h" #include "log.h" #include "resource.h" @@ -104,13 +102,7 @@ static gboolean watchdog_cb(void *data) 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; @@ -118,6 +110,7 @@ static int deviced_init(void *data) int retval; CRITICAL_LOG("Initializing deviced."); + mainloop = g_main_loop_new(NULL, FALSE); ret = poweroff_check_revived(); if (is_poweroff_state(ret)) { @@ -165,14 +158,10 @@ static int deviced_init(void *data) _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(); @@ -194,31 +183,8 @@ static int deviced_exit(void *data) 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, -};