summaryrefslogtreecommitdiffstats
path: root/envsetup.sh
diff options
context:
space:
mode:
authorKhalid Zubair <kzubair@cyngn.com>2015-10-21 12:43:14 -0700
committerEthan Chen <intervigil@gmail.com>2016-01-04 11:27:34 -0800
commitfdc26cd560c2cd870f73fb44302dcff174048dbf (patch)
treebcf65ef10694480850bb332e0663788858e8cd0f /envsetup.sh
parent2a70972835ad79349f60727a819879a59e532df0 (diff)
downloadbuild-fdc26cd560c2cd870f73fb44302dcff174048dbf.zip
build-fdc26cd560c2cd870f73fb44302dcff174048dbf.tar.gz
build-fdc26cd560c2cd870f73fb44302dcff174048dbf.tar.bz2
mms: introduce a shortcut to quickly rebuild kernel/boot.img
Add a new shortcut to short circuit the long build process that walks the entire tree collecting all Android.mks. The resulting dependency list is sufficient to rebuild the kernel, copy product files and repack the system image with updated modules. This shortcut allows Kernel devs to rebuild just the boot.img and kernel modules very quickly (20s vs 3min). Change-Id: Ie0a69f241ea7b920859ff1e02c3542b79952462c
Diffstat (limited to 'envsetup.sh')
-rw-r--r--envsetup.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/envsetup.sh b/envsetup.sh
index cb49f2a..38f9c6c 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -13,6 +13,8 @@ Invoke ". build/envsetup.sh" from your shell to add the following functions to y
- mmp: Builds all of the modules in the current directory and pushes them to the device.
- mmmp: Builds all of the modules in the supplied directories and pushes them to the device.
- mmma: Builds all of the modules in the supplied directories, and their dependencies.
+- mms: Short circuit builder. Quickly re-build the kernel, rootfs, boot and system images
+ without deep dependencies. Requires the full build to have run before.
- cgrep: Greps on all local C/C++ files.
- ggrep: Greps on all local Gradle files.
- jgrep: Greps on all local Java files.
@@ -2138,6 +2140,30 @@ function cmka() {
fi
}
+function mms() {
+ local T=$(gettop)
+ if [ -z "$T" ]
+ then
+ echo "Couldn't locate the top of the tree. Try setting TOP."
+ return 1
+ fi
+
+ case `uname -s` in
+ Darwin)
+ local NUM_CPUS=$(sysctl hw.ncpu|cut -d" " -f2)
+ ONE_SHOT_MAKEFILE="__none__" \
+ make -C $T -j $NUM_CPUS "$@"
+ ;;
+ *)
+ local NUM_CPUS=$(cat /proc/cpuinfo | grep "^processor" | wc -l)
+ ONE_SHOT_MAKEFILE="__none__" \
+ mk_timer schedtool -B -n 1 -e ionice -n 1 \
+ make -C $T -j $NUM_CPUS "$@"
+ ;;
+ esac
+}
+
+
function repolastsync() {
RLSPATH="$ANDROID_BUILD_TOP/.repo/.repo_fetchtimes.json"
RLSLOCAL=$(date -d "$(stat -c %z $RLSPATH)" +"%e %b %Y, %T %Z")