Commit ab160dbb authored by Sylvain BERTRAND's avatar Sylvain BERTRAND Committed by Michal Marek

scripts: fix link-vmlinux.sh bash-ism

While building linux with dash shell:
  LINK    vmlinux
trap: SIGHUP: bad trap
/src/linux-4.0/Makefile:933: recipe for target 'vmlinux' failed
make[1]: *** [vmlinux] Error 1

See the following document for behavior of posix shell trap instruction:
http://pubs.opengroup.org/onlinepubs/000095399/utilities/trap.html

Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: default avatarSylvain BERTRAND <sylvain.bertrand@gmail.com>
Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
parent ee4eb20d
...@@ -111,7 +111,6 @@ sortextable() ...@@ -111,7 +111,6 @@ sortextable()
} }
# Delete output files in case of error # Delete output files in case of error
trap cleanup SIGHUP SIGINT SIGQUIT SIGTERM ERR
cleanup() cleanup()
{ {
rm -f .old_version rm -f .old_version
...@@ -124,6 +123,20 @@ cleanup() ...@@ -124,6 +123,20 @@ cleanup()
rm -f vmlinux.o rm -f vmlinux.o
} }
on_exit()
{
if [ $? -ne 0 ]; then
cleanup
fi
}
trap on_exit EXIT
on_signals()
{
exit 1
}
trap on_signals HUP INT QUIT TERM
# #
# #
# Use "make V=1" to debug this script # Use "make V=1" to debug this script
...@@ -231,7 +244,6 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then ...@@ -231,7 +244,6 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then
if ! cmp -s System.map .tmp_System.map; then if ! cmp -s System.map .tmp_System.map; then
echo >&2 Inconsistent kallsyms data echo >&2 Inconsistent kallsyms data
echo >&2 Try "make KALLSYMS_EXTRA_PASS=1" as a workaround echo >&2 Try "make KALLSYMS_EXTRA_PASS=1" as a workaround
cleanup
exit 1 exit 1
fi fi
fi fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment