chris41g

installer

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