Guest User

Untitled

a guest
Jun 21st, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. target=vibrantmtd
  4. export ANDROID_BUILD_TOP=~/android/aosp
  5.  
  6. setup ()
  7. {
  8. if [ x = "x$ANDROID_BUILD_TOP" ] ; then
  9. echo "Android build environment must be configured"
  10. exit 1
  11. fi
  12. . "$ANDROID_BUILD_TOP"/build/envsetup.sh
  13.  
  14. KERNEL_DIR=~/android/kernel/ICS/aries/sgs/DerTefuel
  15. BUILD_DIR="$KERNEL_DIR/build"
  16. MODULES=("fs/cifs/cifs.ko" "fs/fuse/fuse.ko" "fs/nls/nls_utf8.ko")
  17.  
  18. if [ x = "x$NO_CCACHE" ] && ccache -V &>/dev/null ; then
  19. CCACHE=ccache
  20. CCACHE_BASEDIR="$KERNEL_DIR"
  21. CCACHE_COMPRESS=1
  22. CCACHE_DIR="$BUILD_DIR/.ccache"
  23. export CCACHE_DIR CCACHE_COMPRESS CCACHE_BASEDIR
  24. else
  25. CCACHE=""
  26. fi
  27.  
  28. CROSS_PREFIX=/home/nelson/android/toolchain/arm-2009q3/bin/arm-none-linux-gnueabi-
  29. }
  30.  
  31. build ()
  32. {
  33. local target=$1
  34. echo "Building for $target"
  35. local target_dir="$BUILD_DIR/$target"
  36. local module
  37. rm -fr "$target_dir"
  38. mkdir -p "$target_dir/usr"
  39. cp "$KERNEL_DIR/usr/"*.list "$target_dir/usr"
  40. sed "s|usr/|$KERNEL_DIR/usr/|g" -i "$target_dir/usr/"*.list
  41. mka -C "$KERNEL_DIR" O="$target_dir" aries_${target}_defconfig HOSTCC="$CCACHE gcc"
  42. mka -C "$KERNEL_DIR" O="$target_dir" HOSTCC="$CCACHE gcc" CROSS_COMPILE="$CCACHE $CROSS_PREFIX" zImage modules
  43. cp "$target_dir"/arch/arm/boot/zImage $ANDROID_BUILD_TOP/device/samsung/$target/kernel
  44. for module in "${MODULES[@]}" ; do
  45. cp "$target_dir/$module" $ANDROID_BUILD_TOP/device/samsung/$target
  46. done
  47. }
  48.  
  49. setup
  50.  
  51. if [ "$1" = clean ] ; then
  52. rm -fr "$BUILD_DIR"/*
  53. exit 0
  54. fi
  55.  
  56. targets=("$@")
  57. if [ 0 = "${#targets[@]}" ] ; then
  58. targets=(vibrantmtd)
  59. fi
  60.  
  61. START=$(date +%s)
  62.  
  63. for target in "${targets[@]}" ; do
  64. build $target
  65. done
  66.  
  67. #echo "launching packaging script"
  68. #~/android/ics/release/doit.sh
  69.  
  70. END=$(date +%s)
  71. ELAPSED=$((END - START))
  72. E_MIN=$((ELAPSED / 60))
  73. E_SEC=$((ELAPSED - E_MIN * 60))
  74. printf "Elapsed: "
  75. [ $E_MIN != 0 ] && printf "%d min(s) " $E_MIN
  76. printf "%d sec(s)\n" $E_SEC
Add Comment
Please, Sign In to add comment