From patchwork Mon Nov 1 23:31:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= X-Patchwork-Id: 296182 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oA1NjNnX022075 for ; Mon, 1 Nov 2010 23:45:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751493Ab0KAXpV (ORCPT ); Mon, 1 Nov 2010 19:45:21 -0400 Received: from mail.asbjorn.biz ([217.195.185.3]:57933 "EHLO mail.asbjorn.biz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751069Ab0KAXpV (ORCPT ); Mon, 1 Nov 2010 19:45:21 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 01 Nov 2010 23:45:24 +0000 (UTC) X-Greylist: delayed 383 seconds by postgrey-1.27 at vger.kernel.org; Mon, 01 Nov 2010 19:45:21 EDT Received: from asbjorn.it (cpe.xe-4-0-0-472.boanqu2.customer.tele.dk [62.243.45.94]) by mail.asbjorn.biz (Postfix) with ESMTPA id CC2E41C000A8; Tue, 2 Nov 2010 00:38:56 +0100 (CET) Received: by asbjorn.it (Postfix, from userid 1000) id C76561186C52; Mon, 1 Nov 2010 23:31:01 +0000 (UTC) From: Asbjoern Sloth Toennesen To: Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] kbuild, deb-pkg: fix Architecture field when cross compiling Date: Mon, 1 Nov 2010 23:31:01 +0000 Message-Id: <1288654261-8269-1-git-send-email-asbjorn@asbjorn.biz> X-Mailer: git-send-email 1.7.2.3 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org diff --git a/scripts/package/builddeb b/scripts/package/builddeb index 49b74e1..e5b7b9b 100644 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -25,8 +25,20 @@ create_package() { chown -R root:root "$pdir" chmod -R go-w "$pdir" + # Check for cross compilation + local forcearch="" + env | grep -q CROSS_COMPILE + if [ $? -eq 0 ] ; then + local debarch="" + case "$ARCH" in + x86_64) debarch="amd64" ;; + *) debarch="$ARCH" ;; + esac + forcearch="-DArchitecture=$debarch" + fi + # Create the package - dpkg-gencontrol -isp -p$pname -P"$pdir" + dpkg-gencontrol -isp $forcearch -p$pname -P"$pdir" dpkg --build "$pdir" .. }