platform/core/system/initrd.git
3 months agoAdd support for Online Update. 19/309619/4 accepted/tizen/unified/20240430.020636 accepted/tizen/unified/toolchain/20240507.011854 accepted/tizen/unified/x/20240430.094831 accepted/tizen/unified/x/20240507.051014
Mateusz Moscicki [Fri, 12 Apr 2024 14:33:21 +0000 (16:33 +0200)]
Add support for Online Update.

Run Online Update if bootmode is set to fota.
Additionally a bow-restore tool is added which is used to revert data
changes during a data migration during the OS Upgrade.

Change-Id: I73e17329a86541bb3067976cecd2a6a4dc4f8509

3 months agoDisable resize filesystem on rootfs and hal partitions. 45/306345/3
Mateusz Moscicki [Wed, 7 Feb 2024 13:36:45 +0000 (14:36 +0100)]
Disable resize filesystem on rootfs and hal partitions.

Running the resize2fs (and/or fsck) on partition changes its data and
checksum, so during the OS Upgrade checksums don't match, and
Upgrade procedure ends with an error.

Change-Id: I83a19aff720c8b5ec773048b9794c5ecdc5756e2

4 months agoadd finding partitions retry loop 67/308067/2 accepted/tizen/unified/20240320.152019 accepted/tizen/unified/x/20240326.073621
Marek Szyprowski [Fri, 15 Mar 2024 12:21:41 +0000 (13:21 +0100)]
add finding partitions retry loop

Retry finding partitions if no rootfs has been found to let kernel to
probe slowly-initializing block devices.

Change-Id: I8eeb72d1e44c4e91609ea21d3185a616082ce913
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
4 months agoadd support for booting from initramfs 79/306979/3
Marek Szyprowski [Fri, 1 Mar 2024 10:02:42 +0000 (11:02 +0100)]
add support for booting from initramfs

When system starts from initramfs, the pivot_root syscall fails for the
initial tmpfs filesystem and this is a known limitation. Switching to the
new rootfs has to be done by the 'switch_root' command in such case.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I8d89d93ddd1b41e68cb965132abc4a72e2f8950e

5 months agoConnect to NBD volume to mount filesystems via a network 03/298103/6
Łukasz Stelmach [Thu, 31 Aug 2023 09:55:13 +0000 (11:55 +0200)]
Connect to NBD volume to mount filesystems via a network

Change-Id: I1423e87670b5cc214847d7724c02ac42de9ee1cd
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
5 months agoDynamic Partitions: fix bug related to maps having many extents 39/305639/2 accepted/tizen/unified/20240214.163943 accepted/tizen/unified/toolchain/20240311.065550 accepted/tizen/unified/x/20240219.013911
Jacek Kryszyn [Mon, 5 Feb 2024 14:49:56 +0000 (15:49 +0100)]
Dynamic Partitions: fix bug related to maps having many extents

A dynamic partition can consist of more than one extent. In such
a case, parse-dynparts with --list-tables option would output one
line per partition and partitions having many extents would have
those extents separated with \n string. Such a line would be later
echoed to dmsetup. Echo without -e does not break lines so the
output directed to dmsetup would be incorrect. This patch fixes
this problem.

Change-Id: Ib8bc16c117b3233dd95cf6ac3abc01b26dacff72

5 months agoRemove parse-dynparts 49/305349/3
Jacek Kryszyn [Wed, 31 Jan 2024 12:41:21 +0000 (13:41 +0100)]
Remove parse-dynparts

parse-dynparts moved to platform/core/system/upgrade

Change-Id: I521c4072ff6c4616f987ceaf93c8877ac9b50409

5 months agoDynamic Partitions: perform mknodes 48/305348/3
Jacek Kryszyn [Fri, 26 Jan 2024 10:56:42 +0000 (11:56 +0100)]
Dynamic Partitions: perform mknodes

Needed for device-mapper library newer than 1.02.77 (2012-10-15).
Newer versions of the library (tested on library version 1.02.196
(2023-08-02)) do not create nodes in /dev/mapper automatically so
dmsetup mknodes has to be invoked explicitly. In case of 1.02.77
invoking mknodes when nodes are already created does nothing so
this patch is backward compatible.

Change-Id: I8df343d095243c8759e66c0362c30eb93612285c

7 months agoRefactoring the way dynamic partitions are searched 50/303050/1 accepted/tizen_unified_riscv accepted/tizen/unified/20240112.154547 accepted/tizen/unified/riscv/20240115.113710
Jacek Kryszyn [Tue, 19 Dec 2023 09:40:08 +0000 (10:40 +0100)]
Refactoring the way dynamic partitions are searched

Output of parse-dynparts is processed using here string instead
of here document which results in more readable code.

Change-Id: If2982a30532d323e65afc613ca9a33cdd2a98c05

7 months agoparse-dynparts: coverity fixes 87/302787/1
Jacek Kryszyn [Wed, 13 Dec 2023 10:47:00 +0000 (11:47 +0100)]
parse-dynparts: coverity fixes

Fixing parse-dynparts bugs/issues discoverd by coverity.

Change-Id: I4966c170e3db34c238f0f37c5271038bf650237d

8 months agoMerge "Ensure 64-bits file offsets are used on every architecture" into tizen
Karol Lewandowski [Fri, 17 Nov 2023 17:23:15 +0000 (17:23 +0000)]
Merge "Ensure 64-bits file offsets are used on every architecture" into tizen

8 months agoEnsure 64-bits file offsets are used on every architecture 36/301536/1 accepted/tizen/unified/20231120.174016
Karol Lewandowski [Fri, 17 Nov 2023 17:14:05 +0000 (18:14 +0100)]
Ensure 64-bits file offsets are used on every architecture

This should fix compilation errors on 32-bit architectures.

