FS#6643 - Bootloader support for Ipod/Iaudio/Gigabeat in rbUtil

Attached to Project: Rockbox
Opened by Dominik Wenger (Domonoky) - Saturday, 10 February 2007, 14:51 GMT
Task Type Patches
Category Build environment
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


I changed the rbUtil so it can also install Bootloaders.
At the moment it can install bootloaders for Ipods, Iaudio and Gigabeat.
All is untested so be carefull.

A windows Binary of it can be found at:

Attached is a patch for ipodpatcher, because i changed a few things for better use in rbutil.
Also attached is the patch for rbUtil.
This Patch has 2 Code::Blocks Projects in it, One to generate a static lib out of Ipodpatcher and one to build rbUtil.
The project to generate the lib, produces at the moment a ipodpatcher lib for windows (for linux you have to include another file)
To compile rbUtil you need Code::Blocks v1.6 and WxWidgets 2.8. (for linux you would have to adjust the makefiles)

I plan to support every rockbox platform with this, but this will take a while.

This task depends upon

Closed by  Thom Johansen (preglow)
Wednesday, 21 February 2007, 22:33 GMT
Reason for closing:  Accepted
Comment by Dominik Wenger (Domonoky) - Saturday, 10 February 2007, 23:45 GMT

i changed again a few thing.
It now also supports H1x0 and H3x0 for Bootloader installation. (H120 ist tested by me)
I updated it to the changes in ipodpatcher.
Fixed bugs in ipod bootloader installation.

Now there is only one Code::Blocks Project file, static libs arent needed anymore.
But it is a little hackish, because i set an extra compile line for the files in ipodpatcher and fwpatcher. And this compile line has hardcoded paths in it, so you have to adjust it your self.
This is because, if you make a Wxwidget Project in Code::Blocks, it autmatically includes an WxWidget header for all files, and causes problems with ipodpatcher and fwpatcher.
Hopefully i can change this in the future.

Attached is the patch for rbUtil against momentary SVN.

Comment by Dominik Wenger (Domonoky) - Wednesday, 14 February 2007, 02:30 GMT

i have added a few more checks (macpod ..).
The next steps would be to integrate the installation for the missing players.
Extend the Uninstall to uninstall also the Bootloaders, (where possible).

And Testing, testing, Testing.. :-)

i have updated the Windows binary at:

attached is the newest patch for rbutil
Comment by Dominik Wenger (Domonoky) - Friday, 16 February 2007, 00:42 GMT
again updates :-)

i added support for uninstallation of the bootloader.
reworked the Wizardpages for the Bootloader install/uninstall (better code)

i have updated the Windows binary at:
Comment by Dominik Wenger (Domonoky) - Friday, 16 February 2007, 14:56 GMT

- completly assimilated fwpatcher. (no TChars anymore). So should compile better under Unix.
fwpatcher functions are tested with h120.

Now it only needs bootloader support for H10 and lots of testing.
Comment by Dave Chapman (linuxstb) - Friday, 16 February 2007, 22:58 GMT
I've been testing this on Mac OS X, and it seems to be working well.

Here are some comments:

1) After installing Rockbox or the fonts, I get an "rbutil error" dialog saying that "Rockbox has been installed on your device", even though there were no errors (as far as I can see).

2) The rbutil.ini file contains the wrong URLs for the build and download servers (they shouldn't have www. at the start).

3) The wxBootLocationPage::OnWizardPageChanging() function in wizard_pages() is preventing the installation of ipod bootloaders - I don't think this check should be done for the ipods. Commenting out the content of the function was required for me to install the ipod bootloader.

4) On the main rbutil screen (this is an older bug, I seem to recall it when I first tested rbutil a few months ago), some of the text is truncated. For example, the install button just has the text "Install Rockbox on your". Looking at the code, this seems to be because the text containers are a fixed size, and that size is too small on the Mac (and Linux IIRC).

5) rbutil is looking in /usr/local/share/rbutil/ for the rbutil.ini file. I'm not sure of the ideal location on Mac OS X, but I don't think it's there...

6) The irivertools.h file had a couple of prototypes for functions including the old TCHAR/BOOL types. I just deleted those declarations from the .h file - they are internal functions only used in irivertools.cpp so didn't need defining in irivertools.h anyway.

Just so I don't lose it, I'm attaching my Mac OS X Makefile for rbutil. If anyone else eants to try it on the Mac, you'll need to download wxMac-2.8.0.tar.gz from and do the following:

tar zxf wxMac-2.8.0.tar.gz
cd wxMac-2.8.0
mkdir osx_build
cd osx_build
../configure --enable-universal_binary --enable-shared=no

This builds wxMac as a static library including Universal binary support. There is no need to run "make install" - you can use it locally.

The Makefile.macosx file is copied from one of the wxwidgets sample applications, and is in need of cleaning. To use, you need to manually edit the paths at the top to point to both the rbutil source directory, and various locations in the wxMac source.

You also need the rbutil.r file (again, this is simply copied from a sample application).

Comment by Dave Chapman (linuxstb) - Friday, 16 February 2007, 22:58 GMT
Forgot this file...
   rbutil.r (144.7 KiB)
Comment by Dominik Wenger (Domonoky) - Saturday, 17 February 2007, 18:56 GMT

I tried to fix all Bugs above. But i am not shure if 5) is fixed.
I also reworked the ini file (and the corresponding code), so its better code.

Missing things:
- H10 bootloader support ( dont know how to do it best with MTP and UMS Versions)
- Gigabeat: the new Bootloader isnt on and it needs a bootsplash.raw ?

- Testing, Testing and Testing.

Comment by Dave Chapman (linuxstb) - Sunday, 18 February 2007, 01:17 GMT
I've just tried your latest patch on the Mac, and it's working well - no compile problems, and it's looking for rbutil.ini inside the "" folder - which seems good. Couple of things (as always):

1) I forgot to mention this last time, but the ipod bootloader URL isn't constructed correctly - you're missing the .ipod from the end.

2) After installing either Rockbox or the fonts, I get an error message saying:

"file '/Volumes/DAVE_S IPOD/.rockbox/.rbutil_install_data', line 832: '=' expected."

I'm attaching that file, I hope it helps.
Comment by Jonas Häggqvist (rasher) - Sunday, 18 February 2007, 23:45 GMT
I just tested this (latest patch) on Linux with an Iriver ihp-120, and had only one small problem. The Makefile has not been altered and needs the following added to the OBJS line instaed of the fwpatcher/ objects "irivertools.o md5sum.o".

Other than that, really nice work!
Comment by Dominik Wenger (Domonoky) - Monday, 19 February 2007, 16:52 GMT
Fixed  bug 1 ) (ipod bootloader url)

For 2) this rbutil_install_data is clearly defect. But i dont know how this could happen. On windows i can reproduce this. Does this only happen on MaxOS ?
Please try deleting the file, and try again. The best would be to also try it under Linux. Many thx.

Still Missing:
- New Gigabeat bootloader on
- H10 bootloader install

- Autodetection of the Devices (if can code it :-) )
- Additional tools, like submit.
Comment by Dominik Wenger (Domonoky) - Wednesday, 21 February 2007, 20:12 GMT
Updated again.

- Now supports all Targets (without Sansa)
- Fixed strange error message when installing on Linux