tizen: bootscript: unpack initramfs and pass its actual size to kernel 17/318717/1 accepted/tizen_unified_toolchain accepted/tizen/unified/20241121.055644 accepted/tizen/unified/toolchain/20241022.122700 accepted/tizen/unified/toolchain/20241022.123101 accepted/tizen/unified/x/20241011.113909 accepted/tizen/unified/x/asan/20241014.000539
authorMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 7 Oct 2024 09:28:14 +0000 (11:28 +0200)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 7 Oct 2024 09:28:38 +0000 (11:28 +0200)
commit19d9a7fecb3c36e97d1dff6ca2c1b368e584e15b
tree45b3203a74b12d1070634c39c0fba753e0dc2102
parent2189fa396478fa2c55562b284f1562b8737e4285
tizen: bootscript: unpack initramfs and pass its actual size to kernel

The initramfs ramdisk image (CPIO compressed archive) is stored on the
separate ramdisk/ramdisk-recovery partitions, thus it is not possible to
determine size of the compresszed archive. Passing the size of the
partition as the size of initramfs image to the kernel instructs the
kernel to check if the remaining bytes are another CPIO archive with more
initramfs data.

Decompressing or interpreting such additional garbage bytes sometimes
fails, what results in kernel ignoring the whole initramfs data as broken
one and thus breaking the Tizen boot sequence.

To avoid such problems and dependency on unknown/garbage data from
ramdisk partitions, lets decompres initramfs data (CPIO gzip archive)
directly in u-boot and pass the kernel only the single, uncompressed CPIO
archive as iniramfs image.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I5f4f0d70d5db864eef5a8eb28582feaa46e44d8a
tizen/bootscript/tizen-boot-bpif3.scr