From fdc26cd560c2cd870f73fb44302dcff174048dbf Mon Sep 17 00:00:00 2001 From: Khalid Zubair Date: Wed, 21 Oct 2015 12:43:14 -0700 Subject: 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 --- envsetup.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'envsetup.sh') 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") -- cgit v1.1