To make this change effective for parse-dynparts, this change
sets CXX flags to be the same as C flags.

Change-Id: Ibf345313815285241c4998cd700d2c2b5ae17867

8 months agoMerge "packaging: Move parse-dynparts to separate package" into tizen
Karol Lewandowski [Fri, 17 Nov 2023 09:50:38 +0000 (09:50 +0000)]
Merge "packaging: Move parse-dynparts to separate package" into tizen

8 months agopackaging: Move parse-dynparts to separate package 62/300162/6
Karol Lewandowski [Tue, 17 Oct 2023 14:13:35 +0000 (16:13 +0200)]
packaging: Move parse-dynparts to separate package

parse-dynparts is going to be used by both initrd and initrd-recovery,
so it must be moved out of initrd package.

Change-Id: Ic3e959fd0fb6898b6f4923de7bda9a83bdc15277

8 months agoMerge "Test parse-dynparts" into tizen
Karol Lewandowski [Fri, 17 Nov 2023 09:28:59 +0000 (09:28 +0000)]
Merge "Test parse-dynparts" into tizen

8 months agoMerge "parse-dynparts: Upgrade to OpenSSL3 API" into tizen
Karol Lewandowski [Fri, 17 Nov 2023 09:28:48 +0000 (09:28 +0000)]
Merge "parse-dynparts: Upgrade to OpenSSL3 API" into tizen

8 months agoMerge "Map rootfs and hal from super" into tizen
Karol Lewandowski [Fri, 17 Nov 2023 09:28:38 +0000 (09:28 +0000)]
Merge "Map rootfs and hal from super" into tizen

8 months agoTest parse-dynparts 43/299443/11
Jacek Kryszyn [Thu, 28 Sep 2023 13:49:33 +0000 (15:49 +0200)]
Test parse-dynparts

Added tests of parse-dynparts. Tests run on build using GTest.
Exemplary super metadata were generated and corresponding
parse-dynparts outputs were generated as well. Tests check if for
a given metadata parse-dynparts will give expected output.

Change-Id: I91b2af66f3c91e336724ae66945951851927be2f

8 months agoMerge "Build package with parse-dynparts" into tizen
Karol Lewandowski [Wed, 8 Nov 2023 13:22:43 +0000 (13:22 +0000)]
Merge "Build package with parse-dynparts" into tizen

8 months agoparse-dynparts: Upgrade to OpenSSL3 API 43/299143/8
Jacek Kryszyn [Wed, 20 Sep 2023 14:26:32 +0000 (16:26 +0200)]
parse-dynparts: Upgrade to OpenSSL3 API

Changed calls to OpenSSL API to use OpenSSL3 style functions with
proper error handling. Suppressed warnings about strncpy which is
used in a liblp library for copying bytes between char arrays
which don't have to be terminated with NUL

Change-Id: Ifb4c1e10ae39fbf03f7bd9a4087b631884fcddc0

8 months agoMap rootfs and hal from super 09/297909/4
Jacek Kryszyn [Mon, 28 Aug 2023 10:10:05 +0000 (12:10 +0200)]
Map rootfs and hal from super

init script modified to search for super partition and map rootfs
and hal if super found.

Change-Id: I4bf7ca6df17ba1035d770467ef5eab5443a6a638

8 months agoBuild package with parse-dynparts 21/297121/7
Jacek Kryszyn [Thu, 10 Aug 2023 12:30:46 +0000 (14:30 +0200)]
Build package with parse-dynparts

Modified files required to build package with parse-dynparts
binary needed for mounting dm-linear partitions.

Change-Id: I9519d01a445cfc1665a3664e325a834df8550b0b

11 months agoImport parse-dynparts 40/296940/5
Jacek Kryszyn [Mon, 7 Aug 2023 11:26:44 +0000 (13:26 +0200)]
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. Imported from
master branch (commit c8837c1). Project imorted exactly as it is on GitHub -
no changes to any file/directory were made. This is a pure import.

Change-Id: I317310e68e52fd1f657ec8c9b5c1ee58398ad84a

12 months agoSwitch to openssl3 to provide /usr/bin/openssl 98/296098/1 accepted/tizen/8.0/unified/20231005.093757 accepted/tizen/unified/20230727.173045 accepted/tizen/unified/20230731.175301 tizen_8.0_m2_release
Karol Lewandowski [Wed, 19 Jul 2023 22:53:19 +0000 (00:53 +0200)]
Switch to openssl3 to provide /usr/bin/openssl

Change-Id: I45796bfceba5a45a4908505232de68c27e09c703

20 months agoriscv64: Add support for riscv64 64/284464/1 accepted/tizen/unified/20230206.093832 accepted/tizen/unified/20230206.093949
Marek Pikuła [Mon, 24 Oct 2022 12:38:06 +0000 (14:38 +0200)]
riscv64: Add support for riscv64

Change-Id: Ie072a3d84d8afb43811cd4ad39b575cdeb08608f
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
22 months agopackaging: For asan, change list file path to /initrd 07/281207/1 accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix tizen_7.0 tizen_7.0_hotfix accepted/tizen/7.0/unified/20221110.062423 accepted/tizen/7.0/unified/hotfix/20221116.105723 accepted/tizen/unified/20220914.164104 tizen_7.0_m2_release
Seung-Woo Kim [Wed, 14 Sep 2022 07:21:39 +0000 (16:21 +0900)]
packaging: For asan, change list file path to /initrd

For asan, in rpm spec, change list file path to /initrd instead
of %{_libdir}/initrd as like other list files. This fixes asan
initrd creation failure.

