From: Adam Michalski Date: Tue, 13 Jun 2023 15:52:56 +0000 (+0200) Subject: Add ISU package X-Git-Tag: accepted/tizen/unified/20230710.153956~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb62d8fba7dfa7c92d490f861b6751639a9ed8a7;p=platform%2Fcore%2Fsystem%2Fdeviced.git Add ISU package The following changes have been made for ISU: * isu/isu.cfg - ISU configuration file. [isu] section: `name` and `version` have been filled by using the #NAME# and #VERSION# patterns that in turn will be replaced by the `%isu_package` RPM macro into the name and version of the RPM package. `system_service` is the systemd service name and must be the same as the original one. [files] section: contains a list of all files that should be added to the ISU package. Since we only want to replace the binary, there is only one file here. * isu/deviced.service - modified ISU service file. Compared to the original 'deviced.service' the following changes have been made for ISU: - `EnvironmentFile=/etc/isu/service-common.inc` - to include ISU-specific variables - `ExecStart=` has been changed to launch sandbox application with default parameters (`ISU_SANDBOX_INVOCATION`), ISU-provided `#ISU_RUN_PATH#/deviced/rootfs/usr/bin/deviced` is visible as `/usr/bin/deviced` in the sandbox - `NotifyAccess=all` has been set as there is one intermediate process (`isu-sandbox`) between `systemd` and `/usr/bin/deviced` * isu/CMakeLists.txt - CMake config file for the ISU. Added installing ISU config file and the service file to the appropriate locations (/etc/isu/*) * CMakeLists.txt - main config file for CMake. We've added the `isu` subdirectory where we placed the isu configuration file and the modified service file that will run `dlog` in a sandboxed environment. * packaging/deviced.spec - main `deviced` RPM spec file. We've made the following changes: - added `Requires: %{name}-isu = %{version}-%{release}` tag in the main spec section which will cause the ISU package to be installed when the original package is installed. - added the `%isu_package` macro invocation right before the `%prep` section which will cause the configuration to be placed in the correct location with all ISU-related files packaged into the `*-isu` RPM package. Change-Id: Ib4ede1ff59a0a6be23b7414926672e772c2ac1d5 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 1876051..d836395 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -350,6 +350,7 @@ IF(BATTERY_MODULE STREQUAL on) ADD_SUBDIRECTORY(plugins/mobile/battery) ADD_SUBDIRECTORY(plugins/wearable/battery) ENDIF() +ADD_SUBDIRECTORY(isu) INSTALL_CONF(conf display-profile-mobile) INSTALL_CONF(conf display-profile-wearable) diff --git a/isu/CMakeLists.txt b/isu/CMakeLists.txt new file mode 100644 index 0000000..5b86da3 --- /dev/null +++ b/isu/CMakeLists.txt @@ -0,0 +1,5 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(ISU C) + +INSTALL(FILES isu.cfg DESTINATION /etc/isu/deviced/ PERMISSIONS OWNER_WRITE OWNER_READ) +INSTALL(FILES deviced.service DESTINATION /etc/isu/deviced/system-services/ PERMISSIONS OWNER_WRITE OWNER_READ) diff --git a/isu/deviced.service b/isu/deviced.service new file mode 100644 index 0000000..bbc6201 --- /dev/null +++ b/isu/deviced.service @@ -0,0 +1,25 @@ +[Unit] +Description=System device daemon + +# Caution: never uncomment below "Wants=" and "After=" entries. +# Just information, deviced internally wait for /run/.wm_ready +# Wants=display-manager.service +# After=display-manager.service + +[Service] +Type=notify +NotifyAccess=all +SmackProcessLabel=System::Privileged +Environment=XDG_RUNTIME_DIR=/run +Environment=LD_LIBRARY_PATH=/run/isu/deviced/rootfs/usr/lib/ +EnvironmentFile=/etc/isu/service-common.inc +ExecStart=/bin/isu-sandbox $ISU_SANDBOX_INVOCATION \ + --bind #ISU_RUN_PATH#/deviced/rootfs #ISU_RUN_PATH#/deviced/rootfs/ \ + --bind #ISU_RUN_PATH#/deviced/rootfs/usr/bin/deviced /usr/bin/deviced \ + /usr/bin/deviced +Restart=on-failure +RestartSec=0 +KillSignal=SIGUSR1 + +[Install] +WantedBy=multi-user.target diff --git a/isu/isu.cfg b/isu/isu.cfg new file mode 100644 index 0000000..0da0ce7 --- /dev/null +++ b/isu/isu.cfg @@ -0,0 +1,8 @@ +[isu] +name=#NAME# +version=#VERSION# +system_service=deviced.service + +[files] +/usr/bin/deviced + diff --git a/packaging/deviced.spec b/packaging/deviced.spec index 2fbff7f..938235b 100644 --- a/packaging/deviced.spec +++ b/packaging/deviced.spec @@ -44,6 +44,7 @@ BuildRequires: pkgconfig(argos_watchdog) BuildRequires: pkgconfig(cmocka) Requires: %{name}-tools = %{version}-%{release} +Requires: %{name}-isu = %{version}-%{release} %{?systemd_requires} Requires(post): /usr/bin/vconftool Requires(post): %{_sbindir}/update-alternatives @@ -130,6 +131,8 @@ Requires: %{name} = %{version}-%{release} %description plugin-profile-iot-headless Plugin libraries for IoT headless devices +%isu_package + %prep %setup -q