platform/core/system/upgrade.git
13 months agoRevert "upgrade-apply-deltafs: Change hal-device-board module inclusion path" 49/310449/1
Chanwoo Choi [Mon, 29 Apr 2024 08:23:43 +0000 (17:23 +0900)]
Revert "upgrade-apply-deltafs: Change hal-device-board module inclusion path"

This reverts commit 22673b882aeb15496e9e86bd98fc1951a165a0ba.

Change-Id: Ib5a270ef1b9ffb9c3880db3bae8644fc79a2ad23
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
13 months agoSeparation of OS Upgrade into two stages 39/309439/4
Mateusz Moscicki [Fri, 5 Apr 2024 16:30:52 +0000 (18:30 +0200)]
Separation of OS Upgrade into two stages

If ugprade-trigger.sh is called without any additional parameters, the
behavior will be as before - an OS Upgrade will be performed and then a
reboot.

You can also use additional options:

  upgrade-trigger.sh --ro-update <delta_file> - only the upgrade will be done.
  upgrade-trigger.sh --finish - the active slot will be changed and a reboot will occur

Change-Id: I4e343a4791e8f94bb39ec3bc592127562c9aa8b8

13 months agoupgrade-apply-deltafs: Change hal-device-board module inclusion path
Yunhee Seo [Tue, 9 Apr 2024 06:59:17 +0000 (15:59 +0900)]
upgrade-apply-deltafs: Change hal-device-board module inclusion path

As HAL ABI versioning is applied to hal-api-device-board module,
inclusion path and file path is changed.

Change-Id: Ib584d14bd9c821eb348580dfa20cd27b5299e7e5
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
13 months agoAdd support for the "Online Update" accepted/tizen/unified/20240430.020633 accepted/tizen/unified/toolchain/20240508.012353 accepted/tizen/unified/x/20240430.094814 accepted/tizen/unified/x/20240507.051009
Mateusz Moscicki [Wed, 17 Apr 2024 10:09:32 +0000 (12:09 +0200)]
Add support for the "Online Update"

"Online Update" is a new type of OS Update.
After "reboot fota" the normal boot will be performed, and in addition
the following targets will be run:

* online-update-pre.target - this target startup is reached very realy -
  after mouting the file system and before starting services. Within
  this target, changes to permission and directory structure, for
  example, should take place.

* online-update.target - this target is started after the basic services
  (like dlog, dbus) are started. Data migration of services should take
  place within this target.

If a service requires data migration after an upgrade, it should provide
a service that will perform the migration at the appropriate time of
system startup. For example:

  [Unit]
  Description=Bluetooth upgrade service
  ConditionKernelCommandLine=bootmode=fota
  Before=online-update.target bluetooth-share.service
  After=opt.mount
  DefaultDependencies=no

  [Service]
  Type=oneshot
  ExecStart=/usr/share/upgrade/scripts/bluetooth-share/bluetooth-share_upgrade.sh
  SmackProcessLabel=System

  [Install]
  RequiredBy=online-update.target

The lines:

  Before=online-update.target bluetooth-share.service
  After=opt.mount

are responsible for starting the service at the right time.

The old upgrade type is still supported. If the system is booted like
this:

    /usr/lib/systemd/systemd --unit=system-update.target

the old upgrade (Offline) will be performed. And if it runs like this:

   /usr/lib/systemd/system --unit=online-update.target

then the new upgrade (Online) will be performed.

Change-Id: I691af6c500da66fb537fd744e40fec2e7a607242

13 months agoAdd data-checkpoint.service to local-fs.target.wants
Mateusz Moscicki [Fri, 16 Feb 2024 13:46:00 +0000 (14:46 +0100)]
Add data-checkpoint.service to local-fs.target.wants

When the system starts in FOTA mode, data checkpoint of system-data and
user partitions must be created so that data can be resotred in case of
upgrade (data migration) failure.

Change-Id: I5deffff111bd6527295a963b9904a087a649c23c

13 months agoClone partitions using head instead of dd
Jacek Kryszyn [Wed, 3 Apr 2024 14:16:11 +0000 (16:16 +0200)]
Clone partitions using head instead of dd

Instead of cloning partitions (whole disks) using dd,
head -c $part_size is used to copy only necessary bytes.
This can be much faster in case of partitions placed
on much bigger disks.

Change-Id: Ie15b9f543bac8ef351ef0a4ed4e9adfd148cf704

13 months agoAdd some small fixes suggested by shellcheck
Antoni [Fri, 22 Mar 2024 12:54:29 +0000 (13:54 +0100)]
Add some small fixes suggested by shellcheck

Some suggestions were ignored, for example if they made code less
readable.

Change-Id: I7063c5a192ea677e4d32628ca9160da32894d702

13 months agoLog output of upgrade binaries
Antoni [Fri, 22 Mar 2024 12:02:36 +0000 (13:02 +0100)]
Log output of upgrade binaries

Some more logs are also added when calling upgrade binaries.

Change-Id: I4a23d5d994604a112ff4805110749db38ed718dc

13 months agoRefactor and unify logging in upgrade-support scripts
Antoni [Fri, 15 Mar 2024 09:56:23 +0000 (10:56 +0100)]
Refactor and unify logging in upgrade-support scripts

All messages will now be both logged to file and printed.

Change-Id: I7be56b787027f5f8e2d626e2c078b6aedabb31cc

13 months agoDynamic Partitions - fix remove partitions after cloning
Jacek Kryszyn [Tue, 19 Mar 2024 11:27:06 +0000 (12:27 +0100)]
Dynamic Partitions - fix remove partitions after cloning

