[kteam-tools][PATCH] git-build-kernel: cross-compile instead of $ARCH chroot

Kamal Mostafa kamal at canonical.com
Thu Sep 12 16:57:44 UTC 2013


Signed-off-by: Kamal Mostafa <kamal at canonical.com>
Cc: Brad Figg <brad.figg at canonical.com>
Cc: Steve Conklin <steve.conklin at canonical.com>
---
 git-build-kernel/git-build-kernel | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
index a62d00c..c4a8f6c 100755
--- a/git-build-kernel/git-build-kernel
+++ b/git-build-kernel/git-build-kernel
@@ -81,7 +81,9 @@ then
     CHROOT="${GITREPODIR##ubuntu-}"
     CHROOT="${CHROOT%.git}"
 fi
-CHROOT="$CHROOT-$ARCH" # append the arch to the chroot name
+### Cross-compile in an amd64 chroot; don't use an ARCH chroot.
+# CHROOT="$CHROOT-$ARCH" # append the arch to the chroot name
+CHROOT="$CHROOT-amd64"
 
 ### Get the version number - we need it to locate the orig tarball
 VERSION=`echo "$chg" | sed -n -e '1s/^.*(\([^)]*\)).*$/\1/p'`
@@ -115,6 +117,7 @@ trap "rm -rf $WORKDIR/building $BUILDDIR" 0
 echo "git-build-kernel ($CHROOT)"
 echo "      version: $DISTRO ($VERSION)"
 echo "      targets: $TARGETS"
+echo "         arch: $ARCH"
 echo "  starting build in $HOSTNAME:$WORKDIR ..."
 
 function show_elapsed
@@ -145,6 +148,8 @@ show_elapsed &
 		set -e
 		set -x
 		cd "$BUILDDIR"
+		export \$(dpkg-architecture -a$ARCH)
+		[ \$DEB_BUILD_ARCH != \$DEB_HOST_ARCH ] && export CROSS_COMPILE="\${DEB_HOST_GNU_TYPE}-"
 		fakeroot debian/rules clean
 		if [ $do_source_pkg = 1 ]
 		then
-- 
1.8.1.2





More information about the kernel-team mailing list