Saturday, 11 September 2010

iPod linux Openiboot struggles! Compile from source step by step

Since the iPhone/iPod touch has just been released I decided to install Openiboot on my Touch
This turned out to be a massive pain as I kept getting loads of errors.
However I manged to do it.
So here are the steps to install openiboot for those having trouble.
For ease I used a Ubuntu live cd and another computer but you could use any distro and probably just one comptuer.

Here is exactly what I did.
 !! The default build-toolchain.sh did NOT work for me some editing was required I will post my version soon !!

STEP 1
Installed msysgit on windows 7
Used this git client to download the git source
"git clone git://github.com/planetbeing/iphonelinux.git"
This will make a directory here C:\msysgit\iphonelinux
I copied the directory to a removeble USB drive.
Go here and save the text as build-toolchain.sh
Assuming "M:\" is your USB drive's letter, save build-toolchain.sh to
M:\iphonelinux\toolchain\build-toolchain.sh
STEP 2
Boot Ubuntu into live CD mode, when the OS has loaded, connect to the internet however you like. Then press CTRL + ALT + F1.
This is where all the work need to be done in the terminal.
Plug your USB drive in and type,
# sudo su
# fdisk -l
Your USB drive will probably be the last entry, something like /dev/sdc1 but might be different.
Now type 
# mount /dev/sdc1 /mnt
# cd /mnt
You are now in your USB drives directory.
STEP 3 
Type
# sudo apt-get install libssl-dev libusb-dev libusb-1.0-0-dev libpng12-dev
# sudo apt-get install build-essential texinfo tofrodos git-core
# cd /mnt/iphonelinux/toolchain
STEP 4
# fromdos build-toolchain.sh
STEP 5
# build-toolchain.sh clean 
(^if that errors it doesn't matter)
# rm /usr/local/bin/arm-elf-cc 
(^if that errors it doesn't matter)
# build-toolchain.sh make
STEP 6
# sudo updatedb && locate libcommon.a
Not sure if this was required but I did it,
copy the libcommon.a from /iphonelinux/openiboot/mk8900image/x86/libcommon.a to /iphonelinux/openiboot/mk8900image/libcommon.a
with this command
# cp /mnt/iphonelinux/openiboot/mk8900image/x86/libcommon.a /mnt/iphonelinux/openiboot/mk8900image/libcommon.a
**for x64 bit systems, the path is x86_64 instead of x86
STEP 7 
# cd /iphonelinux/openiboot/
iPod touch >
# PLATFORM=IPOD make openiboot.img3
iPhone >
# PLATFORM=IPHONE make openiboot.img3
iPhone 3G
# PLATFORM=3G make openiboot.img3

STEP 8
# cd client
# make all
# cd ..

STEP 9

Your iProduct must be in recovery mode for this to work
Turn your iPod/phone off, press and hold the home key, and plug the connector into it, it should now show an iTunes logo (or Steve jobs depending on what jailbreak you used)

STEP 10

# client/loadibec openiboot.img3
Your iPod/phone should now be showing the openiboot screen
Press the power button once to move the selector to the Console icon (middle one)
Press the Home button.
Back to the computer,
Type
# sudo client/oibc
You should now see "WELCOME TO OPENIBOOT" on your computer and your iPod/Phone

STEP 11

Now in this program type all this out
# nor_read 0x09000000 0x0 1048576
# ~norbackup.dump:1048576
# install

DONE

You should now have openiboot installed!

I wrote this pretty quickly and it probably contains spelling errors.
The reason was I kept getting an annoying error when trying to install openiboot with the precompiled binaries.
"uploaded failed : 0xffffff92" be gone!
You can find my build-toolchain.sh here
More info


4 comments:

  1. whoa, good to know

    please disable your captcha

    ReplyDelete
  2. Apple and Open source...Like oil and vinegar and not as useful.

    Good job documenting the insanity!

    http://artistsupplyreview.blogspot.com/

    ReplyDelete
  3. iproducts are not very friendly to other software :(

    ReplyDelete
  4. Why not just install a virtualbox and avoid all this pain in the ass.

    ReplyDelete