platform/core/system/tota-ua.git
2 years agoMount rootfs as read-only 84/270884/3
Mateusz Moscicki [Thu, 3 Feb 2022 12:17:04 +0000 (13:17 +0100)]
Mount rootfs as read-only

Change-Id: I5663fac73d62888cdb284dfa88e869d5cb651c7d

2 years agoFix "use after free" 20/270420/4
Mateusz Moscicki [Tue, 1 Feb 2022 12:37:13 +0000 (13:37 +0100)]
Fix "use after free"

Change-Id: I832770abb9ad0dbdee65fe14883c31cd317ed73d

2 years agoEnable static linking to libtota 19/270419/3
Mateusz Moscicki [Tue, 18 Jan 2022 14:07:20 +0000 (15:07 +0100)]
Enable static linking to libtota

delta.ua is provided in the delta.tar file to perform the system
upgrade. When linked dynamically it calls functions from libtota that
are on the old system, while we would like to use the new version.

Change-Id: Ifaf889ac498886eab3310edbf250d99c22cb8bd1

2 years agoAdd support for DELTA_IMG_AB update type 18/270418/3
Mateusz Moscicki [Thu, 27 Jan 2022 13:00:07 +0000 (14:00 +0100)]
Add support for DELTA_IMG_AB update type

Add new partition upgrade type - DELTA_IMG_AB
A patch is a binary diff between two partition that is compressed with
the Brotli algorithm.
Brotli has a good compression ratio and allows decompression using a
small amount of memory (during tests, it did not exceed 17MB).

Change-Id: I467eb1bfefa2ffb1866515c1f18aeb21e710ebd1

2 years agoAdd support for the case that rootfs is a device mapped by DM 17/270417/2
Mateusz Moscicki [Tue, 1 Feb 2022 12:10:59 +0000 (13:10 +0100)]
Add support for the case that rootfs is a device mapped by DM

Change-Id: I074e72c9fad9289d059e81bd0801f7f26460aa64

2 years agoMerge branch 'tizen' into tizen_6.5 accepted/tizen/6.5/unified/20211231.161241 submit/tizen_6.5/20211229.171734
Karol Lewandowski [Thu, 30 Dec 2021 13:11:24 +0000 (14:11 +0100)]
Merge branch 'tizen' into tizen_6.5

Change-Id: Ib040e970ecd05893f67253b8134fcff067ec29c2

2 years agoRevert "Ensure required 'A/B partition switch' program is available" accepted/tizen/unified/20211231.161330 submit/tizen/20211230.132434
Karol Lewandowski [Thu, 30 Dec 2021 13:08:59 +0000 (14:08 +0100)]
Revert "Ensure required 'A/B partition switch' program is available"

This reverts commit e4e165e7be32be63403e5306b73f0711423e5d8b, as
* the program is not universally available,
* it should not be needed when legacy upgrade is used.

Change-Id: I21d8adc31f64bb71989665e826676ba1a70caae1

2 years agoMerge branch 'tizen' into tizen_6.5 54/268554/2
Mateusz Moscicki [Wed, 29 Dec 2021 13:12:32 +0000 (14:12 +0100)]
Merge branch 'tizen' into tizen_6.5

Change-Id: I9b33cafba04a2ad4cdab903226e590000d22d423

2 years agoEnsure required 'A/B partition switch' program is available 56/268556/1
Karol Lewandowski [Fri, 24 Dec 2021 13:51:30 +0000 (14:51 +0100)]
Ensure required 'A/B partition switch' program is available

Change-Id: Idfd9b899830419581964d3b5e01a284e34b7c5c8

2 years agoReflect the change from partition_switch to device_board_switch_partition 53/268553/1
Mateusz Moscicki [Fri, 24 Dec 2021 10:52:28 +0000 (11:52 +0100)]
Reflect the change from partition_switch to device_board_switch_partition

Change-Id: I042a9468b9e3e36a68a6792c38e9fd67a596f7d5

2 years agoMerge branch 'tizen' into tizen_6.5 73/267773/1 accepted/tizen/6.5/unified/20211212.212847 submit/tizen_6.5/20211209.154403
Mateusz Moscicki [Thu, 9 Dec 2021 14:00:26 +0000 (15:00 +0100)]
Merge branch 'tizen' into tizen_6.5

Change-Id: I23bdab528b12fe242a8b06fd42ebc3386777a2ab

2 years agoUse /run/upgrade-sysroot instead of /system 79/267679/2 accepted/tizen/unified/20211213.133531 submit/tizen/20211209.154145
Mateusz Moscicki [Tue, 7 Dec 2021 11:38:06 +0000 (12:38 +0100)]
Use /run/upgrade-sysroot instead of /system

Change-Id: I1b781134eafc29b07d0e6410407c665e3bd911df

2 years agoUse PARTLABEL based on LABEL from update.cfg and /hal/etc/upgrade/label_map.list 28/267528/2
Mateusz Moscicki [Mon, 6 Dec 2021 16:44:30 +0000 (17:44 +0100)]
Use PARTLABEL based on LABEL from update.cfg and /hal/etc/upgrade/label_map.list

Change-Id: I25edbad79770baa298bd0f404e9ba0d1acc08eb3

2 years agoCopy partitions listed in the /hal/etc/upgrade/background_copy.list 27/267527/1
Mateusz Moscicki [Mon, 6 Dec 2021 16:40:50 +0000 (17:40 +0100)]
Copy partitions listed in the /hal/etc/upgrade/background_copy.list