Change-Id: Ib739d4c236bd115a2781cf74e3a3562d6520d865
Fixes: 5dc810b14e1d ("Modify root directory of initrd")
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
22 months agoSupport emulator in initrd-wrapper package 81/280381/2 accepted/tizen/unified/20220901.224708 submit/tizen/20220901.064220
SangYoun Kwak [Mon, 29 Aug 2022 08:26:41 +0000 (17:26 +0900)]
Support emulator in initrd-wrapper package

Change-Id: I9cee65dc9976f2d8f737376631843769b28f92a5
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
23 months agoAdd close function to verityctl 41/279841/1
SangYoun Kwak [Thu, 18 Aug 2022 08:33:46 +0000 (17:33 +0900)]
Add close function to verityctl

Change-Id: I21720370ce7a6579812dc3120ec0dcbc9f470868
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
23 months agoAdd reboot binary to reboot when dm-verity fails 71/279171/7
SangYoun Kwak [Wed, 3 Aug 2022 06:00:44 +0000 (15:00 +0900)]
Add reboot binary to reboot when dm-verity fails

Change-Id: I09aac2aaedd190a0aab058b638e3cac0acc3f960
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
23 months agoFix path of lists 65/279165/2
SangYoun Kwak [Wed, 3 Aug 2022 05:10:12 +0000 (14:10 +0900)]
Fix path of lists

Change-Id: I8db1f65f5baa8e55aa1e3114c5acedefc7e55557
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
23 months agoModify root directory of initrd 25/279125/2
SangYoun Kwak [Tue, 2 Aug 2022 08:40:38 +0000 (17:40 +0900)]
Modify root directory of initrd

Change-Id: I36f489cd15ff59ec5b9b828371a87640e1e789b0
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
23 months agoRelicense initrd package as MIT to prevent license conflict issues 19/279119/1
Hyotaek Shim [Tue, 2 Aug 2022 08:08:39 +0000 (17:08 +0900)]
Relicense initrd package as MIT to prevent license conflict issues

For example, libcryptsetup is based on GPL-2.0+/LGPL-2.1+.

Change-Id: I13f2d91eac9c9f52703900ddfc074a8adb730635
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2 years agoAdd to check the return value of verity script 36/278936/2 accepted/tizen/unified/20220729.131709 submit/tizen/20220729.003331
SangYoun Kwak [Thu, 28 Jul 2022 08:10:36 +0000 (17:10 +0900)]
Add to check the return value of verity script

Change-Id: I6294c37196e427cebd1c02c914035b11f8eb0b24
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
2 years agoAdd openssl to verity-tools package 24/278924/4
SangYoun Kwak [Thu, 28 Jul 2022 06:12:59 +0000 (15:12 +0900)]
Add openssl to verity-tools package

Change-Id: I2c7c27052d45ac7c616897b48bba52ddee24d747
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
2 years agoinit: Do not perform fsck on rootfs and halfs unless when we are doing resize 39/278639/2 accepted/tizen/unified/20220726.012311 submit/tizen/20220725.143901
Karol Lewandowski [Fri, 22 Jul 2022 14:54:23 +0000 (16:54 +0200)]
init: Do not perform fsck on rootfs and halfs unless when we are doing resize

Running fsck on the filesystems will cause partition to be modified, and,
consequently it will break possibility of doing DELTA_IMAGE-based upgrade.
This is because the upgrade type verifies the checksum of the partition
before doing upgrade - after fsck it is simply not matching anymore.

Change-Id: If0f56db7895983dbba41a773329d05a2eb1f2675

2 years agoAdd public key (secure-boot-public-key.pem) 87/278387/5 accepted/tizen/unified/20220721.135023 submit/tizen/20220721.040936
SangYoun Kwak [Wed, 20 Jul 2022 05:05:21 +0000 (14:05 +0900)]
Add public key (secure-boot-public-key.pem)

Change-Id: Ib6f7991772022a8a7fb9271855459faa059ddb2b
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
2 years agoDo not install verity-tools by default, considering 8MB-ramdisk targets 22/278322/2
Hyotaek Shim [Tue, 19 Jul 2022 05:11:23 +0000 (14:11 +0900)]
Do not install verity-tools by default, considering 8MB-ramdisk targets

Change-Id: I2701e734af2a3395f7c8198e61af7b38a46f81ad
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2 years agoRename veritytool package to verity-tools 17/278317/1 accepted/tizen/unified/20220720.034159 submit/tizen/20220719.050530 submit/tizen/20220719.073139
Hyotaek Shim [Tue, 19 Jul 2022 04:49:49 +0000 (13:49 +0900)]
Rename veritytool package to verity-tools

Change-Id: Id6f7068d58af89cf6ce0f8ae81aba631bc0b9c52
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2 years agoModify script path declaration and copy statements 27/277927/1
SangYoun Kwak [Fri, 15 Jul 2022 05:56:43 +0000 (14:56 +0900)]
Modify script path declaration and copy statements

Change-Id: If9e721f4d82dc633f1c80cd34279a6c640330961
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
2 years agoModify scripts to verify and add verifying script 00/277900/3
SangYoun Kwak [Fri, 15 Jul 2022 01:48:25 +0000 (10:48 +0900)]
Modify scripts to verify and add verifying script

Change-Id: Ia14c0564d6bea295151a1c918d75214cf12fd64c
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
2 years agoFix to find module_a or module_b instead of modules_a or modules_b 80/277580/1 accepted/tizen/unified/20220713.144341 submit/tizen/20220713.061815
SangYoun Kwak [Fri, 8 Jul 2022 11:12:49 +0000 (20:12 +0900)]
Fix to find module_a or module_b instead of modules_a or modules_b

Change-Id: I571c5e089f05400b3ca23201e6ec4fb7d23b434c
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
2 years agoFor asan, copy asan-runtime-env and libasan files into ramdisk 55/277055/2 accepted/tizen/unified/20220701.055233 submit/tizen/20220630.103030
Seung-Woo Kim [Wed, 29 Jun 2022 06:26:23 +0000 (15:26 +0900)]
For asan, copy asan-runtime-env and libasan files into ramdisk

