aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSylvain BERTRAND <sylvain.bertrand@gmail.com>2015-05-06 20:36:04 -0400
committerMichal Marek <mmarek@suse.cz>2015-05-07 06:42:03 -0400
commitab160dbbc4ba71a4e339382d37b31ea44fd43e86 (patch)
tree2c139a548615c7d7cf8f5707be57eefda6ff27cc /scripts
parentee4eb20dbce91751c248399e8a0cf9b8813adf5a (diff)
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-xscripts/link-vmlinux.sh16
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()
111} 111}
112 112
113# Delete output files in case of error 113# Delete output files in case of error
114trap cleanup SIGHUP SIGINT SIGQUIT SIGTERM ERR
115cleanup() 114cleanup()
116{ 115{
117 rm -f .old_version 116 rm -f .old_version
@@ -124,6 +123,20 @@ cleanup()
124 rm -f vmlinux.o 123 rm -f vmlinux.o
125} 124}
126 125
126on_exit()
127{
128 if [ $? -ne 0 ]; then
129 cleanup
130 fi
131}
132trap on_exit EXIT
133
134on_signals()
135{
136 exit 1
137}
138trap on_signals HUP INT QUIT TERM
139
127# 140#
128# 141#
129# Use "make V=1" to debug this script 142# Use "make V=1" to debug this script
@@ -231,7 +244,6 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then
231 if ! cmp -s System.map .tmp_System.map; then 244 if ! cmp -s System.map .tmp_System.map; then
232 echo >&2 Inconsistent kallsyms data 245 echo >&2 Inconsistent kallsyms data
233 echo >&2 Try "make KALLSYMS_EXTRA_PASS=1" as a workaround 246 echo >&2 Try "make KALLSYMS_EXTRA_PASS=1" as a workaround
234 cleanup
235 exit 1 247 exit 1
236 fi 248 fi
237fi 249fi