Dynamic partitions from the next slot are removed after
cloning using dmsetup remove. Sometimes this operation
fails due to devices being busy. This fix changes the
way that partitions are removed. dmsetup remove is
repeated five times and --retry flag is used which makes
dmsetup try to remove the device for a couple of seconds
until it will fail.

Change-Id: I2b13055981ed9d4ed5f6b69b516b932c96da020f

13 months agoFix a missing argument 77/310177/3 accepted/tizen/unified/20240424.162647 accepted/tizen/unified/x/20240425.051120
Mateusz Moscicki [Tue, 23 Apr 2024 12:17:41 +0000 (14:17 +0200)]
Fix a missing argument

Change-Id: Ib343925388826c79e60a7e9d60b7f2b62e8aceeb

13 months agoFix error -Werror=shadow 71/310171/2 accepted/tizen/unified/20240424.063531
Youngjae Cho [Tue, 23 Apr 2024 10:35:59 +0000 (19:35 +0900)]
Fix error -Werror=shadow

Fix constructor parameter identifier to be suffixed with _.

Change-Id: I8a56b643387e68d3c9031e2324f7acec388ffdfd
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
13 months agoFix error -Werror=sign-compare 70/310170/2
Youngjae Cho [Tue, 23 Apr 2024 09:59:49 +0000 (18:59 +0900)]
Fix error -Werror=sign-compare

It blames comparing signed type with unsigned type.

Fix it in two step:
 1. If signed variable is definitely a nonnegative value at the
    code context, cast it into unsigned type directly.
 2. If it is unclear whether a signed variable is nonnegative, then
    add assertion for testing the variable is nonnegative. After
    that assertion, cast it into unsigned type. It helps catching
    violation that casting negative value into unsigned variable.

Change-Id: Ib4f2a2cb2ad1901518d0726de6035ac4a033bc67
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
14 months agodynamic-partition: liblp: Fix an abnormal completion to do strncpy 04/308404/2 accepted/tizen/unified/20240325.141306 accepted/tizen/unified/x/20240327.045004
Jaehoon Chung [Mon, 25 Mar 2024 02:12:31 +0000 (11:12 +0900)]
dynamic-partition: liblp: Fix an abnormal completion to do strncpy

Fix an abnormal completion to do strncpy.
Use deviceinfo.partition_name.size instead of sizeof(out.partiton_name).

Change-Id: I8b3605f609a731f5529b1e6b1b8702fb549e08d5
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
14 months agodynamic-partitions: testlib: Fix overflow coverity issue 03/308403/1
Jaehoon Chung [Mon, 25 Mar 2024 02:07:58 +0000 (11:07 +0900)]
dynamic-partitions: testlib: Fix overflow coverity issue

It should be overflow according to multiply number_of_parts by
PART_SIZE_B. The  type of  number_of_parts is 'int'. To prevent
incorrect operation, cast a proper type.

Change-Id: I8fd44cc7622b25631f49f7df670a7a5bf435997e
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
15 months agoAdd check for dm-bow error during upgrade 71/303071/4 accepted/tizen/unified/20240319.154803 accepted/tizen/unified/x/20240320.133014
Mateusz Moscicki [Tue, 19 Dec 2023 14:34:00 +0000 (15:34 +0100)]
Add check for dm-bow error during upgrade

If such an error occurs, the partition will be remounted as RO.
Therefore, before commiting the data, a check is made to ensure that the
partition is not in this mode.

Change-Id: I43cb571b646f2e0403e2e1138f455c8afe571d59

15 months agoparse-dynparts: list free space on super 70/307270/3
Jacek Kryszyn [Tue, 20 Feb 2024 15:00:49 +0000 (16:00 +0100)]
parse-dynparts: list free space on super

Added --free-space flag which allows to list free space on
super partition. Can be combined with --list-tables to print
table as multiple lines. Refactored parse-dynparts a bit so
it doesn't matter in which order --list-tables and --free-space
are given. Filename of super still has to be given as a first
argument to maintain compatibility with existing scripts.

Tests of parse-dynparts were refactored in order to be easier
to maintain. Test data is now created using functions from
liblp instead of external tools and hard to understand
operations on raw structures.

Change-Id: If6446618dae03ff31dc7972c94cc84781dc1b9bb

15 months agodynamic-partitions: Modify to cast before multiply 89/307189/1 accepted/tizen/unified/20240307.075324 accepted/tizen/unified/toolchain/20240311.065624 accepted/tizen/unified/x/20240308.033508
SangYoun Kwak [Wed, 6 Mar 2024 02:27:50 +0000 (11:27 +0900)]
dynamic-partitions: Modify to cast before multiply

Previously, some variables(which are int32_t) are multiplied then casted
to int64_t. It is pointless since it can cause casting after overflow.
To prevent overflow, expression is modified to cast first operand and
then perform multiplication.

This solves a bug reported by SVACE with the following WGIDs:
701511 701817 701826 711926

Change-Id: Ic51b4f608d36850162e42330a7162e41e4b73f6e
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
16 months agoliblp: build on 32-bit architectures 06/305906/1 accepted/tizen/unified/20240214.163949 accepted/tizen/unified/x/20240219.013854
Jacek Kryszyn [Tue, 13 Feb 2024 08:42:58 +0000 (09:42 +0100)]
liblp: build on 32-bit architectures

Due to a missing definition it was impossible to build liblp
required by parse-dynparts and resize-dynparts on 32-bit
architectures.

Change-Id: I489abc3beea3ea1871078e5d3198e3ea36ed8f23

