Guest User

Untitled

a guest
Apr 8th, 2018
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 9.45 KB | None | 0 0
  1. ui_print("-------------------------------");
  2. ui_print("  ICS Alpha 6 i9000/i9000b     ");
  3. ui_print("-------------------------------");
  4. ui_print("           INSTALLING          ");
  5. ui_print("-------------------------------");
  6. ui_print(" ");
  7. show_progress(1.000000, 0);
  8.  
  9. ui_print("Preparing ROM...");
  10. ui_print("-Extracting Installation Files...");
  11. set_progress(0.050000);
  12. package_extract_file("bml_over_mtd", "/tmp/bml_over_mtd");
  13. set_perm(0, 0, 0777, "/tmp/bml_over_mtd");
  14. package_extract_file("busybox", "/tmp/busybox");
  15. set_perm(0, 0, 0777, "/tmp/busybox");
  16. package_extract_file("flash_image", "/tmp/flash_image");
  17. set_perm(0, 0, 0777, "/tmp/flash_image");
  18. package_extract_file("bml_over_mtd.sh", "/tmp/bml_over_mtd.sh");
  19. set_perm(0, 0, 0777, "/tmp/bml_over_mtd.sh");
  20. package_extract_file("boot.img", "/tmp/boot.img");
  21. package_extract_file("modem.bin", "/tmp/modem.bin");
  22. set_perm(0, 0, 0777, "/tmp/modem.bin");
  23. package_extract_file("updater.sh", "/tmp/updater.sh");
  24. set_perm(0, 0, 0777, "/tmp/updater.sh");
  25. package_extract_file("make_ext4fs", "/tmp/make_ext4fs");
  26. set_perm(0, 0, 0777, "/tmp/make_ext4fs");
  27. package_extract_file("erase_image", "/tmp/erase_image");
  28. set_perm(0, 0, 0777, "/tmp/erase_image");
  29. package_extract_file("backup-batterystats", "/tmp/backup-batterystats");
  30. set_perm(0, 0, 0777, "/tmp/backup-batterystats");
  31. package_extract_file("restore-batterystats", "/tmp/restore-batterystats");
  32. set_perm(0, 0, 0777, "/tmp/restore-batterystats");
  33.  
  34. mount("yaffs2", "MTD", "system", "/system");
  35. ui_print("-Backing up batterystats.bin...");
  36. run_program("/tmp/backup-batterystats");
  37. assert(run_program("/tmp/updater.sh") == 0);
  38. set_progress(0.100000);
  39. unmount("/system");
  40.  
  41. ui_print("");
  42. ui_print("Formatting Partitions");
  43. ui_print("-Formatting /Cache...");
  44. format("yaffs2", "MTD", "cache");
  45. format("yaffs2", "MTD", "datadata");
  46. set_progress(0.200000);
  47.  
  48. ui_print("-Formatting /System...");
  49. format("yaffs2", "MTD", "system");
  50. set_progress(0.300000);set_progress(0.400000);
  51.  
  52. ui_print(" ");
  53. ui_print("Installing ROM...");
  54. mount("yaffs2", "MTD", "system", "/system");
  55. mount("yaffs2", "MTD", "datadata", "/datadata");
  56. package_extract_dir("system", "/system");
  57. package_extract_dir("datadata", "/datadata");
  58. set_progress(0.500000);
  59.  
  60. ui_print(" ");
  61. ui_print("Creating Symlinks...");
  62. symlink("busybox", "/system/xbin/[", "/system/xbin/[[",
  63.         "/system/xbin/arp", "/system/xbin/ash", "/system/xbin/awk",
  64.         "/system/xbin/basename", "/system/xbin/bbconfig", "/system/xbin/brctl",
  65.         "/system/xbin/bunzip2", "/system/xbin/bzcat", "/system/xbin/bzip2",
  66.         "/system/xbin/cal", "/system/xbin/cat", "/system/xbin/catv",
  67.         "/system/xbin/chgrp", "/system/xbin/chmod", "/system/xbin/chown",
  68.         "/system/xbin/chroot", "/system/xbin/cksum", "/system/xbin/clear",
  69.         "/system/xbin/cmp", "/system/xbin/cp", "/system/xbin/cpio",
  70.         "/system/xbin/cut", "/system/xbin/date", "/system/xbin/dc",
  71.         "/system/xbin/dd", "/system/xbin/depmod", "/system/xbin/devmem",
  72.         "/system/xbin/df", "/system/xbin/diff", "/system/xbin/dirname",
  73.         "/system/xbin/dmesg", "/system/xbin/dnsd", "/system/xbin/dos2unix",
  74.         "/system/xbin/du", "/system/xbin/echo", "/system/xbin/ed",
  75.         "/system/xbin/egrep", "/system/xbin/env", "/system/xbin/expr",
  76.         "/system/xbin/false", "/system/xbin/fdisk", "/system/xbin/fgrep",
  77.         "/system/xbin/find", "/system/xbin/fold", "/system/xbin/free",
  78.         "/system/xbin/freeramdisk", "/system/xbin/fuser", "/system/xbin/getopt",
  79.         "/system/xbin/grep", "/system/xbin/gunzip", "/system/xbin/gzip",
  80.         "/system/xbin/head", "/system/xbin/hexdump", "/system/xbin/id",
  81.         "/system/xbin/ifconfig", "/system/xbin/insmod", "/system/xbin/install",
  82.         "/system/xbin/ip", "/system/xbin/kill", "/system/xbin/killall",
  83.         "/system/xbin/killall5", "/system/xbin/length", "/system/xbin/less",
  84.         "/system/xbin/ln", "/system/xbin/losetup", "/system/xbin/ls",
  85.         "/system/xbin/lsmod", "/system/xbin/lspci", "/system/xbin/lsusb",
  86.         "/system/xbin/lzop", "/system/xbin/lzopcat", "/system/xbin/md5sum",
  87.         "/system/xbin/mkdir", "/system/xbin/mke2fs", "/system/xbin/mkfifo",
  88.         "/system/xbin/mkfs.ext2", "/system/xbin/mknod", "/system/xbin/mkswap",
  89.         "/system/xbin/mktemp", "/system/xbin/modprobe", "/system/xbin/more",
  90.         "/system/xbin/mount", "/system/xbin/mountpoint", "/system/xbin/mv",
  91.         "/system/xbin/netstat", "/system/xbin/nice", "/system/xbin/nohup",
  92.         "/system/xbin/nslookup", "/system/xbin/ntpd", "/system/xbin/od",
  93.         "/system/xbin/patch", "/system/xbin/pgrep", "/system/xbin/pidof",
  94.         "/system/xbin/ping", "/system/xbin/pkill", "/system/xbin/printenv",
  95.         "/system/xbin/printf", "/system/xbin/ps", "/system/xbin/pwd",
  96.         "/system/xbin/rdev", "/system/xbin/readlink", "/system/xbin/realpath",
  97.         "/system/xbin/renice", "/system/xbin/reset", "/system/xbin/rm",
  98.         "/system/xbin/rmdir", "/system/xbin/rmmod", "/system/xbin/route",
  99.         "/system/xbin/run-parts", "/system/xbin/sed", "/system/xbin/seq",
  100.         "/system/xbin/setsid", "/system/xbin/sh", "/system/xbin/sha1sum",
  101.         "/system/xbin/sha256sum", "/system/xbin/sha512sum",
  102.         "/system/xbin/sleep", "/system/xbin/sort", "/system/xbin/split",
  103.         "/system/xbin/stat", "/system/xbin/strings", "/system/xbin/stty",
  104.         "/system/xbin/swapoff", "/system/xbin/swapon", "/system/xbin/sync",
  105.         "/system/xbin/sysctl", "/system/xbin/tac", "/system/xbin/tail",
  106.         "/system/xbin/tar", "/system/xbin/tee", "/system/xbin/telnet",
  107.         "/system/xbin/test", "/system/xbin/tftp", "/system/xbin/time",
  108.         "/system/xbin/top", "/system/xbin/touch", "/system/xbin/tr",
  109.         "/system/xbin/traceroute", "/system/xbin/true", "/system/xbin/tty",
  110.         "/system/xbin/tune2fs", "/system/xbin/umount", "/system/xbin/uname",
  111.         "/system/xbin/uniq", "/system/xbin/unix2dos", "/system/xbin/unlzop",
  112.         "/system/xbin/unzip", "/system/xbin/uptime", "/system/xbin/usleep",
  113.         "/system/xbin/uudecode", "/system/xbin/uuencode", "/system/xbin/vi",
  114.         "/system/xbin/watch", "/system/xbin/wc", "/system/xbin/wget",
  115.         "/system/xbin/which", "/system/xbin/whoami", "/system/xbin/xargs",
  116.         "/system/xbin/yes",
  117.         "/system/xbin/zcat");
  118. symlink("toolbox", "/system/bin/cat", "/system/bin/cmp",
  119.         "/system/bin/date", "/system/bin/dd", "/system/bin/dmesg",
  120.         "/system/bin/getevent", "/system/bin/getprop", "/system/bin/hd",
  121.         "/system/bin/id", "/system/bin/ifconfig", "/system/bin/iftop",
  122.         "/system/bin/insmod", "/system/bin/ioctl", "/system/bin/ionice",
  123.         "/system/bin/kill", "/system/bin/log", "/system/bin/lsmod",
  124.         "/system/bin/nandread", "/system/bin/netstat",
  125.         "/system/bin/newfs_msdos", "/system/bin/notify", "/system/bin/printenv",
  126.         "/system/bin/ps", "/system/bin/reboot", "/system/bin/renice",
  127.         "/system/bin/rmdir", "/system/bin/rmmod", "/system/bin/route",
  128.         "/system/bin/schedtop", "/system/bin/sendevent",
  129.         "/system/bin/setconsole", "/system/bin/setprop", "/system/bin/sleep",
  130.         "/system/bin/smd", "/system/bin/start", "/system/bin/stop",
  131.         "/system/bin/sync", "/system/bin/top", "/system/bin/uptime",
  132.         "/system/bin/vmstat", "/system/bin/watchprops",
  133.         "/system/bin/wipe");
  134.  
  135.  
  136. set_perm_recursive(0, 0, 0755, 0644, "/system");
  137. set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
  138. set_perm(0, 3003, 02750, "/system/bin/netcfg");
  139. set_perm(0, 3004, 02755, "/system/bin/ping");
  140. set_perm(0, 2000, 06750, "/system/bin/run-as");
  141. set_perm_recursive(1002, 1002, 0755, 0440, "/system/etc/bluetooth");
  142. set_perm(0, 0, 0755, "/system/etc/bluetooth");
  143. set_perm(1000, 1000, 0640, "/system/etc/bluetooth/auto_pairing.conf");
  144. set_perm(3002, 3002, 0444, "/system/etc/bluetooth/blacklist.conf");
  145. set_perm(1002, 1002, 0440, "/system/etc/dbus.conf");
  146. set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
  147. set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh");
  148. set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
  149. set_perm(0, 2000, 0755, "/system/vendor");
  150. set_perm_recursive(0, 2000, 0755, 0755, "/system/vendor/bin");
  151. set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor/etc");
  152. set_perm(0, 0, 0644, "/system/vendor/etc/gps.xml");
  153. set_perm(0, 2000, 0755, "/system/vendor/firmware");
  154. set_perm(0, 2000, 0755, "/system/vendor/lib");
  155. set_perm(0, 2000, 0755, "/system/vendor/lib/egl");
  156. set_perm(0, 2000, 0755, "/system/vendor/lib/hw");
  157. set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
  158. set_perm_recursive(0, 0, 0755, 755, "/system/etc/init.d");
  159. set_perm(0, 0, 06755, "/system/xbin/su");
  160.  
  161. set_progress(0.700000);
  162.  
  163. ui_print("");
  164. ui_print("Writing boot image...");
  165. assert(run_program("/tmp/bml_over_mtd.sh", "boot", "72", "reservoir", "2004", "/tmp/boot.img"),
  166.        delete("/tmp/boot.img"));
  167. set_progress(0.900000);
  168.  
  169. ui_print("");
  170. ui_print("-Restoring up batterystats.bin");
  171. run_program("/tmp/restore-batterystats");
  172. set_progress(1.000000);
  173. show_progress(1.000000, 0);
  174. ui_print(" ");
  175. ui_print(" ");
  176. ui_print(" ");
  177. ui_print(" ");
  178. ui_print(" ");
  179. ui_print(" ");
  180. ui_print(" ");
  181. ui_print(" ");
  182. ui_print(" ");
  183. ui_print(" ");
  184. ui_print(" ");
  185. ui_print(" ");
  186. ui_print(" *********************************************** ");
  187. ui_print(" *             Installation complete.          * ");
  188. ui_print(" +---------------------------------------------+ ");
  189. ui_print(" *********************************************** ");
  190. unmount("/system");
Add Comment
Please, Sign In to add comment