install-recovery.sh & applypatch
来源:互联网 发布:以太网端口 编辑:程序博客网 时间:2024/05/16 18:11
install-recovery.sh & applypatch
(2014-05-25 21:35:55)转载▼
分类: Android
2012-12-21 11:32
install-recovery.sh & applypatch
1.
1
2
3
service flash_recovery
/system/etc/install-recovery
.sh
class main
oneshot
2.
1
2
3
service flash_recovery
/system/etc/install-recovery
.sh
class main
oneshot
3.
4.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
def
MakeRecoveryPatch(output_zip, recovery_img, boot_img):
"""Generate a binary patch that creates the recovery image starting
with the boot image. (Most of the space in these images is just the
kernel, which is identical for the two, so the resulting patch
should be efficient.) Add it to the output zip, along with a shell
script that is run from init.rc on first boot to actually do the
patching and install the new recovery image.
recovery_img and boot_img should be File objects for the
corresponding images. info should be the dictionary returned by
common.LoadInfoDict() on the input target_files.
Returns an Item for the shell script, which must be made
executable.
"""
d
=
common.Difference(recovery_img, boot_img)
_, _, patch
=
d.ComputePatch()
common.ZipWriteStr(output_zip,
"recovery/recovery-from-boot.p"
, patch)
Item.Get(
"system/recovery-from-boot.p"
,
dir
=
False
)
boot_type, boot_device
=
common.GetTypeAndDevice(
"/boot"
, OPTIONS.info_dict)
recovery_type, recovery_device
=
common.GetTypeAndDevice(
"/recovery"
, OPTIONS.info_dict)
sh
=
"""#!/system/bin/sh
if ! applypatch -c %(recovery_type)s:%(recovery_device)s:%(recovery_size)d:%(recovery_sha1)s; then
log -t recovery "Installing new recovery image"
applypatch %(boot_type)s:%(boot_device)s:%(boot_size)d:%(boot_sha1)s %(recovery_type)s:%(recovery_device)s %(recovery_sha1)s %(recovery_size)d %(boot_sha1)s:/system/recovery-from-boot.p
else
log -t recovery "Recovery image already installed"
fi
"""
%
{
'boot_size'
: boot_img.size,
'boot_sha1'
: boot_img.sha1,
'recovery_size'
: recovery_img.size,
'recovery_sha1'
: recovery_img.sha1,
'boot_type'
: boot_type,
'boot_device'
: boot_device,
'recovery_type'
: recovery_type,
'recovery_device'
: recovery_device,
}
common.ZipWriteStr(output_zip,
"recovery/etc/install-recovery.sh"
, sh)
return
Item.Get(
"system/etc/install-recovery.sh"
,
dir
=
False
)
5.
1
2
3
4
5
6
7
#!/system/bin/sh
if
! applypatch
-
c MTD:recovery:
3586808
:a1bdc75a0eaa8faf855807c3b60c43dbcfb1400a; then
log
-
t recovery
"Installing new recovery image"
applypatch MTD:boot:
3776935
:
6cbe8dfacd08ba5cfa39b97e16de0d1f8176c0ed
MTD:recovery a1bdc75a0eaa8faf855807c3b60c43dbcfb1400a
3586808
6cbe8dfacd08ba5cfa39b97e16de0d1f8176c0ed
:
/
system
/
recovery
-
from
-
boot.p
else
log
-
t recovery
"Recovery image already installed"
fi
Recovery
0 0
- install-recovery.sh & applypatch
- install.sh如何执行
- ossec install.sh failed
- install android ndk, host-setup.sh error
- bash: ./my-install.sh: Permission denied ---solved
- UBUNTU 下 install as /bin/sh?no
- Android bsdiff/bspatch imgdiff/applypatch
- mkimage.sh 分析 boot.img recovery.img system.img制作方法
- ./configure时候遇到的问题 Cannot find install-sh, install.sh, or shtool in ac-aux
- ./configure时,error: cannot find install-sh, install.sh, or shtool解决方法
- $ npm install sh.exe": npm: command not found
- meteor安装过慢 curl install.meteor.com | sh
- ubuntu fastdfs ./make.sh install 执行报错
- recovery
- recovery
- Recovery
- [IMX6Q][Android5.1]移植笔记 --- Recovery mode的shell功能实现(sh+toolbox)
- sh
- SpringMVC+Mybatis多静态数据源配置
- [非maven] ssm框架搭建
- asp.net mvc 参数传递的问题
- java控制台编译通过,运行出现错误: 找不到或无法加载主类xx.java
- 昂贵的聘礼 [DFS][最短路]
- install-recovery.sh & applypatch
- Linux IO模式及 select、poll、epoll详解
- .Net下的分库分表帮助类——用分库的思想来分表
- Intellij IDEA 快捷键整理
- 数学知识
- UVA 12219 Common Subexpression Elimination (dfs瞎搞)
- Android异步消息处理机制 Handler、Looper、Message
- Java复习之适配器模式
- linux安装redis并使用其提供的初始化启动脚本加入到系统服务中