From 88f828e91ff4f13fb3d4f873fc0eedd6ef49a156 Mon Sep 17 00:00:00 2001 From: Bhanu Chetlapalli Date: Mon, 21 May 2012 16:39:51 -0700 Subject: [MIPS] Add MIPS support to build-kernel.sh Enables building of mips goldfish kernel Signed-Off-By: Bhanu Chetlapalli --- distrib/build-kernel.sh | 21 ++++++++++++++++++--- docs/ANDROID-KERNEL.TXT | 5 +++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/distrib/build-kernel.sh b/distrib/build-kernel.sh index 20d85c6..ec5c4f1 100755 --- a/distrib/build-kernel.sh +++ b/distrib/build-kernel.sh @@ -134,6 +134,10 @@ else CROSSTOOLCHAIN=i686-android-linux-4.4.3 CROSSPREFIX=i686-android-linux- ;; + mips) + CROSSTOOLCHAIN=mipsel-linux-android-4.4.3 + CROSSPREFIX=mipsel-linux-android- + ;; *) echo "ERROR: Unsupported architecture!" exit 1 @@ -148,6 +152,9 @@ case $ARCH in x86) ZIMAGE=bzImage ;; + mips) + ZIMAGE= + ;; esac # If the cross-compiler is not in the path, try to find it automatically @@ -165,7 +172,11 @@ if [ $? != 0 ] ; then BUILD_TOP=$(cd $BUILD_TOP && pwd) fi fi - CROSSPREFIX=$BUILD_TOP/prebuilt/$HOST_TAG/toolchain/$CROSSTOOLCHAIN/bin/$CROSSPREFIX + if [ "$ARCH" = "mips" ]; then + CROSSPREFIX=$BUILD_TOP/prebuilts/gcc/$HOST_TAG/$ARCH/$CROSSTOOLCHAIN/bin/$CROSSPREFIX + else + CROSSPREFIX=$BUILD_TOP/prebuilt/$HOST_TAG/toolchain/$CROSSTOOLCHAIN/bin/$CROSSPREFIX + fi if [ "$BUILD_TOP" -a -f ${CROSSPREFIX}gcc ]; then echo "Auto-config: --cross=$CROSSPREFIX" else @@ -225,8 +236,12 @@ case $CONFIG in OUTPUT_VMLINUX=vmlinux-$CONFIG esac -cp -f arch/$ARCH/boot/$ZIMAGE $OUTPUT/$OUTPUT_KERNEL cp -f vmlinux $OUTPUT/$OUTPUT_VMLINUX +if [ ! -z $ZIMAGE ]; then + cp -f arch/$ARCH/boot/$ZIMAGE $OUTPUT/$OUTPUT_KERNEL + echo "Kernel $CONFIG prebuilt images ($OUTPUT_KERNEL and $OUTPUT_VMLINUX) copied to $OUTPUT successfully !" +else + echo "Kernel $CONFIG prebuilt image ($OUTPUT_VMLINUX) copied to $OUTPUT successfully !" +fi -echo "Kernel $CONFIG prebuilt images ($OUTPUT_KERNEL and $OUTPUT_VMLINUX) copied to $OUTPUT successfully !" exit 0 diff --git a/docs/ANDROID-KERNEL.TXT b/docs/ANDROID-KERNEL.TXT index d5a1930..9305ff0 100644 --- a/docs/ANDROID-KERNEL.TXT +++ b/docs/ANDROID-KERNEL.TXT @@ -25,6 +25,11 @@ To rebuild the x86 kernel: cd $KERNEL_SOURCES /path/to/rebuild-kernel.sh --arch=x86 --out=$ANDROID/prebuilt/android-x86/kernel +To rebuild the MIPS kernel: + + cd $KERNEL_SOURCES + /path/to/rebuild-kernel.sh --arch=mips --out=$ANDROID/prebuilts/qemu-kernel/mips + Note that you will need to have your cross-toolchain in your path. If this is not the case, the script will complain and give you the expected name. Use --cross= to specify a different toolchain. -- cgit v1.1