Change-Id: I283ad7e6de2997ecdfb17c44096eb5c57380e50f

2 years agoUse partition_switch to change the partition slot 24/267524/1
Mateusz Moscicki [Mon, 6 Dec 2021 16:10:16 +0000 (17:10 +0100)]
Use partition_switch to change the partition slot

Change-Id: I3e4c995190d62838e1c4cff464e831d9376710f4

2 years agoMerge branch 'tizen' into tizen_6.5 65/267265/1 accepted/tizen/6.5/unified/20211201.221725 submit/tizen_6.5/20211130.134151
Karol Lewandowski [Tue, 30 Nov 2021 13:34:17 +0000 (14:34 +0100)]
Merge branch 'tizen' into tizen_6.5

Change-Id: I6b199ffe055027b8cb119e27a3856e492250a84b

2 years agoSupport ro update during normal boot in delta.ua: 31/265631/15 accepted/tizen/unified/20211203.125407 submit/tizen/20211130.134324 submit/tizen/20211202.130243
Ernest Borowski [Mon, 25 Oct 2021 16:19:35 +0000 (16:19 +0000)]
Support ro update during normal boot in delta.ua:

1. Allow to use GPT partition labels rather than hardcoded partitions.
2. Allow to use specified block device rather than hardcoded one.
3. Add usage function.
4. Add function that translates errors into usable form for end user.
5. Add support for a|b slot partition scheme.
6. Fix bug when logging file was not opened before usage.
7. Change log file path from /last_update.log to
   /opt/data/update/last_update.log
8. Do not disable stdout && stderr

Add blkid-print application that is used to determine partition name
based on GPT LABEL.

Change-Id: Ifbc5aaa435791d4de91a896b5b34b874cb46fe8d
Signed-off-by: Ernest Borowski <e.borowski@samsung.com>
2 years agoupgrade-trigger.sh: Add support for launching A|B upgrade. 30/265630/11
Ernest Borowski [Mon, 25 Oct 2021 14:09:10 +0000 (14:09 +0000)]
upgrade-trigger.sh: Add support for launching A|B upgrade.

This mode has different functionality therefore there are other scripts
supporting it.

When upgrade-trigger.sh detects that system uses A|B partition scheme
it executes new upgrade type using 3 stages:
1. upgrade-prepare-partitions.sh -- it is responsible for backing up
   partitions from current slot to next one
2. upgrade-partial.sh -- it is responsible for upgrading partitions
   on next slot using dd and delta.ua
3. upgrade-fota.sh -- it is responsible for finishing upgrade
   and rebooting device into fota RW mode.

Change-Id: I1c8c4fbaf3d2b4817ba7e88690cab316a5cee6e6
Signed-off-by: Ernest Borowski <e.borowski@samsung.com>
2 years agoAdd A|B upgrade support during normal boot mode. 29/265629/10
Ernest Borowski [Mon, 25 Oct 2021 14:05:52 +0000 (14:05 +0000)]
Add A|B upgrade support during normal boot mode.

Change-Id: Ibc9501827ddc1a5d3f1669d97c189ef6e05361b1
Signed-off-by: Ernest Borowski <e.borowski@samsung.com>
2 years agoImprove upgrade-trigger.sh flashing speed. 63/264563/1 accepted/tizen/6.5/unified/20211028.120308 accepted/tizen/unified/20210926.235801 submit/tizen/20210924.144745 submit/tizen_6.5/20211028.162501 tizen_6.5.m2_release
Ernest Borowski [Wed, 22 Sep 2021 10:49:07 +0000 (10:49 +0000)]
Improve upgrade-trigger.sh flashing speed.

Change-Id: I0e9f6d29b1971893f34b773c8343a466a942018e
Signed-off-by: Ernest Borowski <e.borowski@samsung.com>
3 years agoAlways log update progress inside ua. 85/261285/1 accepted/tizen/unified/20210829.234841 submit/tizen/20210817.140154 submit/tizen/20210826.114923 submit/tizen/20210827.084901
Ernest Borowski [Wed, 14 Jul 2021 13:31:09 +0000 (13:31 +0000)]
Always log update progress inside ua.

Progress was not reported during headless upgrade.
This information is required for os-upgrade automatic tests.

Change-Id: Ic2ca02f1d1b92b90329abee516c7d15b6ffd7ca1
Signed-off-by: Ernest Borowski <e.borowski@samsung.com>
3 years agoAllow to use labels in uppercase in update.cfg 14/258914/1 accepted/tizen/unified/20210604.120743 submit/tizen/20210603.041836
Mateusz Moscicki [Thu, 27 May 2021 13:50:16 +0000 (15:50 +0200)]
Allow to use labels in uppercase in update.cfg

This is required to be able to flash the partition with the BOOT label,
which is in upperacse.

Change-Id: Ib018befe9cee4c66bc6ae13708d1cc436ba04f23

3 years agoImprove logging in upgrade-trigger.sh script. 35/258235/3 accepted/tizen/unified/20210526.051953 submit/tizen/20210514.153447
Ernest Borowski [Wed, 12 May 2021 12:42:08 +0000 (12:42 +0000)]
Improve logging in upgrade-trigger.sh script.

- Add log helper function which can log to stdout and file

logging format:
[script-name][tag]actual_log
currently supported tag formats: [Error] [Info]