16 months agoUse resize-dynparts from delta file during OS Upgrade 80/305880/1
Jacek Kryszyn [Mon, 12 Feb 2024 12:56:24 +0000 (13:56 +0100)]
Use resize-dynparts from delta file during OS Upgrade

During OS Upgrade we can not rely on the scripts and programs available
on the system, so from this point on, instead of using resize-dynparts
that is on the system, we use the one provided in the delta file.

Change-Id: I2ff7702dcab670d05e7366d573e461a79c3d06a6

16 months agoDynamic Partitions: allow partition resizing 27/305427/5
Jacek Kryszyn [Wed, 31 Jan 2024 14:34:03 +0000 (15:34 +0100)]
Dynamic Partitions: allow partition resizing

This patch modifies scripts launched during upgrade/partition
cloning by allowing modification of metadata stored on a super
partition in order to resize dynamic partitions.

Change-Id: I338f383d34553f04429c77f85c0720f8c992c94e

16 months agoDynamic Partitions: resizing utility 26/305426/4
Jacek Kryszyn [Wed, 31 Jan 2024 14:26:52 +0000 (15:26 +0100)]
Dynamic Partitions: resizing utility

This patch adds a utility called resize-dynparts which allows
modification of metadata stored on super in order to resize
dynamic partitions.

Change-Id: Idb22f21240a8716d5b303b6cfc456f17f399699e

16 months agoImport parse-dynparts 25/305425/2
Jacek Kryszyn [Wed, 31 Jan 2024 13:53:14 +0000 (14:53 +0100)]
Import parse-dynparts

The project allows to read metadata of a super partition and mount partitions
stored on the super partition using dm-linear. Will be used to implement
the super partition with hal/rootfs dm-linear partitions.
Project url: https://github.com/tchebb/parse-android-dynparts. parse-dynparts
was moved from initrd where it was imported for the first time from
parse-android-dynparts master branch (commit c8837c1). This commit is based
on initrd commit e92dfb3.

Change-Id: I5753df5fd7924fb9d698059406ea322369fc2d7c

16 months agoUse blkid-print from delta file during OS Upgrade 60/305860/1
Mateusz Moscicki [Fri, 9 Feb 2024 12:03:26 +0000 (13:03 +0100)]
Use blkid-print from delta file during OS Upgrade

During OS Upgrade we can not rely on the scripts and programs available
on the system, so from this point on, instead of using blkid-print that
is on the system, we use the one provided in the delta file.

Change-Id: I94d0a6dd86f229a4e53184d7ca300e6dcb03d6bb

16 months agoblkid-print: Disable the display of help message when partition not found 42/305442/2
Mateusz Moscicki [Thu, 1 Feb 2024 14:25:14 +0000 (15:25 +0100)]
blkid-print: Disable the display of help message when partition not found

Displaying a help message may suggest that the program was called with
incorrect parameters.

Change-Id: Ifb6d036b3d78f76da32ce37bc3210a339df09314

16 months agoupgrade-scripts: Get rid of error info during reboot 41/305441/2
Mateusz Moscicki [Thu, 1 Feb 2024 14:24:19 +0000 (15:24 +0100)]
upgrade-scripts: Get rid of error info during reboot

Change-Id: Ibb5cc7de302a319f0c29bb7f2c936e71f1068ae2

18 months agoAllow upgrade of Tizen with dynamic partitions 74/302774/3 accepted/tizen_unified_riscv accepted/tizen/unified/20240112.154553 accepted/tizen/unified/riscv/20240115.113650
Jacek Kryszyn [Fri, 8 Dec 2023 09:53:42 +0000 (10:53 +0100)]
Allow upgrade of Tizen with dynamic partitions

This change adds support of dynamic partitions mapped from super
partition during upgrade. blkid-print was modified in order to
a) print usage and error messages on stderr instead of stdout
b) return output in a form which was extracted using sed anyway

Change-Id: Ibef751fd011dc3baf09df753cc4e8b81a583a0c2

18 months agoscripts: upgrade-support: Add more information into log message 46/301146/4 accepted/tizen/unified/20231122.172552
Jaehoon Chung [Thu, 9 Nov 2023 10:54:46 +0000 (19:54 +0900)]
scripts: upgrade-support: Add more information into log message

Add more information into log message.
To know exact sequence and time, add a LOG_DATE and totaltime about
background_copy.

After applying this patch,

[01/01/1970 09:29:21] [upgrade-prepare-partitions.sh][Info] Background copy rootfs, from: /dev/mmcblk0p2 to /dev/mmcblk0p12
[01/01/1970 09:32:29] [upgrade-prepare-partitions.sh][Info] Finished background copy rootfs from /dev/mmcblk0p2 to /dev/mmcblk0p12
[01/01/1970 09:32:29] [upgrade-prepare-partitions.sh][Info] Checksum verification for rootfs
[01/01/1970 09:34:47] [upgrade-prepare-partitions.sh][Info] Partition rootfs was cloned correctly
[01/01/1970 09:34:47] [upgrade-prepare-partitions.sh][Info] Background copy hal, from: /dev/mmcblk0p10 to /dev/mmcblk0p16
[01/01/1970 09:35:05] [upgrade-prepare-partitions.sh][Info] Finished background copy hal from /dev/mmcblk0p10 to /dev/mmcblk0p16
[01/01/1970 09:35:05] [upgrade-prepare-partitions.sh][Info] Finished Background copying A|B partitions for update...Total Time : 356 sec
[01/01/1970 09:35:05] [upgrade-prepare-partitions.sh]RO update preparation: upgrade-prepare-partitions.sh success
[01/01/1970 09:29:09] [upgrade-trigger.sh][Info] Triggered upgrade..
[01/01/1970 09:29:09] [upgrade-trigger.sh][Info] Using <delta.tar> delta file.
[01/01/1970 09:29:09] [upgrade-trigger.sh]set_upgrade_status success: 1
[01/01/1970 09:29:09] [upgrade-trigger.sh][Info] Package verifier is found. Verify delta.tar
[01/01/1970 09:29:09] [upgrade-trigger.sh][Info] Update package verification PASSED!
[01/01/1970 09:29:09] [upgrade-trigger.sh]set_upgrade_status success: 5
[01/01/1970 09:29:09] [upgrade-trigger.sh]Starting to prepare the partitions for upgrade..
[01/01/1970 09:35:05] [upgrade-trigger.sh]set_upgrade_status success: 20

