Skip to content

Instantly share code, notes, and snippets.

@first087
Created November 14, 2014 08:50
Show Gist options
  • Save first087/d25ac3f443c5acab8d19 to your computer and use it in GitHub Desktop.
Save first087/d25ac3f443c5acab8d19 to your computer and use it in GitHub Desktop.
updater-script from update package file of Nexus 9 LRX21L to LRX21Q
getprop("ro.product.device") == "flounder" || abort("This package is for \"flounder\" devices; this is a \"" + getprop("ro.product.device") + "\".");
ui_print("Verifying current system...");
getprop("ro.build.fingerprint") == "google/volantis/flounder:5.0/LRX21L/1546449:user/release-keys" ||
getprop("ro.build.fingerprint") == "google/volantis/flounder:5.0/LRX21Q/1573789:user/release-keys" ||
abort("Package expects build fingerprint of google/volantis/flounder:5.0/LRX21L/1546449:user/release-keys or google/volantis/flounder:5.0/LRX21Q/1573789:user/release-keys; this device has " + getprop("ro.build.fingerprint") + ".");
apply_patch_check("EMMC:/dev/block/platform/sdhci-tegra.3/by-name/LNX:8020736:cb05bb08e37fa54271cc3f7986fa0f716f610499:8000256:3172d86057339cb034c308640c1d7f838fbbe0a7") || abort("\"EMMC:/dev/block/platform/sdhci-tegra.3/by-name/LNX:8020736:cb05bb08e37fa54271cc3f7986fa0f716f610499:8000256:3172d86057339cb034c308640c1d7f838fbbe0a7\" has unexpected contents.");
# ---- start making changes here ----
(range_sha1("/dev/block/platform/sdhci-tegra.3/by-name/APP", "2,0,1") == "4f751629b480fdfdc69ecb555ee3ba4ef0b8e276") || abort("/dev/block/platform/sdhci-tegra.3/by-name/APP has been remounted R/W; reflash device to reenable OTA updates");
if range_sha1("/dev/block/platform/sdhci-tegra.3/by-name/APP", "80,0,32770,32937,32939,33441,65535,65536,65538,66040,98303,98304,98306,98473,98475,98977,131071,131072,131074,131576,163839,163840,163842,164009,164011,164513,196607,196608,196610,197112,229375,229376,229378,229545,229547,230049,262143,262144,262146,262648,294911,294912,294914,295081,295083,295585,327679,327680,327682,328184,360447,360448,360450,360952,393215,393216,393218,393720,423651,425984,425986,426488,429091,458752,458754,491520,491522,524288,524290,557056,557058,589824,589826,622592,622594,655360,655362,655864,674064,674065,679383") == "4d860daabf2c8fe745a1b11c8625e7fcbe711000" then
ui_print("Patching system image...");
show_progress(0.800000, 0);
block_image_update("/dev/block/platform/sdhci-tegra.3/by-name/APP", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat");
else
(range_sha1("/dev/block/platform/sdhci-tegra.3/by-name/APP", "80,0,32770,32937,32939,33441,65535,65536,65538,66040,98303,98304,98306,98473,98475,98977,131071,131072,131074,131576,163839,163840,163842,164009,164011,164513,196607,196608,196610,197112,229375,229376,229378,229545,229547,230049,262143,262144,262146,262648,294911,294912,294914,295081,295083,295585,327679,327680,327682,328184,360447,360448,360450,360952,393215,393216,393218,393720,423595,425984,425986,426488,429091,458752,458754,491520,491522,524288,524290,557056,557058,589824,589826,622592,622594,655360,655362,655864,674064,674065,679383") == "def455b306dc9a14819da876cf94d0da6f7c8acf") ||
abort("system partition has unexpected contents");
endif;
(range_sha1("/dev/block/platform/sdhci-tegra.3/by-name/VNR", "2,0,1") == "e23b87d31e004b39a04620948d8a6aa70079e880") || abort("/dev/block/platform/sdhci-tegra.3/by-name/VNR has been remounted R/W; reflash device to reenable OTA updates");
if range_sha1("/dev/block/platform/sdhci-tegra.3/by-name/VNR", "10,0,8039,32768,32770,32785,32787,33295,65008,65011,65532") == "798a7710c063d1bccdb3899629b7ef4134adf0bb" then
ui_print("Patching vendor image...");
show_progress(0.100000, 0);
block_image_update("/dev/block/platform/sdhci-tegra.3/by-name/VNR", package_extract_file("vendor.transfer.list"), "vendor.new.dat", "vendor.patch.dat");
else
(range_sha1("/dev/block/platform/sdhci-tegra.3/by-name/VNR", "10,0,8039,32768,32770,32785,32787,33295,65008,65011,65532") == "49403bfe2b20539e8b893ea8927c5a8e8a6f84f9") ||
abort("vendor partition has unexpected contents");
endif;
ui_print("Patching boot image...");
show_progress(0.100000, 10);
apply_patch("EMMC:/dev/block/platform/sdhci-tegra.3/by-name/LNX:8020736:cb05bb08e37fa54271cc3f7986fa0f716f610499:8000256:3172d86057339cb034c308640c1d7f838fbbe0a7",
"-", 3172d86057339cb034c308640c1d7f838fbbe0a7, 8000256,
cb05bb08e37fa54271cc3f7986fa0f716f610499, package_extract_file("patch/boot.img.p"));
set_progress(1.000000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment