iPhoneLinux on the Mac

INFO: This post is now slightly irrelevant and does not work very well, so I wouldn’t recommend using it.

DISCLAIMER: This is recommended for advanced users only. It is probably a bad idea to follow this tutorial if you’ve never opened Terminal before. That being said, this should be relatively easy for most power users.

DISCLAIMER²: Neither I nor the iPhoneLinux team are responsible for any damage to your iPhone through the use of this tutorial. The tutorial does, however, contain a guide on how to back up your NOR just in case something does go horribly wrong (which is extremely unlikely).

The iPhoneLinux team has recently come up with an impressive demo of Linux on the iPhone. Unfortunately, the binaries and instructions included are Linux only. When it came out, I was able to modify the client slightly to allow OpeniBoot to be installed and used from a Mac, and as a bonus I removed the root requirement. Anyway, I just compiled the most recent client build and I’d like to share it with you! I have not yet been able to build OpeniBoot myself, which means we’re stuck with a slightly old build (no file system writing) UPDATE: I was just able to build OpeniBoot myself, but the client cannot seem to connect to it… we’ll have to stick to this for now.

Soon-To-Be Frequently Asked Questions:

- What will this work on?

The original 2G (1G) iPhone, the new iPhone 3G, and the original iPod touch first generation. This will NOT work on the second generation iPod touch (with speakers and volume control) If you need help finding out which iPod touch you have, visit Apple’s support site.

- I hate using a boot menu on startup and Linux sucks. How can I get rid of this?

Launch the OpeniBoot client in Terminal and on the iPhone and run the ‘uninstall’ command. Once it reports that is is done, run ‘reboot’, and you should boot right to the Apple OS.

- Who made this awesomeness??

The awesome iPhoneLinux dev team, lead by planetbeing and other dev team members (but not directly affiliated with the iPhone dev team).

- What is this going to change about my phone/iPod?

It will add a boot menu whenever you turn on, and add the capability to boot Linux kernels on your iPhone via the console.

- What can I do in Linux? Does it support Wi-Fi? How many games can I play?

Linux is currently at a demo-only stage, once it’s booted, all you can really do is use a terminal from your computer. You can’t yet use the multitouch screen to interact in any way, and you can’t yet use WiFi. However, it’s pretty cool to any geek, and the team is working hard on new and exciting features in the form of drivers.

- Help! My iPhone won’t boot!

If your iPhone won’t boot after installing OpeniBoot, it’s likely you need to launch the console again and run “setenv auto-boot true” and then “saveenv”. If it still boots to recovery, you may need to uninstall OpeniBoot as above and then restore your phone.

- What else can I do in the OpeniBoot console?

Not much, but there’s some cool stuff. Type ‘help’ for all of the commands. You can mess around with most of it, just avoid things that seem like they’d change something like anything having to do with “write”, especially the NOR. I don’t know what a lot of the stuff does, but basically anything UNDER nor_erase is fair game (and pretty self explanatory), plus the stuff at the top. If you need to know the syntax of a command, just type the command with no arguments. Examples: Change the display color with “bgcolor 0 200 0″, list the files in your root with “fs_ls 0 /”, or find your battery voltage with “pmu_voltage”.

- Does my iPhone need to be jailbroken to use this?

No, this is much lower level than a jailbreak and you can try out OpeniBoot with no jailbreak.

EDIT: As Will (ChronicProductions) points out in the comments below, you do need to have used PwnageTool or QuickPwn to be able to do this. No wonder I was having so much trouble on my virgin iPod touch ;) You can find PwnageTool and QuickPwn from the iPhone Dev Team’s blog.

- Will this break my phone?

Probably not, it is highly unlikely something bad will happen. However, to stay on the safe side, don’t touch any OpeniBoot commands if you don’t know what they’ll do (especially ones that have to do with the nor), and back up your NOR as described below in the installation process.

- ?????????

If you have another question, feel free to ask in the comments!

Without further ado, you can download the necessary files here.

OpeniBoot set-up:

1. Open Terminal and navigate to the iphonelinux-mac directory by typing “cd ” (note the space after cd) and then dragging the iphonelinux-mac folder to the Terminal window and pressing return.

PLEASE NOTE: While you no longer have to be root to use these utilities, you DO need to be in an Administrator account. If you know the password of an administrative password but do not want to switch users, type “su THENAME” where THENAME is replaced with the administrative user account. You will be prompted for your password. Although you do not see dots or asterisks appearing as you type, it IS recognizing your password. Do not be alarmed if nothing happens while you are typing.

