[GUIDE] Unbrick or restore to OOS using only fastboot

Search This thread

coomac

Senior Member
Apr 9, 2011
101
50
OnePlus 6
Xiaomi Mi 10 Lite
When I today had to restore my device to OOS I first tried it with this method but at the step where the phone rebooted to fastbootd the command was just saying "waiting for device" and nothing more happened.
On the phone I could see that it had rebooted into fastbootd mode but the Computer was just saying "waiting for device".
I could not figure out why that is not working.
Are you using windows? I assume you already have the latest platform tools from Google and the OnePlus USB drivers installed. Sometimes you have to disable driver signature verification for the drivers to install correctly. See if this post helps.
 
  • Like
Reactions: Wishmasterflo

Wishmasterflo

Senior Member
Nov 21, 2018
1,232
728
Stockholm
OnePlus 8T
Are you using windows? I assume you already have the latest platform tools from Google and the OnePlus USB drivers installed. Sometimes you have to disable driver signature verification for the drivers to install correctly. See if this post helps.
Thanks. Yes I use Windows 11. I have the latest platform tools and the Oneplus USB drivers installed and I had to disable driver signsture verification for that. Otherwise they will not install correctly.

I will check again.
 
  • Like
Reactions: coomac

Anvil101

New member
Feb 26, 2022
2
0
My question is... is it required to flash ALL these .img files? My phone is stuck in a boot loop and it would seem to make sense that I should be able to just flash boot.img to fix that. Does that make sense, or am I off the mark?
 

therealtaurus

New member
Mar 20, 2022
2
1
Hello everyone,

First of all, thank coomac for the detailed tutorial and the rest of the people who have contributed to this thread.

After following the steps above, I got a warning in the process of wiping the super partition. Just when executing the following commands (indicated below this paragraph), the message "Invalid sparse file format at header magic" appeared and then it proceeded with its execution, apparently finishing everything without problems. I would like to know if it is the expected behavior or if on the contrary I could have made a mistake.

fastboot flash odm odm.img
fastboot flash system system.img
fastboot flash system_ext system_ext.img
fastboot flash product product.img
fastboot flash vendor vendor.img

I hadn't thought much of it at first, but after two failed installation attempts of LineageOS (just after restoring my kebab to stock), I'm wondering if this warning is a symptom of the problem.

Thanks for your attention.
 
Last edited:

coomac

Senior Member
Apr 9, 2011
101
50
OnePlus 6
Xiaomi Mi 10 Lite
Hello everyone,

First of all, thank coomac for the detailed tutorial and the rest of the people who have contributed to this thread.

After following the steps above, I got a warning in the process of wiping the super partition. Just when executing the following commands (indicated below this paragraph), the message "Invalid sparse file format at header magic" appeared and then it proceeded with its execution, apparently finishing everything without problems. I would like to know if it is the expected behavior or if on the contrary I could have made a mistake.

fastboot flash odm odm.img
fastboot flash system system.img
fastboot flash system_ext system_ext.img
fastboot flash product product.img
fastboot flash vendor vendor.img

I hadn't thought much of it at first, but after two failed installation attempts of LineageOS (just after restoring my kebab to stock), I'm wondering if this warning is a symptom of the problem.

Thanks for your attention.
It's expected behavior. The message always comes up when manually flashing but doesn't affect anything.

Lineage wiki has a few scenarios that can cause error 7. See if any of the suggestions help.
 
  • Like
Reactions: BillGoss

Ramme

Senior Member
Dec 19, 2017
118
50
OnePlus 8T
Hi, I have done everything according to your instructions, it all worked great. I first wanted to flash the latest OOS12 payload clean on my phone, but have noticed that in OOS12 more data is spit out than in the payload of OOS11, so I have OOS11 now clean flashed and will now OOS12 update via OTA. It would be great if you could bring out a tutorial for OOS12. I find my phone feels much faster and cleaner than before with the MSM tool. Thanks!
 
  • Like
Reactions: coomac

ssewk2x

Senior Member
Oct 24, 2010
1,358
1,386
Detroit, MI
OnePlus 8T
I am *desperate* here.