In asan environment, there should be asan-runtime-env and libasan,
but ramdisk mkinitrd.sh does not copy the files. For asan, copy
required files into ramdisk.

Change-Id: Ic7fe94312e9e8193eb786b95f9b35d4c66ab98e8
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2 years agopostscript: Add verbatims object for not elf files 54/277054/1
Seung-Woo Kim [Wed, 29 Jun 2022 06:08:42 +0000 (15:08 +0900)]
postscript: Add verbatims object for not elf files

For files in PROGS or WITHSLIBS, it copies with dependent
libraries for elf file, but for non elf file, finding dependency
causes mic warning logs. Add verbatims object for non elf files
as like initrd-recovery.

This removes below mic warning messages:
   INFO  - /etc/blkid.conf: error while loading shared libraries: /etc/blkid.conf: invalid ELF header
   INFO  - /usr/bin/verityctl: error while loading shared libraries: /usr/bin/verityctl: invalid ELF header

Change-Id: I9346d210045b489bf2527f8c191003a52ddf4046
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2 years agoRemove resize2fs/fsck from module partition 50/276550/4 accepted/tizen/unified/20220621.140311 submit/tizen/20220621.004534
SangYoun Kwak [Mon, 20 Jun 2022 08:43:54 +0000 (17:43 +0900)]
Remove resize2fs/fsck from module partition

Change-Id: Ic7344adc301cba54ed296b7b727cf6e23608f49e
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
2 years agoFix to specify partition(a or b) when using blkid 27/275927/3 accepted/tizen/unified/20220608.140017 submit/tizen/20220607.115429
SangYoun Kwak [Tue, 7 Jun 2022 02:02:50 +0000 (11:02 +0900)]
Fix to specify partition(a or b) when using blkid

Change-Id: I6f20d7c93f63a6e92c238d3a27257bf1d241fc7e
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
2 years agoAdd '-d' option to lsblk command 74/274874/1
SangYoun Kwak [Wed, 11 May 2022 08:31:28 +0000 (17:31 +0900)]
Add '-d' option to lsblk command

Option '-d': print only device itself

Change-Id: I5bce83e00799ded58a5cf69a36d9394a78224fe6
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
2 years agoChange to call blkid command once to reduce boot time 35/273635/5
SangYoun Kwak [Mon, 11 Apr 2022 06:06:01 +0000 (15:06 +0900)]
Change to call blkid command once to reduce boot time

* It is better to call blkid in function process_rootfs and process_userfs than using
get_blk_dev_path function (performance and complexity)

Change-Id: I837e28d1883782ba1c0ae5bfb4f6b98e83334f0f
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
2 years agoApply option --ignore-corruption to veritysetup for debugging 90/272290/2 accepted/tizen/unified/20220315.132322 submit/tizen/20220314.073710
SangYoun Kwak [Mon, 14 Mar 2022 06:54:24 +0000 (15:54 +0900)]
Apply option --ignore-corruption to veritysetup for debugging

Change-Id: Icbfb216faf98a31067abebab1dba46d28fcbc24d
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
2 years agoPrint booting information in /proc/cmdline 12/271912/3
SangYoun Kwak [Thu, 3 Mar 2022 06:16:58 +0000 (15:16 +0900)]
Print booting information in /proc/cmdline

print example
: Initrd booting (/proc/cmdline bootmode=normal partition_ab=a root=/dev/mmcblk1p58)

Change-Id: Ia559635beeed5dd5d44de827aa78e9761bf0a860
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
2 years agoMerge remote-tracking branch 'origin/tizen_6.5' into tizen 68/271468/1 accepted/tizen/unified/20220222.034420 submit/tizen/20220221.170321
Mateusz Moscicki [Mon, 21 Feb 2022 16:25:02 +0000 (17:25 +0100)]
Merge remote-tracking branch 'origin/tizen_6.5' into tizen

Change-Id: I5bbdce15b8f634f3d8614da3d29b2706771f53fb

2 years agoMerge "Allow to specify the mount point for verityctl create" into tizen_6.5 accepted/tizen/6.5/unified/20220222.132806 submit/tizen_6.5/20220221.170828
Karol Lewandowski [Mon, 21 Feb 2022 15:22:18 +0000 (15:22 +0000)]
Merge "Allow to specify the mount point for verityctl create" into tizen_6.5

2 years agoReplace dmsetup with veritysetup for concise scripts 97/270997/1 accepted/tizen/6.5/unified/20220215.114301 submit/tizen_6.5/20220214.042507 submit/tizen_6.5/20220214.083718
SangYoun Kwak [Mon, 14 Feb 2022 02:17:47 +0000 (11:17 +0900)]
Replace dmsetup with veritysetup for concise scripts

Change-Id: I081be663af7ee8eaecc7f89610a4e613b28c2907
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
(cherry picked from commit 7f98032c0f177fb5ef26d11fd71f4209ab56e1ff)

2 years agoReplace dmsetup with veritysetup for concise scripts 88/270988/2 accepted/tizen/unified/20220215.114107 submit/tizen/20220214.042117 submit/tizen/20220214.042524
SangYoun Kwak [Mon, 14 Feb 2022 02:17:47 +0000 (11:17 +0900)]
Replace dmsetup with veritysetup for concise scripts

Change-Id: I081be663af7ee8eaecc7f89610a4e613b28c2907
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
2 years agoAllow to specify the mount point for verityctl create 30/270430/1 tizen_brotli
Mateusz Moscicki [Wed, 2 Feb 2022 13:04:50 +0000 (14:04 +0100)]
Allow to specify the mount point for verityctl create

