| # Squish a CM otapackage for distribution |
| . $ANDROID_BUILD_TOP/vendor/cm/tools/functions |
| OUT_TARGET_HOST=`uname -a | grep Darwin` |
| if [ -z "$OUT_TARGET_HOST" ] |
| OUT_TARGET_HOST=linux-x86 |
| XARGS="xargs --max-args=1 --max-procs `grep 'processor' /proc/cpuinfo|wc -l`" |
| OUT_TARGET_HOST=darwin-x86 |
| XARGS="xargs -n 1 -P `sysctl hw.ncpu | awk '{print $2}'`" |
| if [ -z "$OUT" -o ! -d "$OUT" ]; then |
| echo -e $CL_RED"ERROR: $0 only works with a full build environment. $OUT should exist."$CL_RST |
| if [ ! -f "$OTAPACKAGE" ]; then |
| echo -e $CL_RED"$OTAPACKAGE doesn't exist!"$CL_RST; |
| # Determine what to name the new package |
| MODVERSION=`sed -n -e'/ro\.cm\.version/s/^.*=//p' $OUT/system/build.prop` |
| echo -e $CL_CYN"MODVERSION: $MODVERSION"$CL_RST |
| OUTFILE=$OUT/cm-$MODVERSION.zip |
| ln -f $OTAPACKAGE $OUTFILE |
| # Create a md5 checksum image of the repacked package |
| echo -e $CL_GRN"Package complete: $OUTFILE"$CL_RST |
| echo -e $CL_GRN"md5: $(cat $img.md5sum | awk '{ print $1 }')"$CL_RST |