少妇脱了内裤让我添,久久久久亚洲精品无码网址蜜桃,性色av免费观看,久久人妻av无码中文专区

分享

update.zip升級過程---updater-script腳本語法簡介以及執行流程

 joy_chen 2013-09-30
目前update-script腳本格式是edify,其與amend有何區別,暫不討論,我們只分析其中主要的語法,以及腳本的流程控制。

一、update-script腳本語法簡介:

        我們順著所生成的腳本來看其中主要涉及的語法。

        1.assert(condition):如果condition參數的計算結果為False,則停止腳本執行,否則繼續執行腳本。

        2.show_progress(frac,sec):frac表示進度完成的數值,sec表示整個過程的總秒數。主要用與顯示UI上的進度條。

        3.format(fs_type,partition_type,location):fs_type,文件系統類型,取值一般為“yaffs2”或“ext4”。Partition_type,分區類型,一般取值為“MTD”或則“EMMC”。主要用于格式化為指定的文件系統。事例如下:format(”yaffs2”,”MTD”,”system”)。

        4.mount(fs_type,partition_type,location,mount_point):前兩個參數同上,location要掛載的設備,mount_point掛載點。作用:掛載一個文件系統到指定的掛載點。

        5.package_extract_dir(src_path,destination_path):src_path,要提取的目錄,destination_path目標目錄。作用:從升級包內,提取目錄到指定的位置。示例:package_extract_dir(“system”,”/system”)。

        6.symlink(target,src1,src2,……,srcN):target,字符串類型,是符號連接的目標。SrcX代表要創建的符號連接的目標點。示例:symlink(“toolbox”,”/system/bin/ps”),建立指向toolbox符號連接/system/bin/ps,值得注意的是,在建立新的符號連接之前,要斷開已經存在的符號連接。

        7.set_perm(uid,gid,mode,file1,file2,……,fileN):作用是設置單個文件或則一系列文件的權限,最少要指定一個文件。

        8.set_perm_recursive(uid,gid,mode,dir1,dir2,……,dirN):作用同上,但是這里同時改變的是一個或多個目錄及其文件的權限。

        9.package_extract_file(srcfile_path,desfile_paht):srcfile_path,要提取的文件,desfile_path,提取文件的目標位置。示例:package_extract_file(“boot.img”,”/tmp/boot.img”)將升級包中的boot.img文件拷貝到內存文件系統的/tmp下。

      10.write_raw_image(src-image,partition):src-image源鏡像文件,partition,目標分區。作用:將鏡像寫入目標分區。示例:write_raw_image(“/tmp/boot.img”,”boot”)將boot.img鏡像寫入到系統的boot分區。

      11.getprop(key):通過指定key的值來獲取對應的屬性信息。示例:getprop(“ro.product.device”)獲取ro.product.device的屬性值。

     12. ui_print(String): 用于在Flash Mode要顯示的內容

     13. delete(FilePath): 用于刪除文件的命令

     14. run_program(Shell, ScriptPath): 例如:run_program("/sbin/sh", "/system/bin/install.sh");

     15. umount(Path): 卸載文件系統

     16. cmdlist:

  1. is_mounted  
  2. unmount  
  3. format  
  4. show_progress  
  5. set_progress  
  6. delete  
  7. delete_recursive  
  8. package_extract_dir  
  9. package_extract_file  
  10. retouch_binaries  
  11. undo_retouch_binaries  
  12. symlink  
  13. set_perm  
  14. set_perm_recursive  
  15. getprop  
  16. file_getprop  
  17. write_raw_image  
  18. apply_patch  
  19. apply_patch_check  
  20. apply_patch_space  
  21. read_file  
  22. sha1_check  
  23. wipe_cache  
  24. ui_print  
  25. run_program  
  26. set_bootloader_env  

          

