diff options
| author | Dmitry Muhomor <muhomor.dmitry@gmail.com> | 2024-07-26 22:29:58 +0300 |
|---|---|---|
| committer | Daniel Micay <daniel.micay@grapheneos.org> | 2024-07-29 23:43:31 -0400 |
| commit | 09011f7b71b6093fdd078de96e6458dc472ab072 (patch) | |
| tree | 36025705d93558378954ff862193b079d5a8c972 /static/js/web-install.js | |
| parent | 3b129fdbed9b768e9ee8fcc583819f35beb82216 (diff) | |
web-install: use optimized factory image on devices that have it
Diffstat (limited to 'static/js/web-install.js')
| -rw-r--r-- | static/js/web-install.js | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/static/js/web-install.js b/static/js/web-install.js index 736128ff..4a5128d3 100644 --- a/static/js/web-install.js +++ b/static/js/web-install.js @@ -190,14 +190,14 @@ async function unlockBootloader(setProgress) { const supportedDevices = ["akita", "husky", "shiba", "felix", "tangorpro", "lynx", "cheetah", "panther", "bluejay", "raven", "oriole", "barbet", "redfin", "bramble", "sunfish", "coral", "flame"]; -const qualcommDevices = ["barbet", "redfin", "bramble", "sunfish", "coral", "flame"]; - const legacyQualcommDevices = ["sunfish", "coral", "flame"]; -const tensorDevices = ["akita", "husky", "shiba", "felix", "tangorpro", "lynx", "cheetah", "panther", "bluejay", "raven", "oriole"]; - const day1SnapshotCancelDevices = ["akita", "husky", "shiba", "felix", "tangorpro", "lynx", "cheetah", "panther", "bluejay", "raven", "oriole", "barbet", "redfin", "bramble"]; +function hasOptimizedFactoryImage(product) { + return !legacyQualcommDevices.includes(product); +} + async function getLatestRelease() { let product = await device.getVariable("product"); if (!supportedDevices.includes(product)) { @@ -208,7 +208,7 @@ async function getLatestRelease() { let metadata = await metadataResp.text(); let releaseId = metadata.split(" ")[0]; - return [`${product}-factory-${releaseId}.zip`, product]; + return [`${product}-factory-${releaseId}${hasOptimizedFactoryImage(product) ? "-opt" : ""}.zip`, product]; } async function downloadRelease(setProgress) { @@ -282,28 +282,19 @@ async function flashRelease(setProgress) { setProgress(`${userAction} ${userItem}...`, progress); } ); - setProgress("Disabling UART..."); - // See https://android.googlesource.com/platform/system/core/+/eclair-release/fastboot/fastboot.c#532 - // for context as to why the trailing space is needed. - await device.runCommand("oem uart disable "); - if (qualcommDevices.includes(product)) { + if (legacyQualcommDevices.includes(product)) { + setProgress("Disabling UART..."); + // See https://android.googlesource.com/platform/system/core/+/eclair-release/fastboot/fastboot.c#532 + // for context as to why the trailing space is needed. + await device.runCommand("oem uart disable "); setProgress("Erasing apdp..."); // Both slots are wiped as even apdp on an inactive slot will modify /proc/cmdline await device.runCommand("erase:apdp_a"); await device.runCommand("erase:apdp_b"); - } - if (legacyQualcommDevices.includes(product)) { setProgress("Erasing msadp..."); await device.runCommand("erase:msadp_a"); await device.runCommand("erase:msadp_b"); } - if (tensorDevices.includes(product)) { - setProgress("Disabling FIPS..."); - await device.runCommand("erase:fips"); - setProgress("Erasing DPM..."); - await device.runCommand("erase:dpm_a"); - await device.runCommand("erase:dpm_b"); - } } finally { setInstallerState({ state: InstallerState.INSTALLING_RELEASE, active: false }); } |