Change-Id: I8296ff56131870d4386d143ad0c40fef3c4139ed

2 years agoSpecify modprobe.d path for modprobe options 97/270197/1 submit/tizen_6.5/20220126.094130
Hyotaek Shim [Wed, 26 Jan 2022 09:15:18 +0000 (18:15 +0900)]
Specify modprobe.d path for modprobe options

Change-Id: Iea413eba3a6d9c433b652f5f7af6e0e2f40bddd6
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
(cherry picked from commit 9ff0b2d5a81bb4b7b96280aa114faa7cbcaf7597)

2 years agoSpecify modprobe.d path for modprobe options 95/270195/1 accepted/tizen/unified/20220128.144347 accepted/tizen/unified/20220128.144534 submit/tizen/20220126.094057 submit/tizen/20220127.011830
Hyotaek Shim [Wed, 26 Jan 2022 09:15:18 +0000 (18:15 +0900)]
Specify modprobe.d path for modprobe options

Change-Id: Iea413eba3a6d9c433b652f5f7af6e0e2f40bddd6
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2 years agoRevert "Do RW Update if the .do_rw_update flag is set" 69/268269/1 accepted/tizen/6.5/unified/20211231.161235 submit/tizen_6.5/20211224.120416 submit/tizen_6.5/20211229.171734
Mateusz Moscicki [Fri, 17 Dec 2021 14:48:59 +0000 (15:48 +0100)]
Revert "Do RW Update if the .do_rw_update flag is set"

This reverts commit 5fd2c264562205b64b1888f9708ce3ed8235f29d.

Change-Id: I40403a66d54aa593315480f982735bf08ccd9cb3

2 years agodm-verity: support aarch64 architecture 63/268063/1 accepted/tizen/6.5/unified/20211216.155637 submit/tizen_6.5/20211215.104507
INSUN PYO [Wed, 15 Dec 2021 09:23:17 +0000 (18:23 +0900)]
dm-verity: support aarch64 architecture

Change-Id: I2316e34a6971185b231d987f307c7933d067364a
(cherry picked from commit ad0f06be27ca8f6ff142b055774f4da91a4a837b)

2 years agodm-verity: support aarch64 architecture 58/268058/1 accepted/tizen/unified/20211216.155746 accepted/tizen/unified/20211231.161345 submit/tizen/20211215.104447 submit/tizen/20211230.132434
INSUN PYO [Wed, 15 Dec 2021 09:23:17 +0000 (18:23 +0900)]
dm-verity: support aarch64 architecture

Change-Id: I2316e34a6971185b231d987f307c7933d067364a

2 years agoMount /opt in initrd during normal boot 67/267967/1 accepted/tizen/6.5/unified/20211214.124620 submit/tizen_6.5/20211214.050625
Mateusz Moscicki [Tue, 7 Dec 2021 10:41:42 +0000 (11:41 +0100)]
Mount /opt in initrd during normal boot

Change-Id: Id2b5a0582d9f7ed654e4d1c767ea968773f942c5
(cherry picked from commit 2d9d6056c6b1df5b2d08af9f7f9f622d4adf5743)

2 years agoMount /opt in initrd during normal boot 84/267584/1 accepted/tizen/unified/20211215.125618 submit/tizen/20211214.050618 submit/tizen/20211215.060033
Mateusz Moscicki [Tue, 7 Dec 2021 10:41:42 +0000 (11:41 +0100)]
Mount /opt in initrd during normal boot

Change-Id: Id2b5a0582d9f7ed654e4d1c767ea968773f942c5

2 years agoMerge branch 'tizen' into tizen_6.5 63/267263/1 accepted/tizen/6.5/unified/20211201.221717 submit/tizen_6.5/20211130.134151
Mateusz Moscicki [Tue, 30 Nov 2021 13:16:43 +0000 (14:16 +0100)]
Merge branch 'tizen' into tizen_6.5

Change-Id: I5e225b0fd5566c58685b5d0175b0c6c6bcb801c1

2 years agoMount A/B variant of partition HAL if it exists 92/266992/1 accepted/tizen/unified/20211130.125550 submit/tizen/20211129.232451
Mateusz Moscicki [Tue, 23 Nov 2021 15:40:15 +0000 (16:40 +0100)]
Mount A/B variant of partition HAL if it exists

Change-Id: Ie0eca84ce06933c59d7615262b450513bbfd9727

2 years agoDo RW Update if the .do_rw_update flag is set 95/265795/2 accepted/tizen/unified/20211123.143824 submit/tizen/20211116.140204 submit/tizen/20211119.125959
Mateusz Moscicki [Thu, 28 Oct 2021 10:06:50 +0000 (12:06 +0200)]
Do RW Update if the .do_rw_update flag is set

Change-Id: Ice67a56bba985f3e4ca38f42d19836ed88d9dcef

2 years agoMount partitions from the specified A/B slot 94/265794/2
Mateusz Moscicki [Wed, 27 Oct 2021 14:43:43 +0000 (16:43 +0200)]
Mount partitions from the specified A/B slot

Slot is specified by partition_ab= in /proc/cmdline
If a slot is not specified, partitions will be mounted without regard to
suffix.

Change-Id: I70ff1f96c49857a6c2448eebcaa36e206873df0b

2 years agoinitrd: apply a preen mode 2 about f2fs.fsck 34/262734/1 accepted/tizen/6.5/unified/20211028.114718 accepted/tizen/unified/20210819.224401 submit/tizen/20210819.031929 submit/tizen_6.5/20211028.162501 tizen_6.5.m2_release
Jaehoon Chung [Thu, 19 Aug 2021 02:14:02 +0000 (11:14 +0900)]
initrd: apply a preen mode 2 about f2fs.fsck

