From 9db7666bf4e80d84d711ee323b77301f2aef7532 Mon Sep 17 00:00:00 2001 From: Takuo Kitame Date: Fri, 29 Oct 2010 09:55:59 +0900 Subject: [PATCH] squisher: fix OS X darwin compatibility Number of processors: use sysctl on darwin. xargs: fix incompatible arguments. sed: use gsed on darwin because -i option is not compatible. Change-Id: Ic3885db592e9588f01b69843add0e287ad35d4e9 --- tools/squisher | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/squisher b/tools/squisher index 9629fa83..2f2c1a8a 100755 --- a/tools/squisher +++ b/tools/squisher @@ -9,9 +9,13 @@ if [ -z "$OUT_TARGET_HOST" ] then OUT_TARGET_HOST=linux-x86 MD5=md5sum + XARGS="xargs --max-args=1 --max-procs `grep 'processor' /proc/cpuinfo|wc -l`" + SED=sed else OUT_TARGET_HOST=darwin-x86 MD5=md5 + XARGS="xargs -n 1 -P `sysctl hw.ncpu | awk '{print $2}'`" + SED=gsed fi if [ -z "$OUT" -o ! -d "$OUT" ]; then @@ -76,7 +80,7 @@ echo cd $REPACK/ota/system/framework $OPTICHARGER framework-res.apk cd $REPACK/ota/system/app -find ./ -name \*.apk | xargs --max-args=1 --max-procs=`grep 'processor' /proc/cpuinfo | wc -l` $OPTICHARGER +find ./ -name \*.apk | $XARGS $OPTICHARGER ) @@ -105,12 +109,12 @@ if [ "$WANT_SQUASHFS" -eq 1 ]; then chmod 444 $REPACK/ota/system/xbin/xbin.sqf # Remove xbin stuff and fix up updater-script - sed -i -e's,system/xbin/su,system/bin/su,g' -e'/xbin/d' $updater + $SED -i -e's,system/xbin/su,system/bin/su,g' -e'/xbin/d' $updater fi # Fix build.prop -sed -i \ +$SED -i \ -e '/ro\.kernel\.android\.checkjni/d' \ -e '/ro\.build\.type/s/eng/user/' \ $REPACK/ota/system/build.prop