[LeEco Le 2 Questions & Answers] rczrider:
META-INF/com/google/android/updater-script ?

get_device_compatible("le_s2_na") == "OK" || abort("This package is for \"le_s2_na\" devices; this is a \"" + getprop("ro.product.device") + "\".");
ui_print("Start to check root...");
ifelse(root_check() == "root", abort("The phone has root!
"), ui_print("The phone is OK, start to OTA update.
"));
ui_print("Source: LeEco/Le2_NA/le_s2_na:6.0.1/IFXNAOP5801810091S/39:user/release-keys");
ui_print("Target: LeEco/Le2_NA/le_s2_na:6.0.1/IFXNAOP5801910272S/61:user/release-keys");
ui_print("Verifying current system...");
getprop("ro.build.fingerprint") == "LeEco/Le2_NA/le_s2_na:6.0.1/IFXNAOP5801810091S/39:user/release-keys" ||
getprop("ro.build.fingerprint") == "LeEco/Le2_NA/le_s2_na:6.0.1/IFXNAOP5801910272S/61:user/release-keys" ||
abort("Package expects build fingerprint of LeEco/Le2_NA/le_s2_na:6.0.1/IFXNAOP5801810091S/39:user/release-keys or LeEco/Le2_NA/le_s2_na:6.0.1/IFXNAOP5801910272S/61:user/release-keys; this device has " + getprop("ro.build.fingerprint") + ".");
apply_patch_check("EMMC:/dev/block/bootdevice/by-name/boot:11091240:76343e8329de11d0279fc48e2e1cc2ea3a70e391:11091240:22302e5527893ac327ff04fa478d19532c1d1c05") || abort("\"EMMC:/dev/block/bootdevice/by-name/boot:11091240:76343e8329de11d0279fc48e2e1cc2ea3a70e391:11091240:22302e5527893ac327ff04fa478d19532c1d1c05\" has unexpected contents.");

# ---- radio update verification ----

ui_print("Verifying radio-update...");
apply_patch_check("EMMC:/dev/block/bootdevice/by-name/modem:79092224:580467b7ef83c3f71ad6991e3624b77a1379c8fa:79092224:55c73357a7923ba6ce7099c2c3a4bccdba049ed6") || abort("\"EMMC:/dev/block/bootdevice/by-name/modem:79092224:580467b7ef83c3f71ad6991e3624b77a1379c8fa:79092224:55c73357a7923ba6ce7099c2c3a4bccdba049ed6\" has unexpected contents.");
apply_patch_space(79092224) || abort("Not enough free space on /system to apply patches.");
if (range_sha1("/dev/block/bootdevice/by-name/system", "134,1,32770,33025,33027,33535,65535,65536,65538,66046,98303,98304,98306,98561,98563,99071,131071,131072,131074,131582,163839,163840,163842,164097,164099,164607,196607,196608,196610,197118,229375,229376,229378,229633,229635,230143,262143,262144,262146,262654,294911,294912,294914,295169,295171,295679,327679,327680,327682,328190,360447,360448,360450,360958,393215,393216,393218,393726,425983,425984,425986,426494,458751,458752,458754,459262,491519,491520,491522,492030,524287,524288,524290,524798,557055,557056,557058,557566,589823,589824,589826,590334,622591,622592,622594,623102,655359,655360,655362,655870,688127,688128,688130,688638,720895,720896,720898,721406,753663,753664,753666,754174,786431,786432,786434,786942,819199,819200,819202,819457,819459,819967,851967,851968,851970,852478,878904,884736,884738,884993,884995,885503,917503,917504,917506,950272,950274,983040,983042,1015808,1015810,1016318,1040310,1040311,1048512") == "165a725a008e94b0fde64d19bd4ead3d310134d1" || block_image_verify("/dev/block/bootdevice/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat")) then
ui_print("Verified system image...");
else
abort("system partition has unexpected contents");
endif;

# ---- start making changes here ----

ui_print("Patching system image after verification.");
show_progress(0.900000, 0);
block_image_update("/dev/block/bootdevice/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat");
ui_print("Verifying the updated system image...");
if range_sha1("/dev/block/bootdevice/by-name/system", "136,0,32770,33025,33027,33535,65535,65536,65538,66046,98303,98304,98306,98561,98563,99071,131071,131072,131074,131582,163839,163840,163842,164097,164099,164607,196607,196608,196610,197118,229375,229376,229378,229633,229635,230143,262143,262144,262146,262654,294911,294912,294914,295169,295171,295679,327679,327680,327682,328190,360447,360448,360450,360958,393215,393216,393218,393726,425983,425984,425986,426494,458751,458752,458754,459262,491519,491520,491522,492030,524287,524288,524290,524798,557055,557056,557058,557566,589823,589824,589826,590334,622591,622592,622594,623102,655359,655360,655362,655870,688127,688128,688130,688638,720895,720896,720898,721406,753663,753664,753666,754174,786431,786432,786434,786942,819199,819200,819202,819457,819459,819967,851967,851968,851970,852478,882859,884736,884738,884993,884995,885503,917503,917504,917506,918014,923428,950272,950274,983040,983042,1015808,1015810,1016318,1040310,1040311,1048512") == "127f8d73efdc54efcd9ed606b81300f0c4a5c6a0" then
if range_sha1("/dev/block/bootdevice/by-name/system", "142,32770,33025,33027,33535,65535,65536,65538,66046,98303,98304,98306,98561,98563,99071,131071,131072,131074,131582,163839,163840,163842,164097,164099,164607,196607,196608,196610,197118,229375,229376,229378,229633,229635,230143,262143,262144,262146,262654,294911,294912,294914,295169,295171,295679,327679,327680,327682,328190,360447,360448,360450,360958,393215,393216,393218,393726,425983,425984,425986,426494,458751,458752,458754,459262,491519,491520,491522,492030,524287,524288,524290,524798,557055,557056,557058,557566,589823,589824,589826,590334,622591,622592,622594,623102,655359,655360,655362,655870,688127,688128,688130,688638,720895,720896,720898,721406,753663,753664,753666,754174,786431,786432,786434,786942,819199,819200,819202,819457,819459,819967,851967,851968,851970,852478,882859,883371,884224,884736,884738,884993,884995,885503,917503,917504,917506,918014,923428,923940,949760,950272,950274,950786,982528,983040,983042,983554,1015296,1015808,1015810,1016318,1040310,1040311") == "9192c3ab8d6affd1d695787c2ec307d8f235a74c" then
ui_print("Verified the updated system image.");
else
abort("system partition has unexpected non-zero contents after OTA update");
endif;
else
abort("system partition has unexpected contents after OTA update");
endif;
ui_print("Patching boot image...");
show_progress(0.100000, 10);
apply_patch("EMMC:/dev/block/bootdevice/by-name/boot:11091240:76343e8329de11d0279fc48e2e1cc2ea3a70e391:11091240:22302e5527893ac327ff04fa478d19532c1d1c05",
"-", 22302e5527893ac327ff04fa478d19532c1d1c05, 11091240,
76343e8329de11d0279fc48e2e1cc2ea3a70e391, package_extract_file("patch/boot.img.p"));

# ---- radio update tasks ----

ui_print("Patching firmware images...");
ifelse(msm.boot_update("main"), (
package_extract_file("patch/firmware-update/rpm.mbn", "/dev/block/bootdevice/by-name/rpm");
package_extract_file("patch/firmware-update/emmc_appsboot.mbn", "/dev/block/bootdevice/by-name/aboot");
package_extract_file("patch/firmware-update/tz.mbn", "/dev/block/bootdevice/by-name/tz");
package_extract_file("patch/firmware-update/cmnlib.mbn", "/dev/block/bootdevice/by-name/cmnlib");
package_extract_file("patch/firmware-update/keymaster.mbn", "/dev/block/bootdevice/by-name/keymaster");
package_extract_file("patch/firmware-update/hyp.mbn", "/dev/block/bootdevice/by-name/hyp");
package_extract_file("patch/firmware-update/sbl1.mbn", "/dev/block/bootdevice/by-name/sbl1");
), "");
ifelse(msm.boot_update("backup"), (
package_extract_file("patch/firmware-update/rpm.mbn", "/dev/block/bootdevice/by-name/rpmbak");
package_extract_file("patch/firmware-update/emmc_appsboot.mbn", "/dev/block/bootdevice/by-name/abootbak");
package_extract_file("patch/firmware-update/tz.mbn", "/dev/block/bootdevice/by-name/tzbak");
package_extract_file("patch/firmware-update/cmnlib.mbn", "/dev/block/bootdevice/by-name/cmnlibbak");
package_extract_file("patch/firmware-update/keymaster.mbn", "/dev/block/bootdevice/by-name/keymasterbak");
package_extract_file("patch/firmware-update/hyp.mbn", "/dev/block/bootdevice/by-name/hypbak");
package_extract_file("patch/firmware-update/sbl1.mbn", "/dev/block/bootdevice/by-name/sbl1bak");
), "");
msm.boot_update("finalize");
package_extract_file("patch/firmware-update/devinfo.bin", "/dev/block/bootdevice/by-name/devinfo");
package_extract_file("patch/firmware-update/adspso.bin", "/dev/block/bootdevice/by-name/dsp");
apply_patch("EMMC:/dev/block/bootdevice/by-name/modem:79092224:580467b7ef83c3f71ad6991e3624b77a1379c8fa:79092224:55c73357a7923ba6ce7099c2c3a4bccdba049ed6",
"-", 55c73357a7923ba6ce7099c2c3a4bccdba049ed6, 79092224,
580467b7ef83c3f71ad6991e3624b77a1379c8fa, package_extract_file("patch/firmware-update/NON-HLOS.bin.p"));
package_extract_file("patch/firmware-update/misc.img", "/dev/block/bootdevice/by-name/misc");
package_extract_file("patch/firmware-update/splash.img", "/dev/block/bootdevice/by-name/splash");
package_extract_file("patch/firmware-update/oemconfig.img", "/dev/block/bootdevice/by-name/OEMCONFIG");
package_extract_file("patch/firmware-update/ddr.bin", "/dev/block/bootdevice/by-name/DDR");
set_progress(1.000000);