The developers can know how long time takes for background copy with
Total Time.

Change-Id: I4cb004f14480c804dca2df3f15dddf5a83160dd3
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
18 months agoupgrade-scripts: Store the log message before exit_error 99/301099/5
Jaehoon Chung [Wed, 8 Nov 2023 11:20:15 +0000 (20:20 +0900)]
upgrade-scripts: Store the log message before exit_error

The created files of tmp directory will be removed after rebooting.
That makes a difficult to debug when there is a problem.
To remain the log message, copy all log files from /tmp/ to /var/log/fota/ before exit_error.
If error is occurred, there should be the log files.

Change-Id: I63bd28c9e2256ea3a417ee02c3f6c7a0e49641cf
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
19 months agoupgrade-scripts: Fix to invoke as an error when untar fails 16/300016/3
SangYoun Kwak [Fri, 13 Oct 2023 11:15:22 +0000 (20:15 +0900)]
upgrade-scripts: Fix to invoke as an error when untar fails

Previously, if the untaring of any delta file from the delta.tar.gz
fails, then the script ignored it and continued to the next delta file.
This may cause some delta files to be not applied which causes the
failure of the FOTA as a result.
To prevent this, the log message was changed to 'Error' from 'Info" and
'exit_error' was used instead of 'continue'.

Change-Id: Idffe1387a58b9a358f717bae4a334405b8946da4
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
20 months agoblkid-print: fix partition path for /dev/sdX devices 93/299893/1
Jacek Kryszyn [Wed, 11 Oct 2023 12:18:20 +0000 (14:18 +0200)]
blkid-print: fix partition path for /dev/sdX devices

This change fixes output in case of partitions on /dev/sdX devices.
Previously comparison of a device name with the "dev/sd" string
using strncmp would always return a value different than 0.

Change-Id: I77c471d174e87a70401cddab5464b8c1f671dc3d

20 months agoRemove installed ISU package if the new Tizen does not contain it 44/299444/3 accepted/tizen/unified/20231004.100253
Mateusz Moscicki [Thu, 28 Sep 2023 14:02:35 +0000 (16:02 +0200)]
Remove installed ISU package if the new Tizen does not contain it

Change-Id: I60f957afb64c438ab99fff52272a83a4e6841e2c

21 months agoAdd support for /etc/isu/upgrade.cfg 67/298167/6 accepted/tizen/8.0/unified/20231005.093909 accepted/tizen/unified/20230912.013607 tizen_8.0_m2_release
Mateusz Moscicki [Fri, 1 Sep 2023 11:42:16 +0000 (13:42 +0200)]
Add support for /etc/isu/upgrade.cfg

Configuration file /etc/isu/upgrade.conf specifies what fields will be
checked when verifying the compatiblity of the ISU package during OS
Upgrade.

Fields that should be taken into account should be specified as comma
separated list for option:

    platform_major_version_fields=

Change-Id: I7c0251117516080b6d362991770cc6abff113d5e

21 months agoRemove ISU packages during major OS upgrade 30/296930/3 accepted/tizen/unified/20230822.043319
Mateusz Moscicki [Mon, 7 Aug 2023 09:31:22 +0000 (11:31 +0200)]
Remove ISU packages during major OS upgrade

If the system release name has changed, remove incompatible packages, as
they may not be compatible with the new system version.

Change-Id: I43663bda0f50fbdcd608cd7e65881bd644b36476

22 months agorw-upgrade: Remove deprecated ISU Pkgs after OS upgrade 06/292706/3
Mateusz Moscicki [Thu, 11 May 2023 11:49:03 +0000 (13:49 +0200)]
rw-upgrade: Remove deprecated ISU Pkgs after OS upgrade

Change-Id: Ibe1a96ce2f29a64348a02ab95172e17c69870f66

22 months agoupgrade-apply: Stop copying data twice 43/292643/3
Mateusz Moscicki [Wed, 10 May 2023 12:02:24 +0000 (14:02 +0200)]
upgrade-apply: Stop copying data twice

In case the destination partition is the clone of the source partition,
then there is no need to copy data again, because it is already in
place.

Change-Id: I31efe018a76f1237452109fd463056c949e88bf9

22 months agoSwitch to openssl3 97/296097/1 accepted/tizen/unified/20230727.173041 accepted/tizen/unified/20230731.175259
Karol Lewandowski [Wed, 19 Jul 2023 22:45:16 +0000 (00:45 +0200)]
Switch to openssl3

Change-Id: I0008df12ce2bad49c966dcfd57979f090ae69319

2 years agoVersion 7.5.7 63/287763/1 accepted/tizen/unified/20230209.111250
Mateusz Moscicki [Fri, 3 Feb 2023 12:57:40 +0000 (13:57 +0100)]
Version 7.5.7

