tizen: bootscript: amlogic: unpack initramfs and pass its actual size to kernel 36/318736/3
authorMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 7 Oct 2024 14:40:28 +0000 (16:40 +0200)
committerJaehoon Chung <jh80.chung@samsung.com>
Fri, 18 Oct 2024 02:06:21 +0000 (11:06 +0900)
commitc1be39f87f44eea24b3ea0922a8707a99a552937
tree3d5ec25c4196926c6f9f9622ecb4fbeaeb197a1e
parent6834e6f543c1a83c9e192cdf80f8c24af3882546
tizen: bootscript: amlogic: 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.

In case of Amlogic based boards boot script, kernel load address has to
be recalculated and adjusted to next the 4k page boundary.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I2b1a6e46237ad2de37154154b2a50959aacfa1a1
tizen/bootscript/tizen-boot-amlogic-64b.scr