Apply a preen mode 2 about f2fs.fsck.
When f2fs file is created in lower kernel than v4.19, i_gc_failure is
initialized to 0x1. In Tizen Build System, user image is always set to
1 because of using old kernel.

[FIX] (fsck_chk_inode_blk:1071)  --> Regular: 0x31 reset i_gc_failures from 0x1 to 0x00

Preen mode 2 is for skipping this behavior about old kernel.
https://lore.kernel.org/patchwork/patch/1017743/

The first booting time will be reduced.

Change-Id: I23825d9ff1f49c6b3cf9db9513f53f3854fcdee0
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoSupport container-aware virtual filesystems mount 05/260505/5 accepted/tizen/unified/20210707.070906 submit/tizen/20210706.102309
INSUN PYO [Mon, 28 Jun 2021 01:32:57 +0000 (10:32 +0900)]
Support container-aware virtual filesystems mount

Change-Id: Ifcbfb64445aaa850f9f936c6bfc9a021de9dc4ce
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agoSupport container-based Tizen guest OS 84/260284/3 accepted/tizen/unified/20210702.133337 submit/tizen/20210702.050357
Hyotaek Shim [Wed, 23 Jun 2021 06:45:00 +0000 (15:45 +0900)]
Support container-based Tizen guest OS

Change-Id: I704936b90a8b19c844851abbc9d17fd082402f6b
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agoinitrd: load kernel module #3 55/260555/1 accepted/tizen/unified/20210630.144038 submit/tizen/20210629.050716 submit/tizen/20210629.115102 submit/tizen/20210630.013220
INSUN PYO [Tue, 29 Jun 2021 03:27:29 +0000 (12:27 +0900)]
initrd: load kernel module #3

Modify to load kernel module in parallel.

Change-Id: I865ed1747186c738ac050e587c631262cbd6d6a7

3 years agoinitrd: load kernel module #2 69/260269/2 accepted/tizen/unified/20210624.131807 submit/tizen/20210623.224642
INSUN PYO [Wed, 23 Jun 2021 01:52:44 +0000 (10:52 +0900)]
initrd: load kernel module #2

Change-Id: Id87b8e551d3c278af58bd23b0343a9fd4f3f0213

3 years agoinitrd: fix typo error 32/260232/1 accepted/tizen/unified/20210622.125755 submit/tizen/20210622.081544
INSUN PYO [Tue, 22 Jun 2021 08:10:19 +0000 (17:10 +0900)]
initrd: fix typo error

initrd fails with error.
=================================================================================
[    2.756475] Starting init: /sbin/init exists but couldn't execute it (error -8)
sh-3.2#
=================================================================================

Change-Id: I261e53f9f9cd6cb0e701f839e9a809788acfc7e7

3 years agoinitrd: load kernel module 63/259563/23 submit/tizen/20210622.073805
INSUN PYO [Wed, 9 Jun 2021 23:32:18 +0000 (08:32 +0900)]
initrd: load kernel module

Change-Id: Ie73c7636ebaa28d7a7f4f8e66098c5d0455238ad

3 years agoinitrd: fix hal mountpoint in init wrapper environment 55/259855/4 submit/tizen/20210622.062058
INSUN PYO [Wed, 16 Jun 2021 03:13:11 +0000 (12:13 +0900)]
initrd: fix hal mountpoint in init wrapper environment

Change-Id: Id374e7987895723e6e16da3080757ce1bbc9d3d7

3 years agoUse the standard module directory 60/258960/3 submit/tizen/20210617.094416
Mateusz Majewski [Fri, 28 May 2021 08:29:18 +0000 (10:29 +0200)]
Use the standard module directory

This should be the same directory, but /lib/modules is a better-known
name.

Change-Id: I7bbee8bedfbe44384c0d968e694c9bf6800eb521

3 years agoinitrd: mount module partition to Read-Only 53/259853/1
INSUN PYO [Wed, 16 Jun 2021 02:55:46 +0000 (11:55 +0900)]
initrd: mount module partition to Read-Only

Change-Id: I93ea5b664a72586c74e6751bb0186202735990d5

3 years agoinitrd: improve stability for hal partitions 73/259573/1 accepted/tizen/unified/20210611.145112 submit/tizen/20210610.022051
INSUN PYO [Thu, 10 Jun 2021 01:12:59 +0000 (10:12 +0900)]
initrd: improve stability for hal partitions

If you don't do fsck after resizefs,
sometimes resizefs behaves abnormally.

Change-Id: I55b068a445d8acb47b64cf637aeb4ccff41acb02

3 years agoinitrd: add the mount function about hal partition 88/259488/3 accepted/tizen/unified/20210609.140305 submit/tizen/20210609.062333
Jaehoon Chung [Wed, 9 Jun 2021 02:23:06 +0000 (11:23 +0900)]
initrd: add the mount function about hal partition

Add the mount function about hal partition.
In future, the checking condition of hal/lib directory will be removed.
* exist /hal/lib/
  - included hal path in platform image
* Not exist /hal/lib/
  - Separated hal.img from platform image

Change-Id: I9f1aff8a1c2f2ca92c3465c41257e559d4afa716
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agodm-verity: fix exceptional cases of creating dm-verity metadata 23/259223/5 accepted/tizen/unified/20210604.120735 submit/tizen/20210603.041836
INSUN PYO [Wed, 2 Jun 2021 11:50:06 +0000 (20:50 +0900)]
dm-verity: fix exceptional cases of creating dm-verity metadata

Iot-headless uses btrfs filesystem for root partition.
tune2fs does not work with btrfs filesystem.

Change-Id: I43080e3b960e199c95fde2b3cbb7d175d28c1c9d

