Revert changes for supporting unified-system-plugin package 46/325246/2
authorYunhee Seo <yuni.seo@samsung.com>
Thu, 5 Jun 2025 04:38:32 +0000 (13:38 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Tue, 10 Jun 2025 04:56:36 +0000 (13:56 +0900)
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 <yuni.seo@samsung.com>
CMakeLists.txt
conf/org.tizen.system.deviced-unified-system-service.conf [deleted file]
packaging/deviced.spec
src/core/main.c

index 5b0d48131bdc1e9cda992449e3730aa59f693b41..f36ea414550a80d6daba55eedd07eb14c815decf 100644 (file)
@@ -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 (file)
index 9ceb478..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-<!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>
index cf0bee61f00454205b928b4c2f4976d4f46c2f2c..be19af1ee6009c64b2a41995eec928a37b037f6d 100644 (file)
@@ -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
index b235dd33fb5786c9cbd396d5ef02402f6b5b9609..807ff5260e756f2b514c16f727415f4ad7e4f246 100644 (file)
@@ -27,8 +27,6 @@
 #include <device/board-internal.h>
 #include <argos.h>
 
-#include <unified-system-service-common.h>
-
 #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,
-};