Change-Id: Iebb727b8ec4a12fca80b03f6b64c472134749020
Signed-off-by: Ernest Borowski <e.borowski@samsung.com>
3 years agoImprove upgrade-trigger.sh script: 16/257416/5
Ernest Borowski [Fri, 23 Apr 2021 17:05:12 +0000 (17:05 +0000)]
Improve upgrade-trigger.sh script:

- Add support for delta.tar.gz
- Add missing ""
- Add proper error handling
- Remove useless cat

Change-Id: I6fd9e6e611bd9232d5a2ca5f6cf129d644a1e1f5
Signed-off-by: Ernest Borowski <e.borowski@samsung.com>
3 years agoFix invalid parenthesis 81/246781/1 accepted/tizen/unified/20201109.123541 submit/tizen/20201104.064230
Kichan Kwon [Wed, 4 Nov 2020 06:39:52 +0000 (15:39 +0900)]
Fix invalid parenthesis

Change-Id: I8cf55406c5f81bc4816d065ffdc0827dee84cc42
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
3 years agoSet progress to 100% as soon as hash remaking is finished 56/246556/2 submit/tizen/20201104.032152
Kichan Kwon [Fri, 30 Oct 2020 04:58:12 +0000 (13:58 +0900)]
Set progress to 100% as soon as hash remaking is finished

- verity-handler always use 45 seconds though hash is not made
- To prevent this situation, cancel progress thread after
  hash thread is terminated

Change-Id: Ie31f259e0270874128a98c16ae81e1cd7f8d2b81
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
3 years agoUpdate boilerplate 55/246555/2
Kichan Kwon [Thu, 29 Oct 2020 09:36:37 +0000 (18:36 +0900)]
Update boilerplate

Change-Id: I7785ff75af0de67bfa0c69c81a81aa906d6b3f32
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
3 years agoImprove the readability about progress rearrangement 33/246333/1
Kichan Kwon [Wed, 28 Oct 2020 07:36:42 +0000 (16:36 +0900)]
Improve the readability about progress rearrangement

Change-Id: Idd92eccb52614e10b74550f03c6f3d3adda9f645
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
3 years agoFix build warning 52/246152/3
Kichan Kwon [Mon, 26 Oct 2020 02:42:06 +0000 (11:42 +0900)]
Fix build warning

Change-Id: I21adccf31a2fc5a97598520220b5bae776dd189c
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
3 years agoIntroduce verity-handler 46/246146/4
Kichan Kwon [Mon, 26 Oct 2020 02:16:55 +0000 (11:16 +0900)]
Introduce verity-handler

- It launches verityctl and updates progress
- If dm-verity is enabled, initrd-fota will launch it

Change-Id: Ibb82ac06e4c628bbb7c0428ed5c1eefccb9ef041
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
3 years agoReflect dm-verity status to update progress 45/246145/3
Kichan Kwon [Mon, 26 Oct 2020 01:56:56 +0000 (10:56 +0900)]
Reflect dm-verity status to update progress

- With dm-verity : 20 ~ 80%
  - 80 ~ 100% is for hash remaking
- Without dm-verity : 20 ~ 100%

Change-Id: Icf9a65456eb40334f239f12ac407ddee22d7e6a9
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
3 years agoUpdate img-verifier usage 76/245176/1 accepted/tizen_6.0_unified_hotfix tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.113738 accepted/tizen/6.0/unified/hotfix/20201103.001810 accepted/tizen/unified/20201006.044411 submit/tizen/20201005.081807 submit/tizen_6.0/20201029.205105 submit/tizen_6.0_hotfix/20201102.192505 submit/tizen_6.0_hotfix/20201103.114805 tizen_6.0.m2_release
Kichan Kwon [Mon, 5 Oct 2020 06:03:01 +0000 (15:03 +0900)]
Update img-verifier usage

Change-Id: Ida586c4b105ea96ca490e50c7d1f5d30a78e114d
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
3 years agoInput log path instead of macro 80/244780/1 accepted/tizen/unified/20200928.072843 submit/tizen/20200925.063159
Kichan Kwon [Thu, 24 Sep 2020 06:58:33 +0000 (15:58 +0900)]
Input log path instead of macro

- If you want to write log file, input "-l LOG_FILE_PATH"
- In addition, you have to use "-i IMAGE_PATH" option

Change-Id: I9c7802981caa78f794d6d4518db474cbfea0cda5
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
3 years agoRename pre script to setup script 25/244325/1 accepted/tizen/unified/20200921.044220 submit/tizen/20200921.015202
Kichan Kwon [Thu, 17 Sep 2020 08:29:05 +0000 (17:29 +0900)]
Rename pre script to setup script

Change-Id: Iaeaaf005a9760fd9c1edb0ae91a6044f2855c041
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
3 years agoFix build warning 21/244221/2
Kichan Kwon [Wed, 16 Sep 2020 05:50:10 +0000 (14:50 +0900)]
Fix build warning

- Define unless it is defined
- No more depends on the length of the source argument
- Reduce the size of directory path to prevent string truncation

Change-Id: I71e102b9c2ce9c78af6f5afb13bc9038fd61bb8c
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
3 years agoClarify argument as file path 00/244200/1 accepted/tizen/unified/20200917.055745 submit/tizen/20200916.024901
Kichan Kwon [Wed, 16 Sep 2020 02:11:24 +0000 (11:11 +0900)]
Clarify argument as file path