3 years agodm-verity: rework resizefs in verify boot 99/259199/4 accepted/tizen/unified/20210602.122401 submit/tizen/20210602.090101
INSUN PYO [Wed, 2 Jun 2021 04:53:21 +0000 (13:53 +0900)]
dm-verity: rework resizefs in verify boot

To remove filesystem-related code from verityctl script

Change-Id: Ib3ccca8ec9a4ef30bf58e839ff929dae720bdc24

3 years agodm-verity: do not check dm-verity in init-wrapper 97/259197/4
INSUN PYO [Wed, 2 Jun 2021 03:56:59 +0000 (12:56 +0900)]
dm-verity: do not check dm-verity in init-wrapper

The rootfs must not be mounted to apply the dm-verity.
(The limitation of dm-verity)

In the init-wrapper, rootfs is already mounted.
So in the init-wrapper, you must not check the dm-verity.

Change-Id: I979ced22111c0efabdec54726b370b6232fbd482

3 years agodm-verity: enable meta data signing 15/257715/13 accepted/tizen/unified/20210528.134811 submit/tizen/20210528.010751
INSUN PYO [Fri, 30 Apr 2021 03:29:02 +0000 (12:29 +0900)]
dm-verity: enable meta data signing

Ref: https://review.tizen.org/gerrit/#/c/platform/core/system/initrd/+/257715/11

Change-Id: I047dfc8f4fe1d29065693f7a2789e268a07841cf

3 years agoChange /dev/mapper/root to /dev/mapper/rootfs 97/258197/2
INSUN PYO [Wed, 12 May 2021 05:58:15 +0000 (14:58 +0900)]
Change /dev/mapper/root to /dev/mapper/rootfs

Change-Id: Ibe6ce32efe242d3ba23b5e804b236dbbf722023e

3 years agoUnify initrd script for ramdisk and init wrapper 93/256493/13 accepted/tizen/unified/20210430.052708 submit/tizen/20210429.105422
Hyotaek Shim [Mon, 5 Apr 2021 11:01:57 +0000 (20:01 +0900)]
Unify initrd script for ramdisk and init wrapper

Change-Id: Ic4fcd41e1774ce5303870b4a08c0aa8b5f6e6e5a
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agoAdd /etc/initrd-release file 40/257140/2 accepted/tizen/unified/20210421.101136 submit/tizen/20210421.041051
INSUN PYO [Tue, 20 Apr 2021 01:29:34 +0000 (10:29 +0900)]
Add /etc/initrd-release file

Systemd uses /etc/initrd-release file to check if it is running on ramdisk.

Change-Id: I8a891c6a7f59c4c9237eebe4970cc943c89bbd7a
Refs: https://www.freedesktop.org/software/systemd/man/bootup.html
Refs: https://www.freedesktop.org/wiki/Software/systemd/InitrdInterface/

3 years agoRefactor /sbin/init 96/256696/13
INSUN PYO [Fri, 9 Apr 2021 08:32:47 +0000 (17:32 +0900)]
Refactor /sbin/init

Change-Id: Ibf1987072ae160973070fcf37844c166e902667a

3 years agoAdd tool support for checking and resizing f2fs partition 21/254621/2 accepted/tizen/unified/20210310.144844 submit/tizen/20210310.051909
Dongwoo Lee [Fri, 5 Mar 2021 09:16:46 +0000 (18:16 +0900)]
Add tool support for checking and resizing f2fs partition

To provide f2fs partitions with checking filesystem and expanding at
boot, this adds f2fs tools and modifies init script to deal with the
partiton depending on its type of filesystem.

Change-Id: I6289be62d4d290831eec5a51d9feef434080676e
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
3 years agoChange "Requires(post)" to "Requires(posttrans)" 96/253796/5 accepted/tizen/unified/20210224.131655 submit/tizen/20210224.001604
INSUN PYO [Thu, 18 Feb 2021 05:58:11 +0000 (14:58 +0900)]
Change "Requires(post)" to "Requires(posttrans)"

gbs(0.25.15) seems to have a bug.

A gbs tool downloads and uses the AAA_package at build time.
 - Requires(pre):       AAA_package
 - Requires(post):      AAA_package

A gbs tool does not download the AAA_package at build time.
 - Requires:            AAA_package
 - Requires(preun):     AAA_package
 - Requires(postun):    AAA_package
 - Requires(posttrans): AAA_package

Change-Id: I19c681c9103c15f9b08f54c3f9b6bf8a26f76eea

3 years agoRevert: Adding to mount squashfs for gps tracker image. 23/250823/1 accepted/tizen/unified/20210105.125823 submit/tizen/20210105.050737
INSUN PYO [Tue, 5 Jan 2021 01:56:02 +0000 (10:56 +0900)]
Revert: Adding to mount squashfs for gps tracker image.

squashfs based usr partition is deprecated since 5.0.

Change-Id: Ie5367bf5f8215259a0ae385a6e047893016f67ee

3 years agoCreate /sysroot and /opt at the mic stage, not runtime 36/250536/1 accepted/tizen/unified/20201230.121745 submit/tizen/20201230.014042
insun.pyo [Tue, 29 Dec 2020 06:45:40 +0000 (15:45 +0900)]
Create /sysroot and /opt at the mic stage, not runtime

After applying squashfs,  "/" of ramdisk is read only.

Change-Id: I5453a2fff90623bec10d0980ee9a9eecbd8fd8df

3 years agodm-verity: Cleanup verityctl shell script 86/247286/5 accepted/tizen/unified/20201111.124727 submit/tizen/20201110.071658
INSUN PYO [Mon, 9 Nov 2020 11:23:03 +0000 (20:23 +0900)]
dm-verity: Cleanup verityctl shell script

Change-Id: I959263f7f2de384e1e17c1dfbb561c98cf9bf6d8