2. Put your iPhone/iPod into recovery mode. If you need help with this, visit http://www.iclarified.com/entry/index.php?enid=367

3. In your terminal window, enter “killall iTunes; killall iTunesHelper” and press return. This will avoid iTunes messing with your phone. If you want iTunes’ autosync feature back, simply restart your computer (or log out and back in) You will need to have the USB libraries before you can use loadibec, so copy them by running “sudo cp libusb.dylib /usr/local/lib/libusb-0.1.4.dylib”. Once again, you will be prompted for your password. Nothing will appear while you are typing it, but it IS registering. Press return when it is complete.

4. Load OpeniBoot onto your phone by typing “./loadibec openiboot-” followed by 2g.img3 if you’re on a first generation iPhone, 3g.img3 if you’re on an iPhone 3G, or ipod.img3 if you’re on an iPod touch (first generation only!). Hit return. If this returns nothing, try restarting your iPhone and trying again.

5. Sit back and admire poorlad’s pretty interface on your iPhone. This will be your new boot menu.

6. In your Terminal window, type “./oibc” but do NOT hit return yet. Press the power button so that OpeniBoot console is selected, and press the home button to enter it. While the text is still scrolling, press the return button to enter the OpeniBoot client. This may take several tries, you can’t press return too early or too late or it won’t work. I have to do it several times to get it going.

7. We will now take a backup of your iPhone’s NOR memory to avoid disaster. In the OpeniBoot client, type “help” just to make sure everything is working. You should see a long list of commands. Now type “nor_read 0×09000000 0×0 1048576″ to read it into memory, and press return. Wait for it to return “Done.”. Then type “~norbackup.dump:1048576″ to send the file to your computer. You might want to keep this file safe, just in case.

8. Install OpeniBoot! Type “install” and wait for the install complete message. Once it’s done, enter “reboot”.

9. Now we’re going to upgrade to the latest version of OpeniBoot I have. We can’t install this directly, as it appears to be some sort of upgrade-only version. Enter the OpeniBoot console just as you did before (although the timing is much easier now), and send the updated OpeniBoot with the command “!openiboot-THEDEVICE.bin” where THEDEVICE is replaced with 2g, 3g, or ipod. Run “go 0×09000000″ to launch it.

10. Once again, type ./oibc into Terminal and launch the console from the iPhone and quickly hit return in the Terminal to connect.

11. Type “install” to upgrade, and wait for the done message. To make the Apple OS boot properly, type “setenv auto-boot true” and hit return. (This is case sensitive, as I learned the hard way. My phone wouldn’t boot without a manual fsboot for a day until I realized I was typing TRUE instead of true) Then use “saveenv” and wait until you see “Environment saved”. Then “reboot” and you’re in a newer version of OpeniBoot! To boot into the iPhone OS, just press the home button.

Linux time!

It’s finally time to run Linux! Follow the steps below.

1. Once again, enter the console. I’m sure this is becoming second nature to you by now.

2. Now we’re going to send over the files required for Linux to boot, the kernel and userland. To send over the kernel, run “!zImage”. Then place it in memory with “kernel”. Send the userland with “!rootfs.arm.ext2.gz” and place it in memory with “ramdisk 3588″.

3. Time to boot! Run ‘boot “console=tty console=ttyUSB root=/dev/ram0 rw”‘ Linux is now booting!

4. Your oibc session will close. Run ./linux to communicate with Linux. You can log in with either the username ‘root’ or ‘default’.

5. If you’d like to see what you’re typing on your iPhone’s screen, run “sh 2>&1 > /dev/tty0″.

Mess with Linux! To reboot, run ‘reboot’.

FINAL NOTE: If you have any questions, read the full FAQ before asking. This tutorial was derived from planetbeing’s original tutorial from ORIGINALREADME in the archive you downloaded. The README file was distributed with the upgrade package, which added the uninstall feature.

Popularity: 10% [?]

This entry was posted in iPhone. Bookmark the permalink.

51 Responses to iPhoneLinux on the Mac

  1. Emelia says:

    I’m thankful to get a call from a friend as he revealed the important tips shared
    on your site. Exploring your blog post is a real
    outstanding experience. Many thanks for taking into consideration readers like me,
    and I wish you the very best.

    Review my webpage :: get rid of acne scars [Emelia]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>