Change-Id: I8922ecf13b8791c28bb5102ee4e4a4e5844ca612
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
3 years agoHash delta in block to prevent storing whole delta 99/244199/1
Kichan Kwon [Wed, 16 Sep 2020 01:59:15 +0000 (10:59 +0900)]
Hash delta in block to prevent storing whole delta

Change-Id: I0d368db79d9a5be47d28a836ff9e9534d48a72ff
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
3 years agoUse right stack's function 98/244198/1
Kichan Kwon [Wed, 16 Sep 2020 01:53:50 +0000 (10:53 +0900)]
Use right stack's function

Change-Id: I464e305d39020ed4760bd2a980c4c328c38ead7c
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
3 years agoVersion up : 1.2.9 45/244045/1 accepted/tizen/unified/20200914.131247 submit/tizen/20200914.085602
Kichan Kwon [Mon, 14 Sep 2020 08:54:58 +0000 (17:54 +0900)]
Version up : 1.2.9

Change-Id: I251d385639027c14aca18016e7e814bb3d3abc34
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
3 years agoMerge "Improve the readability of global variables" into tizen
Kwon [Mon, 14 Sep 2020 08:53:59 +0000 (08:53 +0000)]
Merge "Improve the readability of global variables" into tizen

3 years agoMerge "Reject the certificate same with CA" into tizen
Kwon [Mon, 14 Sep 2020 08:53:56 +0000 (08:53 +0000)]
Merge "Reject the certificate same with CA" into tizen

3 years agoImprove the readability of global variables 42/244042/1
Kichan Kwon [Mon, 14 Sep 2020 08:26:41 +0000 (17:26 +0900)]
Improve the readability of global variables

- Declare global variables in one place
- Rename global variables

Change-Id: I8ab81482e56263c568cd5b18dec2a628c3a200a8
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
3 years agoReject the certificate same with CA 05/244005/1
Kichan Kwon [Fri, 11 Sep 2020 07:56:26 +0000 (16:56 +0900)]
Reject the certificate same with CA

- Security team guide : do not sign image same with CA

Change-Id: Ie18115fb29b0224838f357b1c3b05f44e4ad0b74
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
3 years agoAdd return code when reboot failed 90/242990/1 accepted/tizen/unified/20200909.155616 submit/tizen/20200907.025654
Jeon Sang-Heon [Wed, 2 Sep 2020 17:51:48 +0000 (17:51 +0000)]
Add return code when reboot failed

- With local update, trigger script will be executed with system_fw
- So /sbin/reboot will be failed
- If reboot fota failed, return 100

Change-Id: I93ad6d25aa9d63a94d3ced4dc1428ba2a572623b
Signed-off-by: Jeon Sang-Heon <sh95.jeon@samsung.com>
3 years agoCopy img-verifier root CA to ramdisk-recovery 79/242579/2 accepted/tizen/unified/20200828.121420 submit/tizen/20200828.071117
Kichan Kwon [Fri, 28 Aug 2020 05:18:55 +0000 (14:18 +0900)]
Copy img-verifier root CA to ramdisk-recovery

Change-Id: I7fe259b8f73870517cd06a16a5e2ae49238bee6b
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
3 years agoVerify image with all root CAs 88/242088/2 submit/tizen/20200826.021327 submit/tizen/20200826.021413
Kichan Kwon [Mon, 24 Aug 2020 05:58:49 +0000 (14:58 +0900)]
Verify image with all root CAs

- Each signer can use their own root CA
- Root CA dir : TZ_SYS_RO_CA_DIR/img-verifier
  - TZ_SYS_RO_CA_DIR is defined in ca-certificates

Change-Id: I4175957a24851af242836b96b6e7d4ac76cb8f77
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
3 years agoRename upg-verifier to img-verifier 87/242087/2
Kichan Kwon [Mon, 24 Aug 2020 05:38:09 +0000 (14:38 +0900)]
Rename upg-verifier to img-verifier

- Verifier is no more only for TOTA
  - System-recovery also use it

Change-Id: I2f188c6bb1782507581ac8efddff4e5313e47099
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
4 years agoDefine the prefix of error code 24/237824/1 accepted/tizen/unified/20200713.094514 submit/tizen/20200706.142233 submit/tizen/20200706.154131 submit/tizen/20200710.163409
Kichan Kwon [Mon, 6 Jul 2020 02:50:46 +0000 (11:50 +0900)]
Define the prefix of error code

- To check where this error occurs

Change-Id: Icd441b852aeb3e87762071b2c11cb3aaa131def3
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
4 years agoAdd libtota library to WITHLIB 38/236338/2 accepted/tizen/unified/20200624.130214 submit/tizen/20200623.165859
Jeon Sang-Heon [Tue, 16 Jun 2020 18:18:51 +0000 (03:18 +0900)]
Add libtota library to WITHLIB

Change-Id: I09f25b333a8da8cfecd3eff0c0565c2f0f40c77f
Signed-off-by: Jeon Sang-Heon <sh95.jeon@samsung.com>
4 years agoFix lib path to support 64bit 10/236310/2 accepted/tizen/unified/20200616.170851 submit/tizen/20200616.181039
Jeon Sang-Heon [Tue, 16 Jun 2020 15:36:44 +0000 (00:36 +0900)]
Fix lib path to support 64bit

- Change hardcode lib path(/usr/lib) to rpm lib macro({_libdir})

