platform/core/system/upgrade.git
8 months agoblkid-print: handle /dev/vdX devices 19/317919/3 accepted/tizen_unified_toolchain accepted/tizen/9.0/unified/20241030.235817 accepted/tizen/unified/20241001.004059 accepted/tizen/unified/toolchain/20241004.101806 accepted/tizen/unified/x/20241001.153935 accepted/tizen/unified/x/asan/20241014.000141 tizen_9.0_m2_release
Jacek Kryszyn [Tue, 10 Sep 2024 05:00:04 +0000 (07:00 +0200)]
blkid-print: handle /dev/vdX devices

In QEMU virtual disks are named /dev/vdX. blkid-print
would put "p" letter between "vdX" and the number of
a device. This change fixes the issue.

Change-Id: I523ce5837f3c2ca727ad41875a51cde3fe872fa4

9 months agoMerge "Refactor code to improve the SAM score" into tizen
Mateusz Mościcki [Wed, 14 Aug 2024 11:44:00 +0000 (11:44 +0000)]
Merge "Refactor code to improve the SAM score" into tizen

9 months agoFix clone_partitions not performing cloning in online upgrade 05/316105/3 accepted/tizen_unified_dev accepted/tizen/unified/20240819.150116 accepted/tizen/unified/dev/20240821.053453 accepted/tizen/unified/x/20240820.013144
Adam Michalski [Tue, 13 Aug 2024 13:41:18 +0000 (15:41 +0200)]
Fix clone_partitions not performing cloning in online upgrade

In order for the upgrade state to be completed, upgrade_progress_status
must be equal to 100. Previously this value was set by the
online-update-success service, but this service is executed after the
upgrade-manager service. As a result, the upgrade state is never
switched from "ready" to "completed" preventing clone_partitions from
taking its job.

The solution is to take over the responsibility for setting the upgrade
progress status by the update.sh script instead of the
online-update-success.sh (which is executed from online-update-success
service). This way handling of the progress becomes unified regardless
of the upgrade type.

Change-Id: I1d599251986dac7a378a44545e8dcce285ccab89

9 months agoRefactor code to improve the SAM score 07/316107/2
Mateusz Moscicki [Tue, 13 Aug 2024 14:00:28 +0000 (16:00 +0200)]
Refactor code to improve the SAM score

Change-Id: I2a1a27e67d761e67a4881294580a1fe8ad1bd710

10 months agoSeparate ISU data migration part from system RW-upgrade script 51/314951/2 accepted/tizen/unified/20240807.010724 accepted/tizen/unified/dev/20240807.093029 accepted/tizen/unified/toolchain/20240812.133118 accepted/tizen/unified/x/20240807.014257 accepted/tizen/unified/x/asan/20240813.231407
Adam Michalski [Tue, 23 Jul 2024 11:50:57 +0000 (13:50 +0200)]
Separate ISU data migration part from system RW-upgrade script

This commit is the first in the pair of commits that are going to
move ISU data migration part from the main OS-Upgrade script to
the component RW-upgrade scripts (/usr/share/upgrade/scripts/).

Change-Id: I400e03e12a800c984efee01544083ba2248851ac

10 months agoupgrade-apply-deltafs: Remove unused function and sensitive data 75/315275/3 accepted/tizen/unified/20240731.160154 accepted/tizen/unified/dev/20240805.054509 accepted/tizen/unified/x/20240801.044233
SangYoun Kwak [Mon, 29 Jul 2024 09:12:42 +0000 (18:12 +0900)]
upgrade-apply-deltafs: Remove unused function and sensitive data

The function SS_FSAvailiableFreeSpace is not used anywhere so it can be
removed. Also this function prints f_bfree, which is a sensitive value
from statfs so it is removed too.

Another sensitive data from statfs f_bavail is printed as a log, this
log is also removed.

Change-Id: Ic95f76742c95d19bf2146d6bbb45c8372ef10d7c
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
10 months agoupgrade-apply: Fix to check return value properly 52/315252/2
SangYoun Kwak [Mon, 29 Jul 2024 06:06:05 +0000 (15:06 +0900)]
upgrade-apply: Fix to check return value properly

