blob: 538660d869bc6e2888910edff73d401133914e44 [file] [log] [blame]
xplodwild3e9d0bb2013-08-24 17:40:37 +01001function __print_omni_functions_help() {
2cat <<EOF
3Additional OmniROM functions:
4- breakfast: Setup the build environment, but only list
5 devices we support.
6- brunch: Sets up build environment using breakfast(),
7 and then comiles using mka() against bacon target.
8- mka: Builds using SCHED_BATCH on all processors.
xplodwildcb52eae2013-08-29 20:18:18 +02009- pushboot: Push a file from your OUT dir to your phone and
10 reboots it, using absolute path.
Pulser72e23242013-09-29 09:56:55 +010011- repopick: Utility to fetch changes from Gerrit.
xplodwild3e9d0bb2013-08-24 17:40:37 +010012EOF
13}
14
15function brunch()
16{
17 breakfast $*
18 if [ $? -eq 0 ]; then
19 time mka bacon
20 else
21 echo "No such item in brunch menu. Try 'breakfast'"
22 return 1
23 fi
24 return $?
25}
26
27function breakfast()
28{
29 target=$1
Archi7152fc42014-02-28 19:18:54 +010030 local variant=$2
xplodwild3e9d0bb2013-08-24 17:40:37 +010031 CUSTOM_DEVICES_ONLY="true"
32 unset LUNCH_MENU_CHOICES
33 add_lunch_combo full-eng
34 for f in `/bin/ls device/*/*/vendorsetup.sh 2> /dev/null`
35 do
36 echo "including $f"
37 . $f
38 done
39 unset f
40
41 if [ $# -eq 0 ]; then
42 # No arguments, so let's have the full menu
43 lunch
44 else
45 echo "z$target" | grep -q "-"
46 if [ $? -eq 0 ]; then
47 # A buildtype was specified, assume a full device name
48 lunch $target
49 else
50 # This is probably just the omni model name
Archi7152fc42014-02-28 19:18:54 +010051 if [ -z "$variant" ]; then
52 variant="userdebug"
53 fi
54 lunch omni_$target-$variant
xplodwild3e9d0bb2013-08-24 17:40:37 +010055 fi
56 fi
57 return $?
58}
59
60alias bib=breakfast
61
62# Make using all available CPUs
63function mka() {
64 case `uname -s` in
65 Darwin)
66 make -j `sysctl hw.ncpu|cut -d" " -f2` "$@"
67 ;;
68 *)
69 schedtool -B -n 1 -e ionice -n 1 make -j `cat /proc/cpuinfo | grep "^processor" | wc -l` "$@"
70 ;;
71 esac
72}
xplodwildcb52eae2013-08-29 20:18:18 +020073
74function pushboot() {
75 if [ ! -f $OUT/$* ]; then
76 echo "File not found: $OUT/$*"
77 return 1
78 fi
79
80 adb root
81 sleep 1
82 adb wait-for-device
83 adb remount
84
85 adb push $OUT/$* /$*
86 adb reboot
87}
Pulser72e23242013-09-29 09:56:55 +010088
89function repopick() {
90 set_stuff_for_environment
91 T=$(gettop)
92 $T/vendor/omni/build/tools/repopick.py $@
93}
94