3 years agoInclude verityctl in ramdisk-recovery to remake hash table 35/246035/7 accepted/tizen/unified/20201109.123539 submit/tizen/20201104.032152 submit/tizen/20201104.064230
Kichan Kwon [Thu, 22 Oct 2020 10:49:12 +0000 (19:49 +0900)]
Include verityctl in ramdisk-recovery to remake hash table

Change-Id: I8d50fefad2b1892ea223e14bea7219eddc03becc
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
3 years agoEnable making block device's hash table 34/246034/5
Kichan Kwon [Thu, 22 Oct 2020 10:42:54 +0000 (19:42 +0900)]
Enable making block device's hash table

Change-Id: I1a9aa283dd81a0f2922a256c5ab9c0b8c8d5ab6b
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
3 years agoAdd ramdisk-flush.service to free /dev/ram0 45/242245/2 accepted/tizen_6.0_unified_hotfix tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.115530 accepted/tizen/6.0/unified/hotfix/20201103.003821 accepted/tizen/unified/20200828.121620 submit/tizen/20200826.073249 submit/tizen_6.0/20201029.205104 submit/tizen_6.0_hotfix/20201102.192504 submit/tizen_6.0_hotfix/20201103.114804 tizen_6.0.m2_release
INSUN PYO [Tue, 25 Aug 2020 07:10:40 +0000 (16:10 +0900)]
Add ramdisk-flush.service to free /dev/ram0

After booting is complete, the memory of /dev/ram0 used by initrd is still wasted.
Run "/sbin/blockdev --flushbufs /dev/ram0" to free this memory.

Caution: You can't run this command before "chroot . /sbin/init" in the initrd.
Because init is still running on /dev/ram0.

Change-Id: Ia751db9b3eb660de980d6a223fe5dc7bef511f87

3 years agoApply 1 ignore_zero_blocks optimization to dm-verity setup 76/241976/1 accepted/tizen/unified/20200824.134507 submit/tizen/20200821.075138
Hyotaek Shim [Fri, 21 Aug 2020 07:46:00 +0000 (16:46 +0900)]
Apply 1 ignore_zero_blocks optimization to dm-verity setup

Change-Id: I57e66b868eab7ab3b08a06c8bd3d97aa42c8040a
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agoscripts: init.sh: Remove the btrfs balance command 21/240521/2 accepted/tizen/unified/20200812.144013 submit/tizen/20200811.023910
Junghoon Kim [Fri, 7 Aug 2020 05:09:34 +0000 (14:09 +0900)]
scripts: init.sh: Remove the btrfs balance command

The upgraded mic package is adopted in the public image server and it
uses the metadata single option when building the btrfs image.
Thus, remove the btrfs balance command that changes the btrfs filesystem
to single metadata because this is redundant.

Change-Id: Iaf361b0daed2f995f526ade51e9e60ad3212a201
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
3 years agoscripts: init.sh: change old directory of pivot_root 72/240172/2 accepted/tizen/unified/20200806.062536 submit/tizen/20200804.085126 submit/tizen/20200805.100826 submit/tizen/20200806.015616
INSUN PYO [Tue, 4 Aug 2020 04:49:51 +0000 (13:49 +0900)]
scripts: init.sh: change old directory of pivot_root

The /sysroot is always read-only when dm-verity is enabled.
So, we can not create /sysroot/initrd.
The /sysroot/mnt/initrd directory is created by initrd package and we can use it instead of /sysroot/initrd.

Change-Id: Iad3ed304c2bd58e5823cbcdac4cb7dd530ef4102

3 years agoEnable dmverity 67/239967/2 accepted/tizen/unified/20200804.142351 submit/tizen/20200804.040003
INSUN PYO [Fri, 31 Jul 2020 05:48:00 +0000 (14:48 +0900)]
Enable dmverity

Change-Id: Ib83af50f2b1b7788f8aec6d51bb8c880a4b664ea

3 years agodm-verity: change dm-verity tool from veritysetup to dmsetup 91/239991/5 accepted/tizen/unified/20200804.142359 submit/tizen/20200804.010602
INSUN PYO [Fri, 31 Jul 2020 09:11:18 +0000 (18:11 +0900)]
dm-verity: change dm-verity tool from veritysetup to dmsetup

The current version of veritysetup does not support some options.
 - ignore_corruption
 - restart_on_corruption
 - ignore_zero_blocks
 - check_at_most_once

Refer: https://gitlab.com/cryptsetup/cryptsetup/-/wikis/DMVerity

Change-Id: If50db143182444153c643bfd1ba11f26b61c7df0

3 years agodm-verity: fix booting fail on non dm-verity target 41/239841/4 accepted/tizen/unified/20200731.145750 submit/tizen/20200730.105330
INSUN PYO [Thu, 30 Jul 2020 06:01:45 +0000 (15:01 +0900)]
dm-verity: fix booting fail on non dm-verity target

Second reboot fails on non dm-verity target.

The initrd reads meta data for dm-verity in the area after block size,
because block size and partition size are the same by resize2fs.
A dd util is used, and dd waits indefinitely for reading outside this region.

 |---------------------------------------------|
 |                            | expected meta  |
 |____________________________|________________|
                              ^
                              |
partiion end
   block end

This also happens on the second boot, after "verityctl disable" on dm-verity target.

Change-Id: I948b80d94b9251c88aac13eec1f62e0719681ac0

3 years agodm-verity: implement "verityctl format" and "verityctl disable" command 12/239712/7 accepted/tizen/unified/20200730.063318 submit/tizen/20200730.033924
INSUN PYO [Wed, 29 Jul 2020 06:40:37 +0000 (15:40 +0900)]
dm-verity: implement "verityctl format"  and "verityctl disable" command

Change-Id: I630c40e7e673fa71f3709e9789ba176a91c26db0