update releasetools to create unified updater-script

This commit is contained in:
milaq 2012-06-05 14:24:53 +02:00
parent 7d83230817
commit 03bd44d0d1
3 changed files with 40 additions and 0 deletions

26
releasetools/bootloader.sh Executable file
View File

@ -0,0 +1,26 @@
#!/bin/sh
#
# Copyright (C) 2012 the cmhtcleo team
#
echo "updater-script: making compatible update script"
cd $REPACK/ota/META-INF/com/google/android
cat updater-script >> temp
rm -rf updater-script
grep -vw "unmount" temp > updater-script
rm -rf temp
echo 'package_extract_file("checksys.sh","/tmp/checksys.sh");' >> updater-script
echo 'set_perm(0, 0, 755, "/tmp/checksys.sh");' >> updater-script
echo 'run_program("/tmp/checksys.sh");' >> updater-script
echo 'if file_getprop("/tmp/nfo.prop","clk") == "true" then' >> updater-script
echo ' ui_print("cLK detected, using ppp for data connections");' >> updater-script
echo 'else' >> updater-script
echo ' ui_print("MAGLDR detected, using rmnet for data connections");' >> updater-script
echo ' delete("/system/ppp");' >> updater-script
echo 'endif;' >> updater-script
echo 'unmount("/system");' >> updater-script
echo "updater-script: copying checksys.sh"
cp $ANDROID_BUILD_TOP/device/htc/leo/releasetools/checksys.sh $REPACK/ota

11
releasetools/checksys.sh Executable file
View File

@ -0,0 +1,11 @@
#!/sbin/sh
# checksys.sh
output=`grep -i "clk" /proc/cmdline`
if [ -n "$output" ]
then
echo "clk=true" > /tmp/nfo.prop
else
echo "clk=null" > /tmp/nfo.prop
fi

View File

@ -145,6 +145,9 @@ $SED -i \
-e '/ro\.build\.type/s/eng/user/' \
$REPACK/ota/system/build.prop
# include bootloader script for leo
. $ANDROID_BUILD_TOP/device/htc/leo/releasetools/bootloader.sh
# Delete unnecessary binaries
( cd $REPACK/ota/system/bin; echo $DELETE_BINS | xargs rm -f; )