tar_block_read() function can return negative integer and it should be
handled properly. In the previous code, only '-1' and '0' cases are
handled but no negative values less than '-1'.

To fix this issue, negative values less than '-1' is also handled.

Change-Id: Ib3fd0478b008cbe298694ccc10ddf66cfbb7604e
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
10 months agoclone_partition: Modify background clone conditions 61/314861/1
SangYoun Kwak [Mon, 22 Jul 2024 06:48:15 +0000 (15:48 +0900)]
clone_partition: Modify background clone conditions

Previously, to determine whether clone or not, checking bootmode was
sufficient.

Since the online upgrade feature is supported and it boots with bootmode
fota.

Thus, to determine if it is safe to clone or not, conditions below are
going to be checked:
 * upgrade state is "completed"
 * (bootmode is normal)
   or
   (bootmode is fota and upgrade type is online)

Also, due to it checks the upgrade state, clone_partition.service has to
wait the update-manager.service to be started since it changes the
upgrade state.

Change-Id: I103a39dbe12d4cfab2f4844206b9341c3323f793
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
10 months agoclone_partitions: Separate clone actions into functions 60/314860/1
SangYoun Kwak [Mon, 22 Jul 2024 05:55:05 +0000 (14:55 +0900)]
clone_partitions: Separate clone actions into functions

To increase the readability and remove duplicated codes, codes for
cloning actions are separated as functions.

Change-Id: Icad1d3a1d1bbaafab7cf2ac30509aeb9321ce29a
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
10 months agocopy-blockdev: Modify to use strerror_r instead of %m 37/314837/1 accepted/tizen/unified/20240723.034810 accepted/tizen/unified/dev/20240724.110049 accepted/tizen/unified/x/20240723.090010
SangYoun Kwak [Mon, 22 Jul 2024 02:47:56 +0000 (11:47 +0900)]
copy-blockdev: Modify to use strerror_r instead of %m

'%m' formatting is an glibc extension, it can be not-supported according
to the build environment. It is not supported in VD environment, so it
is replaced with strerror_r.

Change-Id: I3bb8b458b3b7f47e36d9e6c22d9b03e946aab30f
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
10 months agocopy-blockdev: Modify to use %m format instead of strerror 11/314711/1 accepted/tizen/unified/20240719.080556 accepted/tizen/unified/dev/20240722.073436 accepted/tizen/unified/x/20240719.092008 accepted/tizen/unified/x/20240719.131400
SangYoun Kwak [Thu, 18 Jul 2024 04:06:20 +0000 (13:06 +0900)]
copy-blockdev: Modify to use %m format instead of strerror

strerror() is not guaranteed as thread-safe. To solve this issue, errno
is set as the return value of posix_fadvise and print it with "%m"
format if it is not zero.

This will solve SVACE issue with WGID 226619.

Change-Id: I53aa630c50ba31ed925acff0a57414b972e1a25b
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
10 months agocopy-blockdev: Fix to handle error case first 33/314633/3 accepted/tizen/unified/20240718.143635 accepted/tizen/unified/x/20240719.012643
SangYoun Kwak [Tue, 16 Jul 2024 11:47:02 +0000 (20:47 +0900)]
copy-blockdev: Fix to handle error case first

The previous code works ok but it can be lead to the reader
misunderstand its behavior.
To make it clear that error case is handled, some codes are rearranged.
Also, to clarify the error handling and flow of the code, switch
statement is replaced to if statement.

Change-Id: I65de34aab245c20ba3b6869cea1931edf99594d5
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
10 months agocopy-blockdev: Add to print log if posix_fadvise is failed 32/314632/1
SangYoun Kwak [Tue, 16 Jul 2024 10:58:31 +0000 (19:58 +0900)]
copy-blockdev: Add to print log if posix_fadvise is failed

posix_fadvise() returns non-zero value(error number) if fails.
To make debug easier, log message is added if it returns non-zero value.

Change-Id: I5436897f11a7cd6a98210df7a53f16f427b2f034
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
11 months agoFix SVACE issue. 84/313984/1
Adam Michalski [Wed, 3 Jul 2024 14:53:09 +0000 (16:53 +0200)]
Fix SVACE issue.