I tried flashing the latest Android 12 OTA on my OnePlus 8t today, and then, before rebooting, installed magisk to the boot partitions. This has, somehow, completely bricked my phone. I can get into fastboot and maybe EDM, and that's it. I happened upon your guide, but when I get to the "fastboot reboot fastboot" part, I get an error saying it can't boot into userspace fastboot mode. Nothing works beyond that point.

To make matters worse, I can't get the MSM tool to communicate with the phone because my PC is ryzen based and it won't run on that. I don't have access to an Intel PC that can run the MSM tool.

For completeness sake, this is what I get from fastboot getvar all:

(bootloader) parallel-download-flash:yes
(bootloader) hw-revision:20001
(bootloader) unlocked:yes
(bootloader) off-mode-charge:1
(bootloader) charger-screen-enabled:1
(bootloader) battery-soc-ok:yes
(bootloader) battery-voltage:4360
(bootloader) version-baseband:
(bootloader) version-bootloader:
(bootloader) erase-block-size: 0x1000
(bootloader) logical-block-size: 0x1000
(bootloader) variant:SM8 UFS
(bootloader) partition-type:mdm1m9kefsc:raw
(bootloader) partition-size:mdm1m9kefsc: 0x1000
(bootloader) partition-type:mdm1m9kefs2:raw
(bootloader) partition-size:mdm1m9kefs2: 0x200000
(bootloader) partition-type:mdm1m9kefs1:raw
(bootloader) partition-size:mdm1m9kefs1: 0x200000
(bootloader) partition-type:mdm1m9kefs3:raw
(bootloader) partition-size:mdm1m9kefs3: 0x200000
(bootloader) partition-type:fsc:raw
(bootloader) partition-size:fsc: 0x20000
(bootloader) partition-type:fsg:raw
(bootloader) partition-size:fsg: 0x200000
(bootloader) partition-type:modemst2:raw
(bootloader) partition-size:modemst2: 0x200000
(bootloader) partition-type:modemst1:raw
(bootloader) partition-size:modemst1: 0x200000
(bootloader) partition-type:ALIGN_TO_128K_2:raw
(bootloader) partition-size:ALIGN_TO_128K_2: 0x1A000
(bootloader) partition-type:storsec_b:raw
(bootloader) partition-size:storsec_b: 0x20000
(bootloader) partition-type:reserve4:raw
(bootloader) partition-size:reserve4: 0xFD0000
(bootloader) partition-type:reserve3:raw
(bootloader) partition-size:reserve3: 0xFD0000
(bootloader) partition-type:reserve2:raw
(bootloader) partition-size:reserve2: 0xFD0000
(bootloader) partition-type:reserve1:raw
(bootloader) partition-size:reserve1: 0x7E8000
(bootloader) partition-type:hyp_log:raw
(bootloader) partition-size:hyp_log: 0xFD0000
(bootloader) partition-type:qsee_log:raw
(bootloader) partition-size:qsee_log: 0xFD0000
(bootloader) partition-type:android_log:raw
(bootloader) partition-size:android_log: 0xFD0000
(bootloader) partition-type:kernel_log:raw
(bootloader) partition-size:kernel_log: 0x1FA0000
(bootloader) partition-type:abl_log:raw
(bootloader) partition-size:abl_log: 0xFD0000
(bootloader) partition-type:eek:p1:raw
(bootloader) partition-size:eek:p1: 0x12C00000
(bootloader) partition-type:aging_mod:raw
(bootloader) partition-size:aging_mod: 0x2000000
(bootloader) partition-type:aging_kernel:raw
(bootloader) partition-size:aging_kernel: 0x4000000
(bootloader) partition-type:mdm1oemnvbktmp:raw
(bootloader) partition-size:mdm1oemnvbktmp: 0x200000
(bootloader) partition-type:vm-data:raw
(bootloader) partition-size:vm-data: 0x400000
(bootloader) partition-type:vm-keystore:raw
(bootloader) partition-size:vm-keystore: 0x20000
(bootloader) partition-type:secdata:raw
(bootloader) partition-size:secdata: 0x7000
(bootloader) partition-type:uefivarstore:raw
(bootloader) partition-size:uefivarstore: 0x80000
(bootloader) partition-type:storsec_a:raw
(bootloader) partition-size:storsec_a: 0x20000
(bootloader) partition-type:logdump:raw
(bootloader) partition-size:logdump: 0x4000000
(bootloader) partition-type:logfs:raw
(bootloader) partition-size:logfs: 0x800000
(bootloader) partition-type:limits-cdsp:raw
(bootloader) partition-size:limits-cdsp: 0x1000
(bootloader) partition-type:limits:raw
(bootloader) partition-size:limits: 0x1000
(bootloader) partition-type:spunvm:raw
(bootloader) partition-size:spunvm: 0x2000000
(bootloader) partition-type:msadp:raw
(bootloader) partition-size:msadp: 0x40000
(bootloader) partition-type:apdp:raw
(bootloader) partition-size:apdp: 0x40000
(bootloader) partition-type:dip:raw
(bootloader) partition-size:dip: 0x100000
(bootloader) partition-type:devinfo:raw
(bootloader) partition-size:devinfo: 0x1000
(bootloader) partition-type:logo_b:raw
(bootloader) partition-size:logo_b: 0x1000000
(bootloader) partition-type:imagefv_b:raw
(bootloader) partition-size:imagefv_b: 0x200000
(bootloader) partition-type:featenabler_b:raw
(bootloader) partition-size:featenabler_b: 0x20000
(bootloader) partition-type:vm-linux_b:raw
(bootloader) partition-size:vm-linux_b: 0x2000000
(bootloader) partition-type:multiimgqti_b:raw
(bootloader) partition-size:multiimgqti_b: 0x8000
(bootloader) partition-type:multiimgoem_b:raw
(bootloader) partition-size:multiimgoem_b: 0x8000
(bootloader) partition-type:uefisecapp_b:raw
(bootloader) partition-size:uefisecapp_b: 0x200000
(bootloader) partition-type:dtbo_b:raw
(bootloader) partition-size:dtbo_b: 0x1800000
(bootloader) partition-type:vbmeta_b:raw
(bootloader) partition-size:vbmeta_b: 0x10000
(bootloader) partition-type:qupfw_b:raw
(bootloader) partition-size:qupfw_b: 0x14000
(bootloader) partition-type:devcfg_b:raw
(bootloader) partition-size:devcfg_b: 0x20000
(bootloader) partition-type:cmnlib64_b:raw
(bootloader) partition-size:cmnlib64_b: 0x80000
(bootloader) partition-type:cmnlib_b:raw
(bootloader) partition-size:cmnlib_b: 0x80000
(bootloader) partition-type:boot_b:raw
(bootloader) partition-size:boot_b: 0x6000000
(bootloader) partition-type:keymaster_b:raw
(bootloader) partition-size:keymaster_b: 0x80000
(bootloader) partition-type:dsp_b:raw
(bootloader) partition-size:dsp_b: 0x4000000
(bootloader) partition-type:abl_b:raw
(bootloader) partition-size:abl_b: 0x800000
(bootloader) partition-type:mdtp_b:raw
(bootloader) partition-size:mdtp_b: 0x2000000
(bootloader) partition-type:mdtpsecapp_b:raw
(bootloader) partition-size:mdtpsecapp_b: 0x400000
(bootloader) partition-type:bluetooth_b:raw
(bootloader) partition-size:bluetooth_b: 0x100000
(bootloader) partition-type:modem_b:raw
(bootloader) partition-size:modem_b: 0x20000000
(bootloader) partition-type:hyp_b:raw
(bootloader) partition-size:hyp_b: 0x800000
(bootloader) partition-type:tz_b:raw
(bootloader) partition-size:tz_b: 0x400000
(bootloader) partition-type:aop_b:raw
(bootloader) partition-size:aop_b: 0x80000
(bootloader) partition-type:logo_a:raw
(bootloader) partition-size:logo_a: 0x1000000
(bootloader) partition-type:imagefv_a:raw
(bootloader) partition-size:imagefv_a: 0x200000
(bootloader) partition-type:featenabler_a:raw
(bootloader) partition-size:featenabler_a: 0x20000
(bootloader) partition-type:vm-linux_a:raw
(bootloader) partition-size:vm-linux_a: 0x2000000
(bootloader) partition-type:multiimgqti_a:raw
(bootloader) partition-size:multiimgqti_a: 0x8000
(bootloader) partition-type:multiimgoem_a:raw
(bootloader) partition-size:multiimgoem_a: 0x8000
(bootloader) partition-type:uefisecapp_a:raw
(bootloader) partition-size:uefisecapp_a: 0x200000
(bootloader) partition-type:dtbo_a:raw
(bootloader) partition-size:dtbo_a: 0x1800000
(bootloader) partition-type:vbmeta_a:raw
(bootloader) partition-size:vbmeta_a: 0x10000
(bootloader) partition-type:qupfw_a:raw
(bootloader) partition-size:qupfw_a: 0x14000
(bootloader) partition-type:devcfg_a:raw
(bootloader) partition-size:devcfg_a: 0x20000
(bootloader) partition-type:cmnlib64_a:raw
(bootloader) partition-size:cmnlib64_a: 0x80000
(bootloader) partition-type:cmnlib_a:raw
(bootloader) partition-size:cmnlib_a: 0x80000
(bootloader) partition-type:boot_a:raw
(bootloader) partition-size:boot_a: 0x6000000
(bootloader) partition-type:keymaster_a:raw
(bootloader) partition-size:keymaster_a: 0x80000
(bootloader) partition-type:dsp_a:raw
(bootloader) partition-size:dsp_a: 0x4000000
(bootloader) partition-type:abl_a:raw
(bootloader) partition-size:abl_a: 0x800000
(bootloader) partition-type:mdtp_a:raw
(bootloader) partition-size:mdtp_a: 0x2000000
(bootloader) partition-type:mdtpsecapp_a:raw
(bootloader) partition-size:mdtpsecapp_a: 0x400000
(bootloader) partition-type:bluetooth_a:raw
(bootloader) partition-size:bluetooth_a: 0x100000
(bootloader) partition-type:modem_a:raw
(bootloader) partition-size:modem_a: 0x20000000
(bootloader) partition-type:hyp_a:raw
(bootloader) partition-size:hyp_a: 0x800000
(bootloader) partition-type:tz_a:raw
(bootloader) partition-size:tz_a: 0x400000
(bootloader) partition-type:aop_a:raw
(bootloader) partition-size:aop_a: 0x80000
(bootloader) partition-type:mdmddr:raw
(bootloader) partition-size:mdmddr: 0x100000
(bootloader) partition-type:ddr:raw
(bootloader) partition-size:ddr: 0x200000
(bootloader) partition-type:cdt:raw
(bootloader) partition-size:cdt: 0x20000
(bootloader) partition-type:ALIGN_TO_128K_1:raw
(bootloader) partition-size:ALIGN_TO_128K_1: 0x1A000
(bootloader) partition-type:xbl_config_b:raw
(bootloader) partition-size:xbl_config_b: 0x20000
(bootloader) partition-type:xbl_b:raw
(bootloader) partition-size:xbl_b: 0x500000
(bootloader) partition-type:xbl_config_a:raw
(bootloader) partition-size:xbl_config_a: 0x20000
(bootloader) partition-type:xbl_a:raw
(bootloader) partition-size:xbl_a: 0x500000
(bootloader) partition-type:userdata:f2fs
(bootloader) partition-size:userdata: 0x381D3DB000
(bootloader) partition-type:eek:em_cust2_b:raw
(bootloader) partition-size:eek:em_cust2_b: 0x12C00000
(bootloader) partition-type:eek:em_cust2_a:raw
(bootloader) partition-size:eek:em_cust2_a: 0x12C00000
(bootloader) partition-type:eek:em_cust1_b:raw
(bootloader) partition-size:eek:em_cust1_b: 0x40000000
(bootloader) partition-type:eek:em_cust1_a:raw
(bootloader) partition-size:eek:em_cust1_a: 0x40000000
(bootloader) partition-type:rawdump:raw
(bootloader) partition-size:rawdump: 0x8000000
(bootloader) partition-type:vm-system_b:raw
(bootloader) partition-size:vm-system_b: 0x8000000
(bootloader) partition-type:vm-system_a:raw
(bootloader) partition-size:vm-system_a: 0x8000000
(bootloader) partition-type:metadata:raw
(bootloader) partition-size:metadata: 0x1000000
(bootloader) partition-type:vbmeta_system_b:raw
(bootloader) partition-size:vbmeta_system_b: 0x10000
(bootloader) partition-type:vbmeta_system_a:raw
(bootloader) partition-size:vbmeta_system_a: 0x10000
(bootloader) partition-type:recovery_b:raw
(bootloader) partition-size:recovery_b: 0x6400000
(bootloader) partition-type:recovery_a:raw
(bootloader) partition-size:recovery_a: 0x6400000
(bootloader) partition-type:super:raw
(bootloader) partition-size:super: 0x1C0000000
(bootloader) partition-type:ALIGN_TO_512K:raw
(bootloader) partition-size:ALIGN_TO_512K: 0x78000
(bootloader) partition-type:persist_bkp:raw
(bootloader) partition-size:persist_bkp: 0x2000000
(bootloader) partition-type:config:raw
(bootloader) partition-size:config: 0x80000
(bootloader) partition-type:eek:p2:raw
(bootloader) partition-size:eek:p2: 0x20000000
(bootloader) partition-type:carrier:raw
(bootloader) partition-size:carrier: 0x4000000
(bootloader) partition-type:modemdump:raw
(bootloader) partition-size:modemdump: 0x12C00000
(bootloader) partition-type:mdm_oem_stanvbk:raw
(bootloader) partition-size:mdm_oem_stanvbk: 0xA00000
(bootloader) partition-type:mdm_oem_dycnvbk:raw
(bootloader) partition-size:mdm_oem_dycnvbk: 0xA00000
(bootloader) partition-type:param:raw
(bootloader) partition-size:param: 0x100000
(bootloader) partition-type:frp:raw
(bootloader) partition-size:frp: 0x80000
(bootloader) partition-type:keystore:raw
(bootloader) partition-size:keystore: 0x80000
(bootloader) partition-type:misc:raw
(bootloader) partition-size:misc: 0x100000
(bootloader) partition-type:persist:raw
(bootloader) partition-size:persist: 0x2000000
(bootloader) partition-type:ssd:raw
(bootloader) partition-size:ssd: 0x2000
(bootloader) has-slot:modem:yes
(bootloader) has-slot:system:no
(bootloader) current-slot:a
(bootloader) has-slot:boot:yes
(bootloader) slot-retry-count:b:7
(bootloader) slot-unbootable:b:no
(bootloader) slot-successful:b:no
(bootloader) slot-retry-count:a:7
(bootloader) slot-unbootable:a:no
(bootloader) slot-successful:a:no
(bootloader) slot-count:2
(bootloader) secure:yes
(bootloader) serialno:7150d10c
(bootloader) product:kona
(bootloader) snapshot-update-status:none
(bootloader) is-userspace:no
(bootloader) max-download-size:805306368
(bootloader) kernel:uefi
all:
Finished. Total time: 0.570s
 

