Sony Playstation 3
Sony Playstation 3 is a home theater personal computer (HTPC) class device which acts as a multimedia frontend in living room. It's an open platform computer in which Gentoo Linux can be installed using documentation found on this page.
This article intends to be an up-to-date installation/configuration Gentoo guide for the PS3. The documentation found for this purpose is very old and deprecated and should not be used nowadays.
- 1 Old articles
- 2 Getting started
- 3 Preparing the PS3
- 4 Getting the installation media
- 5 Getting a stage3 and a Portage snapshot
- 6 Disk partitionning
- 7 Make.conf
- 8 Kernel
- 9 kboot.conf
- 10 fstab and using the gpu's RAM as swap
- 11 Cross-compiling
- 12 PPU and SPU toolchain and utilities
- 13 After installation
- 14 PS3 Overlay
- 15 Troubleshooting
There are several web pages explaining how to install Gentoo on the Sony PS3. However, those are mostly deprecated.
Your installation of Gentoo should follow three main steps:
- Prepare PS3 for the installation of other OS and partition hdd using the tools provided by Sony.
- Install Gentoo as you would do it on any other hardware.
- Install PS3-related packages.
Preparing the PS3
First of all, you must prepare the PS3 for the installation of another OS. The most recent bootloader for the PS3 is Petitboot, which can be found here: http://ozlabs.org/~jk/projects/petitboot/. To format your PS3 and install Petitboot, follow the instructions on this website. You can also use more recent development petitboot builds here: http://www.kernel.org/pub/linux/kernel/people/geoff/cell/ps3-petitboot/.
Getting the installation media
To perform the installation, you need a LiveCD to boot up. Gentoo PPC CDs booting on the PS3 are quite old and do not support some technologies such as ext4. You can use any other distro's PPC/PS3 LiveCD. You can also use an old but working Gentoo/PS3 LiveCD, which can be found on any gentoo mirror under experimental/ppc64/installcd-ps3-minimal[...].
Getting a stage3 and a Portage snapshot
Get the latest ppc64 Gentoo stage3 from in releases/ppc/current/ on any Gentoo mirror. See the Gentoo PowerPC installation documentation for more information and a list of mirrors. You can choose to use a 32-bit userland or a 64-bit userland. Choose the stage3 that fits your needs.
The way of getting the portage snapshot is the same than this manual. Get the stage3 and the snapshot, and put those two files on a USB stick.
Format your hard disk the same way you would for any other Gentoo installation. As the PS3 has only 512 Mib of RAM, you should create a pretty big swap partition (up to 1 Gib), just in case. A boot partition isn't necessary.
Note here that this configuration is accepting ~ppc64 keywords so this system may be unstable, but the packages will be more bleeding-edge.
WARNING: If you use an old LiveCD, do NOT perform any upgrade now. Wait until you have a recent kernel and booted it. Upgrading glibc will break python (and emerge is programmed in python). See bug 271367
|Code: Build the kernel (64-bit userland)|
# cd /usr/src/linux # make ps3_defconfig # make menuconfig Add here what you need... For example, the default config file may not have the USB keyboard and mouse support, and ext2 and ext3 filesystems are compiled as modules (so you won't be able to boot a ext3 partition). You may also need to add the VGA text console support. If you plan to run a GUI, it is suggested to change the preemption model from Server to Desktop. # make && make modules_install # cp vmlinux /boot/vmlinux-kernelversion
For a 32-bit userland, you need the package kgcc64 which provides a 64-bit cross-compiler.
|Code: Build the kernel (32-bit userland)|
# cd /usr/src/linux # make ps3_defconfig # make menuconfig Add here what you need... For example, the default config file may not have the USB keyboard and mouse support, and ext2 and ext3 filesystems are compiled as modules (so you won't be able to boot a ext3 partition). You may also need to add the VGA text console support. If you plan to run a GUI, it is suggested to change the preemption model from Server to Desktop. # CROSS_COMPILE="powerpc64-unknown-linux-gnu-" make && make modules_install # cp vmlinux /boot/vmlinux-kernelversion
If you want an optimized kernel (and you have gcc >= 4.4.0), you may add the following in front of the make command:
|Code: Build an optimized kernel (gcc 4.4.0 or higher)|
Petitboot needs a config file if you want it to boot your Gentoo installation. It doesn't seem to find the /boot/petitboot.conf file, so let's name it /etc/kboot.conf to avoid problems. Here is an example:
fstab and using the gpu's RAM as swap
The PS3 comes with only 256 Mb of RAM, but you can add the 256 Mb of the gpu's RAM as a high-speed SWAP. The device is named /dev/ps3vram
Adjust this file to reflect your system. (partitions, filesystems, etc).
After your first boot, create the swap filesystem on /dev/ps3vram using mkswap /dev/ps3vram. You can manage you different swaps and give priority to the vram using swapon.
When using the PS3 using the Game OS, it will destroy the swap filesystem on dev/ps3vram. You may add this file to ask udev to re-create the swap filesystem at each boot:
As the PS3 cpu isn't very fast for compiling, you should use distcc to cross-compile on another machine. Note that you need the same GCC version on all the machines used to cross-compile. More information about distcc and cross-compilation is found here : http://www.gentoo.org/doc/en/distcc.xml
PPU and SPU toolchain and utilities
You already have the PPU toolchain, as this is what you built your system with. Using crossdev to get the ppu toolchain is deprecated.
In order to get a working toolchain for the SPUs, you may use crossdev. The result will be the same (but the Gentoo-way) of getting the IBM Cell SDK's SPU toolchain, but have different names for the GCC binaries.
|Code: SPU toolchain|
# emerge crossdev # crossdev -t spu -s1 --without-headers # see bug [http://bugs.gentoo.org/show_bug.cgi?id=259144 259144] # crossdev -t spu
You should also want the libraries and utilities for the SPUs:
|Code: SPU utilities|
# emerge libspe2 # emerge spu-tools
Let's assume, the Playstation is running its native OS. To boot another OS, go to Settings/System Settings/Standardsystem and select "other system". The Playstation will reboot, and the installed other OS will boot, here Gentoo.To switch back to the PS3 native OS, execute under gentoo or at the kboot prompt.
There is an unofficial overlay which provides a video driver for the PS3 using the SPUs. The article Overlay article explains how to add it.
The system does not boot
If your system doesn't boot and you see : "Warning: unable to open an initial console", boot the LiveCD, mount your partition, chroot, go in /dev (do not mount liveCD's /dev) and create the console node with:
|Code: Creating the console node|
mknod -m 660 console c 5 1