Reference WGID #220706.

Change-Id: I9c2f5f7a1811a6c4690d0eef4a111f4dc2cdc9b9

11 months agoupgrade-apply: Fix different signedness comparison 40/313540/1 accepted/tizen/unified/20240628.172829 accepted/tizen/unified/dev/20240701.072914 accepted/tizen/unified/x/20240701.021458
Mateusz Moscicki [Thu, 27 Jun 2024 12:35:20 +0000 (14:35 +0200)]
upgrade-apply: Fix different signedness comparison

Change-Id: I6612a640eb3376e6d1860b17b32bfb8055b56849

12 months agoModify "upgrade status" to "upgrade progress status" 83/312283/5 accepted/tizen/unified/20240614.084902 accepted/tizen/unified/dev/20240620.005825 accepted/tizen/unified/toolchain/20240624.121502 accepted/tizen/unified/x/20240614.160439 accepted/tizen/unified/x/asan/20240625.092523
SangYoun Kwak [Wed, 5 Jun 2024 11:10:46 +0000 (20:10 +0900)]
Modify "upgrade status" to "upgrade progress status"

The commands and api functions about 'get/set upgrade status' are
changed to 'upgrade progress status like below:

 * device_board_get_upgrade_status
   -> device_board_get_upgrade_progress_status

 * device_board_set_upgrade_status
   -> device_board_set_upgrade_progress_status

 * hal_device_board_get_upgrade_status
   -> hal_device_board_get_upgrade_progress_status

 * hal_device_board_set_upgrade_status
   -> hal_device_board_set_upgrade_progress_status

Thus, the corresponding scripts and source files should be modified too.

