platform/core/system/isu.git
9 months agogenerator: Ensure isu.cfg is also available in /run/isu/<PKG_NAME> 40/299540/1
Karol Lewandowski [Wed, 4 Oct 2023 09:53:24 +0000 (11:53 +0200)]
generator: Ensure isu.cfg is also available in /run/isu/<PKG_NAME>

Package in /opt/isu/<PKG_NAME> can be removed/upgraded/etc. so we
can't depend on it to have valid run-time info

Change-Id: Ie86249f509dd688e76393723ca1d2b3612926a97

10 months agotmpfiles: Ensure /run/isu is always created 33/299433/1
Karol Lewandowski [Tue, 26 Sep 2023 08:52:49 +0000 (10:52 +0200)]
tmpfiles: Ensure /run/isu is always created

This will prevent some other process taking over this name for
its purpose.

Change-Id: Ia45209768735eac4c2dc02bb687934e9291c4d77

10 months agogenerator: Fix ability to setup more than one .service & .unit in isu package 05/299305/2 accepted/tizen/8.0/unified/20231005.093804 accepted/tizen/unified/20230926.032106 tizen_8.0_m2_release
Karol Lewandowski [Mon, 25 Sep 2023 11:57:08 +0000 (13:57 +0200)]
generator: Fix ability to setup more than one .service & .unit in isu package

This commit fixes incorrect use of compgen -G as in example below:

   compgen -G "/bin/"b*

results in '/bin/bash', while we need behaviour like this:

   compgen -G "/bin/b*"

resulting in '/bin/bash /bin/basename /bin/b..'.

Change-Id: I0abd06fb0fd340023c9d6d87cddbb80ff96fa1ef

10 months agoUse symlinks for directories that are symlinked 72/298772/2 accepted/tizen/unified/20230914.164932
Mateusz Moscicki [Wed, 13 Sep 2023 08:38:25 +0000 (10:38 +0200)]
Use symlinks for directories that are symlinked

In the system the directory like /lib is a link to /usr/lib
In the sandbox we have performed two binds, which resulted in the fact
that from the sandbox perspective, the modificaiton (bind) in directory
/usr/lib was not visible in /lib

By using symlinks inside the sandbox the ISU package that
provides some libraries can bind it to one path:

  --bind #ISU_RUN_PATH#/service/rootfs/usr/lib/libservice.so.1 /usr/lib/libservice.so.1

instead of:

  --bind #ISU_RUN_PATH#/service/rootfs/usr/lib/libservice.so.1 /usr/lib/libservice.so.1
  --bind #ISU_RUN_PATH#/service/rootfs/usr/lib/libservice.so.1 /lib/libservice.so.1

Change-Id: I9c7c8854261546b2bc9f7111b3f90e9f9cd07c41

10 months agoAdd `user-service-common.inc` to ISU configuration 14/298614/1 accepted/tizen/unified/20230913.172613
Adam Michalski [Mon, 11 Sep 2023 11:40:11 +0000 (13:40 +0200)]
Add `user-service-common.inc` to ISU configuration

`user-service-common.inc` is similar to `service-common.inc` except
that it is tailored for user services.

Change-Id: I2f08e534afc654acbabf17b6fb42d717f00a20f2

10 months agogenerator: Log to standard error by default 86/298486/2 accepted/tizen/unified/20230908.185301
Karol Lewandowski [Thu, 7 Sep 2023 12:24:10 +0000 (14:24 +0200)]
generator: Log to standard error by default

Additionally, prepend each log with program name.

Change-Id: I9fec53490de6d56268959f7517b24be1ceb7c593

10 months agogenerator: Fix .service/.mount service installation 85/298485/2
Karol Lewandowski [Thu, 7 Sep 2023 12:15:43 +0000 (14:15 +0200)]
generator: Fix .service/.mount service installation

This commit fixes cases where service provided .mount but not .service
unit. Previously .mount unit would not be installed due to isu_prepare()
terminating early.

Additionally, this commit silents the warning when .mount unit is not
provided as it's rarely used feature.

