Hi all,
"There must be a better way", I thought to myself as I read through the instructions for setting up the boot loader.
After much fussing about (Google is my friend) and dredging up of the old school skills, I've created a batch file that should deal with steps 1b through 1g of the Rockbox iPod installation.
So far the batch file has only been tested in WinXP and with my iPod Photo, but I followed the instructions on Rockbox's web site so it should work for any supported model.
Here are the batch file contents. Copy it, paste it into Notepad and save the file as install.bat in your C:\Rockbox folder. It assumes you've already downloaded the required files and put them in the same folder:
@echo off
REM Rockbox iPod install batch file
REM By Jim Allison (jim@holycow.com)
REM Clear the variables
set device=
set ipod=
cls
REM Check for the executables. If either not found, exit.
if not exist C:\Rockbox\ipodpatcher.exe goto error_ipodpatcher
if not exist C:\Rockbox\ipod_fw.exe goto error_ipod_fw
echo -------------------------------------------------------------------
echo This is a batch file to help install Rockbox on an iPod in Windows.
echo _
echo Please plug in your iPod now, and press any key once
echo it appears as a drive in your Windows Explorer.
echo _
echo Press Ctrl-C to exit
echo _
pause
C:
cd \Rockbox
REM Check for the bin files. If none found, exit. If any found, assume the last one, but ask to make sure.
if exist bootloader-color.bin (
set ipod=Color/Photo
) else (
if exist bootloader-4g.bin (
set ipod=4G-Grayscale
) else (
if exist bootloader-nano.bin (
set ipod=Nano
) else (
if exist bootloader-video.bin (
set ipod=Video/5G
) else (
goto error_nobins
)
)
)
)
cls
echo --------------------------------------------------------------
echo You have the bin file for the
echo _
echo iPod %ipod%.
echo _
echo If this is not your iPod model, please press Ctrl-C to
echo terminate this batch file and make sure only the bin
echo file for your particular iPod model is in C:\Rockbox:
echo _
echo iPod Color/Photo: bootloader-color.bin
echo iPod 4G (Grayscale): bootloader-4g.bin
echo iPod Nano: bootloader-nano.bin
echo iPod Video/5G: bootloader-video.bin
echo _
pause
del temp*.txt
REM Run through drives 0-5 via iPodPatcher
ipodpatcher 0 > temp0.txt
ipodpatcher 1 > temp1.txt
ipodpatcher 2 > temp2.txt
ipodpatcher 3 > temp3.txt
ipodpatcher 4 > temp4.txt
ipodpatcher 5 > temp5.txt
REM Parse temp files for signs of an iPod
for /F "tokens=1,2,3" %%l in (temp0.txt) do if "%%l"=="Part" if "%%m"=="Start" if "%%n"=="Sector" set device=0
for /F "tokens=1,2,3" %%l in (temp1.txt) do if "%%l"=="Part" if "%%m"=="Start" if "%%n"=="Sector" set device=1
for /F "tokens=1,2,3" %%l in (temp2.txt) do if "%%l"=="Part" if "%%m"=="Start" if "%%n"=="Sector" set device=2
for /F "tokens=1,2,3" %%l in (temp3.txt) do if "%%l"=="Part" if "%%m"=="Start" if "%%n"=="Sector" set device=3
for /F "tokens=1,2,3" %%l in (temp4.txt) do if "%%l"=="Part" if "%%m"=="Start" if "%%n"=="Sector" set device=4
for /F "tokens=1,2,3" %%l in (temp5.txt) do if "%%l"=="Part" if "%%m"=="Start" if "%%n"=="Sector" set device=5
if "%device%"=="" goto error_nopod
REM Create backup of original firmware
ipodpatcher -r %device% bootpartition.bin
if not exist bootpartition.bin goto error_backupfailed
REM Extract Apple's firmware from the bootpartition.bin image file
ipod_fw -o apple_os.bin -e 0 bootpartition.bin
if not exist apple_os.bin goto error_backupfailed
REM The iPod Video/5G has an extra firmware for the video decoder chip. This needs to be extracted:
if "%ipod%"=="Video/5G" ipod_fw -o apple_sw_5g_rcsc.bin -e 1 bootpartition.bin
REM Create Rockboot.bin, depending on the iPod model
if "%ipod%"=="4G-Grayscale" ipod_fw -g 4g -o rockboot.bin -i apple_os.bin bootloader-4g.bin
if "%ipod%"=="Color/Photo" ipod_fw -g color -o rockboot.bin -i apple_os.bin bootloader-color.bin
if "%ipod%"=="Nano" ipod_fw -g nano -o rockboot.bin -i apple_os.bin bootloader-nano.bin
if "%ipod%"=="Video/5G" ipod_fw -g video -o rockboot.bin -i apple_os.bin bootloader-video.bin
REM Install the bootloader!
ipodpatcher -w %device% rockboot.bin
cls
echo ---------------------------------------------------------------------------
echo Testing
echo _
echo You can now disconnect your ipod from your PC in the normal way.
echo This should cause your iPod to reboot.
echo _
echo You should now see a light blue screen with some tiny writing - this is the
echo Rockbox bootloader. Because you haven't yet installed Rockbox itself, the
echo bootloader will fail to start Rockbox and should then default to start the
echo original Apple firmware. If this happens, then all has gone well.
echo _
echo Do not delete C:\Rockbox\bootpartition.bin! It can be used
echo to restore your iPod to its original configuration.
echo _
echo Please complete the installation by following the instructions at
echo www.rockbox.org/twiki/bin/view/Main/IpodInstallation#Step_2_Install_Rockbox
echo _
goto end
:error_ipodpatcher
cls
echo -----------------------------------------------------------------
echo C:\Rockbox\iPodPatcher.exe not found!
echo This batch file assumes that your Rockbox files are in C:\Rockbox
echo Exiting...
goto end
:error_ipod_fw
cls
echo -----------------------------------------------------------------
echo C:\Rockbox\iPod_FW.exe not found!
echo This batch file assumes that your Rockbox files are in C:\Rockbox
echo Exiting...
goto end
:error_nobins
cls
echo -------------------------------------------------------------------------
echo No bin files found! Please download the appropriate bin file
echo for your iPod from http://www.rockbox.org/twiki/pub/Main/IpodInstallation
echo and save it into your C:\Rockbox folder.
echo _
echo iPod Color/Photo: bootloader-color.bin
echo iPod 4G (Grayscale): bootloader-4g.bin
echo iPod Nano: bootloader-nano.bin
echo iPod Video/5G: bootloader-video.bin
goto end
:error_backupfailed
echo Oops! Something went wrong with the backup process.
echo I'm not going to continue. Please try the manual procedure.
goto end
:error_nopod
cls
echo -----------------------------------------------------
echo ERROR!
echo I can't find your iPod! Please make sure your iPod is
echo plugged in and appears as a drive in Windows Explorer,
echo then try this batch file again. If it keeps failing
echo then try the manual procedure.
goto end
:end
del temp*.txt
pause