summaryrefslogtreecommitdiff
path: root/usr/gen_initramfs.sh
AgeCommit message (Collapse)Author
2020-01-16gen_initramfs.sh: remove intermediate cpio_list on errorsMasahiro Yamada
This script sets the -e option, so it exits on any error, in which case it exits without cleaning up the intermediate cpio_list. Make sure to delete it on exit. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-01-16initramfs: refactor the initramfs build rulesMasahiro Yamada
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>
2020-01-16gen_initramfs.sh: always output cpio even without -o optionMasahiro Yamada
Currently, this script outputs a cpio file when -o option is given, but otherwise a text file in the format recognized by gen_init_cpio. This behavior is unclear. Make it always output a cpio file. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-01-16initramfs: add default_cpio_list, and delete -d option supportMasahiro Yamada
When CONFIG_INITRAMFS_SOURCE is empty, the Makefile passes the -d option to gen_initramfs.sh to create the default initramfs, which contains /dev, /dev/console, and /root. This commit simplifies the default behavior; remove the -d option, and add the default cpio list. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-01-16initramfs: generate dependency list and cpio at the same timeMasahiro Yamada
Currently, this script is run twice, for the dependency list, and then for the cpio archive. The first one is re-run every time although its build log is suppressed so nobody notices it. Make it work more efficiently by generating the cpio and the dependency list at the same time. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-01-16initramfs: specify $(src)/gen_initramfs.sh as a prerequisite in MakefileMasahiro Yamada
Specify the dependency directly in the Makefile. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Greg Thelen <gthelen@google.com>
2020-01-14initramfs: rename gen_initramfs_list.sh to gen_initramfs.shMasahiro Yamada
The comments in usr/Makefile wrongly refer to the script name (twice). Line 37: # The dependency list is generated by gen_initramfs.sh -l Line 54: # 4) Arguments to gen_initramfs.sh changes There does not exist such a script. I was going to fix the comments, but after some consideration, I thought "gen_initramfs.sh" would be more suitable than "gen_initramfs_list.sh" because it generates an initramfs image in the common usage. The script generates a list that can be fed to gen_init_cpio only when it is directly run without -o or -l option. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>