From patchwork Wed Mar 15 12:43:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 9625513 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C6E04604A9 for ; Wed, 15 Mar 2017 12:43:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA76D28611 for ; Wed, 15 Mar 2017 12:43:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ABB5028619; Wed, 15 Mar 2017 12:43:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 11D8228611 for ; Wed, 15 Mar 2017 12:43:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=OpHY+ftCSgyAnHGSB7yikK2LzZKsRISK7ucCITh5ToI=; b=qFk 2+hQqMCuDOJEflo4f6rXoxDigrPKV02Q12e5jdbqz74Gk5K46X5Kx6x2TOjDcMJpAwcyJ9dFzwXBP ZERFrbw4eWx4yl8CakYRLsk7WivFzytaRy4WY3fAp7p2Bq1TG7mUJesi8Vj1xJgxH6N/eKQIhmpPs Ugz65Ugvcby7G2hcOAKHbAhDK94gXBvMHSIisSyIGi4FOUnLJ7ZF8/TjvUK6uPupDp+tAFH9+Ipg4 tsUmBIKmYJIvtd5FkNHokfdy//IcsEnrNiRtd3v8H+GP+uzLqTU9IMteKT8uzrnv8YetTXKppNHt0 4lRT+cO0g6J+wJr9TZHjk17zUPEr8/w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1co8HE-0008HK-W2; Wed, 15 Mar 2017 12:43:41 +0000 Received: from [179.95.63.235] (helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1co8HC-0008GX-3x; Wed, 15 Mar 2017 12:43:38 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.87) (envelope-from ) id 1co8H2-0007J7-7V; Wed, 15 Mar 2017 09:43:28 -0300 From: Mauro Carvalho Chehab To: Russell King Subject: [PATCH] arm: install.sh: don't use /sbin/install if cross-compiling Date: Wed, 15 Mar 2017 09:43:21 -0300 Message-Id: X-Mailer: git-send-email 2.9.3 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP It doesn't make sense to run the local machine's install script if the Kernel was built using a cross-compiler, as it will try to create symlinks at the rootfs on the local machine: $ export ROOTDIR=/devel/arm_rootdir/ $ make CROSS_COMPILE=arm-linux- ARCH=arm INSTALL_PATH=$ROOTDIR INSTALL_MOD_PATH=$ROOTDIR INSTALL_FW_PATH=$ROOTDIR INSTALL_HDR_PATH=$ROOTDIR zinstall /bin/sh ./arch/arm/boot/install.sh "4.11.0-rc1-00545-g940f6daec092-dirty" \ arch/arm/boot/zImage System.map "/devel/arm_rootdir/" ln: failed to create symbolic link '/boot/System.map': Permission denied ln: failed to create symbolic link '/boot/vmlinuz': Permission denied ln: failed to create symbolic link '/boot/System.map': Permission denied Signed-off-by: Mauro Carvalho Chehab --- arch/arm/boot/install.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/install.sh b/arch/arm/boot/install.sh index 2a45092a40e3..32f821df524d 100644 --- a/arch/arm/boot/install.sh +++ b/arch/arm/boot/install.sh @@ -35,8 +35,11 @@ verify "$2" verify "$3" # User may have a custom install script -if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi -if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi + +if [ "x$CROSS_COMPILE" == "x" ]; then + if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi + if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi +fi if [ "$(basename $2)" = "zImage" ]; then # Compressed install