iPod Mini in 2021 with Rockbox

◷ 10 min read

✏ published 2021-03-14

Jack Leightcap

Contents

- Why?

- How?

- Hardware

- Software

- Building Rockbox From Source, Installing Manually

- Building Rockbox Source

- Note about Original Apple Firmware and Bootloader

- Setting up Partitions

Why?

A couple reasons:

How?

Hardware

Disassembly is listed as "Moderate" difficulty by iFixit — the only real risk is bending the aluminum shell or scratching the plastic.

iPod with 512 GiB

Beware that fake SD cards lead to fairly transparent issues! The 512GiB SD card that Rockbox recognizes in that picture turned out to be very fake, and in fact only had 32GB of storage space. This manifests as filesystem corruption when writing music past the actual memory limit. I've replaced with a 200GB genuine SD card that has more than enough room for me.

To test actual limits of flash memory,

; f3probe --destructive --time-ops /dev/sdb

The limit on SD card size is hypothetically 2TB, an inherent limit of the FAT32 filesystem used.

Software

I'll start out with the method that demonstrates just how easy it easy to get Rockbox installed. Grab Rockbox Utility from the download page, just plug in the iPod, and the Rockbox GUI installer takes care of everything. Reboot the iPod and voilà, Rockbox will flash itself, and you're good to go.

iPod playing music

Upload music just like you'd move music to a flash drive. Done!

Building Rockbox From Source, Installing Manually

Now for the more involved method. The goal here is to build all the software that runs on the iPod from source.

Being open source, any issues or tweaks with Rockbox can be investigated and patched in the source code. Building from source and flashing manually is also a great way to get more granular control over the final installation.

NOTE: the chance of bricking the iPod are near zero; but the official Rockbox documentation should be consulted. These steps are just my best effort at piecing together multiple sources and guides into a coherent process.

Building Rockbox Source

; git clone git://git.rockbox.org/rockbox.git

The Rockbox repo comes with a tool to build toolchains from source; here, we'll just build the necessary ARM toolchain. This includes source patches for gcc-4, so caution if you think you can skip around this stage.

; cd rockbox/
; ./tools/rockboxdev.sh --prefix=/opt/rockbox/ --target=a
; PATH=$PATH:/opt/rockbox/bin/

Now we have the arm-elf-eabi toolchain set up. Building the pieces for Rockbox now,

; mkdir build-ipod && cd build-ipod
; ../tools/configure --target=ipodmini2g --type=N
; make
; make zip

Now have rockbox.ipod and rockbox.zip.

Note about Original Apple Firmware and Bootloader

This set up won't use the original Apple Firmware. This is optional, see the Rockbox documentation for how to include the original Apple firmware in an effective "dual boot" with Rockbox.

The benefit of this manual configuration is we get the choice of depending on the original Apple firmware. My understanding is Rockbox can piggyback on the Apple firmware for a USB mode with faster write speeds, and this "dual booting" also provides a fallback in case Rockbox corrupts itself.

In the spirit of "from scratch" and open-source-ness, I won't be including the Apple firmware.

Note that there's still some effectively untouchable proprietary software running on internal flash. This just provides some debug modes and jumps to whatever firmware is setup on disk.

Setting up Partitions

To put these built files somewhere we need to format our empty SD card. I'll use fdisk; note this requires the use of the DOS compatibility mode. For the rest of this post, assume $BLKDEV is the appropriate iPod USB device (/dev/sdb, for example). Please double check before writing over anything!

; sudo fdisk $BLKDEV

Welcome to fdisk (util-linux 2.36.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m or help): c

DOS Compatibility flag is set (DEPRECATED!)

Command (m for help): n
Partition type
p   primary (0 primary, 0 extended, 4 free)
e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1):
First sector (63-384503806, default 63):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (63-384503806, default 384503806): +32M

Created a new partition 1 of type 'Linux' and of size 32 MiB.

Command (m for help): n
Partition type
p   primary (1 primary, 0 extended, 3 free)
e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (65600-384503806, default 65600):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (65600-384503806, default 384503806):

Created a new partition 2 of type 'Linux' and of size 183.3 GiB.

Command (m for help): t
Partition number (1,2, default 2): 1
Hex code or alias (type L to list all): 0
Type 0 means free space to many systems. Having partitions of type 0 is probably unwise.

Changed type of partition 'Linux' to 'Empty'.

Command (m for help): t
Partition number (1,2, default 2): 2
Hex code or alias (type L to list all): b

Changed type of partition 'Linux' to 'W95 FAT32'.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

The partitions are now set up correctly on the disk.

First, copy over rockbox.ipod onto the "firmware partition" (first, smaller partition without a filesystem):

; sudo dd if=build-ipod/rockbox.ipod of=$BLKDEV1
; sync

Now, the actual Rockbox application;

; sudo mount -o uid=1000,gid=1000 $BLKDEV /mnt
; unzip rockbox.zip -d /mnt/
; umount /mnt/
; eject $BLKDEV

Reboot, give it a moment, and that's it! Rockbox built entirely from source.

You can add music to a new Music/ directory, or just throw anything in the base directory.