diff options
author | Sylvain BERTRAND <sylvain.bertrand@gmail.com> | 2015-05-07 00:36:04 +0000 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2015-05-07 12:42:03 +0200 |
commit | ab160dbbc4ba71a4e339382d37b31ea44fd43e86 (patch) | |
tree | 2c139a548615c7d7cf8f5707be57eefda6ff27cc /scripts | |
parent | ee4eb20dbce91751c248399e8a0cf9b8813adf5a (diff) | |
download | linux-ab160dbbc4ba71a4e339382d37b31ea44fd43e86.tar.gz linux-ab160dbbc4ba71a4e339382d37b31ea44fd43e86.tar.bz2 linux-ab160dbbc4ba71a4e339382d37b31ea44fd43e86.zip |
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: Sylvain BERTRAND <sylvain.bertrand@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/link-vmlinux.sh | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index 86a4fe75f453..c9a11d15d228 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -111,7 +111,6 @@ sortextable() } # Delete output files in case of error -trap cleanup SIGHUP SIGINT SIGQUIT SIGTERM ERR cleanup() { rm -f .old_version @@ -124,6 +123,20 @@ cleanup() 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 @@ -231,7 +244,6 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then if ! cmp -s System.map .tmp_System.map; then echo >&2 Inconsistent kallsyms data echo >&2 Try "make KALLSYMS_EXTRA_PASS=1" as a workaround - cleanup exit 1 fi fi |