Change-Id: I40da3ec35deed3023ad15664379f2c07237665b8

10 months agogenerator: Fix invalid variable reference in error message 84/298484/1
Karol Lewandowski [Thu, 7 Sep 2023 12:05:57 +0000 (14:05 +0200)]
generator: Fix invalid variable reference in error message

Change-Id: I53d635a44c5d5b57b63dba0d8e47a6049041ed85

10 months agoAdd configuration file for OS Upgrade & ISU interoperability 08/298408/1
Karol Lewandowski [Wed, 6 Sep 2023 11:23:10 +0000 (13:23 +0200)]
Add configuration file for OS Upgrade & ISU interoperability

This file can be used to list which fields from isu.cfg and platform
image must match for both to be assumed compatible.

Change-Id: Ib73456fd41dd88a6913625273108ea332144b985

10 months agoAdd tmpfiles.d snippet to guarantee permissions of /opt/isu 07/298407/1 accepted/tizen/unified/20230907.055354
Karol Lewandowski [Wed, 6 Sep 2023 11:17:40 +0000 (13:17 +0200)]
Add tmpfiles.d snippet to guarantee permissions of /opt/isu

Change-Id: I21ae22abe0888eda540abf9ede65e4c2cdab956c

10 months agopkg_manager, generator: Ensure files are installed accessible 05/298405/1
Karol Lewandowski [Wed, 6 Sep 2023 10:36:13 +0000 (12:36 +0200)]
pkg_manager, generator: Ensure files are installed accessible

All files should be readable except for rootfs.img, which are used only
for mounting data filesystem.

Additionally, change generator to check rootfs.img accessability only
when mount unit is being setup (to skip it during user-services setup).

Change-Id: Id7740cbd91aa6c08277813bd6d116cb82f73b282

10 months agogenerator: Drop $SYSTEMD_SCOPE in favor of $INSTANCE 04/298404/1
Karol Lewandowski [Wed, 6 Sep 2023 09:42:45 +0000 (11:42 +0200)]
generator: Drop $SYSTEMD_SCOPE in favor of $INSTANCE

$SYSTEMD_SCOPE is not set when running the script manually.

Change-Id: Ia754a81ea916b38030d474f00dbc7a39969774db

10 months agogenerator: Ensure mount units are started at boot 03/298403/1
Karol Lewandowski [Tue, 5 Sep 2023 22:32:56 +0000 (00:32 +0200)]
generator: Ensure mount units are started at boot

User session units can not depend on .mount units, so system
units have to start these even if it will be used much later.

Change-Id: I54c26a1e8eb57cbf6cbe0ea73c742630b9d0bdbf

10 months agogenerator: Rewrite handling of user service units 02/298402/1
Karol Lewandowski [Tue, 5 Sep 2023 20:47:27 +0000 (22:47 +0200)]
generator: Rewrite handling of user service units

Fix issue with isu-user-generator generating .mount units, which can't be
properly handled by `systemd --user` instance.

This commit changes mechanics to always create mount unit per ISU package
in system instance, so that user units can be sure mount is already available.

Additionally, improve logging a bit explicitly stating why we fail at given
stage.

Change-Id: Ice756587e86085b6b181d2644be599fefe10c465

10 months agoguide: Describe how extended platform compatibility check 07/298307/1
Karol Lewandowski [Tue, 5 Sep 2023 09:22:08 +0000 (11:22 +0200)]
guide: Describe how extended platform compatibility check

Change-Id: I100359f746c6d4eb7ebbf909e23d375727b17b96

10 months agoBump version 82/298182/1 accepted/tizen/unified/20230906.014621
Karol Lewandowski [Fri, 1 Sep 2023 13:15:10 +0000 (15:15 +0200)]
Bump version

Change-Id: Ic80714d13e6cd4cc9905c8c4efa2d1fa87de4f96

10 months agogenerator: Move PATH= setting to 2nd line as required by security-config scripts 80/298180/1
Karol Lewandowski [Fri, 1 Sep 2023 11:58:33 +0000 (13:58 +0200)]
generator: Move PATH= setting to 2nd line as required by security-config scripts

Change-Id: I070f8961d0ab3e04a51ef76ce744afe4548fbcaf

10 months agogenerator: Move mount unit to separate isu.conf 63/298163/2
Karol Lewandowski [Fri, 1 Sep 2023 09:02:31 +0000 (11:02 +0200)]
generator: Move mount unit to separate isu.conf

Having isu.conf (always) will make it easier to detect if service uses ISU
or not.

Change-Id: I9e4cb46db7d1114ce1760c21f143f4a6997b3428

11 months agoBump version 12/297812/1 accepted/tizen/unified/20230825.044301
Karol Lewandowski [Thu, 24 Aug 2023 14:32:24 +0000 (16:32 +0200)]
Bump version

Change-Id: Iff651509763004df799189103e2bdf9dbfc2c258

11 months agoUpdate documentation: Interaction with OS Upgrade section 34/297734/2
Adam Michalski [Wed, 23 Aug 2023 09:53:53 +0000 (11:53 +0200)]
Update documentation: Interaction with OS Upgrade section

Change-Id: I45d23a57ee956a8204f684036190d7baf937c17c

11 months agogenerator: .mount unit is always needed, not depending on existence of original servi... 10/297610/3
Karol Lewandowski [Mon, 21 Aug 2023 11:35:45 +0000 (13:35 +0200)]
generator: .mount unit is always needed, not depending on existence of original service file

Change-Id: I70d217a9cf42b65092b7051063a7c99e4248a70d

11 months agoDrop redunddant generator guide 09/297609/1
Karol Lewandowski [Mon, 21 Aug 2023 11:31:43 +0000 (13:31 +0200)]
Drop redunddant generator guide

Same information has been already moved to doc/GUIDE.md

Change-Id: I0be2f17eb45e46d2ddc71e3398af4e94fdd597cf

11 months agogenerator: Drop fallback mechanism (OnFailure=nonisuNAME.service) 08/297608/1
Karol Lewandowski [Mon, 21 Aug 2023 11:28:48 +0000 (13:28 +0200)]
generator: Drop fallback mechanism (OnFailure=nonisuNAME.service)

Unfortunately, the fallback mechanism, used when ISU service fails
to start can not be used in practice because:

 - it breaks socket activated services, as socket passing is defined
   in .socket units explicitly (ie. .socket specifies eg. Service=a.service,
   and if fallaback uinit would be started then sockets would not be
   passed correctly),

 - it breaks dbus-activated services, as copying original service file
   to nonisuNAME.service causes two services to specify same BusName= name

Change-Id: I7dc187ff367920bc2bfcf3988506f513278a932a

11 months agoUpdate guide to take `PidFile=` for double-forking services into account 05/297305/2
Adam Michalski [Wed, 16 Aug 2023 15:03:14 +0000 (17:03 +0200)]
Update guide to take `PidFile=` for double-forking services into account

Change-Id: I0dbc4decea02f5e19694ddf0f7b8c5ef336a9216

11 months agoAdd a simple ISU package manager 42/296942/9
Mateusz Moscicki [Mon, 7 Aug 2023 12:07:10 +0000 (14:07 +0200)]
Add a simple ISU package manager

Change-Id: I19cdd38341ae3a1d4cb671f1b031990946f8cba3

11 months agoUpdate ISU guide 03/297203/4
Adam Michalski [Fri, 11 Aug 2023 11:27:12 +0000 (13:27 +0200)]
Update ISU guide

Co-author: Karol Lewandowski<k.lewandowsk@samsung.com>

Change-Id: Ib4084ffa0d916878782c47532b3aca32d4fedbbe

11 months agoSupport for mount unit filenames containing a dash 73/296473/6
Adam Michalski [Fri, 28 Jul 2023 11:05:34 +0000 (13:05 +0200)]
Support for mount unit filenames containing a dash

A mount unit file having a dash in its name must be escaped.

Change-Id: I051489c876ffa9eca73ea8b5e63598033e62feb4

