diff --git a/releasetools/bootloader.sh b/releasetools/bootloader.sh new file mode 100755 index 0000000..b91717c --- /dev/null +++ b/releasetools/bootloader.sh @@ -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 diff --git a/releasetools/checksys.sh b/releasetools/checksys.sh new file mode 100755 index 0000000..7a7da4d --- /dev/null +++ b/releasetools/checksys.sh @@ -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 \ No newline at end of file diff --git a/releasetools/squisher b/releasetools/squisher index 59f9e74..f1c12a7 100755 --- a/releasetools/squisher +++ b/releasetools/squisher @@ -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; )