Change-Id: Ib3c0aad68a42ad69846b4c8297b2d66027cb46a0

2 years agoupgrade-apply-deltafs: Drop executable bit from file permissions 16/285816/3
Karol Lewandowski [Tue, 20 Dec 2022 22:57:08 +0000 (23:57 +0100)]
upgrade-apply-deltafs: Drop executable bit from file permissions

Change-Id: Ib46ba63a39620840f09c226a5965897315c762a5

2 years agoupgrade-apply-deltafs: Fix coverity issues 49/287749/1
Mateusz Moscicki [Fri, 3 Feb 2023 12:04:24 +0000 (13:04 +0100)]
upgrade-apply-deltafs: Fix coverity issues

Change-Id: I40ca168f50b981f359a69d31389a741ee74c09cb

2 years agoupgrade-apply-deltafs: Fix memory leak 86/287486/3
Mateusz Moscicki [Mon, 30 Jan 2023 14:45:23 +0000 (15:45 +0100)]
upgrade-apply-deltafs: Fix memory leak

Change-Id: Ifbcc809a3888c76032ff9b91a5b6b9c57f0055f2

2 years agoupgrade-apply-deltafs: Return an error when attribute file cannot be opened 16/287316/4
Mateusz Moscicki [Thu, 26 Jan 2023 09:21:18 +0000 (10:21 +0100)]
upgrade-apply-deltafs: Return an error when attribute file cannot be opened

Change-Id: I3c2c65878c14924ba60d50d0603cf8364d455778

2 years agoAdd Dockerfile to make it easy to build host version of upgrade-apply and upgrade... 39/283139/4
Karol Lewandowski [Tue, 18 Oct 2022 21:53:37 +0000 (23:53 +0200)]
Add Dockerfile to make it easy to build host version of upgrade-apply and upgrade-apply-deltafs

This is supposed to be used as part of CI.

Change-Id: If69c1e75002297773fbfc11434e4ab7162fb2d02

2 years agocmake: Install upgrade-apply-deltafs to default location 72/287572/2
Karol Lewandowski [Tue, 31 Jan 2023 17:02:23 +0000 (18:02 +0100)]
cmake: Install upgrade-apply-deltafs to default location

Change-Id: I41e10c4093098e5c1402e1f9f636dbf39e4914e2

2 years agocmake: Explicitly set install prefix to /usr 94/287694/1
Karol Lewandowski [Thu, 2 Feb 2023 11:03:06 +0000 (12:03 +0100)]
cmake: Explicitly set install prefix to /usr

Change-Id: Ia5f6949128eb7ccd95220a8e59cfac424f7c750c

2 years agoVersion 7.5.6 89/287089/2 accepted/tizen/unified/20230120.182105
Mateusz Moscicki [Mon, 16 Jan 2023 16:38:55 +0000 (17:38 +0100)]
Version 7.5.6

Change-Id: I77ea1541ccb7388d5a3f930499e0bf1ff36487ba

2 years agoFix SVACE issues 88/287088/2
Mateusz Moscicki [Thu, 19 Jan 2023 09:34:55 +0000 (10:34 +0100)]
Fix SVACE issues

Change-Id: Ied2611d4afd457651b41f0aa068c8b230973118f

2 years agoUse delta-verifier provided in the delta archive 87/287087/1
Mateusz Moscicki [Mon, 16 Jan 2023 16:32:09 +0000 (17:32 +0100)]
Use delta-verifier provided in the delta archive

Change-Id: I0fb336f6126f4727b473b1e2a1cfdf995aee42ed

2 years agoMerge changes I272886ee,I817fbcfe,I90795b82,I2cfcb411 into tizen
Mateusz Mościcki [Tue, 10 Jan 2023 13:23:29 +0000 (13:23 +0000)]
Merge changes I272886ee,I817fbcfe,I90795b82,I2cfcb411 into tizen

* changes:
  upgrade-apply-deltafs: Fix missleading debug message in SS_Unlink()
  upgrade-apply-deltafs: Stop trying to apply attributes after a faluire
  upgrade-apply-deltafs: Stop upgrade process immediately after failure
  Fail DELTA_FS type upgrade if there is not enough disk space

2 years agoupgrade-apply-deltafs: Fix missleading debug message in SS_Unlink() 22/286622/3 accepted/tizen/unified/20230116.060918
Antoni Adaszkiewicz [Tue, 10 Jan 2023 12:32:45 +0000 (13:32 +0100)]
upgrade-apply-deltafs: Fix missleading debug message in SS_Unlink()

ENOENT is handled by upgrade-apply-deltafs, but previous debug
messages suggested that ENOENT was an error.

Change-Id: I272886ee2f66d4efb0ee64b13af018c98b6362a2

2 years agoupgrade-apply-deltafs: Stop trying to apply attributes after a faluire 12/286612/4
Antoni Adaszkiewicz [Tue, 10 Jan 2023 11:30:43 +0000 (12:30 +0100)]
upgrade-apply-deltafs: Stop trying to apply attributes after a faluire

Previously we tried to apply attributes even after previous failures to
try to ensure a successful boot in order to retry upgrade process.
Currently when retrying to upgrade we start from the ground up as
thre are recovery mechanisms available (getting the system to
pre-upgrade state).

Change-Id: I817fbcfecfcaea9ab65570128b15a149df31ac91

2 years agoupgrade-apply-deltafs: Stop upgrade process immediately after failure 06/286606/3
Antoni Adaszkiewicz [Tue, 10 Jan 2023 10:37:12 +0000 (11:37 +0100)]
upgrade-apply-deltafs: Stop upgrade process immediately after failure