cro4life2

New member
Jun 16, 2022
1
0
i get the same error as alp above. When i run it i keep getting this issue:


> fastboot flash recovery recovery.img
>> fastboot flash boot boot.img
>> fastboot flash dtbo dtbo.img
>> fastboot reboot fastboot
>> fastboot flash --slot=all recovery recovery.img
>> fastboot flash --slot=all boot boot.img
>> fastboot flash --slot=all dtbo dtbo.img
>> fastboot flash --slot=all abl abl.img
>> fastboot flash --slot=all aop aop.img
>> fastboot flash --slot=all bluetooth bluetooth.img
>> fastboot flash --slot=all cmnlib64 cmnlib64.img
>> fastboot flash --slot=all cmnlib cmnlib.img
>> fastboot flash --slot=all devcfg devcfg.img
>> fastboot flash --slot=all dsp dsp.img
>> fastboot flash --slot=all featenabler featenabler.img
>> fastboot flash --slot=all hyp hyp.img
>> fastboot flash --slot=all imagefv imagefv.img
>> fastboot flash --slot=all keymaster keymaster.img
>> fastboot flash --slot=all logo logo.img
>> fastboot flash --slot=all mdm_oem_stanvbk mdm_oem_stanvbk.img
>> fastboot flash --slot=all modem modem.img
>> fastboot flash --slot=all multiimgoem multiimgoem.img
>> fastboot flash --slot=all qupfw qupfw.img
>> fastboot flash --slot=all spunvm spunvm.img
>> fastboot flash --slot=all storsec storsec.img
>> fastboot flash --slot=all tz tz.img
>> fastboot flash --slot=all uefisecapp uefisecapp.img
>>
target reported max download size of 805306368 bytes
sending 'recovery' (102400 KB)...
OKAY [ 2.497s]
writing 'recovery'...
OKAY [ 0.313s]
finished. total time: 2.810s
target reported max download size of 805306368 bytes
sending 'boot' (98304 KB)...
OKAY [ 2.414s]
writing 'boot'...
OKAY [ 0.336s]
finished. total time: 2.751s
target reported max download size of 805306368 bytes
sending 'dtbo' (8192 KB)...
OKAY [ 0.206s]
writing 'dtbo'...
OKAY [ 0.045s]
finished. total time: 0.253s
usage: fastboot [ <option> ] <command>