Change-Id: Ifc32791c5d04c2ce44e61fd69a36cd710d2af257
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
12 months agoupgrade-apply-deltafs: Change hal-device-board module inclusion path 26/312426/2
Yunhee Seo [Mon, 10 Jun 2024 04:56:51 +0000 (13:56 +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: Ic874c84bd752c0f6cabfc1ca2f9e6ee67804c438
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
12 months agoupgrade-apply: Fix print format for uint64_t 13/312513/1 accepted/tizen/unified/20240611.162844 accepted/tizen/unified/20240612.160703 accepted/tizen/unified/x/20240612.025935
SangYoun Kwak [Tue, 11 Jun 2024 04:28:02 +0000 (13:28 +0900)]
upgrade-apply: Fix print format for uint64_t

The printf format for uint64_t was "%ld", so it is fixed with "PRIu64",
which can be used for uint64_t portably.

Change-Id: I2f62f30b5b3ae44eb5feb38d07f37f2050814bb0
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
12 months agoChange the way Online Upgrade works. 47/311147/9 accepted/tizen/unified/20240611.122417
Mateusz Moscicki [Tue, 14 May 2024 15:00:15 +0000 (17:00 +0200)]
Change the way Online Upgrade works.

The Online Upgrade runs old offline-upgrade, and after this
the normal boot (without reboot) is performed.

Change-Id: I84dd183daba33e8060ddf7df4f0b25358e2c0d46

12 months agoAllow for up to two deltas to be given to upgrade scripts. 73/311573/8
Antoni [Tue, 21 May 2024 14:13:52 +0000 (16:13 +0200)]
Allow for up to two deltas to be given to upgrade scripts.

If a single delta is provided, it has to be either delta-platform or
regular delta. The second delta is optional, and it has to be
delta-boot. The script does not check the type of deltas, it is up
to the script user.

Change-Id: Ia112cc2f95e41a06a337dc0a3a504ab953436208

12 months agoChange the smack label for data-checkpoint.service 62/311162/3 accepted/tizen/unified/20240606.161520
Mateusz Moscicki [Wed, 15 May 2024 11:21:11 +0000 (13:21 +0200)]
Change the smack label for data-checkpoint.service

The service needs a higher permission to set a proper smack label "_" on
the target directory ("/opt").

Change-Id: Ifab76559dd0b3b0d930f164f492c56aa52d9afd5

12 months agoAdd ability to do checkpoint in init 16/310916/4
Mateusz Moscicki [Wed, 8 May 2024 16:18:46 +0000 (18:18 +0200)]
Add ability to do checkpoint in init

The system-data partition should be mounted before system starts to
boot, due to the configuration files that may reside on it.
Therefore, the script that created checkpoints needed to be modified so
that it could be run from both - systemd service and init.

Change-Id: I6a46c420de1ddc6c7e3ece02f58e132b792a3e47

12 months agoMerge "Report upgrade progress for DELTA_IMAGE type deltas" into tizen
Mateusz Mościcki [Tue, 4 Jun 2024 13:09:28 +0000 (13:09 +0000)]
Merge "Report upgrade progress for DELTA_IMAGE type deltas" into tizen

12 months agoMerge "Exit with new code when trying to finish before RO update completes" into...
Mateusz Mościcki [Tue, 4 Jun 2024 13:09:08 +0000 (13:09 +0000)]
Merge "Exit with new code when trying to finish before RO update completes" into tizen

12 months agoAdd ISU rpk package removal during OS Upgrade 12/309512/9
Adam Michalski [Thu, 11 Apr 2024 14:15:27 +0000 (16:15 +0200)]
Add ISU rpk package removal during OS Upgrade

Removal of the ISU packages from /opt/isu has already been done, but
in addition to that removing files from /opt/usr/globalapps needs to
be done as well.

Change-Id: I10c751fbae0693a1f1510e27ab71151893918d41

12 months agoReport upgrade progress for DELTA_IMAGE type deltas 86/309186/4
Antoni [Thu, 4 Apr 2024 11:23:09 +0000 (13:23 +0200)]
Report upgrade progress for DELTA_IMAGE type deltas

This requires a new file (update-progress-info.ini) in archive.

Change-Id: I8108bb69a1fd0e2bb41548c1003218f99df6b829

12 months agoExit with new code when trying to finish before RO update completes 43/311343/4
Antoni [Fri, 17 May 2024 10:54:08 +0000 (12:54 +0200)]
Exit with new code when trying to finish before RO update completes

Change-Id: Id1ef08ccb72b6b3b9a1eed7b4bde6df3fe53c268

13 months agoShow progress of copying 48/310248/5
Jacek Kryszyn [Tue, 23 Apr 2024 12:13:24 +0000 (14:13 +0200)]
Show progress of copying

Use copy-blockdev to show progress of partitions copying
as well as update status during upgrade.

Change-Id: I4fe531a59e99396bcc658a67cc730279deb75b4e

13 months agoAdd copy-blockdev tool 60/309960/7
Jacek Kryszyn [Mon, 8 Apr 2024 08:44:30 +0000 (10:44 +0200)]
Add copy-blockdev tool

copy-blockdev is a tool which copies one block device
to another (just like head -c $src > $dst or dd) but
it is also able to modify status of upgrade during
copying and to wcheck sha1 hash of both files after the
operation. It will be used during partitions cloning
during upggrade.

Change-Id: I53ece0156bc68181173a87b7ca58ef5810d09493

13 months agoRemove always false condition 91/310691/1 accepted/tizen/unified/20240508.124547 accepted/tizen/unified/20240508.150734 accepted/tizen/unified/20240509.124613 accepted/tizen/unified/toolchain/20240513.061321 accepted/tizen/unified/x/20240509.044727
Youngjae Cho [Tue, 7 May 2024 00:32:04 +0000 (09:32 +0900)]
Remove always false condition

(size_t)dest_size > SIZE_MAX is always false.

Change-Id: Iaefc4b21be4a42b0881f2245b525dc30df7d02c1
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
13 months agoFix error -Werror=sign-compare 43/310443/2 accepted/tizen/unified/20240502.044634 accepted/tizen/unified/toolchain/20240507.011902 accepted/tizen/unified/x/20240503.091141 accepted/tizen/unified/x/20240508.055413
Youngjae Cho [Mon, 29 Apr 2024 06:32:34 +0000 (15:32 +0900)]
Fix error -Werror=sign-compare

Change-Id: Iba8b94f3eaa7cbc9fa8357cb540001e4669fbad3
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
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>
15 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

17 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