SangYoun Kwak [Wed, 29 Jun 2022 02:02:41 +0000 (11:02 +0900)]
Fix potential buffer violation when using sprintf
Change-Id: I07411fb6c13c0a965ee3e76193e0b1687fae3548
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
SangYoun Kwak [Mon, 27 Jun 2022 09:58:29 +0000 (18:58 +0900)]
Add critical_log and log where upgrade status is changing
Change-Id: I704f2839d6f7c3989a5cfd87cbaaae12413051aa
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
SangYoun Kwak [Mon, 27 Jun 2022 05:29:07 +0000 (14:29 +0900)]
Add critical_log to indicate upgrade progress
Change-Id: Ic3f1e3e49cdc4f676533f6fc12da828221ed7c55
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
SangYoun Kwak [Mon, 27 Jun 2022 05:09:49 +0000 (14:09 +0900)]
Add critical_log to indicate upgrade progress
Change-Id: Iee469d3fcbb3bc2dd614f20fbed1158f161ff5a9
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
Mateusz Moscicki [Tue, 21 Jun 2022 09:51:07 +0000 (11:51 +0200)]
Add partition cloning verification
Change-Id: I410b9330808542f529b7e1be0f6b82d4c0294c60
Mateusz Moscicki [Mon, 20 Jun 2022 12:35:00 +0000 (14:35 +0200)]
Verify the checksum of the files delivered with delta.tar
Change-Id: I0e7ce71df3b3ef11e64bfc1665e62691ba63ad42
Mateusz Moscicki [Thu, 23 Jun 2022 10:18:07 +0000 (12:18 +0200)]
Simplify the invocation of partition cloning
Change-Id: I15dcced02fd0d9f468616212e7715ce4e18a202f
Hyotaek Shim [Fri, 17 Jun 2022 05:04:16 +0000 (14:04 +0900)]
Add sleep 60 before clone_partitions.service to avoid booting congestion
Change-Id: I8e881a86874ecd935917eabef728e1b503c5f06f
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
Hyotaek Shim [Fri, 17 Jun 2022 04:42:24 +0000 (04:42 +0000)]
Revert "Delay the launch of clone_partitions.service"
This reverts commit
466e3ecd38fefd6a94b01179010620f50061a2c3.
Change-Id: Ia93c180d2b69ed75717c6cf52bcd47a4c6a9ca44
Mateusz Moscicki [Tue, 14 Jun 2022 11:06:11 +0000 (13:06 +0200)]
Delay the launch of clone_partitions.service
The delay is needed to minimize the risk that due to a problem with some
service, the system will reboot during cloning.
Change-Id: Idb65aeee01e8987ce1fef32c0c7892d8c2a5db9e
Mateusz Mościcki [Fri, 10 Jun 2022 15:19:48 +0000 (15:19 +0000)]
Merge changes from topic "new_update_types" into tizen
* changes:
Remove script responsible for full upgrade
Rename upgrade types:
SangYoun Kwak [Fri, 10 Jun 2022 08:23:33 +0000 (17:23 +0900)]
Add '-l' option to blkid for optimization
Change-Id: I8183808210a9fca55e8c754e91da1a986ff27dae
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
Mateusz Moscicki [Fri, 10 Jun 2022 08:18:58 +0000 (10:18 +0200)]
Remove script responsible for full upgrade
This type of upgrade was necessary because it was the only one that did
not require extracing files from the delta.tar.gz. At the moment each
type of A/B upgrade is performed without the need to extract images from
the archive so a separate script is unnecessary.
Change-Id: Ied4c9afc8894e1c774fb960822ca6743c0fb8b2e
Mateusz Moscicki [Thu, 9 Jun 2022 16:27:41 +0000 (18:27 +0200)]
Rename upgrade types:
Types now include information in the name about what the upgrade is
(FULL_IMAGE, DELTA_IMAGE) and when it is to be performed
(BEFORE_BOOT_FOTA, AT_BOOT_FOTA):
PRE_UA -> FULL_IMAGE:BEFORE_BOOT_FOTA
FULL_IMG -> FULL_IMAGE:AT_BOOT_FOTA
DELTA_IMG -> DELTA_IMAGE:AT_BOOT_FOTA
Change-Id: Ic0a71c1e2463ac3bad9b0c0a1119ab562cd9b100
Mateusz Moscicki [Sat, 4 Jun 2022 11:42:50 +0000 (13:42 +0200)]
Add support for lzma patches (DELTA_IMG)
Change-Id: I48db15713776faa1366e87666bdc96a79c1c61d3
Mateusz Moscicki [Fri, 3 Jun 2022 12:10:37 +0000 (14:10 +0200)]
upgrade scripts: use upgrade-apply to flash images
Change-Id: Ib4d22862fb71b0e465e49200dfe92e1350338ec6
Mateusz Moscicki [Fri, 3 Jun 2022 12:01:57 +0000 (14:01 +0200)]
upgrade scripts: extract the common code to upgrade-common.sh
Change-Id: I01cb0deeac4aeae745bcb225a651a3b031a58ce6
SangYoun Kwak [Tue, 7 Jun 2022 05:47:23 +0000 (14:47 +0900)]
Check if partitions are cloned before cloning them(except recovery mode)
Change-Id: I4ea8705f8bea55ed8b901167a93a18bf37a08325
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
Mateusz Majewski [Fri, 3 Jun 2022 11:07:26 +0000 (13:07 +0200)]
Add dest_size
Change-Id: I0510236e0036b9409f632a4109a9e83ace58a6c7
Mateusz Majewski [Fri, 3 Jun 2022 10:57:38 +0000 (12:57 +0200)]
Fix dest-sha1 parameter name in help
Change-Id: Ifd4720395217c414bbbeef99f9e347ac619badac
Mateusz Majewski [Fri, 3 Jun 2022 09:58:36 +0000 (11:58 +0200)]
Depend on some libraries in a static and not dynamic way
Change-Id: I33b151e26df773593b370c063e2947cda246942f
Mateusz Moscicki [Thu, 2 Jun 2022 16:48:14 +0000 (18:48 +0200)]
Drop unneeded tizen prefix in service name
Change-Id: Ic0eba413c5f84b27e21b7fe12ac2281a13d679cb
Mateusz Moscicki [Wed, 1 Jun 2022 13:45:10 +0000 (15:45 +0200)]
upgrade scripts: Improve check exectuion
This change is to prevent bash from exiting a script with an error when
a command returns a code other than 0, which is expected.
E.g.:
SOME_VAR=$(grep some_value /some/file)
as the "errexit" flag is set, if "some_value" is not found grep will
return exit code 1 and the script will abort. This behavior also varies
with different versions of bash, so it is better in such cases to avoid
invoking commands that may return non-zero code.
Change-Id: I3f9eefc51a37d9762a9b47cc716805957461891f
Karol Lewandowski [Thu, 2 Jun 2022 09:53:53 +0000 (09:53 +0000)]
Merge changes I5c53427b,I6922a19d,Ibe876dd0,I67cdb84c into tizen
* changes:
Add SHA1 verification support to upgrade-apply
Import SHA1
Add upgrade-apply tool
Import ss_brotli_patch
Mateusz Majewski [Wed, 1 Jun 2022 05:43:52 +0000 (07:43 +0200)]
Add SHA1 verification support to upgrade-apply
Change-Id: I5c53427b8096874c7b5e6a0abc725a9b6bcaa162
Mateusz Majewski [Tue, 31 May 2022 12:26:01 +0000 (14:26 +0200)]
Import SHA1
This is copied from platform/core/system/libtota @
b25d02d618797b5fb2fbe61a188d6a28dc720bf8.
Change-Id: I6922a19d20f68ee2c5ba640ebdc95084f5b32cb4
Mateusz Majewski [Tue, 31 May 2022 07:12:30 +0000 (09:12 +0200)]
Add upgrade-apply tool
This is a tool that allows us to apply an upgrade provided in a tar
archive to a partition. Hopefully this will allow us to simplify the
upgrade codebase a bit.
Change-Id: Ibe876dd0141065e8c150a360b329f67ca6935c69
Mateusz Majewski [Tue, 31 May 2022 07:12:01 +0000 (09:12 +0200)]
Import ss_brotli_patch
This is copied from platform/core/system/libtota @
b25d02d618797b5fb2fbe61a188d6a28dc720bf8.
Change-Id: I67cdb84caa1da7bf5ed8be9669ca4c219868f5d7
Mateusz Moscicki [Mon, 30 May 2022 14:17:59 +0000 (16:17 +0200)]
Change the location of the reset partitions_cloned flag
The flag must be reset after verifying that partitions are currently
cloned, and before modifying partition contents.
Change-Id: Ieb1144ad1ff91d33acc1a0c7025d851a1d1992c3
Mateusz Moscicki [Mon, 30 May 2022 14:16:44 +0000 (16:16 +0200)]
Remove the upgrade-common.inc file that remains after a full upgrade.
Change-Id: I5b9541b6c4944ecef5a1cf37bae82034578960ea
Mateusz Moscicki [Mon, 30 May 2022 11:47:55 +0000 (13:47 +0200)]
Fix clone_partitions.sh
Change-Id: I7f56f2e710992f1e72b65b7340f5fca0bd5ca387
Mateusz Moscicki [Mon, 30 May 2022 10:53:07 +0000 (12:53 +0200)]
Remove locking from upgrade-full.sh
upgrade-full.sh is not run directly, it is called from
upgrade-trigger.sh which set the lock.
Change-Id: I11da508e0042a7acc147176a12958bea8b56302d
Mateusz Moscicki [Wed, 25 May 2022 15:56:31 +0000 (17:56 +0200)]
Skip cloning partitions if they are already cloned
Change-Id: I99709049ebc8c36e8c1a5058d06ca77e692b615f
Mateusz Moscicki [Tue, 24 May 2022 20:43:35 +0000 (22:43 +0200)]
Add a lock to the upgrade script
One of the steps in A/B upgrade is to clone a partitions from the
current slot to the next slot. At the same time there is
clone_partition.service that also clones partitions for recovery
purposes. Adding a lock is to prevent both processes from cloning
partitions at the same time.
Change-Id: I6f831eebbd6de37617a0b09145dbd70f15d7d638
Mateusz Moscicki [Tue, 24 May 2022 14:59:24 +0000 (16:59 +0200)]
Delete upgrade files when they are no longer needed
Change-Id: I950b79274a9050b8ba8e3d10a3a2799fd13f3ec4
SangYoun Kwak [Wed, 25 May 2022 08:09:34 +0000 (17:09 +0900)]
Set/clear partition status when processing fota or partition cloning
Clear partition cloned status (as 0) before FOTA.
Set partition status as "ok" after partitions are cloned.
Change-Id: Icacc0630c716f0b4c7bc1cccf10508c63b388d05
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
Mateusz Mościcki [Wed, 25 May 2022 15:40:53 +0000 (15:40 +0000)]
Merge "Make check_ua_op_mode slightly less broken" into tizen
SangYoun Kwak [Tue, 24 May 2022 01:34:32 +0000 (10:34 +0900)]
Change critical error logs to be logged as critical_logs
Change-Id: If1edd58b6c493c5f29959cc52bc52fbe617ab89b
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
Mateusz Majewski [Tue, 24 May 2022 11:51:05 +0000 (13:51 +0200)]
Make check_ua_op_mode slightly less broken
Change-Id: Ib1cfa0111756d5bb7f992699da49665c27e3b0cb
Karol Lewandowski [Fri, 20 May 2022 15:16:22 +0000 (15:16 +0000)]
Merge "Drop unneeded device_board_* commands" into tizen
Karol Lewandowski [Fri, 20 May 2022 12:32:45 +0000 (14:32 +0200)]
Drop unneeded device_board_* commands
These are executed from running system, not from ramdisk-recovery.
Change-Id: I07bbc57beb405d60103842640891c9db3feb6678
Mateusz Moscicki [Thu, 19 May 2022 11:14:13 +0000 (13:14 +0200)]
Change the severity of the mount fail message
Change-Id: I833adcdc9b9bcfacec4e3596f4d3543d48ef7ed7
Karol Lewandowski [Wed, 18 May 2022 21:14:14 +0000 (23:14 +0200)]
Merge branch 'tizen' into tizen_6.5
Change-Id: Icfa3053a9386f178a895ba19e1088b3733746c7d
Mateusz Moscicki [Wed, 11 May 2022 18:02:12 +0000 (20:02 +0200)]
Set upgrade progress
Change-Id: If4c51014c5f2638eae3f15bc97ab988d1de7a500
Mateusz Moscicki [Fri, 6 May 2022 14:49:36 +0000 (16:49 +0200)]
Verify the checksums of flashed images
Change-Id: I16178fe5ab33efd043db10d6d4612cce717a487d
Hyotaek Shim [Thu, 12 May 2022 06:47:15 +0000 (15:47 +0900)]
Remove CPUQuota in clone_partitions.service
Change-Id: I780d82e233208fd84d77316d6577d789de684fb9
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
Hyotaek Shim [Thu, 12 May 2022 06:47:15 +0000 (15:47 +0900)]
Remove CPUQuota in clone_partitions.service
Change-Id: I780d82e233208fd84d77316d6577d789de684fb9
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
(cherry picked from commit
d8fbc8b33e4d5eaa155b749b690c8591da73e9af)
Mateusz Moscicki [Thu, 5 May 2022 19:18:51 +0000 (21:18 +0200)]
Merge branch 'tizen' into tizen_6.5
Change-Id: If2709885808145e43adbd120554aa16460ee1cd7
Mateusz Moscicki [Wed, 27 Apr 2022 10:02:23 +0000 (12:02 +0200)]
Run clone_partitions.sh in the recovery mode
In recovery mode if two slots are available, we assume that the current
one is valid and the second slot is faulty. So we clone the current
partitions to the other slot so that we have both slots from which the
system can boot correctly.
Change-Id: I12f0951bbde815eafa7b9018f3283469df435cd3
Mateusz Moscicki [Thu, 21 Apr 2022 11:53:51 +0000 (13:53 +0200)]
Merge branch 'tizen' into tizen_6.5
Change-Id: Iad50df2ff30dcb4ef1fba21fc5bd5e65149353f2
Mateusz Moscicki [Thu, 14 Apr 2022 08:16:44 +0000 (10:16 +0200)]
Add partition cloning
When the system boots correctly after the upgrade, we clone the
partitions listed in /hal/etc/upgrade/background_copy.list so that we can
boot from the other slot if nececssary.
Change-Id: I977688e1a159e3504bfe9422bda4103d3f2867a1
Mateusz Moscicki [Wed, 6 Apr 2022 11:41:58 +0000 (13:41 +0200)]
Merge branch 'tizen' into tizen_6.5
Change-Id: Id5ff48d149416c55d22e4732eba94955cc253049
Karol Lewandowski [Mon, 4 Apr 2022 18:31:08 +0000 (20:31 +0200)]
Move all scripts to one standard location
This commit changes installation of the upgrade scripts to
/usr/libexec/upgrade-support, so that
- delta generation scripts can copy whole directory contents
instead of needing to follow each change in script's file names
- other packages can potentially install additional scripts
Change-Id: I89357f31ef738d1860ff4b90cf1bf559096f4d68
Mateusz Moscicki [Fri, 1 Apr 2022 16:34:59 +0000 (18:34 +0200)]
Move a common part of ugprade scripts to a separate file
Change-Id: If3b6f887d245cc0b99cd648742b4d9312e90543c
Mateusz Moscicki [Wed, 30 Mar 2022 14:16:33 +0000 (16:16 +0200)]
Add support for the full upgrade images
An archive considered to be a full upgrade is one whose all entries in
update.cfg file are of type PRE_UA.
In this case, due to the size of the archive and the probable lack of
available space for unpacking, the images are written directly from the
packed archive.
Change-Id: Iba92d8340c6f1b9f49ecb9567f7fee3a2cbde4ff
Karol Lewandowski [Fri, 11 Mar 2022 15:37:38 +0000 (15:37 +0000)]
Merge "Merge branch 'tizen' into tizen_6.5" into tizen_6.5
Mateusz Moscicki [Fri, 11 Mar 2022 15:00:34 +0000 (16:00 +0100)]
Merge branch 'tizen' into tizen_6.5
Change-Id: I8d9ea7af7d1eef126a5801e85c7e5ec2fdec59fa
Mateusz Moscicki [Tue, 8 Mar 2022 10:30:50 +0000 (11:30 +0100)]
Stop displaying unnecessary errors
Change-Id: I7579c69b110d7a42958543fca4f0145244bedddf
Karol Lewandowski [Fri, 11 Mar 2022 10:19:19 +0000 (11:19 +0100)]
blkid-api: Fix incorrect pointer check
Change-Id: Iec1d8620e3e6e47d7be75bd82e96153457f6a5a4
Karol Lewandowski [Fri, 11 Mar 2022 10:19:19 +0000 (11:19 +0100)]
blkid-api: Fix incorrect pointer check
Change-Id: Iec1d8620e3e6e47d7be75bd82e96153457f6a5a4
Mateusz Moscicki [Tue, 8 Mar 2022 10:30:50 +0000 (11:30 +0100)]
Stop displaying unnecessary errors
Change-Id: I7579c69b110d7a42958543fca4f0145244bedddf
Mateusz Moscicki [Fri, 4 Mar 2022 14:36:00 +0000 (15:36 +0100)]
Merge branch 'tizen_6.5' into tizen
Change-Id: Id14818e9a3d4427c6270c3164bbfcff7d7438fe6
Mateusz Moscicki [Thu, 3 Mar 2022 12:35:24 +0000 (13:35 +0100)]
Disable mounting of rootfs in DELTA_IMG and DELTA_IMG_AB upgrade mode
rootfs file system cannot be mounted because the next step will perform
a binary modification.
Change-Id: I8bb7b960848c5effbfafd2481df94555be91d86c
Mateusz Moscicki [Tue, 1 Mar 2022 14:27:07 +0000 (15:27 +0100)]
Mount rootfs as ro only when rootfs uses dm-verity
rootfs can be upgraded in two ways:
1. By modifying files (DELTA_FS)
2. By applying a binary patch (DELTA_IMG, DELTA_IMG_AB)
If the upgrade is done with a binary patch, the file system should be
mounted as RO so that its checksum is not changed.
Change-Id: I05a1925aa688a968cf9ecdb9f68a7be4c12d018a
Mateusz Moscicki [Tue, 22 Feb 2022 12:07:55 +0000 (13:07 +0100)]
Merge branch 'tizen_6.5' into tizen
Change-Id: I2433eaf408973fd8b55bf9bbf39ea413dc6b83d9
Mateusz Moscicki [Tue, 22 Feb 2022 12:07:00 +0000 (13:07 +0100)]
Extract additional upgrade scripts
Change-Id: I7c4675436e567059364a8e0da563e386423bba0b
Mateusz Moscicki [Mon, 21 Feb 2022 15:25:49 +0000 (16:25 +0100)]
Merge remote-tracking branch 'origin/tizen_6.5' into tizen
Change-Id: I6a05404cd57a58b110cfbc01364dfb7d36fd0856
Karol Lewandowski [Mon, 21 Feb 2022 15:20:37 +0000 (15:20 +0000)]
Merge changes from topic "binary-diff-brotli" into tizen_6.5
* changes:
Run scripts from the path where upgrade-trigger.sh is
Mount rootfs as read-only
Fix "use after free"
Enable static linking to libtota
Add support for DELTA_IMG_AB update type
Mateusz Moscicki [Tue, 15 Feb 2022 13:16:55 +0000 (14:16 +0100)]
Run scripts from the path where upgrade-trigger.sh is
Upgrade scripts like:
upgrade-trigger.sh
upgrade-fota.sh
upgrade-partia.sh
upgrade-prepare-partitions.sh
should be run from the path to which they were extracted from the
delta.tar.
Change-Id: Ic7fb2869ca41fa223997d18d9546fa01f258d609
Mateusz Moscicki [Thu, 3 Feb 2022 12:17:04 +0000 (13:17 +0100)]
Mount rootfs as read-only
Change-Id: I5663fac73d62888cdb284dfa88e869d5cb651c7d
Mateusz Moscicki [Tue, 1 Feb 2022 12:37:13 +0000 (13:37 +0100)]
Fix "use after free"
Change-Id: I832770abb9ad0dbdee65fe14883c31cd317ed73d
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
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
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
Karol Lewandowski [Thu, 30 Dec 2021 13:11:24 +0000 (14:11 +0100)]
Merge branch 'tizen' into tizen_6.5
Change-Id: Ib040e970ecd05893f67253b8134fcff067ec29c2
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
Mateusz Moscicki [Wed, 29 Dec 2021 13:12:32 +0000 (14:12 +0100)]
Merge branch 'tizen' into tizen_6.5
Change-Id: I9b33cafba04a2ad4cdab903226e590000d22d423
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
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
Mateusz Moscicki [Thu, 9 Dec 2021 14:00:26 +0000 (15:00 +0100)]
Merge branch 'tizen' into tizen_6.5
Change-Id: I23bdab528b12fe242a8b06fd42ebc3386777a2ab
Mateusz Moscicki [Tue, 7 Dec 2021 11:38:06 +0000 (12:38 +0100)]
Use /run/upgrade-sysroot instead of /system
Change-Id: I1b781134eafc29b07d0e6410407c665e3bd911df
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
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
Mateusz Moscicki [Mon, 6 Dec 2021 16:10:16 +0000 (17:10 +0100)]
Use partition_switch to change the partition slot
Change-Id: I3e4c995190d62838e1c4cff464e831d9376710f4
Karol Lewandowski [Tue, 30 Nov 2021 13:34:17 +0000 (14:34 +0100)]
Merge branch 'tizen' into tizen_6.5
Change-Id: I6b199ffe055027b8cb119e27a3856e492250a84b
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>
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>
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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>