commands:
update <filename> reflash device from update.zip
flashall flash boot, system, vendor and if found,
recovery
flash <partition> [ <filename> ] write a file to a flash partition
erase <partition> erase a flash partition
format[:[<fs type>][:[<size>]] <partition> format a flash partition.
Can override the fs type and/or
size the bootloader reports.
getvar <variable> display a bootloader variable
boot <kernel> [ <ramdisk> [ <second> ] ] download and boot kernel
flash:raw boot <kernel> [ <ramdisk> [ <second> ] ] create bootimage and
flash it
devices list all connected devices
continue continue with autoboot
reboot reboot device normally
reboot-bootloader reboot device into bootloader
help show this help message

options:
-w erase userdata and cache (and format
if supported by partition type)
-u do not first erase partition before
formatting
-s <specific device> specify device serial number
or path to device port
-l with "devices", lists device paths
-p <product> specify product name
-c <cmdline> override kernel commandline
-i <vendor id> specify a custom USB vendor id
-b <base_addr> specify a custom kernel base address.
default: 0x10000000
-n <page size> specify the nand page size.
default: 2048
-S <size>[K|M|G] automatically sparse files greater
than size. 0 to disable
C:\Android\fastboot.exe: unknown option -- slot=all
C:\Android\fastboot.exe: unknown option -- slot=all
C:\Android\fastboot.exe: unknown option -- slot=all
C:\Android\fastboot.exe: unknown option -- slot=all
C:\Android\fastboot.exe: unknown option -- slot=all
C:\Android\fastboot.exe: unknown option -- slot=all
C:\Android\fastboot.exe: unknown option -- slot=all
C:\Android\fastboot.exe: unknown option -- slot=all
C:\Android\fastboot.exe: unknown option -- slot=all
C:\Android\fastboot.exe: unknown option -- slot=all
C:\Android\fastboot.exe: unknown option -- slot=all
C:\Android\fastboot.exe: unknown option -- slot=all
C:\Android\fastboot.exe: unknown option -- slot=all
C:\Android\fastboot.exe: unknown option -- slot=all
C:\Android\fastboot.exe: unknown option -- slot=all
C:\Android\fastboot.exe: unknown option -- slot=all
C:\Android\fastboot.exe: unknown option -- slot=all
C:\Android\fastboot.exe: unknown option -- slot=all
C:\Android\fastboot.exe: unknown option -- slot=all
C:\Android\fastboot.exe: unknown option -- slot=all
C:\Android\fastboot.exe: unknown option -- slot=all
C:\Android\fastboot.exe: unknown option -- slot=all
C:\Android\fastboot.exe: unknown option -- slot=all
 

Top Liked Posts

  • There are no posts matching your filters.
  • 14
    This guide is for users that can't or just don't want to download MsmDownloadTool. Linux users especially, since the tool is not available for linux. All you need is a recent version of android tools with a fastboot capable of executing fastboot reboot fastbootd.

    To start, download the appropriate Oxygen OS zip for your device from the OP8T repo thread. Extracting the zip file should give you a file named
    payload.bin.

    Use payload dumper to extract payload.bin.
    You can grab payload_dumper from here (Windows and macOS), here (linux), or here (github, any OS).
    For the download link from github, make sure you're running python 3.6 or higher. Run payload dumper with:
    python payload_dumper.py payload.bin

    The image files will be extracted to a folder named output.

    Before starting the flashing process, you can check your device memory type using the DevCheck app by flar2 or with the command adb shell getprop ro.boot.ddr_type. The adb command will return 0 for LPDDR4X chips and 1 for LPDDR5 chips. This is important to flash the right xbl img files. LPDDR4X is more common for OP8T, so no worries if you miss this step.

    You can start flashing from the standard bootloader or fastbootd. The first three lines below will flash the stock recovery then reboot into fastbootd.

    Code:
    fastboot flash recovery recovery.img
    fastboot flash boot boot.img
    fastboot flash dtbo dtbo.img
    fastboot reboot fastboot
    fastboot flash --slot=all recovery recovery.img
    fastboot flash --slot=all boot boot.img
    fastboot flash --slot=all dtbo dtbo.img
    fastboot flash --slot=all abl abl.img
    fastboot flash --slot=all aop aop.img
    fastboot flash --slot=all bluetooth bluetooth.img
    fastboot flash --slot=all cmnlib64 cmnlib64.img
    fastboot flash --slot=all cmnlib cmnlib.img
    fastboot flash --slot=all devcfg devcfg.img
    fastboot flash --slot=all dsp dsp.img
    fastboot flash --slot=all featenabler featenabler.img
    fastboot flash --slot=all hyp hyp.img
    fastboot flash --slot=all imagefv imagefv.img
    fastboot flash --slot=all keymaster keymaster.img
    fastboot flash --slot=all logo logo.img
    fastboot flash --slot=all mdm_oem_stanvbk mdm_oem_stanvbk.img
    fastboot flash --slot=all modem modem.img
    fastboot flash --slot=all multiimgoem multiimgoem.img
    fastboot flash --slot=all qupfw qupfw.img
    fastboot flash --slot=all spunvm spunvm.img
    fastboot flash --slot=all storsec storsec.img
    fastboot flash --slot=all tz tz.img
    fastboot flash --slot=all uefisecapp uefisecapp.img

    If your phone has the LPDDR4X memory chip (returned 0 with the adb shell command above), flash the images below:
    Code:
    fastboot flash --slot=all xbl_config xbl_config.img
    fastboot flash --slot=all xbl xbl.img
    LPDDR4X is the more common chip for OP8T, so if you forgot to check, you can flash this.

    If your phone has the LPDDR5 chip (returned 1 with the adb shell command above), flash the images below:
    Code:
    fastboot flash --slot=all xbl_config xbl_config_lp5.img
    fastboot flash --slot=all xbl xbl_lp5.img

    This next section will clear the super partition (contains odm, system, system_ext, vendor and product). It's not absolutely necessary, so you can skip to the next step. Clearing the super partition will help avoid the following error, which can come up if you had manually flashed ROMs on both slots previously.
    Code:
    Resizing '<partition name>'              FAILED (remote: 'Not enough space to resize partition')
    Example: Resizing 'product'                          FAILED (remote: 'Not enough space to resize partition')

    If you've ever had this error or you just want to be sure that everything is cleared, check the spoiler.
    Before deleting, you can check the names of the logical partitions on your phone using fastboot getvar all. Scroll up to the section that looks like this:

    Code:
    (bootloader) is-logical:odm_a:yes
    (bootloader) is-logical:product_a:yes
    (bootloader) is-logical:system_a:yes
    (bootloader) is-logical:system_ext_a:yes
    (bootloader) is-logical:vendor_a:yes
    
    or
    
    (bootloader) is-logical:odm_b:yes
    (bootloader) is-logical:product_b:yes
    (bootloader) is-logical:system_b:yes
    (bootloader) is-logical:system_ext_b:yes
    (bootloader) is-logical:vendor_b:yes

    As @Matt85m pointed out, you may also have:

    Code:
    (bootloader) is-logical:odm:yes
    (bootloader) is-logical:product:yes
    (bootloader) is-logical:system:yes
    (bootloader) is-logical:system_ext:yes
    (bootloader) is-logical:vendor:yes

    It is also possible to have logical partitions with the same names ending in -cow (system_a-cow, system_b-cow, system_ext_b-cow, vendor_a-cow, product_b-cow, etc).
    These are created by various ROMs during an OTA. Shout out to @mslezak for the discovery.

    Delete everything with the commands below:

    Code:
    fastboot delete-logical-partition odm
    fastboot delete-logical-partition system
    fastboot delete-logical-partition system_ext
    fastboot delete-logical-partition product
    fastboot delete-logical-partition vendor
    
    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

    Delete any -cow partitions with the same command:
    Code:
    fastboot delete-logical-partition system_a-cow
    and so on.

    If you get an error deleting the -cow partitions, @firegate22 suggests changing slots from the bootloader (fastboot --set-active=a or b) not from fastbootd, then return to fastbootd and try the delete command again.

    All logical partitions can be deleted to free up space in the super partition.

    Recreate partitions a and b with the commands below.

    Code:
    fastboot create-logical-partition odm_a 100000
    fastboot create-logical-partition odm_b 100000
    fastboot create-logical-partition system_a 100000
    fastboot create-logical-partition system_b 100000
    fastboot create-logical-partition system_ext_a 100000
    fastboot create-logical-partition system_ext_b 100000
    fastboot create-logical-partition product_a 100000
    fastboot create-logical-partition product_b 100000
    fastboot create-logical-partition vendor_a 100000
    fastboot create-logical-partition vendor_b 100000

    Flash the rest of the images.
    Code:
    fastboot flash odm odm.img
    fastboot flash system system.img
    fastboot flash system_ext system_ext.img
    fastboot flash product product.img
    fastboot flash vendor vendor.img
    fastboot flash --slot=all vbmeta vbmeta.img
    fastboot flash --slot=all vbmeta_system vbmeta_system.img

    Assuming everything flashes with no errors, return to recovery, do a factory reset and reboot.
    3
    thanks for this helped me alot to restore my device, i have one question though i checked all the commands and i see there might be one command missing, when i extracted the rom i checked all the img files and saw :
    xbl_lp5.img
    xbl_config_lp5.img

    cant help wonder if i have to input the commands as well
    Glad it helped. Those files depend on whether your device has a DDR type 0 (LPDDR4X) or DDR type 1 (LPDDR5) memory chip.

    You can check your device memory type with adb shell getprop ro.boot.ddr_type. It will return 0 or 1. You can also use the DevCheck app by flar2.

    I believe most OP8Ts use DDR0, which requires xbl_config.img and xbl.img. The lp5 images are for DDR1.
    According to the lineage OS wiki, you'd flash the lp5 images with the same commands on DDR1:
    Code:
    fastboot flash --slot=all xbl_config xbl_config_lp5.img
    fastboot flash --slot=all xbl xbl_lp5.img
    2
    I like what you're proposing. I've been thinking along these lines also.
    Would you mind explaining why you're flashing to both slots rather than just the inactive one?
    If you leave the current slot untouched you have a fallback position (the whole point of having A/B partitioning).

    The same question applies to the flashing/deleting of the dynamic partitions in super.
    For this guide specifically, the idea is to return as close to stock as possible. Wiping everything and replacing with OOS would be the best way to do that.

    More generally, other than boot.img and recovery.img, the images flashed on both slots in the first part are the firmware files. You can grab and flash them from pretty much any new OOS version to update the firmware without affecting the installed ROMs. The specific files for the ROM are all in the third part. If you extract the payload.bin for any custom ROM, those are usually the only image files included.

    You can certainly run two different firmware versions on the two slots, but if the inactive slots are empty or contain much older firmware, you can end up with weird issues in the active slots (usually a boot loop but could be more or less serious). Keeping the versions close is just to avoid unnecessary issues.

    Some custom ROMs for OP8T like Lineage recommend or insist on flashing the copy-partitions.zip package for this reason. It's also why the install instructions for older A/B phones that have TWRP generally begin with "flash the stock ROM on both slots" - only the firmware files are strictly necessary, so you can keep the fallback ROM on the other slot if you want to.

    That ended up much longer than planned. Hope it answers your questions though!
    2

    worked it out looking at the entire list of partitions - I had 3 lots of each rom partion for example system_a, system_b and system, for all vendor product etc. purging the ones without the _a/b allowed the process to complete.

    Might be a quirk of lineageOS installation process - you might want to make a note of it on the OP incase someone else runs into it
    2
    OK, couple things you can try.
    - Switch to slot a and try flashing again.
    - If that doesn't work, flash the copy-partitions zip from the lineage wiki then try again.

    Btw you can check the size of the super partition using fastboot getvar partition-size:super (you'll have to convert the hex value to decimal). It should be around 7.5 gb. Use fastboot getvar all to get the sizes of all the logical partitions. The total should be between ~3.3 and 4 gb after flashing or about 500 mb after you delete/recreate them.