Make squisher less verbose and check for mksquashfs.
If mksquashfs is unavailable then set NO_SQUASHFS true so that a valid OTA package is created. Reduces the amount of output by (optionally) using quite zip/unzip Make better use of sed (we don't need grep|sed as sed can match input).
This commit is contained in:
parent
0e7f64ef60
commit
304457f096
1 changed files with 9 additions and 5 deletions
|
@ -22,8 +22,9 @@ fi
|
||||||
|
|
||||||
XBIN=$OUT/system/xbin
|
XBIN=$OUT/system/xbin
|
||||||
OPTICHARGER=$ANDROID_BUILD_TOP/vendor/cyanogen/tools/opticharger
|
OPTICHARGER=$ANDROID_BUILD_TOP/vendor/cyanogen/tools/opticharger
|
||||||
|
QUIET=-q
|
||||||
DELETE_BINS="applypatch applypatch_static check_prereq recovery updater"
|
DELETE_BINS="applypatch applypatch_static check_prereq recovery updater"
|
||||||
|
[ -z "$NO_SQUASHFS" -a `which mksquashfs` = "" ] && NO_SQUASHFS=true
|
||||||
|
|
||||||
WORK=/tmp/repack
|
WORK=/tmp/repack
|
||||||
rm -rf $WORK
|
rm -rf $WORK
|
||||||
|
@ -43,7 +44,7 @@ fi
|
||||||
# Unpack the otapackage and opticharge all apks
|
# Unpack the otapackage and opticharge all apks
|
||||||
mkdir $WORK/ota
|
mkdir $WORK/ota
|
||||||
cd $WORK/ota
|
cd $WORK/ota
|
||||||
unzip $OTAPACKAGE
|
unzip $QUIET $OTAPACKAGE
|
||||||
cd system/framework
|
cd system/framework
|
||||||
$OPTICHARGER framework-res.apk
|
$OPTICHARGER framework-res.apk
|
||||||
cd ../app
|
cd ../app
|
||||||
|
@ -63,7 +64,10 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Fix build.prop
|
# Fix build.prop
|
||||||
grep -v ro.kernel.android.checkjni build.prop | sed -e "s/^ro\.build\.type=eng$/ro\.build\.type=user/g" > build.prop.new
|
sed -n -e '/ro\.kernel\.android\.checkjni/d' \
|
||||||
|
-e '/ro\.build\.type/s/eng/user/' \
|
||||||
|
-e 'p' \
|
||||||
|
build.prop > build.prop.new
|
||||||
mv build.prop.new build.prop
|
mv build.prop.new build.prop
|
||||||
|
|
||||||
# Delete unnecessary binaries
|
# Delete unnecessary binaries
|
||||||
|
@ -72,7 +76,7 @@ for i in $DELETE_BINS; do
|
||||||
done
|
done
|
||||||
|
|
||||||
# Find the CM version
|
# Find the CM version
|
||||||
MODVERSION=`grep ro.modversion build.prop | sed -e "s/^.*CyanogenMod-//g"`
|
MODVERSION=`sed -ne '/ro\.modversion/s/^.*CyanogenMod-//p' build.prop`
|
||||||
|
|
||||||
# No need for recovery
|
# No need for recovery
|
||||||
cd $WORK/ota
|
cd $WORK/ota
|
||||||
|
@ -86,7 +90,7 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Pack it up and sign
|
# Pack it up and sign
|
||||||
zip -r update.zip .
|
zip $QUIET -r update.zip .
|
||||||
echo "Signing package.."
|
echo "Signing package.."
|
||||||
SECURITYDIR=$ANDROID_BUILD_TOP/build/target/product/security
|
SECURITYDIR=$ANDROID_BUILD_TOP/build/target/product/security
|
||||||
java -Xmx2048m -jar $ANDROID_BUILD_TOP/out/host/$OUT_TARGET_HOST/framework/signapk.jar -w $SECURITYDIR/testkey.x509.pem $SECURITYDIR/testkey.pk8 update.zip update_signed.zip
|
java -Xmx2048m -jar $ANDROID_BUILD_TOP/out/host/$OUT_TARGET_HOST/framework/signapk.jar -w $SECURITYDIR/testkey.x509.pem $SECURITYDIR/testkey.pk8 update.zip update_signed.zip
|
||||||
|
|
Loading…
Reference in a new issue