Created
September 6, 2022 21:24
-
-
Save xzeldon/66d6042f26c3f88f4d23437ee99cc98b to your computer and use it in GitHub Desktop.
Oneplus 8T/9R Fastboot rom installer script for linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Copyright 2012 The Android Open Source Projecti | |
# Copyright 2022 xzeldon <contact@zeldon.ru> | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
if ! [ $($(which fastboot) --version | grep "version" | cut -c18-23 | sed 's/\.//g' ) -ge 2802 ]; then | |
echo "fastboot too old; please download the latest version at https://developer.android.com/studio/releases/platform-tools.html" | |
exit 1 | |
fi | |
fastboot --set-active=a | |
sleep 3 | |
echo "> flashing boot/dtbo/recovery" | |
fastboot flash boot boot.img | |
fastboot flash dtbo dtbo.img | |
fastboot flash recovery recovery.img | |
echo "> rebooting to fastbootd" | |
fastboot reboot fastboot | |
echo "> resizing logical partitions" | |
fastboot delete-logical-partition odm_a | |
fastboot delete-logical-partition odm_b | |
fastboot delete-logical-partition system_a | |
fastboot delete-logical-partition system_b | |
fastboot delete-logical-partition system_ext_a | |
fastboot delete-logical-partition system_ext_b | |
fastboot delete-logical-partition product_a | |
fastboot delete-logical-partition product_b | |
fastboot delete-logical-partition vendor_a | |
fastboot delete-logical-partition vendor_b | |
fastboot delete-logical-partition my_carrier_a | |
fastboot delete-logical-partition my_carrier_b | |
fastboot delete-logical-partition my_company_a | |
fastboot delete-logical-partition my_company_b | |
fastboot delete-logical-partition my_engineering_a | |
fastboot delete-logical-partition my_engineering_b | |
fastboot delete-logical-partition my_heytap_a | |
fastboot delete-logical-partition my_heytap_b | |
fastboot delete-logical-partition my_manifest_a | |
fastboot delete-logical-partition my_manifest_b | |
fastboot delete-logical-partition my_preload_a | |
fastboot delete-logical-partition my_preload_b | |
fastboot delete-logical-partition my_product_a | |
fastboot delete-logical-partition my_product_b | |
fastboot delete-logical-partition my_region_a | |
fastboot delete-logical-partition my_region_b | |
fastboot delete-logical-partition my_stock_a | |
fastboot delete-logical-partition my_stock_b | |
fastboot delete-logical-partition my_bigball_a | |
fastboot delete-logical-partition my_bigball_b | |
fastboot delete-logical-partition odm_a-cow | |
fastboot delete-logical-partition odm_b-cow | |
fastboot delete-logical-partition system_a-cow | |
fastboot delete-logical-partition system_b-cow | |
fastboot delete-logical-partition system_ext_a-cow | |
fastboot delete-logical-partition system_ext_b-cow | |
fastboot delete-logical-partition product_a-cow | |
fastboot delete-logical-partition product_b-cow | |
fastboot delete-logical-partition vendor_a-cow | |
fastboot delete-logical-partition vendor_b-cow | |
fastboot delete-logical-partition my_carrier_a-cow | |
fastboot delete-logical-partition my_carrier_b-cow | |
fastboot delete-logical-partition my_company_a-cow | |
fastboot delete-logical-partition my_company_b-cow | |
fastboot delete-logical-partition my_engineering_a-cow | |
fastboot delete-logical-partition my_engineering_b-cow | |
fastboot delete-logical-partition my_heytap_a-cow | |
fastboot delete-logical-partition my_heytap_b-cow | |
fastboot delete-logical-partition my_manifest_a-cow | |
fastboot delete-logical-partition my_manifest_b-cow | |
fastboot delete-logical-partition my_preload_a-cow | |
fastboot delete-logical-partition my_preload_b-cow | |
fastboot delete-logical-partition my_product_a-cow | |
fastboot delete-logical-partition my_product_b-cow | |
fastboot delete-logical-partition my_region_a-cow | |
fastboot delete-logical-partition my_region_b-cow | |
fastboot delete-logical-partition my_stock_a-cow | |
fastboot delete-logical-partition my_stock_b-cow | |
fastboot delete-logical-partition my_bigball_a-cow | |
fastboot delete-logical-partition my_bigball_b-cow | |
fastboot create-logical-partition vendor_a 1 | |
fastboot create-logical-partition vendor_b 1 | |
fastboot create-logical-partition product_a 1 | |
fastboot create-logical-partition product_b 1 | |
fastboot create-logical-partition system_a 1 | |
fastboot create-logical-partition system_b 1 | |
fastboot create-logical-partition system_ext_a 1 | |
fastboot create-logical-partition system_ext_b 1 | |
fastboot create-logical-partition odm_a 1 | |
fastboot create-logical-partition odm_b 1 | |
echo "> flashing logical partitions" | |
fastboot flash vendor vendor.img | |
fastboot flash product product.img | |
fastboot flash system_ext system_ext.img | |
fastboot flash system system.img | |
fastboot flash odm odm.img | |
echo "> flashing vbmeta/vbmeta_system" | |
fastboot flash --disable-verity --disable-verification vbmeta vbmeta.img | |
fastboot flash --disable-verity --disable-verification vbmeta_system vbmeta_system.img | |
echo "> rebooting into recovery (WIPE ALL DATA IF YOU COMING FROM OTHER ROMS)" | |
fastboot reboot recovery |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment