Ubuntu Linux and Symfony on a PlayStation 3
As said previously on this blog, I now work at Splitgames.com, a company based in Paris, France providing services to gamers where I manage the development of our web projects. We use Symfony as a framework on which to base our projects. Of course, we play quite a bit of video games, have a few console systems laying around and I was wondering about how to bridge this two interests. By the way, if you like video games and Symfony we do have a few openings in our office in Paris. Email me if you are interessed at jobs@splitgames.com.
On my right I had a Playstation 3, on my left I had Symfony, the missing link would prove to be Ubuntu Linux.
Note: Running linux on a playstation 3 is not a hack, it doesn’t require any hardware modification, won’t disable any feature on your Playstation 3 and is not difficult to do.
Sony officially support running linux on your ps3 with dedicated tools present in the XMB ( Cross-mediabar, the UI of the Playstation 3).
Caveat: for installing Linux, you will need to format your hard-drive thus losing all the data on it. Fortunately, Sony made a backup utility so you can backup your game’s save data, game demos and other files very simply.
What’s needed ?
- A CD-R ( or DVD-R, I used a DVR-RW ).
- USB Keyboard and mouse.
- USB drive or memory card if you want to backup your data beforehand.
- Component or HDMI cable if you plan on using the linux GUI ( ie, not use your Playstation 3 as a headless server ).
As you can see, the Playstation 3 doesn’t require any special hardware to use linux as the Playstation 2 did.
Ubuntu Install
First, you have to download an iso image of Ubuntu for your PS3.
You can get it there :
http://cdimage.ubuntu.com/custom/20070608-feisty-ps3/ubuntu-7.04-desktop-powerpc+ps3.iso
While it’s downloading, it’s now a good time to backup your data if you’d like to.
Plug in a usb-hardrive or a memory card and:
In the XMB, go to Settings -> System Settings -> Backup Utility, follow the on-screen instructions.
Once the backup is done and the image has been burned on a CD/DVD, go back to the XMB, and then:
Settings > System Settings > Format Utility > Format Hard Disk.
Choose Yes.
Select “Custom partition setting”
and then “Allot 10GB to the Other OS”
followed by “Perform a Quick Format.”
Reboot the PS3 by pressing X on your controller.
You can now insert the Ubuntu CD on your Playstation 3
Settings > System Settings > Install Other OS
Hit X when prompted to start the installer.
This step actually install a bootloader on your system from the CD, it doesn’t install the other operating system.
Next, Settings > System Settings > Default System ,select “Other OS” and reboot.
Don’t forget to plug in your keyboard and mouse.
You will then see a command prompt kboot: on the screen, just press enter to boot from the CD.
From now on, it’s a normal Ubuntu install, just click on the installer on the desktop, select the 10GB drive and wait, and then wait some more. The installation is quite slow, much slower than on a comparable computer ( I blame the blu-ray drive ).
Caveat: if you are not using the HDMI output on a HDCP compatible screen, the live CD is going to default to NTSC/PAL resolution. Basically, the screen resolution will be too low for the installer application to display all of its window. Just press the “ALT” key on your keyboard and drag the window with the mouse to access the buttons on the lower side of the window.
After the installation finished and I rebooted into my ubuntu system, I had to make some configuration modification to display a decent resolution over Component cables. See the Notes at the end for the solution to this issue.
Installing Symfony
Now that you have a fully functional Ubuntu installation, there is a few steps left to accomplish before installing your development environment.
First, launch a terminal and get Super-User privileges and install the essential packages
reefab@reefab-desktop:~$ sudo -s
root@reefab-desktop:~# apt-get install php5 php5-cli php5-mysql php-pear
Next, install Symfony using Pear, ( the PHP package manager, the cleanest way in my opinion ).
root@reefab-desktop:~# pear channel-discover pear.symfony-project.com
root@reefab-desktop:~# pear install symfony/symfony
Now create a directory inside /var/www/ that will house your applications.
root@reefab-desktop:/var/www# mkdir symfony-test
And create your project and one application.
root@reefab-desktop:/var/www/symfony-test# symfony init-project test
root@reefab-desktop:/var/www/symfony-test# symfony init-app frontend
We now need to make some configuration in Apache to enable this application.
Create a new file in the site-available/ directory of the apache configuration
root@reefab-desktop:/var/www/symfony-test# vi /etc/apache2/sites-available/symfony-test
<VirtualHost *:80>
ServerName symfony-test
DocumentRoot "/var/www/symfony-test/web"
DirectoryIndex index.php
Alias /sf /usr/share/php/data/symfony/web/sf
<Directory "/usr/share/php/data/symfony/web/sf/">
AllowOverride All
Allow from All
</Directory>
<Directory "/var/www/symfony-test/web">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
And enable this site:
root@reefab-desktop:/var/www/symfony-test# a2ensite
Which site would you like to enable?
Your choices are: default symfony-test
Site name? symfony-test
Site symfony-test installed; run /etc/init.d/apache2 reload to enable.
root@reefab-desktop:/var/www/symfony-test# /etc/init.d/apache2 reload
the “symfony-test” hostname doesn’t exists so you may have to edit your /etc/hosts file and add it at the end of the line 127.0.0.1 or the one that start with the ip address of your system.
Example:
127.0.0.1 localhost symfony-test
Now point your browser to http://symfony-test/ and there you are, a fully functional symfony installation on your Playstation 3 !
Notes
If you have a hdmi hdcp compatible display, you can just skip this part.
First, go to a system Console ( press CTRL-ALT-F1 for example ).
You may have an issue with debug message scrolling on the screen and preventing you to actually see what you are typing.
So, you will have to login in and typing “dmesg -n 1″ to stop the kernel message being displayed on the consoles.
Now, use sudo to gain super-user privileges:
sudo -s
I then used the “ps3videomode” utility, just run it once to get a list of all video mode supported.
Then, you’ll have to try some to get on that will works on your display, if the screen become garbled, just press the up arrow and change the number to the default mode. This can get tricky.
I used vidmode number 4: YUV60Hz - 1080i
Now you have to edit /etc/kboot.conf and edit the default entry so it reads:
linux='/boot/vmlinux-2.6.16 initrd=/boot/initrd.img video=ps3fb:mode:##'
with ## being the vidmode you found. Then edit your xorg to add the resolution.
Your system will now have the correct resolution.








3 Comments