Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add ville device

  • Loading branch information...
commit 2a2a2216dd3708c7c7568c8c5dd28fd40934cc29 1 parent 0956d69
yanhao authored
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
2  Makefile
@@ -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
View
2  build/target/board/generic/device.mk
@@ -29,5 +29,3 @@ PRODUCT_COPY_FILES := \
PRODUCT_PACKAGES := \
audio.primary.goldfish
-
-PRODUCT_AAPT_CONFIG += hdpi xhdpi
View
68 build/tools/releasetools/common.py
@@ -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"]
View
35 build/tools/releasetools/edify_generator.py
@@ -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,))
View
73 build/tools/releasetools/ota_from_target_files
@@ -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:
View
4 patch_device/common/miui_recovery.mk
@@ -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)
View
6 patch_device/crespo/device.conf
@@ -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");
View
1  patch_device/crespo/root/sbin/[
View
1  patch_device/crespo/root/sbin/[[
View
BIN  patch_device/crespo/root/sbin/adbd
Binary file not shown
View
1  patch_device/crespo/root/sbin/ash
View
1  patch_device/crespo/root/sbin/awk
View
1  patch_device/crespo/root/sbin/basename
View
1  patch_device/crespo/root/sbin/bbconfig
View
1  patch_device/crespo/root/sbin/blkid
View
1  patch_device/crespo/root/sbin/bunzip2
View
BIN  patch_device/crespo/root/sbin/busybox
Binary file not shown
View
1  patch_device/crespo/root/sbin/bzcat
View
1  patch_device/crespo/root/sbin/bzip2
View
1  patch_device/crespo/root/sbin/cal
View
1  patch_device/crespo/root/sbin/cat
View
1  patch_device/crespo/root/sbin/catv
View
1  patch_device/crespo/root/sbin/chattr
View
1  patch_device/crespo/root/sbin/chgrp
View
1  patch_device/crespo/root/sbin/chmod
View
1  patch_device/crespo/root/sbin/chown
View
1  patch_device/crespo/root/sbin/chroot
View
1  patch_device/crespo/root/sbin/cksum
View
1  patch_device/crespo/root/sbin/clear
View
1  patch_device/crespo/root/sbin/cmp
View
1  patch_device/crespo/root/sbin/cp
View
1  patch_device/crespo/root/sbin/cpio
View
1  patch_device/crespo/root/sbin/cut
View
1  patch_device/crespo/root/sbin/date
View
1  patch_device/crespo/root/sbin/dc
View
1  patch_device/crespo/root/sbin/dd
View
1  patch_device/crespo/root/sbin/depmod
View
1  patch_device/crespo/root/sbin/devmem
View
1  patch_device/crespo/root/sbin/df
View
1  patch_device/crespo/root/sbin/diff
View
1  patch_device/crespo/root/sbin/dirname
View
1  patch_device/crespo/root/sbin/dmesg
View
1  patch_device/crespo/root/sbin/dos2unix
View
1  patch_device/crespo/root/sbin/du
View
1  patch_device/crespo/root/sbin/echo
View
1  patch_device/crespo/root/sbin/egrep
View
1  patch_device/crespo/root/sbin/env
View
1  patch_device/crespo/root/sbin/expand
View
1  patch_device/crespo/root/sbin/expr
View
1  patch_device/crespo/root/sbin/false
View
1  patch_device/crespo/root/sbin/fdisk
View
1  patch_device/crespo/root/sbin/fgrep
View
1  patch_device/crespo/root/sbin/find
View
1  patch_device/crespo/root/sbin/fold
View
1  patch_device/crespo/root/sbin/free
View
1  patch_device/crespo/root/sbin/freeramdisk
View
1  patch_device/crespo/root/sbin/fuser
View
1  patch_device/crespo/root/sbin/getopt
View
1  patch_device/crespo/root/sbin/grep
View
1  patch_device/crespo/root/sbin/groups
View
1  patch_device/crespo/root/sbin/gunzip
View
1  patch_device/crespo/root/sbin/gzip
View
1  patch_device/crespo/root/sbin/head
View
1  patch_device/crespo/root/sbin/hexdump
View
1  patch_device/crespo/root/sbin/id
View
1  patch_device/crespo/root/sbin/insmod
View
1  patch_device/crespo/root/sbin/install
View
1  patch_device/crespo/root/sbin/kill
View
1  patch_device/crespo/root/sbin/killall
View
1  patch_device/crespo/root/sbin/killall5
View
1  patch_device/crespo/root/sbin/length
View
1  patch_device/crespo/root/sbin/less
View
1  patch_device/crespo/root/sbin/ln
View
1  patch_device/crespo/root/sbin/losetup
View
1  patch_device/crespo/root/sbin/ls
View
1  patch_device/crespo/root/sbin/lsattr
View
1  patch_device/crespo/root/sbin/lsmod
View
1  patch_device/crespo/root/sbin/lspci
View
1  patch_device/crespo/root/sbin/lsusb
View
1  patch_device/crespo/root/sbin/lzcat
View
1  patch_device/crespo/root/sbin/lzop
View
1  patch_device/crespo/root/sbin/lzopcat
View
1  patch_device/crespo/root/sbin/makedevs
View
1  patch_device/crespo/root/sbin/md5sum
View
1  patch_device/crespo/root/sbin/mkdir
View
1  patch_device/crespo/root/sbin/mkfifo
View
1  patch_device/crespo/root/sbin/mkfs.ext2
View
1  patch_device/crespo/root/sbin/mknod
View
1  patch_device/crespo/root/sbin/mkswap
View
1  patch_device/crespo/root/sbin/mktemp
View
1  patch_device/crespo/root/sbin/modinfo
View
1  patch_device/crespo/root/sbin/modprobe
View
1  patch_device/crespo/root/sbin/more
View
1  patch_device/crespo/root/sbin/mount
View
1  patch_device/crespo/root/sbin/mountpoint
View
1  patch_device/crespo/root/sbin/mv
View
1  patch_device/crespo/root/sbin/nanddump
View
1  patch_device/crespo/root/sbin/nandwrite
View
1  patch_device/crespo/root/sbin/nice
View
1  patch_device/crespo/root/sbin/nohup
View
1  patch_device/crespo/root/sbin/od
View
1  patch_device/crespo/root/sbin/patch
View
1  patch_device/crespo/root/sbin/pgrep
View
1  patch_device/crespo/root/sbin/pidof
View
1  patch_device/crespo/root/sbin/pkill
View
1  patch_device/crespo/root/sbin/printenv
View
1  patch_device/crespo/root/sbin/printf
View
1  patch_device/crespo/root/sbin/ps
View
1  patch_device/crespo/root/sbin/pstree
View
1  patch_device/crespo/root/sbin/pwd
View
1  patch_device/crespo/root/sbin/rdev
View
1  patch_device/crespo/root/sbin/readlink
View
1  patch_device/crespo/root/sbin/realpath
View
1  patch_device/crespo/root/sbin/renice
View
1  patch_device/crespo/root/sbin/reset
View
1  patch_device/crespo/root/sbin/resize
View
1  patch_device/crespo/root/sbin/rev
View
1  patch_device/crespo/root/sbin/rm
View
1  patch_device/crespo/root/sbin/rmdir
View
1  patch_device/crespo/root/sbin/rmmod
View
1  patch_device/crespo/root/sbin/run-parts
View
1  patch_device/crespo/root/sbin/sed
View
1  patch_device/crespo/root/sbin/seq
View
1  patch_device/crespo/root/sbin/setconsole
View
1  patch_device/crespo/root/sbin/setserial
View
1  patch_device/crespo/root/sbin/setsid
View
1  patch_device/crespo/root/sbin/sh
View
1  patch_device/crespo/root/sbin/sha1sum
View
1  patch_device/crespo/root/sbin/sha256sum
View
1  patch_device/crespo/root/sbin/sha512sum
View
1  patch_device/crespo/root/sbin/sleep
View
1  patch_device/crespo/root/sbin/sort
View
1  patch_device/crespo/root/sbin/split
View
1  patch_device/crespo/root/sbin/stat
View
1  patch_device/crespo/root/sbin/strings
View
1  patch_device/crespo/root/sbin/stty
View
1  patch_device/crespo/root/sbin/swapoff
View
1  patch_device/crespo/root/sbin/swapon
View
1  patch_device/crespo/root/sbin/sync
View
1  patch_device/crespo/root/sbin/sysctl
View
1  patch_device/crespo/root/sbin/tac
View
1  patch_device/crespo/root/sbin/tail
View
1  patch_device/crespo/root/sbin/tar
View
1  patch_device/crespo/root/sbin/tee
View
1  patch_device/crespo/root/sbin/test
View
1  patch_device/crespo/root/sbin/time
View
1  patch_device/crespo/root/sbin/top
View
1  patch_device/crespo/root/sbin/touch
View
1  patch_device/crespo/root/sbin/tr
View
1  patch_device/crespo/root/sbin/true
View
1  patch_device/crespo/root/sbin/ttysize
View
1  patch_device/crespo/root/sbin/ueventd
View
1  patch_device/crespo/root/sbin/umount
View
1  patch_device/crespo/root/sbin/uname
View
1  patch_device/crespo/root/sbin/unexpand
View
1  patch_device/crespo/root/sbin/uniq
View
1  patch_device/crespo/root/sbin/unix2dos
View
1  patch_device/crespo/root/sbin/unlzma
View
1  patch_device/crespo/root/sbin/unlzop
View
1  patch_device/crespo/root/sbin/unxz
View
1  patch_device/crespo/root/sbin/unzip
View
1  patch_device/crespo/root/sbin/uptime
View
1  patch_device/crespo/root/sbin/usleep
View
1  patch_device/crespo/root/sbin/uudecode
View
1  patch_device/crespo/root/sbin/uuencode
View
1  patch_device/crespo/root/sbin/watch
View
1  patch_device/crespo/root/sbin/wc
View
1  patch_device/crespo/root/sbin/which
View
1  patch_device/crespo/root/sbin/whoami
View
1  patch_device/crespo/root/sbin/xargs
View
1  patch_device/crespo/root/sbin/xzcat
View
1  patch_device/crespo/root/sbin/yes
View
1  patch_device/crespo/root/sbin/zcat
View
2  patch_device/maguro/Android.mk
@@ -6,5 +6,5 @@ MIUI_KERNEL := $(LOCAL_PATH)/kernel
MIUI_KERNEL_BASE := 0x80000000
MIUI_PRODUCT_ROOT := $(LOCAL_PATH)/root
-MIUI_DEVICE_CONFIG := $(LOCAL_PATH)/device.conf
+#MIUI_DEVICE_CONFIG := $(LOCAL_PATH)/device.conf
include $(MIUI_RECOVERY)
View
2  patch_device/maguro/device.conf
@@ -1,2 +0,0 @@
-#calibrate("0.9728", "20", "0.9597", "28", "yes");
-calibrate("0.9466", "17", "0.9500", "33");
View
BIN  patch_device/maguro/root/sbin/recovery
Binary file not shown
View
1  patch_device/maguro/root/sbin/ueventd
View
20 patch_device/saga/device.conf
@@ -1,2 +1,20 @@
#calibrate("0.9728", "20", "0.9597", "28", "yes");
-calibrate("2.0246", "28", "1.2555", "-3");
+ini_set("dp", "2");
+calibrate("7.90", "20", "7.90", "20");
+
+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");
+
+##
+# Initializing Rom Information
+#
+ini_set("rom_name", "MIUI Test Zip");
+ini_set("rom_version", "2.00 NIGHTLY A7");
+ini_set("rom_author", "amarullz");
+ini_set("rom_device", "Any Device");
+ini_set("rom_date", "Apr, 14 2012");
+
+
View
BIN  patch_device/saga/kernel
Binary file not shown
View
1  patch_device/saga/root/cwkeys
@@ -0,0 +1 @@
+{64,0x22e5ddb3,{3498567301,2044920075,3084308789,1036113394,3639563173,4293450355,3317914439,4022690584,1437635571,4217143355,214439227,1337528042,2179971651,347207117,1075373271,365361009,3079404266,586170066,2821971819,1897658619,2836612118,3852358780,777278254,2803368815,353289346,1104581695,2835028263,1510609786,806361876,1240471337,2130829805,953450312,248123023,2010550836,3097533892,2257037024,4012628805,1385631432,4080872333,38850829,3880721630,3559792050,3443278286,2949333134,667714941,591172707,3628129413,1941574385,515652563,4194742905,3346466304,1299771672,2356813514,2682684430,863147039,2231232850,1073451938,1537101485,4223270126,2439555731,1606173828,1875038759,333196737,3459498787},{2975538194,1919044245,655989698,1088576402,2185665250,592325159,1627299586,2185590245,309902435,2238232673,654276958,2465761453,2592443666,4084148749,1027990935,3897616625,1340326607,600635083,3990532360,2766061591,1696233283,3898552021,3831554424,430576146,2490798456,1314457342,1265023710,503662088,420986576,2028597532,2650145483,2343384216,780144224,2195625052,3969629520,1920200026,1964624659,2001835836,3144615614,470136308,2430475817,1591211693,220452315,2183909104,1071986637,3761386936,1537283736,1691318806,2378488130,166657719,3054165992,933153804,1679143752,1260664122,2685312591,3323407859,1498652211,1736935835,3500837152,3924063620,541107132,1575755786,4138353960,2712134822}}
View
56 patch_device/saga/root/default.prop
@@ -4,58 +4,4 @@
ro.secure=0
ro.allow.mock.location=0
ro.debuggable=1
-persist.sys.timezone=Asia/Shanghai
-persist.sys.usb.config=adb
-# begin build properties
-# autogenerated by buildinfo.sh
-ro.build.id=IMM76L
-ro.build.display.id=full_crespo-userdebug 4.0.4 IMM76L eng.yanhao.20120905.110519 test-keys
-ro.build.version.incremental=eng.yanhao.20120905.110519
-ro.build.version.sdk=15
-ro.build.version.codename=REL
-ro.build.version.release=4.0.4
-ro.build.date=2012年 09月 05日 星期三 11:05:28 CST
-ro.build.date.utc=1346814328
-ro.build.type=userdebug
-ro.build.user=yanhao
-ro.build.host=local
-ro.build.tags=test-keys
-ro.product.model=Nexus S
-ro.product.brand=google
-ro.product.name=full_crespo
-ro.product.device=crespo
-ro.product.board=herring
-ro.product.cpu.abi=armeabi-v7a
-ro.product.cpu.abi2=armeabi
-ro.product.manufacturer=samsung
-ro.product.locale.language=zh
-ro.product.locale.region=CN
-ro.wifi.channels=
-ro.board.platform=s5pc110
-# ro.build.product is obsolete; use ro.product.device
-ro.build.product=crespo
-# Do not try to parse ro.build.description or .fingerprint
-ro.build.description=full_crespo-userdebug 4.0.4 IMM76L eng.yanhao.20120905.110519 test-keys
-ro.build.fingerprint=google/full_crespo/crespo:4.0.4/IMM76L/eng.yanhao.20120905.110519:userdebug/test-keys
-ro.build.characteristics=default
-# end build properties
-#
-# system.prop for smdkc110
-#
-
-rild.libpath=/vendor/lib/libsec-ril.so
-rild.libargs=-d /dev/ttyS0
-ro.sf.lcd_density=240
-
-#
-# ADDITIONAL_BUILD_PROPERTIES
-#
-keyguard.no_require_sim=true
-ro.com.android.dataroaming=true
-ro.com.android.dateformat=MM-dd-yyyy
-ro.config.ringtone=MI.ogg
-ro.config.notification_sound=FadeIn.ogg
-ro.config.alarm_alert=GoodMorning.ogg
-ro.config.sms_received_sound=FadeIn.ogg
-ro.config.sms_delivered_sound=MessageComplete.ogg
-dalvik.vm.lockprof.threshold=500
+persist.service.adb.enable=1
View
11 patch_device/saga/root/etc/recovery.fstab
@@ -1,11 +0,0 @@
-# mount point fstype device
-
-/sdcard vfat /dev/block/platform/s3c-sdhci.0/by-name/media
-/system ext4 /dev/block/platform/s3c-sdhci.0/by-name/system
-/cache yaffs2 cache
-/data ext4 /dev/block/platform/s3c-sdhci.0/by-name/userdata
-/misc mtd misc
-/boot mtd boot
-/recovery mtd recovery
-/bootloader mtd bootloader
-/radio mtd radio
View
BIN  patch_device/saga/root/init
Binary file not shown
View
78 patch_device/saga/root/init.goldfish.rc
@@ -0,0 +1,78 @@
+on early-init
+ export EXTERNAL_STORAGE /mnt/sdcard
+ mkdir /mnt/sdcard 0000 system system
+ # for backwards compatibility
+ symlink /mnt/sdcard /sdcard
+
+on boot
+ setprop ARGH ARGH
+ setprop net.eth0.gw 10.0.2.2
+ setprop net.eth0.dns1 10.0.2.3
+ setprop net.gprs.local-ip 10.0.2.15
+ setprop ro.radio.use-ppp no
+ setprop ro.build.product generic
+ setprop ro.product.device generic
+
+# fake some battery state
+ setprop status.battery.state Slow
+ setprop status.battery.level 5
+ setprop status.battery.level_raw 50
+ setprop status.battery.level_scale 9
+
+# disable some daemons the emulator doesn't want
+ stop dund
+ stop akmd
+
+# start essential services
+ start qemud
+ start goldfish-logcat
+ start goldfish-setup
+
+ setprop ro.setupwizard.mode EMULATOR
+
+# enable Google-specific location features,
+# like NetworkLocationProvider and LocationCollector
+ setprop ro.com.google.locationfeatures 1
+
+# For the emulator, which bypasses Setup Wizard, you can specify
+# account info for the device via these two properties. Google
+# Login Service will insert these accounts into the database when
+# it is created (ie, after a data wipe).
+#
+# setprop ro.config.hosted_account username@hosteddomain.org:password
+# setprop ro.config.google_account username@gmail.com:password
+#
+# You MUST have a Google account on the device, and you MAY
+# additionally have a hosted account. No other configuration is
+# supported, and arbitrary breakage may result if you specify
+# something else.
+
+service goldfish-setup /system/etc/init.goldfish.sh
+ user root
+ group root
+ oneshot
+
+# The qemu-props program is used to set various system
+# properties on boot. It must be run early during the boot
+# process to avoid race conditions with other daemons that
+# might read them (e.g. surface flinger), so define it in
+# class 'core'
+#
+service qemu-props /system/bin/qemu-props
+ class core
+ user root
+ group root
+ oneshot
+
+service qemud /system/bin/qemud
+ socket qemud stream 666
+ oneshot
+
+# -Q is a special logcat option that forces the
+# program to check wether it runs on the emulator
+# if it does, it redirects its output to the device
+# named by the androidboot.console kernel option
+# if not, is simply exits immediately
+
+service goldfish-logcat /system/bin/logcat -Q
+ oneshot
View
613 patch_device/saga/root/init.rc 100644 → 100755
@@ -1,50 +1,621 @@
+import init.usb.rc
+
on early-init
+ # Set init and its forked children's oom_adj.
+ write /proc/1/oom_adj -16
+
start ueventd
+# create mountpoints
+ mkdir /mnt 0775 root system
+ mkdir /mnt/sdcard 0000 system system
+
on init
- export PATH /sbin
+
+sysclktz 0
+
+loglevel 3
+
+# setup the global environment
+ export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
+ export LD_LIBRARY_PATH /vendor/lib:/system/lib
+ export ANDROID_BOOTLOGO 1
export ANDROID_ROOT /system
+ export ANDROID_ASSETS /system/app
export ANDROID_DATA /data
- export EXTERNAL_STORAGE /sdcard
+ export EXTERNAL_STORAGE /mnt/sdcard
+ export ASEC_MOUNTPOINT /mnt/asec
+ export LOOP_MOUNTPOINT /mnt/obb
+ export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework2.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/HTCDev.jar:/system/framework/HTCExtension.jar:/system/framework/com.htc.framework.jar:/system/framework/filterfw.jar:/system/framework/com.htc.android.bluetooth.jar:/system/framework/wimax.jar:/system/framework/com.orange.authentication.simcard.jar
+# Backward compatibility
symlink /system/etc /etc
+ symlink /sys/kernel/debug /d
+ symlink /mnt/sdcard /sdcard
+
+# Right now vendor lives on the same filesystem as system,
+# but someday that may change.
+ symlink /system/vendor /vendor
+
+# Create cgroup mount point for cpu accounting
+ mkdir /acct
+ mount cgroup none /acct cpuacct
+ mkdir /acct/uid
- mkdir /sdcard
mkdir /system
- mkdir /data
- mkdir /cache
- mount /tmp /tmp tmpfs
+ mkdir /data 0771 system system
+ mkdir /cache 0770 system cache
+ mkdir /config 0500 root root
-on boot
+ # Directory for putting things only root should see.
+ mkdir /mnt/secure 0700 root root
+
+ # Directory for staging bindmounts
+ mkdir /mnt/secure/staging 0700 root root
+
+ # Directory-target for where the secure container
+ # imagefile directory will be bind-mounted
+ mkdir /mnt/secure/asec 0700 root root
+
+ # Secure container public mount points.
+ mkdir /mnt/asec 0700 root system
+ mount tmpfs tmpfs /mnt/asec mode=0755,gid=1000
+
+ # Filesystem image public mount points.
+ mkdir /mnt/obb 0700 root system
+ mount tmpfs tmpfs /mnt/obb mode=0755,gid=1000
+
+ mkdir /app-cache 0700 root system
+ mount tmpfs tmpfs /app-cache size=8m,mode=0755,gid=1000
+
+ write /proc/sys/kernel/panic_on_oops 1
+ write /proc/sys/kernel/hung_task_timeout_secs 0
+ write /proc/cpu/alignment 4
+ write /proc/sys/kernel/sched_latency_ns 10000000
+ write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
+ write /proc/sys/kernel/sched_compat_yield 1
+ write /proc/sys/kernel/sched_child_runs_first 0
+ write /proc/sys/kernel/randomize_va_space 2
+
+# Create cgroup mount points for process groups
+ mkdir /dev/cpuctl
+ mount cgroup none /dev/cpuctl cpu
+ chown system system /dev/cpuctl
+ chown system system /dev/cpuctl/tasks
+ chmod 0777 /dev/cpuctl/tasks
+ write /dev/cpuctl/cpu.shares 1024
+
+ mkdir /dev/cpuctl/fg_boost
+ chown system system /dev/cpuctl/fg_boost/tasks
+ chmod 0777 /dev/cpuctl/fg_boost/tasks
+ write /dev/cpuctl/fg_boost/cpu.shares 1024
+
+ mkdir /dev/cpuctl/bg_non_interactive
+ chown system system /dev/cpuctl/bg_non_interactive/tasks
+ chmod 0777 /dev/cpuctl/bg_non_interactive/tasks
+ # 5.0 %
+ write /dev/cpuctl/bg_non_interactive/cpu.shares 52
+
+# Allow everybody to read the xt_qtaguid resource tracking misc dev.
+# This is needed by any process that uses socket tagging.
+ chmod 0644 /dev/xt_qtaguid
+
+on fs
+# mount mtd partitions
+ # Mount /system rw first to give the filesystem a chance to save a checkpoint
+ mount yaffs2 mtd@system /system
+ mount yaffs2 mtd@system /system ro remount
+ mount yaffs2 mtd@userdata /data nosuid nodev
+ mount yaffs2 mtd@cache /cache nosuid nodev
+
+on post-fs
+ # once everything is setup, no need to modify /
+ mount rootfs rootfs / ro remount
+
+ # We chown/chmod /cache again so because mount is run as root + defaults
+ chown system cache /cache
+ chmod 0770 /cache
+
+ # This may have been created by the recovery system with odd permissions
+ chown system cache /cache/recovery
+ chmod 0770 /cache/recovery
+
+ #change permissions on vmallocinfo so we can grab it from bugreports
+ chown root log /proc/vmallocinfo
+ chmod 0440 /proc/vmallocinfo
+
+ #change permissions on kmsg & sysrq-trigger so bugreports can grab kthread stacks
+ chown root system /proc/kmsg
+ chmod 0440 /proc/kmsg
+ chown root system /proc/sysrq-trigger
+ chmod 0220 /proc/sysrq-trigger
+
+ # create the lost+found directories, so as to enforce our permissions
+ mkdir /cache/lost+found 0770 root root
+
+on post-fs-data
+ # We chown/chmod /data again so because mount is run as root + defaults
+ chown system system /data
+ chmod 0771 /data
+
+ # create htcfs
+ mkdir /data/htcfs 0750 media media
+ # Create dump dir and collect dumps.
+ # Do this before we mount cache so eventually we can use cache for
+ # storing dumps on platforms which do not have a dedicated dump partition.
+ mkdir /data/dontpanic 0750 root log
+
+ # Collect apanic data, free resources and re-arm trigger
+ copy /proc/apanic_console /data/dontpanic/apanic_console
+ chown root log /data/dontpanic/apanic_console
+ chmod 0640 /data/dontpanic/apanic_console
+
+ copy /proc/apanic_threads /data/dontpanic/apanic_threads
+ chown root log /data/dontpanic/apanic_threads
+ chmod 0640 /data/dontpanic/apanic_threads
+
+ write /proc/apanic_console 1
+
+ # create basic filesystem structure
+ mkdir /data/misc 01771 system misc
+ mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth
+ mkdir /data/misc/bluetooth 0770 system system
+ mkdir /data/misc/keystore 0700 keystore keystore
+ mkdir /data/misc/keychain 0771 system system
+ mkdir /data/misc/vpn 0770 system vpn
+ mkdir /data/misc/systemkeys 0700 system system
+ # give system access to wpa_supplicant.conf for backup and restore
+ mkdir /data/misc/wifi 0770 wifi wifi
+ chmod 0660 /data/misc/wifi/wpa_supplicant.conf
+ mkdir /data/local 0751 root root
+ mkdir /data/local/tmp 0771 shell shell
+ mkdir /data/data 0771 system system
+ mkdir /data/app-private 0771 system system
+ mkdir /data/app 0771 system system
+ mkdir /data/property 0700 root root
+ mkdir /data/radio 0770 radio radio
+ mkdir /dev/radio 0770 radio radio
+
+ # create dalvik-cache, so as to enforce our permissions
+ mkdir /data/dalvik-cache 0771 system system
+
+ # create resource-cache and double-check the perms
+ mkdir /data/resource-cache 0771 system system
+ chown system system /data/resource-cache
+ chmod 0771 /data/resource-cache
+
+ # create the lost+found directories, so as to enforce our permissions
+ mkdir /data/lost+found 0770 root root
+
+ # create directory for DRM plug-ins - give drm the read/write access to
+ # the following directory.
+ mkdir /data/drm 0770 drm drm
+
+ chown system system /sys/class/android_usb/android0/f_mass_storage/lun/file
+ chmod 0660 /sys/class/android_usb/android0/f_mass_storage/lun/file
+ chown system system /sys/class/android_usb/android0/f_rndis/ethaddr
+ chmod 0660 /sys/class/android_usb/android0/f_rndis/ethaddr
+
+ # HTC add: Smartcard Service on ICS
+ chmod 0660 /dev/assd
+ chown smartcard smartcard /dev/assd
+
+ # HTC add: 3LM setting on ICS
+ setprop ro.3lm.production 1
+
+ # HTC add: 3LM encryption on ICS
+ setprop ro.3lm.legacy_encryption 1
+ mkdir /data/secure 0755 system system
+ mkdir /data/secure/data 0755 system system
+ mount tmpfs tmpfs /data/secure/data mode=0755,gid=1000
+
+ # HTC add: for customization wizard folder
+ mkdir /data/data/cw 0770 root cw_access
+ mkdir /data/data/cwtemp 0770 root cw_access
+
+ chmod 0770 /data/data/cw
+ chmod 0770 /data/data/cwtemp
+
+ # HTC add: double check the perms of /data/data for already existed case
+ chown system system /data/data
+ chmod 0771 /data/data
+ chmod 0660 /data/data/com.android.providers.settings/databases/settings.db-wal
+ chmod 0660 /data/data/com.android.providers.settings/databases/settings.db-shm
+ chmod 0660 /data/data/com.android.providers.settings/databases/settings.db-journal
+
+ # HTC add: double check the perms of /data/data/recovery for already existed case
+ chown root recvy_access /data/data/recovery
+ chmod 0775 /data/data/recovery
+
+ chown system system /sys/class/graphics/fb0/ratelimit
+
+ # If there is no fs-post-data action in the init.<device>.rc file, you
+ # must uncomment this line, otherwise encrypted filesystems
+ # won't work.
+ # Set indication (checked by vold) that we have finished this action
+ setprop vold.post_fs_data_done 1
+
+on boot
+# basic network init
ifup lo
hostname localhost
domainname localdomain
- class_start default
+# set RLIMIT_NICE to allow priorities from 19 to -20
+ setrlimit 13 40 40
+ setrlimit 8 268435456 268435456
+
+# Memory management. Basic kernel parameters, and allow the high
+# level system server to be able to adjust the kernel OOM driver
+# paramters to match how it is managing things.
+ write /proc/sys/vm/overcommit_memory 1
+ write /proc/sys/vm/min_free_order_shift 4
+ write /proc/sys/vm/highmem_is_dirtyable 1
+ write /proc/sys/vm/min_free_kbytes 4096
+ chown root system /sys/module/lowmemorykiller/parameters/adj
+ chmod 0664 /sys/module/lowmemorykiller/parameters/adj
+ chown root system /sys/module/lowmemorykiller/parameters/minfree
+ chmod 0664 /sys/module/lowmemorykiller/parameters/minfree
+
+ # Tweak background writeout
+ write /proc/sys/vm/dirty_expire_centisecs 200
+ write /proc/sys/vm/dirty_background_bytes 1024000
+ write /proc/sys/vm/dirty_bytes 10240000
+
+ # Permissions for System Server and daemons.
+ chown radio system /sys/android_power/state
+ chown radio system /sys/android_power/request_state
+ chown radio system /sys/android_power/acquire_full_wake_lock
+ chown radio system /sys/android_power/acquire_partial_wake_lock
+ chown radio system /sys/android_power/release_wake_lock
+ chown radio system /sys/power/state
+ chown radio system /sys/power/wake_lock
+ chown radio system /sys/power/wake_unlock
+ chmod 0444 /sys/android_camera/fps_mode
+ chmod 0660 /sys/android_camera2/htcwc
+ chown media system /sys/android_camera2/htcwc
+ chown media system /sys/android_camera/cam3Dmode
+ chown radio system /sys/camera_led_status/led_ril_status
+ chown system system /sys/camera_led_status/led_wimax_status
+ chown system system /sys/camera_led_status/led_hotspot_status
+ chown media system /sys/android_camera/cam_mode
+ chmod 0660 /sys/power/state
+ chmod 0660 /sys/power/wake_lock
+ chmod 0660 /sys/power/wake_unlock
+ chown system system /sys/class/timed_output/vibrator/enable
+ chown system system /sys/class/leds/keyboard-backlight/brightness
+ chown system system /sys/class/leds/lcd-backlight/brightness
+ chown system system /sys/class/leds/button-backlight/brightness
+ chown system system /sys/class/leds/jogball-backlight/brightness
+ chown system system /sys/class/leds/red/brightness
+ chown system system /sys/class/leds/green/brightness
+ chown system system /sys/class/leds/blue/brightness
+ chown system system /sys/class/leds/red/device/grpfreq
+ chown system system /sys/class/leds/red/device/grppwm
+ chown system system /sys/class/leds/red/device/blink
+ chown system system /sys/class/leds/red/brightness
+ chown system system /sys/class/leds/green/brightness
+ chown system system /sys/class/leds/blue/brightness
+ chown system system /sys/class/leds/red/device/grpfreq
+ chown system system /sys/class/leds/red/device/grppwm
+ chown system system /sys/class/leds/red/device/blink
+ chown system system /sys/class/timed_output/vibrator/enable
+ chown system system /sys/module/sco/parameters/disable_esco
+ chown system system /sys/kernel/ipv4/tcp_wmem_min
+ chown system system /sys/kernel/ipv4/tcp_wmem_def
+ chown system system /sys/kernel/ipv4/tcp_wmem_max
+ chown system system /sys/kernel/ipv4/tcp_rmem_min
+ chown system system /sys/kernel/ipv4/tcp_rmem_def
+ chown system system /sys/kernel/ipv4/tcp_rmem_max
+ chown root radio /proc/cmdline
+# HTC SSD Peripheral UI - BEGIN
+ chown system system /sys/class/leds/red/brightness
+ chown system system /sys/class/leds/red/blink
+ chown system system /sys/class/leds/red/off_timer
+ chown system system /sys/class/leds/green/brightness
+ chown system system /sys/class/leds/green/blink
+ chown system system /sys/class/leds/green/off_timer
+ chown system system /sys/class/leds/blue/brightness
+ chown system system /sys/class/leds/blue/blink
+ chown system system /sys/class/leds/blue/off_timer
+ chown system system /sys/class/leds/amber/brightness
+ chown system system /sys/class/leds/amber/blink
+ chown system system /sys/class/leds/amber/off_timer
+ chown system system /sys/class/leds/button-backlight-portrait/brightness
+ chown system system /sys/class/leds/button-backlight-landscape/brightness
+ chown system system /sys/class/leds/amber-portrait/brightness
+ chown system system /sys/class/leds/green-portrait/brightness
+ chown system system /sys/class/leds/blue-portrait/brightness
+ chown system system /sys/class/leds/amber-landscape/brightness
+ chown system system /sys/class/leds/green-landscape/brightness
+ chown system system /sys/class/leds/blue-landscape/brightness
+ chown system system /sys/class/leds/sharekey/brightness
+ chown system system /sys/class/leds/sharekey/breath_times
+ chown system system /sys/class/leds/sharekey/breath_max_brightness
+ chown system system /sys/class/leds/charming-led/brightness
+ chown system system /sys/class/leds/charming-led/blink
+ chown system system /sys/class/leds/charming-led/off_timer
+ chown system system /sys/class/leds/flashlight/brightness
+ chown system system /sys/class/leds/caps/brightness
+ chown system system /sys/class/leds/func/brightness
+ chown media media /sys/class/leds/green-camera/brightness
+ chown system system /sys/devices/virtual/htc_accessory/fm/flag
+ chown system system /sys/devices/virtual/htc_accessory/tty/flag
+ chown system system /sys/class/switch/dock/dmb_wakeup
+# HTC SSD Peripheral UI - END
+
+# HTC SSD Peripheral Touch - START
+ chown system system /sys/android_touch/unlock
+# HTC SSD Peripheral UI -END
+
+# HTC SSD USB
+ chown system system /sys/class/android_usb/f_modem/on
+ chown system system /sys/class/android_usb/f_diag/on
+ chown system system /sys/class/android_usb/f_rmnet/on
+
+#set diag permissions
+ chown radio radio /dev/diag
+ chown radio radio /dev/diag_mdm
+ chown radio radio /dev/htcdiag
+ chown radio radio /dev/diag_arm9
+ chown radio radio /dev/btdiag
+ chmod 0660 /dev/diag
+ chmod 0660 /dev/diag_mdm
+ chmod 0660 /dev/htcdiag
+ chmod 0660 /dev/diag_arm9
+ chmod 0660 /dev/btdiag
+
+# Define TCP buffer sizes for various networks
+# ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
+ setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
+ setprop net.tcp.buffersize.wifi 524288,1048576,2097152,262144,524288,1048576
+# setprop net.tcp.buffersize.hsdpa 4094,87380,393216,4096,16384,110208
+# setprop net.tcp.buffersize.umts 4094,87380,393216,4096,16384,110208
+# setprop net.tcp.buffersize.edge 4093,26280,393216,4096,16384,35040
+# setprop net.tcp.buffersize.gprs 4092,8760,393216,4096,8760,11680
+# setprop net.tcp.buffersize.lte 4096,221184,3461120,4096,221184,3461120
+# setprop net.tcp.buffersize.evdo_b 4094,87380,262144,4096,16384,262144
+# setprop net.tcp.buffersize.wimax 4096,221184,524288,4096,16384,110208
+ setprop net.tcp.buffersize.hsdpa 4094,87380,704512,4096,16384,110208
+ setprop net.tcp.buffersize.umts 4094,87380,704512,4096,16384,110208
+ setprop net.tcp.buffersize.edge 4093,26280,704512,4096,16384,35040
+ setprop net.tcp.buffersize.gprs 4092,8760,704512,4096,8760,11680
+ setprop net.tcp.buffersize.lte 4096,221184,3461120,4096,221184,3461120
+ setprop net.tcp.buffersize.evdo_b 4094,87380,262144,4096,16384,262144
+ setprop net.tcp.buffersize.wimax 4096,221184,524288,4096,16384,110208
+
+ # Assign TCP buffer thresholds to be ceiling value of technology maximums
+ # Increased technology maximums should be reflected here.
+ write /proc/sys/net/core/rmem_max 262144
+ write /proc/sys/net/core/wmem_max 262144
+# Set this property so surfaceflinger is not started by system_init
+ setprop system_init.startsurfaceflinger 0
+
+# Set error receiver
+ setprop ro.error.receiver.htc.apps com.htc.feedback
+
+ class_start core
+ class_start main
+
+on nonencrypted
+ class_start late_start
+
+on charger
+ class_start charger
+
+on property:vold.decrypt=trigger_reset_main
+ class_reset main
+
+on property:vold.decrypt=trigger_load_persist_props
+ load_persist_props
+
+on property:vold.decrypt=trigger_post_fs_data
+ trigger post-fs-data
+
+on property:vold.decrypt=trigger_restart_min_framework
+ class_start main
+
+on property:vold.decrypt=trigger_restart_framework
+ class_start main
+ class_start late_start
+
+on property:vold.decrypt=trigger_shutdown_framework
+ class_reset late_start
+ class_reset main
+
+## Daemon processes to be run by init.
+##
service ueventd /sbin/ueventd
+ class core
critical
-service recovery /sbin/recovery
-
-service adbd /sbin/adbd recovery
+service console /system/bin/sh
+ class core
+ console
disabled
+ user shell
+ group log
-# Always start adbd on userdebug and eng builds
on property:ro.debuggable=1
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 18D1
- write /sys/class/android_usb/android0/idProduct D001
- write /sys/class/android_usb/android0/functions adb
- write /sys/class/android_usb/android0/enable 1
- write /sys/class/android_usb/android0/iManufacturer $ro.product.manufacturer
- write /sys/class/android_usb/android0/iProduct $ro.product.model
- write /sys/class/android_usb/android0/iSerial $ro.serialno