Previously even after critical failures (e.g. no space left) delta
would still continue be applied (with no chance of success at the end)

Change-Id: I90795b82c2bc276f6f4a5f701af1aa17b71e8bef

2 years agoFail DELTA_FS type upgrade if there is not enough disk space 21/286421/3
Antoni Adaszkiewicz [Thu, 5 Jan 2023 15:35:39 +0000 (16:35 +0100)]
Fail DELTA_FS type upgrade if there is not enough disk space

Change-Id: I2cfcb4113093aab111e64677e453c65892e97a26

2 years agoMerge "Drop redundant parts of CMake for host build" into tizen
Karol Lewandowski [Thu, 5 Jan 2023 10:46:29 +0000 (10:46 +0000)]
Merge "Drop redundant parts of CMake for host build" into tizen

2 years agoMerge "upgrade-apply-deltafs: Add minor changes in CMakeList.host-build" into tizen
Karol Lewandowski [Thu, 5 Jan 2023 10:46:24 +0000 (10:46 +0000)]
Merge "upgrade-apply-deltafs: Add minor changes in CMakeList.host-build" into tizen

2 years agoREADME: fix typo in README file 73/286373/1
Jaehoon Chung [Thu, 5 Jan 2023 01:18:10 +0000 (10:18 +0900)]
README: fix typo in README file

Fix typo in README file.

Change-Id: Idb88fe002271ef79e62577085ff5f158bbd2f820
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
2 years agoDrop redundant parts of CMake for host build 65/286365/2
Karol Lewandowski [Wed, 4 Jan 2023 20:36:59 +0000 (21:36 +0100)]
Drop redundant parts of CMake for host build

Change-Id: Ic0f819cbadccffc6fa42e6d167e07441ce93020f

2 years agoupgrade-apply-deltafs: Add minor changes in CMakeList.host-build 17/286317/2
Antoni Adaszkiewicz [Tue, 3 Jan 2023 15:44:15 +0000 (16:44 +0100)]
upgrade-apply-deltafs: Add minor changes in CMakeList.host-build

This change was needed due to dropping LZMA support in DELTA_FS

Change-Id: I9a14fb7651f431dfd765e657f20a2e545056d80a

2 years agoMerge "upgrade-apply-deltafs: Fix misleading debug message" into tizen
Karol Lewandowski [Wed, 4 Jan 2023 20:19:07 +0000 (20:19 +0000)]
Merge "upgrade-apply-deltafs: Fix misleading debug message" into tizen

2 years agoRemove liblzma-tool dependency in host-build 54/286254/2
Jaehoon Chung [Wed, 4 Jan 2023 11:03:17 +0000 (20:03 +0900)]
Remove liblzma-tool dependency in host-build

Remove liblzma-tool dependency in host-build.
lzma doesn't support anymore.

Change-Id: Ifd05f3a48e9a1f050173ce7c5059f009b999562e
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
2 years agoupgrade-apply-deltafs: Fix build warning 76/285276/4
Jaehoon Chung [Wed, 4 Jan 2023 11:03:09 +0000 (20:03 +0900)]
upgrade-apply-deltafs: Fix build warning

There are some warning message.
To clean codes, fix the build warning.

Change-Id: I0c7f79e12636dd4d8724ac169248448e0ff99cd0
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
2 years agoupgrade-apply-deltafs: Fix misleading debug message 46/286246/1
Antoni Adaszkiewicz [Mon, 2 Jan 2023 16:08:40 +0000 (17:08 +0100)]
upgrade-apply-deltafs: Fix misleading debug message

ENOENT and EEXIST when using symlink() are expected and handled by
upgrade-apply-deltafs.

Change-Id: I154557186d3a7664c1f23777f5d0406f5cf37bf6

2 years agoupgrade-apply-deltafs: Add a README file 81/285981/3
Antoni Adaszkiewicz [Fri, 23 Dec 2022 10:32:50 +0000 (11:32 +0100)]
upgrade-apply-deltafs: Add a README file

Change-Id: I1d76ad615a9f40b4de87f9b1940eb57611337b00

2 years agoVersion 7.5.5 41/285941/1
Mateusz Moscicki [Thu, 22 Dec 2022 15:05:19 +0000 (16:05 +0100)]
Version 7.5.5

Change-Id: I4dbc18aba5739f437538752eb80473f0bd614bf3

2 years agobrotli: Add cleanup after decompression is complete 09/285809/2
Mateusz Moscicki [Mon, 19 Dec 2022 15:53:00 +0000 (16:53 +0100)]
brotli: Add cleanup after decompression is complete

Change-Id: Ice1f953ae36e7b9abfffe8d674379748a946be41

2 years agoRemove dependencies to LZMA 08/285808/1
Mateusz Moscicki [Fri, 9 Dec 2022 14:20:04 +0000 (15:20 +0100)]
Remove dependencies to LZMA

Change-Id: If86e7acaac441600e916b561c24f6f28d88700e9

2 years agoupgrade-apply-deltafs: Fail update if decompression fails 10/285210/2 accepted/tizen/unified/20221220.041635
Antoni Adaszkiewicz [Wed, 7 Dec 2022 12:37:38 +0000 (13:37 +0100)]
upgrade-apply-deltafs: Fail update if decompression fails

Prevoiusly, if "system.7z" file (new files archive) decompression
failed, update would still continue.

Change-Id: I5caf02a3170be84048a26e33301a3a0dffddcb9d

