fix-firstrun-path.bat 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. @echo off
  2. echo.
  3. echo [WaouW] Correction du chemin firstrun.sh
  4. echo ========================================
  5. echo.
  6. REM Détecter la partition boot
  7. for %%d in (D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
  8. if exist %%d:\cmdline.txt (
  9. set BOOT_DRIVE=%%d:
  10. goto :found_boot
  11. )
  12. )
  13. echo [ERREUR] Partition boot non detectee
  14. pause
  15. exit /b 1
  16. :found_boot
  17. echo [INFO] Partition boot detectee : %BOOT_DRIVE%
  18. echo [INFO] Modification de cmdline.txt pour pointer vers notre script...
  19. REM Lire le contenu actuel
  20. for /f "delims=" %%i in (%BOOT_DRIVE%\cmdline.txt) do set CMDLINE=%%i
  21. REM Remplacer /boot/firmware/firstrun.sh par /boot/firstrun.sh
  22. set CMDLINE=%CMDLINE:/boot/firmware/firstrun.sh=/boot/firstrun.sh%
  23. REM Écrire le nouveau cmdline.txt
  24. echo %CMDLINE% > "%BOOT_DRIVE%\cmdline.txt"
  25. echo [OK] cmdline.txt modifie pour utiliser /boot/firstrun.sh
  26. echo.
  27. echo [INFO] Verification du contenu de cmdline.txt :
  28. type "%BOOT_DRIVE%\cmdline.txt"
  29. echo.
  30. echo [SUCCESS] Configuration corrigee !
  31. echo Le Pi va maintenant executer votre script firstrun.sh au demarrage.
  32. echo.
  33. pause