Home arrow Info pages arrow PS3 arrow Creating PS3 toolchains on Gentoo
Installing a Gentoo stage4 tarball on the PS3 PDF Print E-mail
Written by Administrator   
Saturday, 09 December 2006

After I made my original guide to installing Gentoo on the PS3, I made a tarball available of my install for people who wanted to dive straight in - but also  people new to Gentoo have been using it so this is a guide based on my original, but for installing a user made stage4 tarball instead of a normal stage3 install.

 

Needed Items

To make the install, there are a number of items you need:

A Playstation 3

Doh!

A Screen

I did my install on a TV as I'm waiting on a cheap HDMI to DVI cable to turn up. On a standard decent quality TV the text in kboot is very readable.

A USB keyboard

Annoyingly my PS2 Linux kit keyboard didn't work with kboot, so if you have a problem with "sticky" keys find another keyboard.

otheros.self

The "other OS" installer from Sony, which you can download at: http://www.playstation.com/ps3-openplatform/index.html

The "Addon Packages CD"

A collection of items needed for a linux install, including some good doc's, you can get this from: http://dl.qj.net/PS3-Linux-Addon-Disc-PlayStation-3/pg/12/fid/11308/catid/514

The "Addon Packages source CD"

The source code for the contents of the "Addon Packages CD" - most importantly for us, pre-patched kernel source. http://dl.qj.net/PS3-Linux-Addon-Disc-Source-PlayStation-3/pg/12/fid/11310/catid/514

A Gentoo PPC64 Stage 4 tarball

I've made one available, best to look on the Gentoo forum for information about the latest available:

http://forums.gentoo.org/viewforum-f-32.html?sid=733526f096adf57385c9b417d1719471 

A Gentoo portage snapshot

Again, best to get this from a local mirror, I got mine from: http://gentoo.blueyonder.co.uk/snapshots/portage-latest.tar.bz2

 

Preparing for installation

The first task is to put the installer and bootloader onto a readable medium. The easiest way to do this is to use a USB stick. You need two files, the "other OS" installer called otheros.self, and the bootloader kboot called otheros.bld.

It seems that Sony's idea is that different distributions can create their own kboot packages complete with scripts to install their specific distribution. As the Gentoo install is a manual process, we can cheat and use someone else's kboot, and the easiest one to get hold of is the one for installing Fedora Core 5, and that is on the "Addon Packages" cd image, a file called otheros.bld in the folder kboot.

On a USB stick, make a directory called PS3, and in that directory another directory called otheros. Then copy  otheros.self and otheros.bld into the otheros directory.

Also, if your USB stick is big enough, copy the stage 4 tarball and the portage snapshot onto it  - if there isn't enough space you could burn them to a cdrom/DVD.

 

Setting up the Playstation3

Before you continue, make sure your PS3 has been updated to the latest firmware.

The first step is to partition your hard disk. Be aware that the process will destroy any save data on the PS3 HD, so back them up! The following is copied directly from the SCE install documents:


Creating a Linux partition 

1) Turn on the PS3. After initializing, you can see GameOS menu.  You select "Settings -> System Settings".
2) After selecting "Format Utility" from sub menu, following messages are displayed.

Format Memory Stick
Format SD Memory Card
Format CompackFlash
Format Hard Disk

To allocate a Linux partition on the Hard Disk, select "Format Hard Disk".

3) After following message is displayed. you select 'Yes'.

Do you want to format the hard disk?

Yes No

4) After following message is displayed. you select 'Yes'.

If you format, all data on the hard disk will be deleted.
This data cannot be restored.
Are you sure you want to continue?

Yes No

5) You can see following message.

Select a partition setting for the hard disk.

Use All for the PS3 System
Custom

To allocate a Linux partition on the Hard Disk, select "Custom".
After selecting "Custom", following messages are displayed.

Select a partition setting for the hard disk.

Use All for the PS3 System
Allot 10GB to the Other OS
Allot 10GB to the PS3 System

To allocate a Linux partition on the Hard Disk, select one of following items.

Allot 10GB to the Other OS
Allot 10GB to the PS3 System

If your hard disk size is 20GB, you have to select 'Allot 10GB to the Other OS'.

6) After selecting the item, format process is started.
7) After creating a Linux partition, following messages are displayed.

Format Complete.
Press the X button to restart the system.

After pressing the X button, restart the system software and you can see GameOS menu.


 

The only thing I need to add to that is that the two games I've installed to my PS3 HD take over 4GB each, so you would be better off keeping the larger partion for the GameOS if you have a 60GB drive.

Installing the bootloader(kboot)

