updater-script,

本文介绍了使用`./build.sh -j4 gecko-update-fota-full`和`./build.sh -j4 gecko-update-fota-fullimg`两个脚本进行系统更新的详细过程,涵盖了它们在FOTA升级中的应用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

./build.sh -j4  gecko-update-fota-full的脚本:

 

 updater-script 
ui_print("Starting B2G FOTA: full");
show_progress(1.0, 0);
set_progress(0.25);
ui_print("Checking device");
assert(getprop("ro.build.product") == "mako" || getprop("ro.product.device") == "mako" || getprop("ro.product.model") == "mako");
ui_print("Device is compatible");
ui_print("Mounting /system");
ifelse(is_mounted("/system"),ui_print("Already mounted."),assert(mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system")));
set_progress(0.5);
ui_print("Remove stale libdmd.so");
delete("/system/b2g/libdmd.so");
ui_print("Remove stale update");
delete_recursive("/system/b2g/updated");
ui_print("Extracting files to /system");
package_extract_dir("system", "/system");
set_progress(0.75);
ui_print("Creating symlinks");
symlink("/data/misc/audio/mbhc.bin", "/system/etc/firmware/wcd9310/wcd9310_mbhc.bin");
symlink("/data/misc/audio/wcd9310_anc.bin", "/system/etc/firmware/wcd9310/wcd9310_anc.bin");
symlink("/data/misc/wifi/WCNSS_qcom_cfg.ini", "/system/vendor/firmware/wlan/prima/WCNSS_qcom_cfg.ini");
symlink("/data/misc/wifi/WCNSS_qcom_wlan_nv.bin", "/system/vendor/firmware/wlan/prima/WCNSS_qcom_wlan_nv.bin");
symlink("Roboto-Bold.ttf", "/system/fonts/DroidSans-Bold.ttf");
symlink("Roboto-Regular.ttf", "/system/fonts/DroidSans.ttf");
symlink("libGLESv2.so", "/system/lib/libGLESv3.so");
symlink("mksh", "/system/bin/sh");
symlink("toolbox", "/system/bin/cat", "/system/bin/chcon",
        "/system/bin/chmod", "/system/bin/chown", "/system/bin/clear",
        "/system/bin/cmp", "/system/bin/cp", "/system/bin/date",
        "/system/bin/dd", "/system/bin/df", "/system/bin/dmesg",
        "/system/bin/du", "/system/bin/getenforce", "/system/bin/getevent",
        "/system/bin/getprop", "/system/bin/getsebool", "/system/bin/grep",
        "/system/bin/hd", "/system/bin/id", "/system/bin/ifconfig",
        "/system/bin/iftop", "/system/bin/insmod", "/system/bin/ioctl",
        "/system/bin/ionice", "/system/bin/kill", "/system/bin/ln",
        "/system/bin/load_policy", "/system/bin/log", "/system/bin/ls",
        "/system/bin/lsmod", "/system/bin/lsof", "/system/bin/md5",
        "/system/bin/mkdir", "/system/bin/mkswap", "/system/bin/mount",
        "/system/bin/mv", "/system/bin/nandread", "/system/bin/netstat",
        "/system/bin/newfs_msdos", "/system/bin/notify", "/system/bin/printenv",
        "/system/bin/ps", "/system/bin/r", "/system/bin/readlink",
        "/system/bin/renice", "/system/bin/restorecon", "/system/bin/rm",
        "/system/bin/rmdir", "/system/bin/rmmod", "/system/bin/route",
        "/system/bin/runcon", "/system/bin/schedtop", "/system/bin/sendevent",
        "/system/bin/setconsole", "/system/bin/setenforce",
        "/system/bin/setprop", "/system/bin/setsebool", "/system/bin/sleep",
        "/system/bin/smd", "/system/bin/start", "/system/bin/stop",
        "/system/bin/swapoff", "/system/bin/swapon", "/system/bin/sync",
        "/system/bin/top", "/system/bin/touch", "/system/bin/umount",
        "/system/bin/uptime", "/system/bin/vmstat", "/system/bin/watchprops",
        "/system/bin/wipe");
ui_print("Setting file permissions");
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm(0, 0, 0755, "/system/b2g/b2g");
set_perm(0, 0, 0755, "/system/b2g/plugin-container");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm(0, 3003, 02750, "/system/bin/netcfg");
set_perm(0, 2000, 0750, "/system/bin/run-as");
set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
set_perm(0, 2000, 0755, "/system/vendor");
set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor/etc");
set_perm(0, 0, 0644, "/system/vendor/etc/audio_effects.conf");
set_perm(0, 2000, 0755, "/system/vendor/firmware");
set_perm(0, 2000, 0755, "/system/vendor/firmware/keymaster");
set_perm(0, 2000, 0755, "/system/vendor/firmware/wlan");
set_perm(0, 2000, 0755, "/system/vendor/firmware/wlan/prima");
set_perm(0, 2000, 0755, "/system/vendor/lib");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
set_perm(0, 0, 06755, "/system/xbin/librank");
set_perm(0, 0, 06755, "/system/xbin/procmem");
set_perm(0, 0, 06755, "/system/xbin/procrank");
set_perm(0, 0, 06755, "/system/xbin/su");
set_perm(0, 0, 06755, "/system/xbin/tcpdump");
set_progress(0.8);
ui_print("Cleaning update files");
ui_print("Mounting /data");
ifelse(is_mounted("/data"),ui_print("Already mounted."),assert(mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/userdata", "/data")));
ui_print("Cleaning FOTA files");
delete_recursive("/data/local/b2g-updates",
                 "/data/media/0/updates/fota");
ui_print("FOTA files removed");
set_progress(0.9);
ui_print("Unmounting ...");
unmount("/data");
unmount("/system");
set_progress(1.0);

 

 

 

./build.sh -j4  gecko-update-fota-fullimg的脚本:

~/project/nexus4/B2G/out/target/product/mako/fota/fullimg/META-INF/com/google/android$ cat updater-script 
ui_print("Starting B2G FOTA: fullimg");
show_progress(1.0, 0);
set_progress(0.25);
ui_print("Checking device");
assert(getprop("ro.build.product") == "mako" || getprop("ro.product.device") == "mako" || getprop("ro.product.model") == "mako");
ui_print("Device is compatible");
ui_print("Flashing partition /boot");
package_extract_file("boot.img", "/dev/block/platform/msm_sdcc.1/by-name/boot");
ui_print("Flashing partition /data");
package_extract_file("userdata.img", "/dev/block/platform/msm_sdcc.1/by-name/userdata");
ui_print("Flashing partition /system");
package_extract_file("system.img", "/dev/block/platform/msm_sdcc.1/by-name/system");
set_progress(1.0);

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值