From 44ac897065f3f7850a4ea97f587ffa32a75fca6c Mon Sep 17 00:00:00 2001 From: Mateusz Moscicki Date: Tue, 18 Jul 2023 11:56:13 +0200 Subject: [PATCH] Add ISU package This commit adds Individual Service Upgrade (ISU) feature to sensord package. When installed it will allow to upgrade this service using ISU mechanism, without the need to perform full OS Upgrade. This commits add necessary configuration to create upgrade packages of needed format. ISU framework itself is maintained and installed separately. Change-Id: Iac0b284f42277e12aa2e0f4a90dcada4cbde1327 (cherry picked from commit c9d2dab94c4c6187571b65b9b0443ad48afc95e3) --- CMakeLists.txt | 1 + isu/CMakeLists.txt | 5 +++++ isu/isu.cfg | 8 ++++++++ isu/system-services/sensord.service | 21 +++++++++++++++++++++ packaging/sensord.spec | 2 ++ 5 files changed, 37 insertions(+) create mode 100644 isu/CMakeLists.txt create mode 100644 isu/isu.cfg create mode 100644 isu/system-services/sensord.service diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b33e5db..106caf3c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,7 @@ ADD_SUBDIRECTORY(src/client-dummy) ADD_SUBDIRECTORY(src/sensorctl) ADD_SUBDIRECTORY(src/physical-sensor) ADD_SUBDIRECTORY(src/fusion-sensor) +ADD_SUBDIRECTORY(isu) INSTALL( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ diff --git a/isu/CMakeLists.txt b/isu/CMakeLists.txt new file mode 100644 index 00000000..9aadbc76 --- /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/sensord/ PERMISSIONS OWNER_WRITE OWNER_READ) +INSTALL(FILES system-services/sensord.service DESTINATION /etc/isu/sensord/system-services/ PERMISSIONS OWNER_WRITE OWNER_READ) diff --git a/isu/isu.cfg b/isu/isu.cfg new file mode 100644 index 00000000..bdf03210 --- /dev/null +++ b/isu/isu.cfg @@ -0,0 +1,8 @@ +[isu] +name=#NAME# +version=#VERSION# +system_service=sensord.service + +[files] +/usr/bin/sensord + diff --git a/isu/system-services/sensord.service b/isu/system-services/sensord.service new file mode 100644 index 00000000..2b3b3475 --- /dev/null +++ b/isu/system-services/sensord.service @@ -0,0 +1,21 @@ +[Unit] +Description=Sensor Daemon +Requires=sensord.socket + +[Service] +User=sensor +Group=input +Type=notify +NotifyAccess=all +SmackProcessLabel=System +EnvironmentFile=/etc/isu/service-common.inc +ExecStart=/bin/isu-sandbox $ISU_SANDBOX_INVOCATION \ + --bind #ISU_RUN_PATH#/sensord/rootfs/usr/bin/sensord /usr/bin/sensord \ + /usr/bin/sensord +MemoryLimit=20M +Nice=-5 +AmbientCapabilities=CAP_SETFCAP CAP_SETUID CAP_SETGID +SecureBits=keep-caps + +[Install] +WantedBy=multi-user.target diff --git a/packaging/sensord.spec b/packaging/sensord.spec index 04c25e16..87c5c3c8 100644 --- a/packaging/sensord.spec +++ b/packaging/sensord.spec @@ -63,6 +63,8 @@ Group: System/Testing %description -n sensor-test Sensor functional testing +%isu_package + %prep %setup -q -- 2.34.1