Change-Id: I6ff3f1cda446c6c0fde74e7c870bb4a64698e04d
Signed-off-by: Jeon Sang-Heon <sh95.jeon@samsung.com>
4 years agoWrite current progress to file by itself 16/235616/6 accepted/tizen/unified/20200616.041013 submit/tizen/20200616.030922
Kichan Kwon [Mon, 8 Jun 2020 02:19:20 +0000 (11:19 +0900)]
Write current progress to file by itself

- To unify with system-rw-update

- Write to socket -> Write to file
- Remove fota-gui-test

Change-Id: I79d26710b171759e40df511a5996a13f6e0e3373
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
4 years agoEnable 64 bit 28/236228/1
Kunhoon Baik [Tue, 16 Jun 2020 01:08:18 +0000 (10:08 +0900)]
Enable 64 bit

Tizen will support 64 bit binary officially.
TOTA-UA will be included to initrd-recovery partition.
Although initrd-recovery partition size is exceeded, TOTA-UA will be applied.

Change-Id: I983e17e0b24b1e520a92f36d404dbcdb5180aae7

4 years agoMake directory for TOTA root CA 61/235661/1
Kichan Kwon [Fri, 5 Jun 2020 07:10:28 +0000 (16:10 +0900)]
Make directory for TOTA root CA

Change-Id: I4909c925a19238f2e61d7c5d5d747ef4c14580a4
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
4 years agoUnify the error checking of open() 89/235589/1
Kichan Kwon [Mon, 8 Jun 2020 02:27:32 +0000 (11:27 +0900)]
Unify the error checking of open()

Change-Id: Id65ea98987c616e5fb481d0410b0a87960709619
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
4 years agoAdd group write permission to tota dir 14/235414/1 accepted/tizen/unified/20200607.214824 submit/tizen/20200605.111029
Jeon Sang-Heon [Thu, 4 Jun 2020 09:27:20 +0000 (18:27 +0900)]
Add group write permission to tota dir

Change-Id: I81343bc291539bae1c6867d69391d26067a1d897
Signed-off-by: Jeon Sang-Heon <sh95.jeon@samsung.com>
4 years agoAdd some comments about upg-verifier for easy understanding 39/235339/1
Kichan Kwon [Thu, 4 Jun 2020 03:36:02 +0000 (12:36 +0900)]
Add some comments about upg-verifier for easy understanding

Change-Id: Id74ee43b3ca8aec60426c68613e0cd875d3ee3a5
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
4 years agoDon't update config file after PRE_UA 32/235132/3
Kichan Kwon [Tue, 2 Jun 2020 05:14:47 +0000 (14:14 +0900)]
Don't update config file after PRE_UA

- upg verification is failed because of manipulation
- Although PRE_UA is remained, tota-ua will skip it

Change-Id: I6ac7ae7e6de207f21b259395bc150336d4f52e15
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
4 years agoDeny signed file without root CA 55/235255/1
Kichan Kwon [Wed, 3 Jun 2020 06:00:47 +0000 (15:00 +0900)]
Deny signed file without root CA

- Signed file + Root CA : try to verify
- Unsigned file + Root CA : deny
- Only signed file : deny
- Only unsigned file : skip

Change-Id: I8a8e8eae0fee75396bd7c16a12027f295d084dcd
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
4 years agoIntroduce package verifier 06/235006/5
Kichan Kwon [Mon, 1 Jun 2020 07:13:57 +0000 (16:13 +0900)]
Introduce package verifier

- Before upgrade, upg-verifier checks whether upg has valid signature

Change-Id: I42cc2306b9582413e40f2166b582533d1c121ef6
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
4 years agoRemove update-helper 52/234952/2 accepted/tizen/unified/20200602.133131 submit/tizen/20200602.081629
Jeon Sang-Heon [Mon, 1 Jun 2020 05:06:59 +0000 (14:06 +0900)]
Remove update-helper

- Remove update-helper
- Give permission to system_fw of tota_dir
- Version up : 1.2.8

Change-Id: I888d52279f754fd004273d71c022dd666639e5f4
Signed-off-by: Jeon Sang-Heon <sh95.jeon@samsung.com>
4 years agoDetach fota_gui 34/234834/1 accepted/tizen/unified/20200602.133210 submit/tizen/20200529.091328 submit/tizen/20200602.005102 submit/tizen/20200602.024041
Kichan Kwon [Fri, 29 May 2020 06:14:25 +0000 (15:14 +0900)]
Detach fota_gui

- It is moved to tota-gui

Change-Id: I76e5d141a93193fdc159c07081510e7c57581e0b
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
4 years agoMove fota_gui_test to the tota-ua package 33/234833/1
Kichan Kwon [Fri, 29 May 2020 05:49:02 +0000 (14:49 +0900)]
Move fota_gui_test to the tota-ua package

- fota_gui_test is independent from wearable GUI

Change-Id: I40091e2bfad138d296a1fede2890350c5e7a6015
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
4 years agoFix coverity issue 42/224642/1 accepted/tizen/unified/20200214.050241 submit/tizen/20200212.071002
Jeon Sang-Heon [Wed, 12 Feb 2020 05:20:06 +0000 (14:20 +0900)]
Fix coverity issue

- make cfg_data to null terminated

Change-Id: I95d762dd21e6ad6e18f5b2a9bf9ba18082d3f332
Signed-off-by: Jeon Sang-Heon <sh95.jeon@samsung.com>
4 years agofix memory leak 29/224329/3
Jeon Sang-Heon [Mon, 10 Feb 2020 01:17:53 +0000 (10:17 +0900)]
fix memory leak

Change-Id: I1dc2e278dac680b5d0d47790a609db645d9c54a6

