Permalink
Browse files

add ville device

  • Loading branch information...
1 parent 0956d69 commit 2a2a2216dd3708c7c7568c8c5dd28fd40934cc29 yanhao committed Sep 13, 2012
Showing with 2,255 additions and 461 deletions.
  1. +1 −1 Makefile
  2. +0 −2 build/target/board/generic/device.mk
  3. +48 −20 build/tools/releasetools/common.py
  4. +32 −3 build/tools/releasetools/edify_generator.py
  5. +55 −18 build/tools/releasetools/ota_from_target_files
  6. +3 −1 patch_device/common/miui_recovery.mk
  7. +5 −1 patch_device/crespo/device.conf
  8. +0 −1 patch_device/crespo/root/sbin/[
  9. +0 −1 patch_device/crespo/root/sbin/[[
  10. BIN patch_device/crespo/root/sbin/adbd
  11. +0 −1 patch_device/crespo/root/sbin/ash
  12. +0 −1 patch_device/crespo/root/sbin/awk
  13. +0 −1 patch_device/crespo/root/sbin/basename
  14. +0 −1 patch_device/crespo/root/sbin/bbconfig
  15. +0 −1 patch_device/crespo/root/sbin/blkid
  16. +0 −1 patch_device/crespo/root/sbin/bunzip2
  17. BIN patch_device/crespo/root/sbin/busybox
  18. +0 −1 patch_device/crespo/root/sbin/bzcat
  19. +0 −1 patch_device/crespo/root/sbin/bzip2
  20. +0 −1 patch_device/crespo/root/sbin/cal
  21. +0 −1 patch_device/crespo/root/sbin/cat
  22. +0 −1 patch_device/crespo/root/sbin/catv
  23. +0 −1 patch_device/crespo/root/sbin/chattr
  24. +0 −1 patch_device/crespo/root/sbin/chgrp
  25. +0 −1 patch_device/crespo/root/sbin/chmod
  26. +0 −1 patch_device/crespo/root/sbin/chown
  27. +0 −1 patch_device/crespo/root/sbin/chroot
  28. +0 −1 patch_device/crespo/root/sbin/cksum
  29. +0 −1 patch_device/crespo/root/sbin/clear
  30. +0 −1 patch_device/crespo/root/sbin/cmp
  31. +0 −1 patch_device/crespo/root/sbin/cp
  32. +0 −1 patch_device/crespo/root/sbin/cpio
  33. +0 −1 patch_device/crespo/root/sbin/cut
  34. +0 −1 patch_device/crespo/root/sbin/date
  35. +0 −1 patch_device/crespo/root/sbin/dc
  36. +0 −1 patch_device/crespo/root/sbin/dd
  37. +0 −1 patch_device/crespo/root/sbin/depmod
  38. +0 −1 patch_device/crespo/root/sbin/devmem
  39. +0 −1 patch_device/crespo/root/sbin/df
  40. +0 −1 patch_device/crespo/root/sbin/diff
  41. +0 −1 patch_device/crespo/root/sbin/dirname
  42. +0 −1 patch_device/crespo/root/sbin/dmesg
  43. +0 −1 patch_device/crespo/root/sbin/dos2unix
  44. +0 −1 patch_device/crespo/root/sbin/du
  45. +0 −1 patch_device/crespo/root/sbin/echo
  46. +0 −1 patch_device/crespo/root/sbin/egrep
  47. +0 −1 patch_device/crespo/root/sbin/env
  48. +0 −1 patch_device/crespo/root/sbin/expand
  49. +0 −1 patch_device/crespo/root/sbin/expr
  50. +0 −1 patch_device/crespo/root/sbin/false
  51. +0 −1 patch_device/crespo/root/sbin/fdisk
  52. +0 −1 patch_device/crespo/root/sbin/fgrep
  53. +0 −1 patch_device/crespo/root/sbin/find
  54. +0 −1 patch_device/crespo/root/sbin/fold
  55. +0 −1 patch_device/crespo/root/sbin/free
  56. +0 −1 patch_device/crespo/root/sbin/freeramdisk
  57. +0 −1 patch_device/crespo/root/sbin/fuser
  58. +0 −1 patch_device/crespo/root/sbin/getopt
  59. +0 −1 patch_device/crespo/root/sbin/grep
  60. +0 −1 patch_device/crespo/root/sbin/groups
  61. +0 −1 patch_device/crespo/root/sbin/gunzip
  62. +0 −1 patch_device/crespo/root/sbin/gzip
  63. +0 −1 patch_device/crespo/root/sbin/head
  64. +0 −1 patch_device/crespo/root/sbin/hexdump
  65. +0 −1 patch_device/crespo/root/sbin/id
  66. +0 −1 patch_device/crespo/root/sbin/insmod
  67. +0 −1 patch_device/crespo/root/sbin/install
  68. +0 −1 patch_device/crespo/root/sbin/kill
  69. +0 −1 patch_device/crespo/root/sbin/killall
  70. +0 −1 patch_device/crespo/root/sbin/killall5
  71. +0 −1 patch_device/crespo/root/sbin/length
  72. +0 −1 patch_device/crespo/root/sbin/less
  73. +0 −1 patch_device/crespo/root/sbin/ln
  74. +0 −1 patch_device/crespo/root/sbin/losetup
  75. +0 −1 patch_device/crespo/root/sbin/ls
  76. +0 −1 patch_device/crespo/root/sbin/lsattr
  77. +0 −1 patch_device/crespo/root/sbin/lsmod
  78. +0 −1 patch_device/crespo/root/sbin/lspci
  79. +0 −1 patch_device/crespo/root/sbin/lsusb
  80. +0 −1 patch_device/crespo/root/sbin/lzcat
  81. +0 −1 patch_device/crespo/root/sbin/lzop
  82. +0 −1 patch_device/crespo/root/sbin/lzopcat
  83. +0 −1 patch_device/crespo/root/sbin/makedevs
  84. +0 −1 patch_device/crespo/root/sbin/md5sum
  85. +0 −1 patch_device/crespo/root/sbin/mkdir
  86. +0 −1 patch_device/crespo/root/sbin/mkfifo
  87. +0 −1 patch_device/crespo/root/sbin/mkfs.ext2
  88. +0 −1 patch_device/crespo/root/sbin/mknod
  89. +0 −1 patch_device/crespo/root/sbin/mkswap
  90. +0 −1 patch_device/crespo/root/sbin/mktemp
  91. +0 −1 patch_device/crespo/root/sbin/modinfo
  92. +0 −1 patch_device/crespo/root/sbin/modprobe
  93. +0 −1 patch_device/crespo/root/sbin/more
  94. +0 −1 patch_device/crespo/root/sbin/mount
  95. +0 −1 patch_device/crespo/root/sbin/mountpoint
  96. +0 −1 patch_device/crespo/root/sbin/mv
  97. +0 −1 patch_device/crespo/root/sbin/nanddump
  98. +0 −1 patch_device/crespo/root/sbin/nandwrite
  99. +0 −1 patch_device/crespo/root/sbin/nice
  100. +0 −1 patch_device/crespo/root/sbin/nohup
  101. +0 −1 patch_device/crespo/root/sbin/od
  102. +0 −1 patch_device/crespo/root/sbin/patch
  103. +0 −1 patch_device/crespo/root/sbin/pgrep
  104. +0 −1 patch_device/crespo/root/sbin/pidof
  105. +0 −1 patch_device/crespo/root/sbin/pkill
  106. +0 −1 patch_device/crespo/root/sbin/printenv
  107. +0 −1 patch_device/crespo/root/sbin/printf
  108. +0 −1 patch_device/crespo/root/sbin/ps
  109. +0 −1 patch_device/crespo/root/sbin/pstree
  110. +0 −1 patch_device/crespo/root/sbin/pwd
  111. +0 −1 patch_device/crespo/root/sbin/rdev
  112. +0 −1 patch_device/crespo/root/sbin/readlink
  113. +0 −1 patch_device/crespo/root/sbin/realpath
  114. +0 −1 patch_device/crespo/root/sbin/renice
  115. +0 −1 patch_device/crespo/root/sbin/reset
  116. +0 −1 patch_device/crespo/root/sbin/resize
  117. +0 −1 patch_device/crespo/root/sbin/rev
  118. +0 −1 patch_device/crespo/root/sbin/rm
  119. +0 −1 patch_device/crespo/root/sbin/rmdir
  120. +0 −1 patch_device/crespo/root/sbin/rmmod
  121. +0 −1 patch_device/crespo/root/sbin/run-parts
  122. +0 −1 patch_device/crespo/root/sbin/sed
  123. +0 −1 patch_device/crespo/root/sbin/seq
  124. +0 −1 patch_device/crespo/root/sbin/setconsole
  125. +0 −1 patch_device/crespo/root/sbin/setserial
  126. +0 −1 patch_device/crespo/root/sbin/setsid
  127. +0 −1 patch_device/crespo/root/sbin/sh
  128. +0 −1 patch_device/crespo/root/sbin/sha1sum
  129. +0 −1 patch_device/crespo/root/sbin/sha256sum
  130. +0 −1 patch_device/crespo/root/sbin/sha512sum
  131. +0 −1 patch_device/crespo/root/sbin/sleep
  132. +0 −1 patch_device/crespo/root/sbin/sort
  133. +0 −1 patch_device/crespo/root/sbin/split
  134. +0 −1 patch_device/crespo/root/sbin/stat
  135. +0 −1 patch_device/crespo/root/sbin/strings
  136. +0 −1 patch_device/crespo/root/sbin/stty
  137. +0 −1 patch_device/crespo/root/sbin/swapoff
  138. +0 −1 patch_device/crespo/root/sbin/swapon
  139. +0 −1 patch_device/crespo/root/sbin/sync
  140. +0 −1 patch_device/crespo/root/sbin/sysctl
  141. +0 −1 patch_device/crespo/root/sbin/tac
  142. +0 −1 patch_device/crespo/root/sbin/tail
  143. +0 −1 patch_device/crespo/root/sbin/tar
  144. +0 −1 patch_device/crespo/root/sbin/tee
  145. +0 −1 patch_device/crespo/root/sbin/test
  146. +0 −1 patch_device/crespo/root/sbin/time
  147. +0 −1 patch_device/crespo/root/sbin/top
  148. +0 −1 patch_device/crespo/root/sbin/touch
  149. +0 −1 patch_device/crespo/root/sbin/tr
  150. +0 −1 patch_device/crespo/root/sbin/true
  151. +0 −1 patch_device/crespo/root/sbin/ttysize
  152. +0 −1 patch_device/crespo/root/sbin/ueventd
  153. +0 −1 patch_device/crespo/root/sbin/umount
  154. +0 −1 patch_device/crespo/root/sbin/uname
  155. +0 −1 patch_device/crespo/root/sbin/unexpand
  156. +0 −1 patch_device/crespo/root/sbin/uniq
  157. +0 −1 patch_device/crespo/root/sbin/unix2dos
  158. +0 −1 patch_device/crespo/root/sbin/unlzma
  159. +0 −1 patch_device/crespo/root/sbin/unlzop
  160. +0 −1 patch_device/crespo/root/sbin/unxz
  161. +0 −1 patch_device/crespo/root/sbin/unzip
  162. +0 −1 patch_device/crespo/root/sbin/uptime
  163. +0 −1 patch_device/crespo/root/sbin/usleep
  164. +0 −1 patch_device/crespo/root/sbin/uudecode
  165. +0 −1 patch_device/crespo/root/sbin/uuencode
  166. +0 −1 patch_device/crespo/root/sbin/watch
  167. +0 −1 patch_device/crespo/root/sbin/wc
  168. +0 −1 patch_device/crespo/root/sbin/which
  169. +0 −1 patch_device/crespo/root/sbin/whoami
  170. +0 −1 patch_device/crespo/root/sbin/xargs
  171. +0 −1 patch_device/crespo/root/sbin/xzcat
  172. +0 −1 patch_device/crespo/root/sbin/yes
  173. +0 −1 patch_device/crespo/root/sbin/zcat
  174. +1 −1 patch_device/maguro/Android.mk
  175. +0 −2 patch_device/maguro/device.conf
  176. BIN patch_device/maguro/root/sbin/recovery
  177. +0 −1 patch_device/maguro/root/sbin/ueventd
  178. +19 −1 patch_device/saga/device.conf
  179. BIN patch_device/saga/kernel
  180. +1 −0 patch_device/saga/root/cwkeys
  181. +1 −55 patch_device/saga/root/default.prop
  182. +0 −11 patch_device/saga/root/etc/recovery.fstab
  183. BIN patch_device/saga/root/init
  184. +78 −0 patch_device/saga/root/init.goldfish.rc
  185. +592 −21 patch_device/saga/root/init.rc
  186. +281 −0 patch_device/saga/root/init.saga.rc
  187. +202 −0 patch_device/saga/root/init.usb.rc
  188. +84 −2 patch_device/saga/root/ueventd.rc
  189. +16 −0 patch_device/saga/root/ueventd.saga.rc
  190. +12 −0 patch_device/ville/Android.mk
  191. +2 −0 patch_device/ville/device.conf
  192. BIN patch_device/ville/kernel
  193. +126 −0 patch_device/ville/root/default.prop
  194. +9 −0 patch_device/ville/root/etc/recovery.fstab
  195. BIN patch_device/ville/root/init
  196. +257 −0 patch_device/ville/root/init.qcom.sh
  197. +56 −0 patch_device/ville/root/init.rc
  198. BIN patch_device/ville/root/res/images/icon_clockwork.png
  199. BIN patch_device/ville/root/res/images/icon_error.png
  200. BIN patch_device/ville/root/res/images/icon_firmware_error.png
  201. BIN patch_device/ville/root/res/images/icon_firmware_install.png
  202. BIN patch_device/ville/root/res/images/icon_installing.png
  203. BIN patch_device/ville/root/res/images/icon_installing_overlay01.png
  204. BIN patch_device/ville/root/res/images/icon_installing_overlay02.png
  205. BIN patch_device/ville/root/res/images/icon_installing_overlay03.png
  206. BIN patch_device/ville/root/res/images/icon_installing_overlay04.png
  207. BIN patch_device/ville/root/res/images/icon_installing_overlay05.png
  208. BIN patch_device/ville/root/res/images/icon_installing_overlay06.png
  209. BIN patch_device/ville/root/res/images/icon_installing_overlay07.png
  210. BIN patch_device/ville/root/res/images/indeterminate01.png
  211. BIN patch_device/ville/root/res/images/indeterminate02.png
  212. BIN patch_device/ville/root/res/images/indeterminate03.png
  213. BIN patch_device/ville/root/res/images/indeterminate04.png
  214. BIN patch_device/ville/root/res/images/indeterminate05.png
  215. BIN patch_device/ville/root/res/images/indeterminate06.png
  216. BIN patch_device/ville/root/res/images/progress_empty.png
  217. BIN patch_device/ville/root/res/images/progress_fill.png
  218. BIN patch_device/ville/root/res/images/stitch.png
  219. +1 −0 patch_device/ville/root/res/keys
  220. +5 −0 patch_device/ville/root/ueventd.goldfish.rc
  221. +82 −0 patch_device/ville/root/ueventd.rc
  222. +137 −0 patch_device/ville/root/ueventd.ville.rc
  223. +7 −4 src/Android.mk
  224. BIN src/busybox/busybox
  225. BIN src/miui/.miui_recovery.log.swp
  226. +2 −2 src/miui/src/controls/miui_control_title.c
  227. +5 −121 src/miui/src/controls/miui_controls.c
  228. +13 −25 src/miui/src/main/info_ui.c
  229. +2 −2 src/miui/src/main/lang_ui.c
  230. +109 −1 src/miui/src/main/miui_ui.c
  231. +1 −0 src/miui/src/miui.h
  232. +1 −1 src/miui/src/miui_inter.h
  233. BIN src/res/icons/agreement.png
  234. BIN src/res/icons/apps.png
  235. BIN src/res/icons/customize.png
  236. BIN src/res/icons/ic_power_system.png
  237. BIN src/res/icons/ic_settings_bluetooth.png
  238. BIN src/res/icons/install.png
  239. BIN src/res/icons/lang.png
  240. BIN src/res/icons/license.png
  241. BIN src/res/icons/mainmenu.install.icon.png
  242. BIN src/res/icons/mainmenu.power.icon.png
  243. BIN src/res/icons/mainmenu.tools.icon.png
  244. BIN src/res/icons/personalize.png
  245. BIN src/res/icons/power.png
  246. BIN src/res/icons/update.png
  247. BIN src/res/icons/welcome.png
  248. +5 −0 src/res/langs/cn.lang
  249. +4 −1 src/res/langs/en.lang
View
@@ -4,7 +4,7 @@ MIUI_PRODUCTS := $(strip $(MIUI_PRODUCTS))
.PHONY: default
default:
- make recovery -B -j32
+ make recovery -B -j32
@echo make default
.PHONY: usage
@@ -29,5 +29,3 @@ PRODUCT_COPY_FILES := \
PRODUCT_PACKAGES := \
audio.primary.goldfish
-
-PRODUCT_AAPT_CONFIG += hdpi xhdpi
@@ -159,7 +159,7 @@ class Partition(object):
line = line.strip()
if not line or line.startswith("#"): continue
pieces = line.split()
- if not (3 <= len(pieces) <= 4):
+ if not (3 <= len(pieces) <= 7):
raise ValueError("malformed recovery.fstab line: \"%s\"" % (line,))
p = Partition()
@@ -168,7 +168,7 @@ class Partition(object):
p.device = pieces[2]
p.length = 0
options = None
- if len(pieces) >= 4:
+ if len(pieces) >= 4 and pieces[3] != 'NULL':
if pieces[3].startswith("/"):
p.device2 = pieces[3]
if len(pieces) >= 5:
@@ -218,25 +218,41 @@ def BuildBootableImage(sourcedir):
assert p1.returncode == 0, "mkbootfs of %s ramdisk failed" % (targetname,)
assert p2.returncode == 0, "minigzip of %s ramdisk failed" % (targetname,)
- cmd = ["mkbootimg", "--kernel", os.path.join(sourcedir, "kernel")]
-
- fn = os.path.join(sourcedir, "cmdline")
+ """check if uboot is requested"""
+ fn = os.path.join(sourcedir, "ubootargs")
if os.access(fn, os.F_OK):
- cmd.append("--cmdline")
- cmd.append(open(fn).read().rstrip("\n"))
+ cmd = ["mkimage"]
+ for argument in open(fn).read().rstrip("\n").split(" "):
+ cmd.append(argument)
+ cmd.append("-d")
+ cmd.append(os.path.join(sourcedir, "kernel")+":"+ramdisk_img.name)
+ cmd.append(img.name)
- fn = os.path.join(sourcedir, "base")
- if os.access(fn, os.F_OK):
- cmd.append("--base")
- cmd.append(open(fn).read().rstrip("\n"))
+ else:
+ cmd = ["mkbootimg", "--kernel", os.path.join(sourcedir, "kernel")]
- fn = os.path.join(sourcedir, "pagesize")
- if os.access(fn, os.F_OK):
- cmd.append("--pagesize")
- cmd.append(open(fn).read().rstrip("\n"))
+ fn = os.path.join(sourcedir, "cmdline")
+ if os.access(fn, os.F_OK):
+ cmd.append("--cmdline")
+ cmd.append(open(fn).read().rstrip("\n"))
+
+ fn = os.path.join(sourcedir, "base")
+ if os.access(fn, os.F_OK):
+ cmd.append("--base")
+ cmd.append(open(fn).read().rstrip("\n"))
- cmd.extend(["--ramdisk", ramdisk_img.name,
- "--output", img.name])
+ fn = os.path.join(sourcedir, "pagesize")
+ if os.access(fn, os.F_OK):
+ cmd.append("--pagesize")
+ cmd.append(open(fn).read().rstrip("\n"))
+
+ fn = os.path.join(sourcedir, "ramdiskaddr")
+ if os.access(fn, os.F_OK):
+ cmd.append("--ramdiskaddr")
+ cmd.append(open(fn).read().rstrip("\n"))
+
+ cmd.extend(["--ramdisk", ramdisk_img.name,
+ "--output", img.name])
p = Run(cmd, stdout=subprocess.PIPE)
p.communicate()
@@ -355,8 +371,14 @@ def SignFile(input_name, output_name, key, password, align=None,
else:
sign_name = output_name
- cmd = ["java", "-Xmx2048m", "-jar",
+ check = (sys.maxsize > 2**32)
+ if check is True:
+ cmd = ["java", "-Xmx2048m", "-jar",
os.path.join(OPTIONS.search_path, "framework", "signapk.jar")]
+ else:
+ cmd = ["java", "-Xmx1024m", "-jar",
+ os.path.join(OPTIONS.search_path, "framework", "signapk.jar")]
+
if whole_file:
cmd.append("-w")
cmd.extend([key + ".x509.pem", key + ".pk8",
@@ -812,8 +834,14 @@ def worker():
# map recovery.fstab's fs_types to mount/format "partition types"
-PARTITION_TYPES = { "yaffs2": "MTD", "mtd": "MTD",
- "ext4": "EMMC", "emmc": "EMMC" }
+PARTITION_TYPES = { "bml": "BML",
+ "ext2": "EMMC",
+ "ext3": "EMMC",
+ "ext4": "EMMC",
+ "emmc": "EMMC",
+ "mtd": "MTD",
+ "yaffs2": "MTD",
+ "vfat": "EMMC" }
def GetTypeAndDevice(mount_point, info):
fstab = info["fstab"]
@@ -87,8 +87,10 @@ def AssertOlderBuild(self, timestamp):
def AssertDevice(self, device):
"""Assert that the device identifier is the given string."""
- cmd = ('assert(getprop("ro.product.device") == "%s" ||\0'
- 'getprop("ro.build.product") == "%s");' % (device, device))
+ cmd = ('assert(' +
+ ' || \0'.join(['getprop("ro.product.device") == "%s" || getprop("ro.build.product") == "%s"'
+ % (i, i) for i in device.split(",")]) +
+ ');')
self.script.append(self._WordWrap(cmd))
def AssertSomeBootloader(self, *bootloaders):
@@ -99,6 +101,21 @@ def AssertSomeBootloader(self, *bootloaders):
");")
self.script.append(self._WordWrap(cmd))
+ def RunBackup(self, command):
+ self.script.append('package_extract_file("system/bin/backuptool.sh", "/tmp/backuptool.sh");')
+ self.script.append('package_extract_file("system/bin/backuptool.functions", "/tmp/backuptool.functions");')
+ self.script.append('set_perm(0, 0, 0777, "/tmp/backuptool.sh");')
+ self.script.append('set_perm(0, 0, 0644, "/tmp/backuptool.functions");')
+ self.script.append(('run_program("/tmp/backuptool.sh", "%s");' % command))
+ if command == "restore":
+ self.script.append('delete("/system/bin/backuptool.sh");')
+ self.script.append('delete("/system/bin/backuptool.functions");')
+
+ def RunConfig(self, command):
+ self.script.append('package_extract_file("system/bin/modelid_cfg.sh", "/tmp/modelid_cfg.sh");')
+ self.script.append('set_perm(0, 0, 0777, "/tmp/modelid_cfg.sh");')
+ self.script.append(('run_program("/tmp/modelid_cfg.sh", "%s");' % command))
+
def ShowProgress(self, frac, dur):
"""Update the progress bar, advancing it over 'frac' over the next
'dur' seconds. 'dur' may be zero to advance it via SetProgress
@@ -141,6 +158,12 @@ def Mount(self, mount_point):
p.device, p.mount_point))
self.mounts.add(p.mount_point)
+ def Unmount(self, mount_point):
+ """Unmount the partiiton with the given mount_point."""
+ if mount_point in self.mounts:
+ self.mounts.remove(mount_point)
+ self.script.append('unmount("%s");' % (mount_point,))
+
def UnpackPackageDir(self, src, dst):
"""Unpack a given directory from the OTA package into the given
destination directory."""
@@ -200,11 +223,17 @@ def WriteRawImage(self, mount_point, fn):
args = {'device': p.device, 'fn': fn}
if partition_type == "MTD":
self.script.append(
- 'write_raw_image(package_extract_file("%(fn)s"), "%(device)s");'
+ 'package_extract_file("%(fn)s", "/tmp/boot.img");'
+ 'write_raw_image("/tmp/boot.img", "%(device)s");' % args
% args)
elif partition_type == "EMMC":
self.script.append(
'package_extract_file("%(fn)s", "%(device)s");' % args)
+ elif partition_type == "BML":
+ self.script.append(
+ ('assert(package_extract_file("%(fn)s", "/tmp/%(device)s.img"),\n'
+ ' write_raw_image("/tmp/%(device)s.img", "%(device)s"),\n'
+ ' delete("/tmp/%(device)s.img"));') % args)
else:
raise ValueError("don't know how to write \"%s\" partitions" % (p.fs_type,))
@@ -51,6 +51,18 @@ Usage: ota_from_target_files [flags] input_target_files output_ota_package
-a (--aslr_mode) <on|off>
Specify whether to turn on ASLR for the package (on by default).
+
+ --backup <boolean>
+ Enable or disable the execution of backuptool.sh.
+ Disabled by default.
+
+ --configid <boolean>
+ Enable or disable the execution of modelid_cfg.sh.
+ Enabled by default.
+
+ --override_device <device>
+ Override device-specific asserts. Can be a comma-separated list.
+
"""
import sys
@@ -87,6 +99,9 @@ OPTIONS.omit_prereq = False
OPTIONS.extra_script = None
OPTIONS.aslr_mode = True
OPTIONS.worker_threads = 3
+OPTIONS.backuptool = False
+OPTIONS.modelidcfg = True
+OPTIONS.override_device = 'auto'
def MostPopularKey(d, default):
"""Given a dict, return the key corresponding to the largest
@@ -100,7 +115,7 @@ def MostPopularKey(d, default):
def IsSymlink(info):
"""Return true if the zipfile.ZipInfo object passed in represents a
symlink."""
- return (info.external_attr >> 16) == 0120777
+ return (info.external_attr >> 16) & 0770000 == 0120000
def IsRegular(info):
"""Return true if the zipfile.ZipInfo object passed in represents a
@@ -308,7 +323,10 @@ def SignOutput(temp_zip_name, output_zip_name):
def AppendAssertions(script, input_zip):
- device = GetBuildProp("ro.product.device", input_zip)
+ if OPTIONS.override_device == "auto":
+ device = GetBuildProp("ro.product.device", input_zip)
+ else:
+ device = OPTIONS.override_device
script.AssertDevice(device)
@@ -376,12 +394,16 @@ def WriteFullOTAPackage(input_zip, output_zip):
metadata=metadata,
info_dict=OPTIONS.info_dict)
- if not OPTIONS.omit_prereq:
- ts = GetBuildProp("ro.build.date.utc", input_zip)
- script.AssertOlderBuild(ts)
+ #if not OPTIONS.omit_prereq:
+ # ts = GetBuildProp("ro.build.date.utc", input_zip)
+ # script.AssertOlderBuild(ts)
AppendAssertions(script, input_zip)
device_specific.FullOTA_Assertions()
+ if OPTIONS.backuptool:
+ script.Mount("/system")
+ script.RunBackup("backup")
+ script.Unmount("/system")
script.ShowProgress(0.5, 0)
@@ -390,7 +412,7 @@ def WriteFullOTAPackage(input_zip, output_zip):
script.FormatPartition("/system")
script.Mount("/system")
- script.UnpackPackageDir("recovery", "/system")
+ #script.UnpackPackageDir("recovery", "/system")
script.UnpackPackageDir("system", "/system")
(symlinks, retouch_files) = CopySystemFiles(input_zip, output_zip)
@@ -402,9 +424,9 @@ def WriteFullOTAPackage(input_zip, output_zip):
boot_img = common.GetBootableImage("boot.img", "boot.img",
OPTIONS.input_tmp, "BOOT")
- recovery_img = common.GetBootableImage("recovery.img", "recovery.img",
- OPTIONS.input_tmp, "RECOVERY")
- MakeRecoveryPatch(output_zip, recovery_img, boot_img)
+ #recovery_img = common.GetBootableImage("recovery.img", "recovery.img",
+ # OPTIONS.input_tmp, "RECOVERY")
+ #MakeRecoveryPatch(output_zip, recovery_img, boot_img)
Item.GetMetadata(input_zip)
Item.Get("system").SetPermissions(script)
@@ -413,6 +435,13 @@ def WriteFullOTAPackage(input_zip, output_zip):
common.ZipWriteStr(output_zip, "boot.img", boot_img.data)
script.ShowProgress(0.2, 0)
+ if OPTIONS.backuptool:
+ script.ShowProgress(0.2, 10)
+ script.RunBackup("restore")
+
+ if OPTIONS.modelidcfg:
+ script.RunConfig("")
+
script.ShowProgress(0.2, 10)
script.WriteRawImage("/boot", "boot.img")
@@ -542,11 +571,12 @@ def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip):
"/tmp/boot.img", "boot.img", OPTIONS.target_tmp, "BOOT")
updating_boot = (source_boot.data != target_boot.data)
- source_recovery = common.GetBootableImage(
- "/tmp/recovery.img", "recovery.img", OPTIONS.source_tmp, "RECOVERY")
- target_recovery = common.GetBootableImage(
- "/tmp/recovery.img", "recovery.img", OPTIONS.target_tmp, "RECOVERY")
- updating_recovery = (source_recovery.data != target_recovery.data)
+ #source_recovery = common.GetBootableImage(
+ # "/tmp/recovery.img", "recovery.img", OPTIONS.source_tmp, "RECOVERY")
+ #target_recovery = common.GetBootableImage(
+ # "/tmp/recovery.img", "recovery.img", OPTIONS.target_tmp, "RECOVERY")
+ #updating_recovery = (source_recovery.data != target_recovery.data)
+ updating_recovery = false
# Here's how we divide up the progress bar:
# 0.1 for verifying the start state (PatchCheck calls)
@@ -685,9 +715,9 @@ def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip):
script.Print("Unpacking new files...")
script.UnpackPackageDir("system", "/system")
- if updating_recovery:
- script.Print("Unpacking new recovery...")
- script.UnpackPackageDir("recovery", "/system")
+ #if updating_recovery:
+ # script.Print("Unpacking new recovery...")
+ # script.UnpackPackageDir("recovery", "/system")
script.Print("Symlinks and permissions...")
@@ -753,6 +783,12 @@ def main(argv):
OPTIONS.aslr_mode = False
elif o in ("--worker_threads"):
OPTIONS.worker_threads = int(a)
+ elif o in ("--backup"):
+ OPTIONS.backuptool = bool(a.lower() == 'true')
+ elif o in ("--configid"):
+ OPTIONS.modelidcfg = bool(a.lower() == 'true')
+ elif o in ("--override_device"):
+ OPTIONS.override_device = a
else:
return False
return True
@@ -767,7 +803,8 @@ def main(argv):
"extra_script=",
"worker_threads=",
"aslr_mode=",
- ],
+ "backup=",
+ "override_device="],
extra_option_handler=option_handler)
if len(args) != 2:
@@ -43,16 +43,18 @@ $(MIUI_PRODUCT): $(MKBOOTFS) $(MINIGZIP) \
$(MKBOOTIMG) \
recoveryimage
@echo make $(MIUI_PRODUCT)
+ rm -rf $(miui_recovery_product)
mkdir -p $(miui_recovery_out)
mkdir -p $(miui_recovery_product)
mkdir -p $(miui_recovery_root)
cp -rf $(MIUI_PRODUCT_ROOT) $(miui_recovery_product)/
cp -rf $(MIUI_KERNEL) $(miui_recovery_product)/
- #-rm -rf $(miui_recovery_root)/sbin
cp -rf $(miui_recovery_sbin) $(miui_recovery_root)/
cp -f $(miui_recovery_binary) $(miui_recovery_root)/sbin/
cp -rf $(miui_recovery_resource) $(miui_recovery_root)/
+ifneq ($(MIUI_DEVICE_CONFIG),)
-cp -f $(MIUI_DEVICE_CONFIG) $(miui_recovery_root)/res/
+endif
@echo make recovery image $(miui_recovery_target)
$(MKBOOTFS) $(miui_recovery_root) | $(MINIGZIP) > $(miui_recovery_ramdisk)
$(MKBOOTIMG) $(miui_recoveryimage_args) --output $(miui_recovery_target)
@@ -1,2 +1,6 @@
-#calibrate("0.9728", "20", "0.9597", "28", "yes");
+ini_set("customkeycode_up", "115");
+ini_set("customkeycode_down", "114");
+ini_set("customkeycode_select", "116");
+ini_set("customkeycode_menu", "229");
+ini_set("customkeycode_back", "158");
calibrate("2.0246", "28", "1.2555", "-3");
Binary file not shown.
Oops, something went wrong.

0 comments on commit 2a2a221

Please sign in to comment.