2 years agoupgrade-apply-deltafs: Fix a new files archive decompression bug 05/285205/4
Antoni Adaszkiewicz [Wed, 7 Dec 2022 11:38:48 +0000 (12:38 +0100)]
upgrade-apply-deltafs: Fix a new files archive decompression bug

In rare cases (in deltas without any diffs) "sysytem.7z" archive file
would be the first file in its image directory. In this situation, a
wrong offset for the file (relative to delta) would be assumed, and as
a result a wrong file would be targeted for decompression.

Change-Id: I470854c92f9c0a1afe0bdbae134f4e63347916de

2 years agoupgrade-apply-deltafs: Drop unused legacy code 61/285061/4
Antoni Adaszkiewicz [Mon, 5 Dec 2022 14:21:34 +0000 (15:21 +0100)]
upgrade-apply-deltafs: Drop unused legacy code

Change-Id: I715f7b534fbca97707410480c002f0f56a58281c

2 years agoupgrade-apply-deltafs: Change new files archive offset logic 60/285060/5
Antoni Adaszkiewicz [Mon, 5 Dec 2022 14:12:12 +0000 (15:12 +0100)]
upgrade-apply-deltafs: Change new files archive offset logic

Now offset of "system.7z" archive (relative to delta) will be set to -1
if it is not found in delta. This allows said offset to be 0 and be
considered correcct (even though this cannot happen currently as there
are always crucial files at the begining of a delta).

Change-Id: I5faba74558e120eea6bec9d76ad1ce152e46f927

2 years agoVersion 7.5.4 53/284953/2
Antoni Adaszkiewicz [Thu, 1 Dec 2022 16:57:54 +0000 (17:57 +0100)]
Version 7.5.4

Change-Id: Ie75de7cfcb50486a3934e0f23ffee6e754adc9a5

2 years agoAdd delta-device compatiability verification to upgrade-trigger.sh, using delta-verif... 30/283330/6
Antoni Adaszkiewicz [Mon, 24 Oct 2022 10:33:55 +0000 (12:33 +0200)]
Add delta-device compatiability verification to upgrade-trigger.sh, using delta-verifier binary
from update-control

Change-Id: I2c06533e2c7f483b886a1557a0078d8662698277

2 years agoupgrade-apply-deltafs: Drop legacy code 46/282946/3
Antoni Adaszkiewicz [Thu, 13 Oct 2022 10:34:36 +0000 (12:34 +0200)]
upgrade-apply-deltafs: Drop legacy code

Change-Id: I3783b5c220b55180ac1bc79c69ab2b22068a84fe

2 years agoupgrade-apply-deltafs: Fix delta folder bug - if the given path to delta archive... 16/282716/4
Antoni Adaszkiewicz [Mon, 10 Oct 2022 18:17:59 +0000 (20:17 +0200)]
upgrade-apply-deltafs: Fix delta folder bug - if the given path to delta archive wasn't
absolute, in some instances it would cause this program to create an additional directory in
currently upgraded partition (with the same name as the directory the delta was in)

Change-Id: I8648504fa533f1f121f85af31aa40f2f75bf6cb6

2 years agoupgrade-apply-deltafs: Fix compiler warnings 13/282713/3
Antoni Adaszkiewicz [Mon, 10 Oct 2022 14:06:23 +0000 (16:06 +0200)]
upgrade-apply-deltafs: Fix compiler warnings

Change-Id: I6249d461d5f4b7b1c342cebd8dcffe4c30a4511d

2 years agoupgrade-apply-deltafs: Stop opening log file if logs are redirected to stdout and... 08/282708/4
Antoni Adaszkiewicz [Mon, 10 Oct 2022 09:31:13 +0000 (11:31 +0200)]
upgrade-apply-deltafs: Stop opening log file if logs are redirected to stdout and assume current directory as log directory for host

Change-Id: Iae411e68719b977e6941232b2f2c87b3ada552f1

2 years agoupgrade-apply-deltafs: Add possibility to build this binary on host by adding a cmake... 20/282620/7
Antoni Adaszkiewicz [Thu, 6 Oct 2022 12:35:50 +0000 (14:35 +0200)]
upgrade-apply-deltafs: Add possibility to build this binary on host by adding a cmake file

Change-Id: If634e2c3f8c171ac0f3a07a8d61f0e3723fc7ddf

2 years agoAllow scripts responsible for upgrading to work with upgrade-delta-fs binary 21/282221/2
Antoni Adaszkiewicz [Mon, 26 Sep 2022 13:04:56 +0000 (15:04 +0200)]
Allow scripts responsible for upgrading to work with upgrade-delta-fs binary

Change-Id: I1dfe8f4cb9a9739c18e05cdb988ebe45ef0aaa86