11 months agoAdd support for *.mount units 46/296646/2
Mateusz Moscicki [Wed, 2 Aug 2023 08:48:24 +0000 (10:48 +0200)]
Add support for *.mount units

Change-Id: Ib7b0c3ac07d428cb7ad2183d7276cc375237460e

11 months agoAdd support for new services provided by ISU 45/296645/2
Mateusz Moscicki [Wed, 2 Aug 2023 08:44:30 +0000 (10:44 +0200)]
Add support for new services provided by ISU

Add support for the situation where the ISU package provides a service
file that did not previously exist in the system

Change-Id: I1b5f09e9db7e073d9c729d6fcb19310cb4286a04

11 months agoAdd support for wildards in files section in isu.cfg 44/296644/2
Mateusz Moscicki [Wed, 2 Aug 2023 08:38:10 +0000 (10:38 +0200)]
Add support for wildards in files section in isu.cfg

Change-Id: I948a4791b37bb0f8d6b4ffef5d9b2ecbb883a8e5

12 months agoModify isu service common include file to conform to Tizen 6.0 46/295546/1 accepted/tizen/unified/20230726.020655 accepted/tizen/unified/dev/20230801.061614 accepted/tizen/unified/dev/20230801.062820
Adam Michalski [Mon, 10 Jul 2023 15:06:53 +0000 (17:06 +0200)]
Modify isu service common include file to conform to Tizen 6.0

Tizen 6.0 does not have the `hal` partition.

Change-Id: If59c09d523743e0e9659c3798f4d4cfdfefb6291

13 months agoAdd ISU guide 24/293424/7 accepted/tizen/unified/20230621.023246
Mateusz Moscicki [Fri, 26 May 2023 10:25:32 +0000 (12:25 +0200)]
Add ISU guide

Change-Id: Id7c3e0082883568f9a6d18db75a0c0aab6f8f7df

13 months agoAdd PATH environment variable 89/294289/1
Adam Michalski [Thu, 15 Jun 2023 15:28:10 +0000 (17:28 +0200)]
Add PATH environment variable

The PATH variable is required in scripts by the security-config.

Change-Id: I22b9a94a46ec7d302324868ef7c3bcf4f2a6e93e

13 months agoAdd `service-common.inc` to ISU configuration 40/293640/7
Adam Michalski [Thu, 1 Jun 2023 10:38:05 +0000 (12:38 +0200)]
Add `service-common.inc` to ISU configuration

Change-Id: Ie27126a2768ab6e0716e7f7bd54b496f23266f9d

13 months agoisu_pkgs_maker: Return exit code on error 57/293457/3
Mateusz Moscicki [Mon, 29 May 2023 14:31:13 +0000 (16:31 +0200)]
isu_pkgs_maker: Return exit code on error

Change-Id: Iffe109fad430ec88da6833a1eb65b0124e3aaa09

13 months agoAdd support for multiple service files 52/293452/3 accepted/tizen/unified/20230605.170308
Mateusz Moscicki [Mon, 29 May 2023 12:14:02 +0000 (14:14 +0200)]
Add support for multiple service files

Change-Id: I9cd65c94e165a8312267b64eeaef805c569db489

14 months agoAdd isu_pkgs_maker.py 92/293092/4
Mateusz Moscicki [Fri, 19 May 2023 11:15:54 +0000 (13:15 +0200)]
Add isu_pkgs_maker.py

The isu_pkgs_maker.py is a script that is used to generate ISU packages
based on configuration in `/etc/isu/` on rootfs.

Change-Id: I2190a031b87425bf7c48e3123d800879139e6b45

14 months agoAdd ISU systemd generator
Mateusz Moscicki [Fri, 19 May 2023 09:37:50 +0000 (11:37 +0200)]
Add ISU systemd generator

Generator is responsible for mounting the image with the updated service
and generating the service files that run it.
For more information see README.

Change-Id: I0caae33614adb9807c7d93ba34fdd9a209b02ab6

14 months agoInitial empty repository master
Tizen Infrastructure [Fri, 19 May 2023 01:49:46 +0000 (01:49 +0000)]
Initial empty repository