Skip to content

Commit 7168965

Browse files
committed
gen_initramfs.sh: remove intermediate cpio_list on errors
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>
1 parent 65e00e0 commit 7168965

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎usr/gen_initramfs.sh‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ dep_list=
193193
cpio_list=$(mktemp ${TMPDIR:-/tmp}/cpiolist.XXXXXX)
194194
output="/dev/stdout"
195195

196+
trap "rm -f $cpio_list" EXIT
197+
196198
while [ $# -gt 0 ]; do
197199
arg="$1"
198200
shift
@@ -243,4 +245,3 @@ if test -n "$KBUILD_BUILD_TIMESTAMP"; then
243245
fi
244246
fi
245247
usr/gen_init_cpio $timestamp $cpio_list > $output
246-
rm $cpio_list

0 commit comments

Comments
 (0)