Advertisement
otack

Firefox OS base image flashing script

Apr 21st, 2015
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @ECHO OFF
  2. %cd:~0,2%
  3. SET workDIR=%~dp0
  4.  
  5.  
  6. ECHO .
  7. ECHO .
  8. ECHO ************* WARNING **************
  9. ECHO *                                  *
  10. ECHO * CHOOSING 'Y' WILL WIPE YOUR DATA *
  11. ECHO *                                  *
  12. ECHO ************* WARNING **************
  13. ECHO .
  14. ECHO . If you are moving between a major version
  15. ECHO . (such as 1.4 to 2.0 or 2.0 to 1.4)
  16. ECHO . we recommend choosing 'Y'.
  17. ECHO .
  18. SET /P _choice=Do you want to flash user data [Y/N]?
  19. ECHO .
  20. ECHO . Rebooting device into fastboot mode.
  21. ECHO . This can take a few seconds.
  22.  
  23. adb.exe reboot boot-fastboot
  24. goto system
  25.  
  26. :: Flash system
  27. :system
  28. IF EXIST "%workDIR%system.img" (
  29.     fastboot.exe erase cache
  30.     fastboot.exe flash system system.img
  31.     IF /I "%_choice%"=="Y" goto userdata
  32.     goto boot
  33. ) ELSE (
  34.     ECHO %workDIR%system.img not found to flash
  35.     goto error
  36. )
  37.  
  38. :: Flash userdata
  39. :userdata
  40. IF EXIST "%workDIR%userdata.img" (
  41.     fastboot.exe flash data userdata.img
  42.     goto boot
  43. ) ELSE (
  44.     ECHO %workDIR%userdata.img not found to flash
  45.     goto error
  46. )
  47.  
  48. :: Flash boot aka kernel
  49. :boot
  50. IF EXIST "%workDIR%boot.img" (
  51.     fastboot.exe flash boot boot.img
  52.     goto end
  53. ) ELSE (
  54.     ECHO %workDIR%boot.img not found to flash
  55.     goto error
  56. )
  57.  
  58. :error
  59. ECHO 
  60. ECHO Something is wrong. Make sure you follow all the steps... Press any key to exit...
  61. PAUSE >nul
  62. EXIT
  63.  
  64. :end
  65. ECHO 
  66. ECHO Everything completed. Press any key to exit/reboot...
  67. PAUSE >nul
  68. fastboot reboot
  69. EXIT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement