This guide and Persona 4 boss fights have one thing in common: third time's usually the charm ...
The following will guide you through compiling the homebrew PS2 toolchain and OpenPS2Loader from a clean VM or install of Linux Mint 14 and other Ubuntu-based variants.
Linux Mint 14 ISOs can be snagged here:
http://www.linuxmint.com/download.php
As you can see from the above link, Linux Mint ISOs are separated by desktop environment -- Cinnamon, KDE, XFCE, and MATE (pronounced mah-tay) -- and architecture (x32 and x64). Since 64-bit support in the toolchain is bugged/broken at the time of this writing, 32-bit is the only way to go. This guide will focus on the 32-bit Cinnamon spin for the sake of consistency/familiarity. Cinnamon is a fork of the Gnome3 desktop, and thus you might already be familiar with "gedit" as your text editor (as opposed to "kate" for KDE, and "pluma" for MATE/XFCE). Also, the default file manager Nautilus was forked by the Mint developers and it's now called Nemo ...
With those caveats out of the way, let's get started ...
64-bit Update: PS2Packer (and the entire PS2DSK) compiles and function properly on x64 Linux and Windows.
PS2unpacker however malfunctions under a 64-bit environment despite appearing to compile without issue.
(Confirmed by E P (x64 Slax) and SP193 (x64bit Ubuntu 12.10/Win7 x64 MiniGW)
Highlight the following code with your mouse and chose "Copy" so its in your clipboard ...
Code:
export PS2DEV=/usr/local/ps2dev
export GSKIT=$PS2DEV/gsKit
export PS2SDK=$PS2DEV/ps2sdk
export PATH=$PATH:$PS2DEV/bin
export PATH=$PATH:$PS2DEV/ee/bin
export PATH=$PATH:$PS2DEV/iop/bin
export PATH=$PATH:$PS2DEV/dvp/bin
export PATH=$PATH:$PS2SDK/bin
Open up a Terminal, and type ...
Code:
$ sudo gedit ~/.profile
... followed by your user password.
After the text-editor opens your ./profile, use your arrow keys to move the blinking cursor to the bottom. Once you're on the last line, you may also have to press "END" to make sure the cursor is at the very end of any existing text. If that's the cast, press "ENTER/RETURN" once at this point to make the blank line manually, followed by a right click and "PASTE". Then click "SAVE" at the top and close the editor ...
Now, you have to source your ./profile ...
Code:
$ source ~/.profile
You can also source your ./profile by pressing ALT+CTRL+BACKSPACE and then logging back in ...
Next, download the "ps2sdk-scripts.tar.gz" file (see attachment below) file. Move it out of your "Downloads" folder and into your HOME folder, then extract it. Once that's taken care of, take a moment. By all means, if you're hungry or nature's calling, take care of it. Because we're about to open Terminal to execute the build script ...
Code:
$ sudo ./install-ps2sdk.sh
... and babysit the resulting wall of text for quite some time. Although the compiling process only takes roughly 12-15 mins or so, at certain points the process can (and will) be interrupted by confirmation prompts to download required packages and tools. So, as long you sit there "Y" and "ENTER" at every confirmation prompt, you won't artificially extend the process any further than it needs.
Another reason to babysit it is at around the 8 to 12 minute mark or so (depending on your computer), the script gets to the part of building PS2-Packer, and this is the part that tends to break or fail the most, giving you an error and terminating the script. The vast majority as to why this happens (in my experience at least) is because the script automatically adds the first step (i.e. editing/sourcing ./profile) as well as makes necessary symlinks (or attempts to fix any broken ones). Alas, this doesn't always prove successful. Hence why we did the first step manually and made sure the ./profile was sourced and verified. The babysitting also helps ensure all the "sudos" within the script itself make the most out of their shelf-life before demanding the password again. Since I've done this across Mint 11, 12, 13, and now 14, the steps we've taken so far is sort of an insurance policy: 20% of the time, PS2Packer will puke at this point; 80% of the time PS2Packer builds nicely for me, I'm greeted with the "Success" confirmation message.
If you see the "Success" confirmation message, I recommend sourcing your ./profile again before proceeding.
With the PS2DEV toolchain ready, let's move on to OpenPS2Loader ...
Open Terminal again (in case you closed it) and type the following ...
Code:
$ cd ps2sdk-scripts
$ sudo ./install-opl.sh
After typing your password again, the script will clone the mainline "ifcaro" repository of OPL, and automatically start compiling. Takes about 5 minutes. If everything goes smoothly here, OPNPS2LD.ELF will be waiting for you inside your "home/user/open-ps2-loader" folder. But before you venture off to have some fun, it's best to verify that you can manually re-compile OPL from the terminal and/or the update script. So open terminal and type the following:
Code:
$ cd open-ps2-loader
$ make rebuild
OPL should re-compile without problems. If you get an error or any sort, try logging out, logging back in, and repeat the step above. If OPL recompiles without issue, then you should be able to re-compile OPL from the included script in your "ps2sdk-scripts" folder ...
While we're at it, let's double check something. Type the following in Terminal ...
Notice how your "open-ps2-loader" folder is owned by "root"? Let's take care of that ...
Code:
$ sudo chown -R <username>:<username> open-ps2-loader
... then repeat the "ls -l" command to verify it.
Congrats! You can now build the "release" version of OPL at anytime!
But what about Beta builds? No problem!
Open terminal again, and then clone the "doctorxyz" repo ...
Code:
$ mkdir opl_beta
$ cd opl_beta
$ hg clone https://bitbucket.org/doctorxyz/open-ps2-loader
This will make another "open-ps2-loader" sub-folder within "opl_beta", which will contain doctorxyz's most recent commits. From there, you can click "Home" on the desktop to bring up Nemo/Nautilus file manager, then double-click "opl_beta" folder, double-click the "open-ps2-loader" folder, double-click the "MAKEFILE", and chose "Run in Terminal" from the confirmation box ...
You can also clone doctorxyz's OPL+GSM integrated builds in the same fashion ...
Code:
$ mkdir opl_gsm
$ cd opl_gsm
$ hg clone https://bitbucket.org/doctorxyz/opl_gsm
... and build it the same way (i.e. choose "Run In Terminal" after double-clicking the MAKEFILE)
That's should cover all the bases ...
In a follow up, I'll walk you through manually compiling PS2-Packer just in case the attached script bombs out on you. Since PS2-Packer is the final step in compiling the toolchain, if the script bombs out for some reason, re-running the script would be redundant and time-consuming. Much easier and faster to just re-compile PS2-Packer manually. Unfortunately, an update on my Mint 14 Cinnamon install (and a stupid install of KDE two weeks ago) has finally caught up to me and -- yup, you guessed it -- my PS2-Packer walkthru was on there. Forgot to shovel it over to my NTFS drive! Sooo, as soon as I work up the motivation to re-boot into a Live USB session, I'll be able to access and publish that part before the re-install ... but before that I gotta save Rise Kujikawa. Hey, don't give me any lip - it's easier to find your place again in the Persona 4 walkthru when you procrastinate on certain chores to the end/start of a given month. Translation: Ms. Rastard's a believer now!

Compiling PS2-Packer Manually
So the script bombed on you at compiling PS2Packer, eh?!? Let me guess: it complained about not finding the libz.a and libucl.a files, right?!? The reasons explaining that might make you wanna give Stallman's beard a good tug next time you see him. You see, Stallman wants *cough-erm* demands total GNU purity, and that means Canonical and other Linux distro maintainers changed what never needed fixing in the first place in order to appease him: /usr/lib/i386-linux-gnu/ became the new stomping grounds replete with a stockpile of hyphens of mass pretension. To make things easier, Canonical would often deploy Ubuntu with /usr/lib/ and /usr/lib/i386-linux-gnu/ symlinked, but not always. Multiply that by the total number of Ubuntu-based distros, and you've got a recipe for an on-again-off-again square dance that explains why PS2-Packer compiled nicely in Natty, puked on Ocelot, etc. etc.
Compiling PS2-Packer manually is simple although it was written at a time where the toolchain didn't have the luxury of scripts. Everything was compiled manually, and most likely under your $HOME folder, and that required a more elaborate and explicit ./profile that pointed to absolute paths as jimmikaelkael's original thread admirably demonstrates. That made multiple toolchain maintenance a pain - perfect example being uLaunch and OPL; they can't use the same toolchain as the sources are heavily modified by their respective authors. In that regard, Jimmy's original thread it still useful for those who want multiple toochains to compile various PS2 homebrew projects. But since the PS2DEV toolchain compiles into the root file system out-of-the-box instead of $HOME, some commands and steps for PS2Packer are either vague or not documented.
Not anymore
Let's assume your toolchain is working correctly and compiles OPL without a hitch.
Welp, best way to learn is to deliberately break it, and piece it back together.
Open Terminal, navigate to the ps2packer's source folder, and break it:
Now, let's rebuild it:
P2Packer should re-compile without any errors at all. But it's not done ...
Next, you need to become root ...
Enter the root password (for Ubuntu, its blank - for Linux Mint, chosen upon installation)
Your terminal prompt should change from $ to # ...
As root, and still in the ps2packer source folder, type the following:
PS2Packer should now install the compiled binaries.
No sense in staying root so either close Terminal or type:
... followed by the password. The prompt should return to normal ...
Done deal!
Feel free to test it out via the OPL update script or "make rebuild" ...
Solving "Missing" LIBZ.A and LIBUCL.A Error
If PS2Packer fails to compile because of this error, its due to /usr/lib/ and /usr/lib/i386-linux-gnu/ not being symlinked by your distro. Rest assured if you've ran Soulslayer's script, you've got these specific libraries within /usr/lib/i386-linux-gnu. It's just PS2Packer expects them to be in /usr/lib/ and won't look within the "i386-linux-gnu" folder if there's no symlink. Thanks to doctorxyz, this error is becoming rare as he modified Soulslayer's script to correct this turnaround. In case the script fails at this for some reason, you've got two options:
(1) modify PS2Packer's makefile
(2) cheat like hell
Personally, I choose option 2 - cheat like hell.
Since we know where the files are, open Terminal and invoke the nuclear option ...
Code:
$ gksudo nemo (Mint)
$ gksudo nautilus (Ubuntu)
... followed by the password. Say hello to a radioactive version of Nemo/Nautilus. Be very careful with this thing. Notice that it opens in the root file system instead of $home and that's by design. A linux file manager by itself is harmless. With superuser/root powers, it takes ownership of and adjusts the permissions of everything it looks at. Not kidding. If you can imagine $HOME having root-only read, write, and execute permissions, you can imagine spending minutes to hours at the CLI fixing the damage. Since we have a specific goal and destination, let's not waste any time: navigate to /usr/lib/i386-linux-gnu, locate the LIBZ.A and LIBUCL.A files, hold CTRL when you select them (just like you would in Windows), right-click followed by "Copy". Then, click the "lib" box to bring you exactly one folder up, right click and "Paste", then close Nemo/Nautilus faster than you opened it.
Then repeat all of the above steps starting with "make clean" ...
PS2Packer should find the libraries, compile, and install ...