The process of installing the bootloader is pretty simple, and is done though the PS3's menu's. Insert the USB stick containing the bootloader into the PS3. Go to the System settings menu, and then find the sub menu called "Install Other OS" and follow the instructions. If there is an error, check the folder structure on the stick.

If there are no errors, congratulations, you are now ready to boot your PS3 with kboot! 

Kboot first steps

To boot up with kboot, first go to the System settings menu of the GameOS, and then choose the sub menu "Default System" - choose  "Other OS".Now when your PS3 boot's it will use kboot instead of the GameOS -to return to booting the GameOS if you quit the Gentoo install before finishing, type the command "boot-game-os" in kboot to change the boot settings.

Now shutdown your PS3, plug in the USB keyboard, and restart.

If you have done above correctly, after the kboot boot process, you should have access to a command prompt. Kboot is a simple bootloader, and includes a rescue mode with BusyBox, meaning we have access to nearly all the commands we are used to during a normal Gentoo install. To get away from the Kboot prompt, and to see our old friend BusyBox's welcome, just type sh.

Creating the Linux partitions

You can go crazy with multiple partitions, but I wanted to keep my first test install simple, and with no need of a boot partition, I created just two, swap and root. If you don't know how to use fdisk, see the wonderful Gentoo install handbook.

The Fedora Core install seems to use 512MB for swap, and that size makes sense, so my final partition layout is:

Disk /dev/sda: 10.7 GB, 10737414144 bytes
64 heads, 32 sectors/track, 10239 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         489      500720   82  Linux swap / Solaris
/dev/sda2   *         490       10239     9984000   83  Linux

Note that the PS3 drive is /dev/sda!

Now we are all used to fdisk whining at us after changing the partion table during an install, that we should reboot the system to "ensure the partition table is updated" - and we ignore it! Well it seems that at this point the PS3 doesn't re-read the partition table so the simpliest solution is to just reboot and then continue with the installation.

Next up, you need to format the root partion.

# mkfs.ext3 /dev/sda2

Kboot doesn't seem to have mkswap so just wait until you have chrooted into Gentoo and set up the swap partition then. Then mount /dev/sda2 as in a normal Gentoo install

# mkdir /mnt/gentoo
# mount  /dev/sda2 /mnt/gentoo

Installing the tarball

We need to copy over the Stage 4 tarball and the portage snapshot to the PS3 drive. So just mount the USB stick (or the cdrom if you burn one)

# mount /dev/sdd1 /mnt/tmp
# cp /mnt/tmp/myTarBall.tar.bz2 /mnt/gentoo
# cp /mnt/tmp/portage-latest.tar.bz2 /mnt/gentoo

Obviously substitute the name of the tarball you obtained for "myTarBall.tar.bz2" above.

And now we just need to decompress them 

# cd /mnt/gentoo
# tar xvjpf myTarBall.tar.bz2
# tar xvjf /mnt/gentoo/portage-latest.tar.bz2 -C /mnt/gentoo/usr

CHROOT'ing to Gentoo

Before we chroot, we need to copy over resolv.conf to our new install: 

# cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf

And then mount the proc filesystem

# mount -t proc none /mnt/gentoo/proc

Normally we would also bind /dev, however people have been having issue's with -o bind and mount and kboot, and for this quick install we don't really need it. If I am making some kind of horrible error by not doing this get in touch:)

And finally chroot as normal:

# chroot /mnt/gentoo /bin/bash
# env-update
>> Regenerating /etc/ld.so.cache...
# source /etc/profile

Congratulations, even though just a chroot you are in Gentoo on a PS3! 

Next up, sync portage:

# emerge --sync

Label /root

# e2label /dev/sda2 / 

 And set up the swap partition

# makeswap /dev/sda1
# swapon /dev/sda1
You probably want to set the root password of your new install:
# passwd

Finally as we are using Kboot as our bootloader, it needs a config file, /etc/kboot.conf, you should already have one from the tarball, but you should check that the partitions are set as you have created them. So for the partition scheme above you need a kboot.conf that looks like:

default=linux
timeout=10
root=/dev/ram0
linux='/boot/vmlinux real_root=/dev/sda2            initrd=/boot/initramfs-genkernel-ppc64-2.6.16'

 ***Note that the html formatting on this webpage has split the last line above***

Finishing the install

That's the install finished, but you should also check /etc/conf.d/net to make sure the networking setup fits your environment - if it is blank it will use dhcp.

And then thats it. Type "exit" to leave the chroot, and then "reboot" to reboot your PS3. When the PS3 has rebooted to kboot, wait 10 seconds and then it should start booting Gentoo!!!

 

 

Last Updated ( Saturday, 09 December 2006 )
 
< Prev   Next >