Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752010AbbEGAgP (ORCPT ); Wed, 6 May 2015 20:36:15 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:35320 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751776AbbEGAgK (ORCPT ); Wed, 6 May 2015 20:36:10 -0400 Date: Thu, 7 May 2015 00:36:04 +0000 From: sylvain.bertrand@gmail.com To: Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] scripts: fix link-vmlinux.sh bash-ism Message-ID: <20150507003604.GA16571@freedom> References: <20141229163456.GB27533@dhcppc1> <54A6BF7E.8070003@suse.cz> <20150303163453.GA21318@localhost.localdomain> <550895A1.1000901@suse.cz> <20150427152525.GA22179@freedom> <20150506135422.GA24849@freedom> <554A2457.70609@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <554A2457.70609@suse.cz> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1371 Lines: 56 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 Signed-off-by: Sylvain BERTRAND --- --- a/scripts/link-vmlinux.sh 2014-12-29 15:10:29.436431249 +0000 +++ b/scripts/link-vmlinux.sh 2014-12-29 16:23:06.010853608 +0000 @@ -111,7 +111,6 @@ } # Delete output files in case of error -trap cleanup SIGHUP SIGINT SIGQUIT SIGTERM ERR cleanup() { rm -f .old_version @@ -124,6 +123,20 @@ 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 ! 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/