Skip to content

Instantly share code, notes, and snippets.

@chenshaoju
Last active April 7, 2018 13:27
Show Gist options
  • Save chenshaoju/b64b33faef41742954f430a3cf9c9746 to your computer and use it in GitHub Desktop.
Save chenshaoju/b64b33faef41742954f430a3cf9c9746 to your computer and use it in GitHub Desktop.
OnePlus 5T Firmware Clean/Flash bash script
#!/sbin/sh
#
# In some case, you may need use "sh ./clean.sh" to run this script.
dd if=/dev/zero of=/dev/block/platform/soc/1da4000.ufshc/by-name/oem_stanvbk bs=4096
dd if=/dev/zero of=/dev/block/platform/soc/1da4000.ufshc/by-name/cmnlib64 bs=4096
dd if=/dev/zero of=/dev/block/platform/soc/1da4000.ufshc/by-name/cmnlib bs=4096
dd if=/dev/zero of=/dev/block/platform/soc/1da4000.ufshc/by-name/hyp bs=4096
dd if=/dev/zero of=/dev/block/platform/soc/1da4000.ufshc/by-name/pmic bs=4096
dd if=/dev/zero of=/dev/block/platform/soc/1da4000.ufshc/by-name/tz bs=4096
dd if=/dev/zero of=/dev/block/platform/soc/1da4000.ufshc/by-name/devcfg bs=4096
dd if=/dev/zero of=/dev/block/platform/soc/1da4000.ufshc/by-name/keymaster bs=4096
dd if=/dev/zero of=/dev/block/platform/soc/1da4000.ufshc/by-name/xbl bs=4096
dd if=/dev/zero of=/dev/block/platform/soc/1da4000.ufshc/by-name/rpm bs=4096
dd if=/dev/zero of=/dev/block/platform/soc/1da4000.ufshc/by-name/LOGO bs=4096
dd if=/dev/zero of=/dev/block/platform/soc/1da4000.ufshc/by-name/modem bs=4096
dd if=/dev/zero of=/dev/block/platform/soc/1da4000.ufshc/by-name/dsp bs=4096
dd if=/dev/zero of=/dev/block/platform/soc/1da4000.ufshc/by-name/bluetooth bs=4096
dd if=/dev/zero of=/dev/block/platform/soc/1da4000.ufshc/by-name/cmnlib64bak bs=4096
dd if=/dev/zero of=/dev/block/platform/soc/1da4000.ufshc/by-name/cmnlibbak bs=4096
dd if=/dev/zero of=/dev/block/platform/soc/1da4000.ufshc/by-name/hypbak bs=4096
dd if=/dev/zero of=/dev/block/platform/soc/1da4000.ufshc/by-name/tzbak bs=4096
dd if=/dev/zero of=/dev/block/platform/soc/1da4000.ufshc/by-name/keymasterbak bs=4096
dd if=/dev/zero of=/dev/block/platform/soc/1da4000.ufshc/by-name/xblbak bs=4096
dd if=/dev/zero of=/dev/block/platform/soc/1da4000.ufshc/by-name/rpmbak bs=4096
exit 0
#!/sbin/sh
#
# In some case, you may need use "sh ./flash.sh" to run this script.
# All firmware files must upload to /cache or you need change these path below.
dd if=/cache/static_nvbk.bin of=/dev/block/platform/soc/1da4000.ufshc/by-name/oem_stanvbk bs=4096
dd if=/cache/cmnlib64.mbn of=/dev/block/platform/soc/1da4000.ufshc/by-name/cmnlib64 bs=4096
dd if=/cache/cmnlib.mbn of=/dev/block/platform/soc/1da4000.ufshc/by-name/cmnlib bs=4096
dd if=/cache/hyp.mbn of=/dev/block/platform/soc/1da4000.ufshc/by-name/hyp bs=4096
dd if=/cache/pmic.elf of=/dev/block/platform/soc/1da4000.ufshc/by-name/pmic bs=4096
dd if=/cache/tz.mbn of=/dev/block/platform/soc/1da4000.ufshc/by-name/tz bs=4096
dd if=/cache/devcfg.mbn of=/dev/block/platform/soc/1da4000.ufshc/by-name/devcfg bs=4096
dd if=/cache/keymaster.mbn of=/dev/block/platform/soc/1da4000.ufshc/by-name/keymaster bs=4096
dd if=/cache/xbl.elf of=/dev/block/platform/soc/1da4000.ufshc/by-name/xbl bs=4096
dd if=/cache/rpm.mbn of=/dev/block/platform/soc/1da4000.ufshc/by-name/rpm bs=4096
dd if=/cache/logo.bin of=/dev/block/platform/soc/1da4000.ufshc/by-name/LOGO bs=4096
dd if=/cache/NON-HLOS.bin of=/dev/block/platform/soc/1da4000.ufshc/by-name/modem bs=4096
dd if=/cache/adspso.bin of=/dev/block/platform/soc/1da4000.ufshc/by-name/dsp bs=4096
dd if=/cache/BTFM.bin of=/dev/block/platform/soc/1da4000.ufshc/by-name/bluetooth bs=4096
dd if=/cache/cmnlib64.mbn of=/dev/block/platform/soc/1da4000.ufshc/by-name/cmnlib64bak bs=4096
dd if=/cache/cmnlib.mbn of=/dev/block/platform/soc/1da4000.ufshc/by-name/cmnlibbak bs=4096
dd if=/cache/hyp.mbn of=/dev/block/platform/soc/1da4000.ufshc/by-name/hypbak bs=4096
dd if=/cache/tz.mbn of=/dev/block/platform/soc/1da4000.ufshc/by-name/tzbak bs=4096
dd if=/cache/keymaster.mbn of=/dev/block/platform/soc/1da4000.ufshc/by-name/keymasterbak bs=4096
dd if=/cache/xbl.elf of=/dev/block/platform/soc/1da4000.ufshc/by-name/xblbak bs=4096
dd if=/cache/rpm.mbn of=/dev/block/platform/soc/1da4000.ufshc/by-name/rpmbak bs=4096
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment