Android的Amend脚本(update-script)和Edify脚本(updater-script和update-binary)比较
我不是春哥@移动叔叔
2011年8月28日
最近在移植ClockworkMod的Recovery到基于MT6573方案的联想的A60机器,新版的Recovery仅支持的Edify脚本和之前的RA的Recovery支持的Amend脚本语法比较不完整版.供做ROM的同学参考.
如果使用老的脚本的卡刷包将会提示如下:
Amend scripting (update-script) is no longer supported,
Amend scripting was deprecated by Google in Android 1.5.
It was necessary to remove it when upgrading to the ClockworkMod 3.0 Gingerbread based recovery.
Please swith to Edify scripting (update-script and update-binary) to create working update zip packages
Installation aborted。
大致意思是:
Amend脚本(update-script)已经不再支持,
在Android1.5的时使用的Amend脚本已经过时
有必要更新到姜饼的最新recovery
请将升级包脚本升级到Edify脚本(updater-script和update-binary).
安装已取消!
1安装信息输出:
Amend:
无
Edify:
ui_print(“---start mobileuncle update---”);
通过ui_print()命令可以输出脚本执行到那个环节了
2 格式化分区
Amend:
format SYSTEM:
format DATA:
format CACHE:
Edify:
format(“MTD,”system”);
format(“MTD”,”userdata”);
format(“MTD”,”cache”);
3 复制分区
3.1 system分区
Amend:
copy_dir PACKAGE:system SYSTEM:
Edify:
mount("MTD", "system", "/system");
package_extract_dir("system", "/system");
3.2 data分区
Amend:
copy_dir PACKAGE:data DATA:
Edify:
mount("MTD", "userdata", "/data");
package_extract_dir("data", "/data");
3.3 sdcard
Amend:
copy_dir PACKAGE:sdcard SDCARD:
Edify:
mount("vfat","/dev/block/mmcblk0p1","/sdcard");
package_extract_dir("sdcard", "/sdcard");
4 删除目录
Amend:
delete_recursive DATA:app
Edify:
delete_recursive("/data/app");
5 删除文件
Amend:
delete DATA:etc/hosts
Edify:
delete("/data/etc/hosts");
6 目录权限设置
Amend:
set_perm_recursive 1000 1000 0771 0644 DATA:app
Edify:
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
7 文件权限设置
Amend:
set_perm 2000 2000 0771 DATA:etc
Edify:
set_perm(2000, 2000, 0771, "/data/etc");
8 软链接
Amend:
symlink /data/app/apps.apk SYSTEM:app/apps.apk
symlink /data/etc/hosts SYSTEM:etc/hosts
Edify:
symlink("/data/app/apps.apk", "/system/app/apps.apk");
symlink("/data/etc/hosts", "/system/etc/hosts");
9 toolbox软链
Amend:
symlink toolbox SYSTEM:bin/date
Edify:
symlink("toolbox", "/system/bin/date");
10 Busybox安装
Amend:
run_program PACKAGE:installbusybox
Edify:
run_program("installbusybox");
set_perm(0, 1000, 0755, "/system/xbin/busybox");
11 写Boot.img
Amend:
format BOOT:
write_raw_image PACKAGE:boot.img BOOT:
Edify:
package_extract_file("boot.img","/tmp/boot.img"); write_raw_image("/tmp/boot.img", "boot");
delete("/tmp/boot.img");
12 toolbox批量软链
Amend:
无
Edify:
symlink("toolbox",
"/system/bin/renice","/system/bin/cmp",
"/system/bin/chown","/system/bin/rm",
"/system/bin/chmod","/system/bin/df",
"/system/bin/sleep","/system/bin/sendevent",
"/system/bin/mount","/system/bin/setprop",
"/system/bin/hd","/system/bin/umount",
"/system/bin/getevent","/system/bin/ls",
"/system/bin/uptime","/system/bin/watchprops",
"/system/bin/start","/system/bin/top",
"/system/bin/lsof","/system/bin/kill",
"/system/bin/reboot","/system/bin/ps",
"/system/bin/route","/system/bin/wipe",
"/system/bin/dd","/system/bin/setconsole",
"/system/bin/cat","/system/bin/sync",
"/system/bin/mv","/system/bin/notify",
"/system/bin/rmdir","/system/bin/date",
"/system/bin/ifconfig","/system/bin/insmod",
"/system/bin/dmesg","/system/bin/lsmod",
"/system/bin/id","/system/bin/smd",
"/system/bin/getprop","/system/bin/ln",
"/system/bin/stop","/system/bin/log",
"/system/bin/netstat","/system/bin/ionice",
"/system/bin/newfs_msdos","/system/bin/schedtop",
android最新版"/system/bin/nandread","/system/bin/vmstat",
"/system/bin/rmmod","/system/bin/printenv",
"/system/bin/mkdir","/system/bin/iftop",
"/system/bin/ioctl");
set_perm(0, 0, 04755, "/system/bin/toolbox");
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论