initramfs: refactor the initramfs build rules
Currently, usr/gen_initramfs.sh takes care of all the use-cases:
[1] generates a cpio file unless CONFIG_INITRAMFS_SOURCE points to
a single cpio archive
[2] If CONFIG_INITRAMFS_SOURCE is the path to a cpio archive,
use it as-is.
[3] Compress the cpio file according to CONFIG_INITRAMFS_COMPRESSION_*
unless it is passed a compressed archive.
To simplify the script, move [2] and [3] to usr/Makefile.
If CONFIG_INITRAMFS_SOURCE is the path to a cpio archive, there is
no need to run this shell script.
For the cpio archive compression, you can re-use the rules from
scripts/Makefile.lib .
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Showing
Please register or sign in to comment