[Android One (Second-Generation) General] EthanFirst:
updater-script

if getprop("ro.build.version.release") == "5.1.1" then
# L
mount("ext4", "EMMC", "/dev/block/platform/7824900.sdhci/by-name/oem", "/oem", "max_batch_time=0,commit=1,data=ordered,barrier=1,errors=panic,nodelalloc");
(!less_than_int(1469150918, getprop("ro.build.date.utc"))) || abort("E3003: Can't install this package (Fri Jul 22 01:28:38 UTC 2016) over newer build (" + getprop("ro.build.date") + ").");
file_getprop("/oem/oem.prop", "ro.product.device") == "imobileiq2_sprout" || abort("E3000: This package expects the value \"imobileiq2_sprout\" for \"ro.product.device\" on the OEM partition; this has value \"" + file_getprop("/oem/oem.prop", "ro.product.device") + "\".");
file_getprop("/oem/oem.prop", "ro.product.name") == "imobileiq2" || abort("E3000: This package expects the value \"imobileiq2\" for \"ro.product.name\" on the OEM partition; this has value \"" + file_getprop("/oem/oem.prop", "ro.product.name") + "\".");
ui_print("Target: google/imobileiq2/imobileiq2_sprout:7.0/NRD90M/3085278:user/release-keys");
show_progress(0.750000, 0);
ui_print("Patching system image unconditionally...");
block_image_update("/dev/block/platform/7824900.sdhci/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat") ||
abort("E1001: Failed to update system image.");
show_progress(0.050000, 5);
package_extract_file("boot.img", "/dev/block/platform/7824900.sdhci/by-name/boot");
show_progress(0.200000, 10);
ui_print("Writing bootloader...");
package_extract_file("bootloader-flag.txt", "/dev/block/platform/7824900.sdhci/by-name/misc");
package_extract_file("bootloader.sbl1.img", "/dev/block/platform/7824900.sdhci/by-name/sbl1");
package_extract_file("bootloader.rpm.img", "/dev/block/platform/7824900.sdhci/by-name/rpm");
package_extract_file("bootloader.tz.img", "/dev/block/platform/7824900.sdhci/by-name/tz");
package_extract_file("bootloader.hyp.img", "/dev/block/platform/7824900.sdhci/by-name/hyp");
package_extract_file("bootloader.aboot.img", "/dev/block/platform/7824900.sdhci/by-name/aboot");
package_extract_file("bootloader-flag-clear.txt", "/dev/block/platform/7824900.sdhci/by-name/misc");
ui_print("Writing radio...");
package_extract_file("radio.modem.img", "/dev/block/platform/7824900.sdhci/by-name/modem");
ui_print("Updating devinfo version");
update_devinfo();
unmount("/oem");
set_progress(1.000000);

else
# M / N
mount("ext4", "EMMC", "/dev/block/platform/soc.0/7824900.sdhci/by-name/oem", "/oem", "max_batch_time=0,commit=1,data=ordered,barrier=1,errors=panic,nodelalloc");
(!less_than_int(1469150918, getprop("ro.build.date.utc"))) || abort("E3003: Can't install this package (Fri Jul 22 01:28:38 UTC 2016) over newer build (" + getprop("ro.build.date") + ").");
file_getprop("/oem/oem.prop", "ro.product.device") == "imobileiq2_sprout" || abort("E3000: This package expects the value \"imobileiq2_sprout\" for \"ro.product.device\" on the OEM partition; this has value \"" + file_getprop("/oem/oem.prop", "ro.product.device") + "\".");
file_getprop("/oem/oem.prop", "ro.product.name") == "imobileiq2" || abort("E3000: This package expects the value \"imobileiq2\" for \"ro.product.name\" on the OEM partition; this has value \"" + file_getprop("/oem/oem.prop", "ro.product.name") + "\".");
ui_print("Target: google/imobileiq2/imobileiq2_sprout:7.0/NRD90M/3085278:user/release-keys");
show_progress(0.750000, 0);
ui_print("Patching system image unconditionally...");
block_image_update("/dev/block/platform/soc.0/7824900.sdhci/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat") ||
abort("E1001: Failed to update system image.");
show_progress(0.050000, 5);
package_extract_file("boot.img", "/dev/block/platform/soc.0/7824900.sdhci/by-name/boot");
show_progress(0.200000, 10);
ui_print("Writing bootloader...");
package_extract_file("bootloader-flag.txt", "/dev/block/platform/soc.0/7824900.sdhci/by-name/misc");
package_extract_file("bootloader.sbl1.img", "/dev/block/platform/soc.0/7824900.sdhci/by-name/sbl1");
package_extract_file("bootloader.rpm.img", "/dev/block/platform/soc.0/7824900.sdhci/by-name/rpm");
package_extract_file("bootloader.tz.img", "/dev/block/platform/soc.0/7824900.sdhci/by-name/tz");
package_extract_file("bootloader.hyp.img", "/dev/block/platform/soc.0/7824900.sdhci/by-name/hyp");
package_extract_file("bootloader.aboot.img", "/dev/block/platform/soc.0/7824900.sdhci/by-name/aboot");
package_extract_file("bootloader-flag-clear.txt", "/dev/block/platform/soc.0/7824900.sdhci/by-name/misc");
ui_print("Writing radio...");
package_extract_file("radio.modem.img", "/dev/block/platform/soc.0/7824900.sdhci/by-name/modem");
ui_print("Updating devinfo version");
update_devinfo();
unmount("/oem");
set_progress(1.000000);

endif;