二、updater-script腳本執行流程分析:

          先看一下在測試過程中用命令make otapackage生成的升級腳本如下:

  1. assert(!less_than_int(1331176658, getprop("ro.build.date.utc")));  
  2. assert(getprop("ro.product.device") == "tcc8800" ||  
  3.        getprop("ro.build.product") == "tcc8800");  
  4. show_progress(0.500000, 0);  
  5. format("yaffs2", "MTD", "system");  
  6. mount("yaffs2", "MTD", "system", "/system");  
  7. package_extract_dir("recovery", "/system");  
  8. package_extract_dir("system", "/system");  
  9. symlink("busybox", "/system/bin/cp", "/system/bin/grep",  
  10.         "/system/bin/tar", "/system/bin/unzip",  
  11.         "/system/bin/vi");  
  12. symlink("toolbox", "/system/bin/cat", "/system/bin/chmod",  
  13.         "/system/bin/chown", "/system/bin/cmp", "/system/bin/date",  
  14.         "/system/bin/dd", "/system/bin/df", "/system/bin/dmesg",  
  15.         "/system/bin/getevent", "/system/bin/getprop", "/system/bin/hd",  
  16.         "/system/bin/id", "/system/bin/ifconfig", "/system/bin/iftop",  
  17.         "/system/bin/insmod", "/system/bin/ioctl", "/system/bin/ionice",  
  18.         "/system/bin/kill", "/system/bin/ln", "/system/bin/log",  
  19.         "/system/bin/ls", "/system/bin/lsmod", "/system/bin/lsof",  
  20.         "/system/bin/mkdir", "/system/bin/mount", "/system/bin/mv",  
  21.         "/system/bin/nandread", "/system/bin/netstat",  
  22.         "/system/bin/newfs_msdos", "/system/bin/notify", "/system/bin/printenv",  
  23.         "/system/bin/ps", "/system/bin/reboot", "/system/bin/renice",  
  24.         "/system/bin/rm", "/system/bin/rmdir", "/system/bin/rmmod",  
  25.         "/system/bin/route", "/system/bin/schedtop", "/system/bin/sendevent",  
  26.         "/system/bin/setconsole", "/system/bin/setprop", "/system/bin/sleep",  
  27.         "/system/bin/smd", "/system/bin/start", "/system/bin/stop",  
  28.         "/system/bin/sync", "/system/bin/top", "/system/bin/umount",  
  29.         "/system/bin/uptime", "/system/bin/vmstat", "/system/bin/watchprops",  
  30.         "/system/bin/wipe");  
  31. set_perm_recursive(0, 0, 0755, 0644, "/system");  
  32. set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");  
  33. set_perm(0, 3003, 02750, "/system/bin/netcfg");  
  34. set_perm(0, 3004, 02755, "/system/bin/ping");  
  35. set_perm(0, 2000, 06750, "/system/bin/run-as");  
  36. set_perm_recursive(1002, 1002, 0755, 0440, "/system/etc/bluetooth");  
  37. set_perm(0, 0, 0755, "/system/etc/bluetooth");  
  38. set_perm(1000, 1000, 0640, "/system/etc/bluetooth/auto_pairing.conf");  
  39. set_perm(3002, 3002, 0444, "/system/etc/bluetooth/blacklist.conf");  
  40. set_perm(1002, 1002, 0440, "/system/etc/dbus.conf");  
  41. set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");  
  42. set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh");  
  43. set_perm(0, 0, 0544, "/system/etc/install-recovery.sh");  
  44. set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");  
  45. set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");  
  46. set_perm(0, 0, 06755, "/system/xbin/librank");  
  47. set_perm(0, 0, 06755, "/system/xbin/procmem");  
  48. set_perm(0, 0, 06755, "/system/xbin/procrank");  
  49. set_perm(0, 0, 06755, "/system/xbin/su");  
  50. set_perm(0, 0, 06755, "/system/xbin/tcpdump");  
  51. show_progress(0.200000, 0);  
  52. show_progress(0.200000, 10);  
  53. assert(package_extract_file("boot.img", "/tmp/boot.img"),  
  54.        write_raw_image("/tmp/boot.img", "boot"),  
  55.        delete("/tmp/boot.img"));  
  56. show_progress(0.100000, 0);  
  57. unmount("/system");  


          下面分析下這個腳本的執行過程:

         比較時間戳:如果升級包較舊則終止腳本的執行。

         匹配設備信息:如果和當前的設備信息不一致,則停止腳本的執行。

         顯示進度條:如果以上兩步匹配則開始顯示升級進度條。

         格式化system分區并掛載。

         提取包中的recovery以及system目錄下的內容到系統的/system下。

         為/system/bin/下的命令文件建立符號連接。

         設置/system/下目錄以及文件的屬性。

         將包中的boot.img提取到/tmp/boot.img。

         將/tmp/boot.img鏡像文件寫入到boot分區。

         完成后卸載/system。

         以上就是updater-script腳本中的語法,及其執行的具體過程。通過分析其執行流程,我們可以發現在執行過程中,并未將升級包另外解壓到一個地方,而是需要什么提取什么。值得主要的是在提取recovery和system目錄中的內容時,一并放在了/system/下。在操作的過程中,并未刪除或改變update.zip包中的任何內容。在實際的更新完成后,我們的update.zip包確實還存在于原來的位置。


