chris41g

dbconverter.sh

Jul 7th, 2011
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.51 KB | None | 0 0
  1. #!/sbin/sh -x
  2. mount -o remount,rw /dev/block/stl9 /system
  3. if [ ! -d /tmp ]; then
  4.     mkdir /tmp
  5. fi;
  6. cd /tmp
  7. if [ -f $1 ]; then
  8.     /tmp/busybox unzip -qq $1 META-INF/com/google/android/updater-script -d /tmp/ #extract the updater-script quietly to /tmp/
  9. fi;
  10. if [ -f /tmp/META-INF/com/google/android/updater-script ]; then
  11.     sed -i 1i"# Script modified by Dual Boot installer" /tmp/META-INF/com/google/android/updater-script; #add disclosure
  12.     sed -i 's/stl9/mmcblk0p2/g' /tmp/META-INF/com/google/android/updater-script; #replace system partition with system sd card
  13.     sed -i 's/stl10/mmcblk0p3/g' /tmp/META-INF/com/google/android/updater-script; #replace data partition with data sd card
  14.     sed -i 's/stl11/mmcblk0p4/g' /tmp/META-INF/com/google/android/updater-script; #replace cache partition with cache sd card
  15.     sed -i '/\/dev\/block\/bml7/d' /tmp/META-INF/com/google/android/updater-script; #disable kernel flash
  16.     sed -i 's/[ \t]*$//' /tmp/META-INF/com/google/android/updater-script; #remove trailing whitespaces
  17.     sed -i 's/.$//' /tmp/META-INF/com/google/android/updater-script; #convert to UNIX LF line endings just in case
  18.     echo '#Kernel flashing disabled by DualBoot installer script' >> /tmp/META-INF/com/google/android/updater-script; #add string to end of file
  19.     echo 'ui_print("Flashing Kernel Disabled by Install Script");' >> /tmp/META-INF/com/google/android/updater-script; #add string to end of file
  20.     /tmp/zip -qqru0 $1 META-INF/; #put the updater-script back
  21. fi;
  22. if [ -d /tmp/META-INF ]; then
  23.     rm -R /tmp/META-INF;
  24. fi;
Advertisement
Add Comment
Please, Sign In to add comment