4 years agoAdd PATH variable to script 32/214232/1 accepted/tizen_5.5_unified accepted/tizen_5.5_unified_mobile_hotfix accepted/tizen_5.5_unified_wearable_hotfix tizen_5.5 tizen_5.5_mobile_hotfix tizen_5.5_tv tizen_5.5_wearable_hotfix accepted/tizen/5.5/unified/20191031.004312 accepted/tizen/5.5/unified/mobile/hotfix/20201027.075916 accepted/tizen/5.5/unified/wearable/hotfix/20201027.110943 accepted/tizen/unified/20191021.094655 submit/tizen/20190927.073457 submit/tizen/20191021.053733 submit/tizen_5.5/20191031.000010 submit/tizen_5.5_mobile_hotfix/20201026.185105 submit/tizen_5.5_wearable_hotfix/20201026.184305 tizen_5.5.m2_release
Jeon Sang-Heon [Thu, 19 Sep 2019 06:22:56 +0000 (15:22 +0900)]
Add PATH variable to script

Fixed security issue in upgrade-trigger.sh

Change-Id: Ic595ea068087c3bfa6aba830e4dfe6c81a3dcab2
Signed-off-by: Jeon Sang-Heon <sh95.jeon@samsung.com>
4 years agoVersion up : 1.2.7 37/212337/1 accepted/tizen/unified/20190821.064545 submit/tizen/20190820.091150
Kichan Kwon [Tue, 20 Aug 2019 09:10:59 +0000 (18:10 +0900)]
Version up : 1.2.7

Change-Id: I38e1ae87bd838da4a0f8b28231c89fe5377c5aa5
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
5 years agoMerge "Migrate to openssl 1.1" into tizen
Kwon [Tue, 16 Jul 2019 06:32:47 +0000 (06:32 +0000)]
Merge "Migrate to openssl 1.1" into tizen

5 years agoAdd Line feed to all log 82/209982/1
Jeon Sang-Heon [Mon, 15 Jul 2019 01:04:32 +0000 (10:04 +0900)]
Add Line feed to all log

Change-Id: I4d75e03ef0465c5d1a5da1763de621d4aea479aa
Signed-off-by: Jeon Sang-Heon <sh95.jeon@samsung.com>
5 years agoMigrate to openssl 1.1 57/209957/1
Dariusz Michaluk [Fri, 12 Jul 2019 13:25:11 +0000 (15:25 +0200)]
Migrate to openssl 1.1

Change-Id: I6e3d7242d219078e6f46837803b325bcd1f6da5b

5 years agoMerge "Delete meaningless configuration" into tizen
Kwon [Fri, 12 Jul 2019 01:54:35 +0000 (01:54 +0000)]
Merge "Delete meaningless configuration" into tizen

5 years agofota_gui : apply HWC(HardWare Composer) 37/209837/2 accepted/tizen/unified/20190712.045702 submit/tizen/20190712.010810
Kichan Kwon [Thu, 11 Jul 2019 11:08:08 +0000 (20:08 +0900)]
fota_gui : apply HWC(HardWare Composer)

- Wearable targets use HWC windows since Tizen 5.5
- Commit via HWC if backend has HWC capability

Change-Id: I444050c369d58d2b7ddc4c96df693803720095fb
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
5 years agoDelete meaningless configuration 35/209535/1
INSUN PYO [Mon, 8 Jul 2019 11:29:01 +0000 (20:29 +0900)]
Delete meaningless configuration

Change-Id: I4699e047dcdb3319c67b59224cf830c9b14af7ad

5 years agoRevert missing TZ_SYS_UPGRADE 66/208766/1 accepted/tizen/unified/20190704.115621 submit/tizen/20190704.062808
Kichan Kwon [Fri, 28 Jun 2019 06:29:50 +0000 (15:29 +0900)]
Revert missing TZ_SYS_UPGRADE

Change-Id: Ia961c75939454831bf4d2569adbccb94174ae12d
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
5 years agoRevert "Apply upgrade path config: TZ_SYS_UPGRADE" 17/202117/1 accepted/tizen/unified/20190326.024534 submit/tizen/20190325.064448
Sunmin Lee [Mon, 18 Mar 2019 06:59:08 +0000 (15:59 +0900)]
Revert "Apply upgrade path config: TZ_SYS_UPGRADE"

This reverts commit 9633446018c18469d167a1cabbf5cfa601140010.

Change-Id: I41bde7ffc24ef34db829c29fd768efbc9b41f361

5 years agoRun Package Verifier at upgrade-trigger.sh 01/189401/1 accepted/tizen_5.0_unified tizen_5.0 accepted/tizen/5.0/unified/20181102.021254 accepted/tizen/unified/20180919.142017 submit/tizen/20180919.023134 submit/tizen/20180919.074116 submit/tizen_5.0/20181101.000004
Sunmin Lee [Mon, 17 Sep 2018 01:36:46 +0000 (10:36 +0900)]
Run Package Verifier at upgrade-trigger.sh

In some cases, the verifier needs to be run at the
upgrade-trigger.sh before enter the upgrade mode.

Change-Id: Ie93c13898ad335b8290491d9a577ffe32ca81f7d
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
5 years agoupdate-helper: New dbus method "get_result" 81/189381/2
Sunmin Lee [Mon, 17 Sep 2018 09:23:35 +0000 (18:23 +0900)]
update-helper: New dbus method "get_result"