三、總結

        以上的九篇著重分析了Android系統中Recovery模式中的一種,即我們做好的update.zip包在系統更新時所走過的流程。其核心部分就是Recovery服務的工作原理。其他兩種FACTORY RESET、ENCRYPTED FILE SYSTEM ENABLE/DISABLE與OTA INSTALL是相通的。重點是要理解Recovery服務的工作原理。另外詳細分析其升級過程,對于我們在實際升級時,可以根據我們的需要做出相應的修改。

http://blog.csdn.net/tody_guo/article/details/7943429

    本站是提供個人知識管理的網絡存儲空間,所有內容均由用戶發布,不代表本站觀點。請注意甄別內容中的聯系方式、誘導購買等信息,謹防詐騙。如發現有害或侵權內容,請點擊一鍵舉報。
    轉藏 分享 獻花(0

    0條評論

    發表

    請遵守用戶 評論公約

    類似文章 更多

    主站蜘蛛池模板: 蜜桃视频在线观看免费网址入口| 久久精品成人欧美大片| 亚洲成av人综合在线观看| 少妇人妻偷人精品一区二区| 国模丽丽啪啪一区二区| 青青草国产精品免费观看| 精品国产香蕉伊思人在线| 国产成人亚洲综合色影视| 特级a欧美做爰片第一次| 精品国内自产拍在线观看视频| 曰韩少妇内射免费播放| 污污污污污污污网站污| 天堂…中文在线最新版在线| 国产国产乱老熟女视频网站97| 亚洲乱码卡一卡二卡新区中国| 日本阿v免费观看视频| 免费观看又色又爽又湿的软件| 欧洲精品一卡2卡三卡4卡影视| 超清无码一区二区三区| 久久夜色撩人精品国产小说| 国产成人av综合亚洲色欲| 久久综合色老色| 老熟女一区二区免费| 国产精品欧美久久久久久日本一道| 国产精品 中文字幕 亚洲 欧美| 无码三级中文字幕在线观看| 成人欧美一区二区三区视频| www夜片内射视频在观看视频| 亚洲欧美日韩久久精品第一区| 国产亚洲日本精品无码| 东北老女人高潮大叫对白| 国产精品视频二区不卡| 天天天天躁天天爱天天碰2018| 亚洲综合另类小说色区大陆| 国产成人一区二区无码不卡在线| 亚洲大色堂人在线视频| 成在人线av无码免观看| 少妇av射精精品蜜桃专区| 伊人久久大香线蕉无码不卡| 四虎国产精品永久在线国在线| 老司机午夜福利试看体验区|