Installation from Mac

From wikiPodLinux

NOTE: this procedure is only supported for 1G, 2G, and 3G iPods. All other iPods are unsupported.

Clarification: The above Unsupported exclamation only applies to 4G, 5G, Mini and Nano iPods. If you have a 1G, 2G or 3G iPod, you will not get in trouble for asking clueless questions.


Table of contents

Overview

This section of the guide details how to install Linux on your iPod (1G to 3G) using a Mac OSX based PC. To use this portion of the guide your iPod must be formatted with the HFS+ filesystem (this is the default for Mac-iPods). There are currently two available methods to install linux on Mac-iPods :

  • The other method of installation is via the command line. The instructions for this method are as follows below.

Locating your iPod

With OSX your iPod should be automatically mounted when you plug it into your Mac. To determine the device name:

Start the Terminal application, and run the mount command.

# mount
/dev/disk1s3 on /Volumes/iPod (nodev, nosuid, mounted by leachbj) 

The /dev/disk1s3 portion indicates the iPod is the second SCSI device (counting starts at 0, your HDD is probably disk0) and so will be visible as /dev/disk1, if on your system you see /dev/disk2s3 then your iPod would be using device /dev/disk2. In the above example the volume is mounted as /Volumes/iPod. The iPod portion will be the name of your iPod.

The following example commands will use disk1 as the device for the iPod and /Volumes/iPod for the mount point, please replace these with the corrects values for your configuration.

Visual example: (in this case my iPod is disk3)

Image:1step.png

Backup

The backup file is a complete backup of the operating system partition on the iPod and includes the Apple iPod operating system (this file is about 40MB and can be compressed once the installation process is complete).

# dd if=/dev/disk1s2 of=ipod_os_partition_backup

Should you need to restore the backup for any reason simply use the following command.

# dd if=ipod_os_partition_backup of=/dev/disk1s2

Note, if you want to upgrade the Apple firmware then you should firstly restore the iPod operating system backup.

It is also possible to completely restore your iPod to its factory state by using the restore program from Apple. This will restore the original operating system to your iPod. Unfortunately this will mean any settings or music will have to be copied back to your iPod.

Kernel Installation

To install the kernel you need the iPod Boot Loader (https://sourceforge.net/project/showfiles.php?group_id=73079&package_id=101451), a version of the iPod Linux Kernel (https://sourceforge.net/project/showfiles.php?group_id=73079&package_id=73283) and the iPod operating system backup created earlier in the backup process.

Firstly extract the ipodloader and iPod Linux kernel archives into a working directory and check for any last minute release notes. In the examples below the make_fw tool and loader.bin file are from the ipodloader distribution and the iPod Linux kernel version is uclinux-2.4.24-ipod0.bin.

1. Extract the Apple OS from the backup image.

# ./make_fw -o apple_os.bin -e 0 ipod_os_partition_backup

If you have a 5G (video) iPod, you need to execute this command as well:

# ./make_fw -o apple_sw_5g_rcsc.bin -e 1 ipod_os_partition_backup

2. Create a new image including the Linux and the Apple OS.

To boot into Linux by default, and Apple OS by holding down Rewind, use this command:

# ./make_fw -o my_sw.bin -l uclinux-2.4.24-ipod0.bin -i apple_os.bin loader.bin 

To boot into Apple OS by default, and Linux by holding down Rewind, use this command:

# ./make_fw -o my_sw.bin -i apple_os.bin -l uclinux-2.4.24-ipod0.bin loader.bin

Note: if you are using a more recent version of make_fw, you may have to add the -g option to the command - if that's necessary you will get a "usage" output from the tool.

3. Copy the new image (which is about 4-5 MB in size) back to your iPod.

# dd if=my_sw.bin of=/dev/disk1s2

4. Copy the kernel modules onto the iPod. The lib directory below refers to the directory from the kernel release and contains the modules directory.

# cp -r lib /Volumes/iPod

Userland Installation

The iPodLinux Userland contains the operating system tools and libraries (including podzilla). Download ipod_fs_240206.tar.gz (http://so2.sys-techs.com/ipod/ipod_fs_240206.tar.gz). This archive should be installed on your normal iPod filesystem.


Extract the root filesystem onto the iPod.

# cd /Volumes/iPod
# tar zxpf /tmp/ipod_fs_240206.tar.gz

1. Update the root filesystem with the latest kernel modules.

# tar zxf /tmp/uclinux-2.4.24-ipod0.tar.gz lib

Finishing up

1. Eject your iPod. Drag your iPod disk icon to the trashcan to unmount and disconnect the iPod. Once unloaded your iPod will either reboot automatically or display the "OK to disconnect." message. 2. Reboot your iPod. If the iPod did not automatically reboot hold down the menu and the play/pause buttons for 3 seconds to reboot it (on newer iPods, that's Menu + Selection buttons instead).

Using the configuration above on reboot your iPod will automatically start Linux. You should see the Tux logo and then the normal Linux boot console messages will scroll by. Once the operating system is booted the Podzilla application will start. This work-in-progress interface mimics the Apple interface.

When you are finished with Linux you can reboot the iPod again by using the same buttons as above. When the Apple logo appears hold down the rewind button to start the Apple firmware.

Upgrading

  • To upgrade to a new version of the kernel simply repeat the process in the Kernel Installation section.
  • To upgrade to a new version of the user tools simply repeat the process in the Userland Installation section.
  • To install a new version of podzilla simply copy the new podzilla binary to your iPod:
# cp podzilla /Volumes/iPod/sbin

Uninstalling iPod Linux

To completely remove Linux from your iPod you should restore the original firmware partition from your backup.

# dd if=ipod_os_partition_backup of=/dev/disk1s2

Additional Modifications

Some programmer types may wish to do additional modifications to this basic setup. These modifications are unsupported. You should not do these unless you know what you are doing. If you're still reading this, then you probably have XCode installed on your Mac, and you know your way around the command line more than just typing in commands like a keyboard monkey.

One thing that some people might want to do is to hide the Linux folders. Unfortunately, simple solutions like using a ".hidden" file won't work, since OS X only refers to these files on boot volumes. The way that we need to hide the directories is to set their invisible/hidden bit. In order to do this, we need to use the XCode/Developer tool called "SetFile". Change to your ipod directory, and run this command, setting the inVisible bit on the directories.

# cd /Volumes/iPod
# /Developer/Tools/SetFile -a V sbin lib mnt proc sys dev etc tmp usr var home
# /Developer/Tools/SetFile -P -a V tmp bin

It is recommended that you look at the man page for SetFile for more information.

The third line hides symlinks like "bin". Another option, since "sbin" is pretty small, is to duplicate the directory and replace the symlink, if you wanted to. If you would like to get setfile, but would rather not install the developer tools, you can get setfille from [corz.org (http://corz.org/osx/su/setfile.php)]

Views
Personal tools