Introduce new dbus method to get the result of update.

Change-Id: Ie0e9c476ddb0ce7f89b92b51e710252105ff7853
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
5 years agoIntroduce dbus activation for update-helper 71/188571/3 accepted/tizen/unified/20180914.073313 submit/tizen/20180914.005919
Sunmin Lee [Fri, 10 Aug 2018 00:56:29 +0000 (09:56 +0900)]
Introduce dbus activation for update-helper

Introduce dbus activation for update-helper service
which substitutes previous path activation.

Change-Id: I3b34fff84a009ef46a655433b9121d6dec344c43
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
5 years agoApply upgrade path config: TZ_SYS_UPGRADE 72/186472/1 accepted/tizen/unified/20180810.132557 submit/tizen/20180810.045919
Sunmin Lee [Fri, 27 Apr 2018 05:02:39 +0000 (14:02 +0900)]
Apply upgrade path config: TZ_SYS_UPGRADE

Replace hard coded path with platform config path.

Change-Id: Ia1a4b9074dff75fdd3d4173c84bfabdcc6f7f3dd
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
6 years agoRequire libtota as shared 72/185572/1
Sunmin Lee [Thu, 26 Jul 2018 07:27:52 +0000 (16:27 +0900)]
Require libtota as shared

As a default, make tota-ua (delta.ua) require libtota.so
instead of static one.

Change-Id: I7477e7ad6f2c60cdb1ae45d356a042c43a2534f3
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
6 years agoFix typo 16/177316/2 accepted/tizen/unified/20180427.131028 submit/tizen/20180427.061142
Sunmin Lee [Fri, 27 Apr 2018 05:02:39 +0000 (14:02 +0900)]
Fix typo

Change-Id: I697f4970ca757945568b99c63160210e1167ece0
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
6 years agoPatch for update-helper 74/176274/3 accepted/tizen/unified/20180419.075946 submit/tizen/20180418.090628
Sunmin Lee [Wed, 14 Feb 2018 02:40:56 +0000 (11:40 +0900)]
Patch for update-helper

The update-helper is a system privileged service that:
- executes the TOTA trigger script
- copies the update result to DOWNLOAD.PATH which can be
  accessible by downloader (ex. client)

Change-Id: I9df91e1417ffdb80937d4be9d8af1e80c2e1c6d1
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
6 years agoMerge branch 'tizen_4.0' into tizen 49/172249/1 accepted/tizen/unified/20180315.150803 submit/tizen/20180315.045201
Sunmin Lee [Mon, 12 Mar 2018 07:21:40 +0000 (16:21 +0900)]
Merge branch 'tizen_4.0' into tizen

Change-Id: If978b9a396fd2ca73f3b55f18b04d4a670d774bd

6 years agoChange parameter of SS_Get_last_update_status API 48/171948/2 accepted/tizen/4.0/unified/20180313.061135 submit/tizen_4.0/20180309.065426
sanghyuk Ko [Thu, 7 Dec 2017 05:56:53 +0000 (14:56 +0900)]
Change parameter of SS_Get_last_update_status API

Change-Id: I45ac37992e9cda6d53aeb31c12fb703391177d82

6 years agoTried to update the applied file when second update 47/171947/1
sanghyuk Ko [Mon, 4 Dec 2017 12:54:38 +0000 (21:54 +0900)]
Tried to update the applied file when second update

Files that are applied the patch during the update are skipped during the second update.
Files that are deleted during the update are skipped during the second update.

Change-Id: Icb563c1fc7693287232d52dd38f15d3ccf4115a7

6 years agoMerge branch 'tizen_4.0' into tizen 20/171420/1 accepted/tizen/unified/20180305.062846 submit/tizen/20180305.013316
Sunmin Lee [Fri, 9 Feb 2018 02:19:23 +0000 (11:19 +0900)]
Merge branch 'tizen_4.0' into tizen

Change-Id: I6946fcc963c19c9d53c8bf148717038f678931a5

6 years agoRemove unnecessary package requirement 19/169019/2 accepted/tizen/4.0/unified/20180206.165247 submit/tizen_4.0/20180205.083039
Sunmin Lee [Thu, 1 Feb 2018 07:53:15 +0000 (16:53 +0900)]
Remove unnecessary package requirement

For now, no code of tota-ua requires libsmack.

Change-Id: I7cd40d610df67f445225f74e84c70a108fddc571
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
6 years agoApply new version format 72/166572/1 accepted/tizen/4.0/unified/20180112.071746 submit/tizen_4.0/20180111.075242 tizen_4.0.IoT.p2_release
Sunmin Lee [Thu, 11 Jan 2018 01:22:12 +0000 (10:22 +0900)]
Apply new version format

Tizen version used by RW scripts is changed to
4-digit (ex 4.0.0.0).
And remove the release number because it will not be used.

Change-Id: Icd65ce7c3d9f0535d4d4c3726bbb1eaa78d1bf6d
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
6 years agoRun pre-script before system-update if exist 92/166292/4
Kichan Kwon [Tue, 9 Jan 2018 07:50:54 +0000 (16:50 +0900)]
Run pre-script before system-update if exist

Change-Id: Ia71e239e87dcf28fc586e6397b78edd611993f96
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agoRefer config file when trigger can't find device path 69/166169/1
Kichan Kwon [Mon, 8 Jan 2018 11:00:37 +0000 (20:00 +0900)]
Refer config file when trigger can't find device path