2 years agoupgrade-apply-deltafs: Rewrite code responsible for reading archive files (deltas... 94/281294/6
Antoni Adaszkiewicz [Thu, 8 Sep 2022 09:45:04 +0000 (11:45 +0200)]
upgrade-apply-deltafs: Rewrite code responsible for reading archive files (deltas in tar format) in
order to speed up patch application and to allow gziped archives

Changes include:
- removing the requirement for archives to be named "delta*"
- adding support for archives with .tar.gz and .tgz file extensions
- using libtar to read archives
- reducing the amount of times the archive is read
- dropping legacy code along the way

Change-Id: Ibbce6a7c36b5520dab21b113200113c48a6b2058

2 years agoupgrade-apply-deltafs: Change path handling to work with relative pathnames and remov... 95/280995/5
Antoni Adaszkiewicz [Tue, 6 Sep 2022 14:26:35 +0000 (16:26 +0200)]
upgrade-apply-deltafs: Change path handling to work with relative pathnames and remove the need
to mount upgraded partition on /run/upgrade-sysroot

Change-Id: Ifdb6c8a4d336fc7375f2a47409abd43d60be9997

2 years agoupgrade-apply-deltafs: Drop legacy code 50/280650/7
Antoni Adaszkiewicz [Thu, 1 Sep 2022 13:36:01 +0000 (15:36 +0200)]
upgrade-apply-deltafs: Drop legacy code

Change-Id: I92f09fe0eaf2556db36ebda7c0d9308f7c13fdee

2 years agoupgrade-apply-deltafs: Redirect logs to stdout 48/280648/7
Antoni Adaszkiewicz [Thu, 1 Sep 2022 12:28:56 +0000 (14:28 +0200)]
upgrade-apply-deltafs: Redirect logs to stdout

Change-Id: I3df168efd1d8a645bfd7f9c391e9b7d0987cf23e

2 years agoRename delta-ua directory to upgrade-apply-deltafs and delta.ua binary to upgrade... 35/280635/3
Antoni Adaszkiewicz [Thu, 1 Sep 2022 11:28:55 +0000 (13:28 +0200)]
Rename delta-ua directory to upgrade-apply-deltafs and delta.ua binary to upgrade-apply-deltafs

Change-Id: I0f7ad405d7a2cbc055fbd1649597c2f46fc52e9c

2 years agoAdd delta.ua - a binary to apply an upgrade of DELTA_FS type. 80/280480/6
Antoni Adaszkiewicz [Mon, 29 Aug 2022 15:21:28 +0000 (17:21 +0200)]
Add delta.ua - a binary to apply an upgrade of DELTA_FS type.

The binary is build with code previously from tota-ua and libtota, although some
changes were made. They include: changes to make delta.ua a command line tool
(reading given parameters instead of reading config files), changes to make delta.ua a tool
only applying the deltas and only applying them for one partition, adding support for handling
hardlinks (previously in cases where harlinks were present in a delta, upgrade wasn't guaranteed
to be successsful), removing code/files unused for update types other than DELTA_FS
and other more minor changes (e.g. removing unused functions)

Change-Id: Ice1e272a553abb5ebae4230eaffe82afc931b204

2 years agoAdd files from libtota and tota-ua, necessary for easier review of the next commit. 79/280479/3
Antoni Adaszkiewicz [Tue, 30 Aug 2022 15:21:01 +0000 (17:21 +0200)]
Add files from libtota and tota-ua, necessary for easier review of the next commit.
The code is imported from following:
-> platform/core/system/libtota, SHA1: d36348f
(ss_bsdiff: Change the search function)
-> platform/core/system/tota-ua, SHA1: 681435d
(Fix fprintf format warning)

Change-Id: I783799ed335f03bc69c287f6d85092b6dbff9b21

2 years agoRemove support for non-A/B upgrade 38/280838/3 accepted/tizen/unified/20221102.172725
Mateusz Moscicki [Mon, 5 Sep 2022 12:11:54 +0000 (14:11 +0200)]
Remove support for non-A/B upgrade

Change-Id: I67bb1f3a27aea2af495bb584d8044035fbc73bb9

2 years agoRename spec and package(s) to match repository name 53/280453/1 accepted/tizen_7.0_unified_hotfix tizen_7.0_hotfix accepted/tizen/7.0/unified/20221110.063322 accepted/tizen/7.0/unified/hotfix/20221116.105834 accepted/tizen/unified/20220831.023208 accepted/tizen/unified/20220901.021441 submit/tizen/20220830.134509 tizen_7.0_m2_release
Karol Lewandowski [Tue, 30 Aug 2022 08:23:49 +0000 (10:23 +0200)]
Rename spec and package(s) to match repository name

Change-Id: Id011a220bba07c9042fd59bd0bb61f009e6d0ea7

2 years agoImport system-rw-upgrade 55/280155/1
Karol Lewandowski [Wed, 24 Aug 2022 09:29:52 +0000 (11:29 +0200)]
Import system-rw-upgrade

This commit imports system-rw-upgrade from commit fbb4ba4cf ("Add critical log where upgrade
status is changing").

Following changes were made with repect to original repository:

 - move scripts and unit files under scripts/rw-upgrade

 - move logic behind installing scripts and unit files to scripts/rw-upgrade/CMakeLists.txt

 - depend only on UPGRADE_ variables

 - integrate build into new spec

Change-Id: I305fe67d2ac32df7d2b9d05b51b67a1fb808a68b

2 years agoImport tota-ua 92/280092/4
Karol Lewandowski [Tue, 23 Aug 2022 12:19:07 +0000 (14:19 +0200)]
Import tota-ua

This commit imports tota-ua from commit a0c2c06cf ("Add return 0
to log functions to prevent unexpected failure").

Following changes were made with repect to original tota-ua repository:

 - naming is adjusted (tota-ua -> upgrade/upgrade-engine)

 - delta.ua is dropped along with libtota depencency
   (currently it brings only unsupported and faulty delta_fs
   upgrade type)

 - actual programs are moved to src/ subdir, scripts moved to scripts/

 - CMakeFiles.txt are considerably simplified, dropping most of the
   duplication

Change-Id: If7da44c748e3e25b4519022fb292088ed8cbdcc0

2 years agoInitial empty repository master
Tizen Infrastructure [Tue, 26 Jul 2022 01:57:11 +0000 (01:57 +0000)]
Initial empty repository