Change-Id: Idd5b34c0682dd34c53c18f8bb4dd5b2399e873fc
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agoMigrate UA data structures to libtota 49/164449/1 accepted/tizen/4.0/unified/20171222.062725 submit/tizen_4.0/20171221.050631 submit/tizen_4.0/20171221.093123 submit/tizen_4.0/20171221.103518
Kichan Kwon [Fri, 3 Nov 2017 10:05:30 +0000 (19:05 +0900)]
Migrate UA data structures to libtota

- To prevent error by structure difference
- You can see the ua_types.h in the libtota

- NOTICE : it must be merged along with the libtota patch
  - https://review.tizen.org/gerrit/#/c/158841/

Change-Id: I743da85dcaa8450d266bd50cac9749b0146fd3a7
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agoUse the same path for update 48/164448/1
Sunmin Lee [Fri, 15 Dec 2017 07:22:36 +0000 (16:22 +0900)]
Use the same path for update

Change-Id: Ie6b90ffd6011d0ac9340d44da738ef6c5908fefd
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
6 years agoArrange the error cases 47/164447/1
Sunmin Lee [Fri, 15 Dec 2017 02:46:52 +0000 (11:46 +0900)]
Arrange the error cases

Arrange the error cases of tota-ua
 - Cleanup the unused cases
 - Add catch clause for missing cases

Change-Id: I15f94e9ea936612402eb023e0c05fb69384cef6c
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
6 years agoAdd required package 03/163003/1 accepted/tizen/4.0/unified/20171212.064828 submit/tizen_4.0/20171211.065239
Sunmin Lee [Mon, 4 Dec 2017 07:50:57 +0000 (16:50 +0900)]
Add required package

The "tar command" is required for upgrade-trigger.
Specify this dependency in spec file.

Change-Id: I345535362493cc4e7e5aa9b4adceb44f6238c6c5
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
6 years agoMerge branch 'tizen' into tizen_4.0 13/161213/1 accepted/tizen/4.0/unified/20171128.072911 submit/tizen_4.0/20171128.000957
Sunmin Lee [Wed, 22 Nov 2017 06:18:15 +0000 (15:18 +0900)]
Merge branch 'tizen' into tizen_4.0

- Remove target dependent partition information
- Remove the target dependency for UA and script
- Remove SS_RECOVERYRAMDISK

Change-Id: I3dbc22b09748b3ccaacf1895f149734c3aad2da2
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
6 years agoupgrade-trigger: flash some images preceding update 42/160742/2 accepted/tizen/4.0/unified/20171121.061712 submit/tizen_4.0/20171120.023417
Sunmin Lee [Thu, 2 Nov 2017 09:32:24 +0000 (18:32 +0900)]
upgrade-trigger: flash some images preceding update

A new update type PRE_UA means that the image
would be flashed by upgrade-trigger.
The upgrade trigger was modified to flash the image
according to update type in config file.

Change-Id: Ic8eb33b408f3479bdbbedaab8bde180dab5781da
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
6 years agoRemove SS_RECOVERYRAMDISK 48/158448/3 accepted/tizen/unified/20171108.063440 submit/tizen/20171106.051051
Kichan Kwon [Wed, 1 Nov 2017 05:46:42 +0000 (14:46 +0900)]
Remove SS_RECOVERYRAMDISK

- All targets are using ramdisk-recovery to upgrade

Change-Id: Ib2a95e3bf04c9e8a880f910b5a83ea72f21f0bfd
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agoRemove the target dependency for UA and script 69/158369/3
Kichan Kwon [Tue, 31 Oct 2017 05:52:12 +0000 (14:52 +0900)]
Remove the target dependency for UA and script

- No more need target specific package if GUI is not used
- Component
  - tota-ua : UA, upgrade trigger
  - target_X : GUI (in current, only wearable)

Change-Id: I26167d869a60034b9eb9224622521e6afe99d540
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agoRemove target dependent partition information 32/158032/3
Kichan Kwon [Fri, 27 Oct 2017 05:19:06 +0000 (14:19 +0900)]
Remove target dependent partition information

- To target independent, we remove these below
  - Default partition configuration
  - Partition-dependent error value

- UPG always make config file if successful, so
  UA doesn't have to know it already
- If config file is not found, stop upgrade and return error

- NOTICE : it must be merged along with the libtota patch
  - https://review.tizen.org/gerrit/#/c/158166/

Change-Id: I9ca5665b06cf8066f701016309d6b22712db492c
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agoFlash recovery kernel before update 60/158660/1 accepted/tizen/4.0/unified/20171103.030245 submit/tizen_4.0/20171102.100452
Sunmin Lee [Thu, 2 Nov 2017 09:32:24 +0000 (18:32 +0900)]
Flash recovery kernel before update

In Tizen 3.0, the recovery kernel was not exist, neither.
Therefore it should be flashed in advance like ramdisk, ramdisk-recovery.

Change-Id: I5ad7d9667d18756fc2e7a5202f2b7ad7de30be45
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
6 years agoRelease 1.0.0 34/157634/1 accepted/tizen/unified/20171031.055636 submit/tizen/20171027.093656 submit/tizen/20171027.100102
Sunmin Lee [Wed, 25 Oct 2017 08:16:32 +0000 (17:16 +0900)]
Release 1.0.0

tota-ua for Tizen 4.0 is released
(accepted/tizen/4.0/unified/20171011.150240)

Change-Id: I6ed67477ed5b9c0d97735bde637cab6d97d0bb47
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>