Forum: Official Open PS2 Loader Forum - Discussion and information on the Official Open PS2 Loader.


The above video goes away if you are a member and logged in, so log in now!




 
Would you like to get all the new info from
PSX-Scene in your email each day?




Want to learn more about the team keeping you up to date with the latest scene news?

Read about them now!

Check out our Developer bios, too!

 


User Tag List

Thread: [Linux] OPL compile guides
  

Results 1 to 3 of 3
  1. #1 [Linux] OPL compile guides 
    izdubar's Avatar
    izdubar is offline Babylon User
    Join Date
    Nov 2009
    Posts
    869
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    2
    openSUSE 11.2 manual guide


    Requirements

    You will need a few linux packages, install them with your distribution package management tool (use either zypper from commandline, or the gui tool in yast):

    • gcc (GNU C compiler, version 3 or 4 are ok)
    • make (GNU makefile)
    • patch (GNU patch)
    • wget (used by the ps2toolchain to get some sources)
    • subversion (source management tool for svn/subversion repositories)
    • mercurial (source management tool for hg/mercurial repositories)


    And last but not least, to pack the OpenPS2Loader ELF, you need to have the ps2-packer. This one can be downloaded from ps2dev. The author of this tool (Nicolas 'Pixel' Noble) did use static libraries to be able to redistribute the binary. Now, on openSUSE, there seems to be no repository providing the required static package, so we will use shared libraries instead (that will require to change the original Makefile, it will be explained in the compile steps at the bottom):

    Code:
    > sudo zypper install zlib zlib-devel libucl1 libucl1-devel

    Compilation

    1. Setup your shell environment. You need to define these variables:

    Code:
    export PS2DEV=/some_path/ps2dev
    export PATH=$PATH:$PS2DEV/bin
    export PATH=$PATH:$PS2DEV/ee/bin
    export PATH=$PATH:$PS2DEV/iop/bin
    export PATH=$PATH:$PS2DEV/dvp/bin
    export PS2SDK=$PS2DEV/ps2sdk
    export PATH=$PATH:$PS2SDK/bin
    export PS2ETH=$PS2DEV/ps2eth
    export GSKIT=$PS2DEV/gsKit
    export LANG=C
    export LC_ALL=C
    You can put your sources (and set accordingly your PS2DEV) where you want, usually in some user directory, as we will modify the ps2-packer makefile (and it is the only part that is dependent of the location of the sources).

    To setup the var I recommend (as it doesn't change definitely your environment) is to put theses lines inside a text file, let's say "setup_ps2dev" in your PS2DEV directory, and after you created this file, you have to give him execute rights:

    Code:
    > mkdir /some_path/ps2dev
    > cd /some_path/ps2dev
    > gedit setup_ps2dev
    copy/paste the lines, and edit your ps2dev path accordingly, quit your editor
    > chmod 755 setup_ps2dev
    That has to be done once for all. And now, every time you want to compile ps2dev stuff you first "execute it" ("source it", is the real definition):

    Code:
    > cd /some_path/ps2dev
    > . setup_ps2dev
    The second command is "dot" "space" "setup_ps2dev".

    Before going to step 2, check your env is correctly set (or the first "cd $PSDEV" will fail):

    Code:
    > echo $PS2DEV
    It should output what you manually set above, and not be empty

    2. Retrieve PS2Toolchain, and compile it

    Code:
    > cd $PS2DEV
    > svn co svn://svn.ps2dev.org/ps2/trunk/ps2toolchain
    > cd ps2toolchain
    > ./toolchain.sh
    It will retrieve and compile some external sources also, so you should now have theses directories under $PS2DEV:

    bin, dvp, ee, iop, ps2sdk and ps2toolchain

    3. Retrieve and compile needed libraries for OpenPS2Loader (ps2eth is no longer needed by OPL, but you should install it as it's needed by other projects)

    Code:
    > cd $PS2DEV
    > svn co svn://svn.ps2dev.org/ps2/trunk/ps2eth
    > cd ps2eth
    > make
    > cd $PS2DEV
    > svn co svn://svn.ps2dev.org/ps2/trunk/gsKit
    > cd gsKit
    > make
    > cd $PS2DEV
    > svn co svn://svn.ps2dev.org/ps2/trunk/ps2sdk-ports/zlib
    > cd zlib
    > make
    > make install
    4. Compile and install PS2-packer

    Code:
    > cd $PS2DEV
    > mkdir ps2-packer
    > cd ps2-packer
    > wget http://ps2dev.org/ps2/Tools/Packers/Unpackers/PS2-Packer_0.4.4/PS2-Packer_0.4.4_source_package.download
    > tar xvf PS2-Packer_0.4.4_source_package.download
    Overwrite the original Makefile with the one in attachment
    > make
    > make install
    5. Download OpenPS2Loader and compile it

    Code:
    > cd $PS2DEV
    > hg clone http://bitbucket.org/ifcaro/open-ps2-loader/
    > cd open-ps2-loader
    > make
    If all went ok, you can find the OPNPS2LD.ELF under $PS2DEV/open-ps2-loader/ directory (and main.elf which is the uncompressed version).

    Finally, you can also compile iso2usbld tool:

    Code:
    > cd $PS2DEV/open-ps2-loader/pc/iso2usbld
    > make

    Install and configure Samba for use with OPL's SMB core

    1. Install Samba
    Code:
    > sudo zypper install samba samba-client
    Please now refer to Ubuntu Samba install guide, and continue at step 2 (Edit Samba configuration).


    Good luck !
    Attached Files
    Last edited by jimmikaelkael; 03-13-2010 at 04:22 AM. Reason: Added samba install part to openSUSE guide

  2. #2  
    jimmikaelkael is offline Member
    Join Date
    Mar 2008
    Location
    France
    Posts
    1,191
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Likes Given
    0
    Likes Received
    11
    Ubuntu 9.04 (Jaunty Jackalope) / Ubuntu 9.10 (Karmic Koala) / Ubuntu 10.04 (Lucid Lynx) manual guide


    Set up the dev environment

    Pre-Requisite:
    Go to 'System/Administration/Software Sources' and make sure 'universe' repository is selected, then open a terminal:
    Code:
    $ sudo apt-get update
    $ sudo apt-get upgrade

    1. Install the packages "gcc-4.4", "patch", "wget", "make" and "mercurial":
    Code:
    $ sudo apt-get install gcc-4.4 patch wget make mercurial

    2. Download the ps2toolchain scripts:
    Code:
    $ cd
    $ hg clone https://bitbucket.org/ps2dev/ps2toolchain

    3. Run the script to download and build the toolchain:
    Code:
    $ cd ps2toolchain/
    $ sudo CC=gcc-4.4 ./toolchain-sudo.sh

    4. Edit your login script ~/.profile
    Code:
    $ sudo gedit ~/.profile
    Then add the following at the end of the file:
    Code:
    export PS2DEV=/usr/local/ps2dev
    export PATH=$PATH:$PS2DEV/bin
    export PATH=$PATH:$PS2DEV/ee/bin
    export PATH=$PATH:$PS2DEV/iop/bin
    export PATH=$PATH:$PS2DEV/dvp/bin
    export PS2SDK=$PS2DEV/ps2sdk
    export PATH=$PATH:$PS2SDK/bin
    You need to source your login script to take new env vars in account:
    Code:
    $ source ~/.profile

    5. Build one of the PS2SDK samples to test your environment:
    Code:
    $ cd /usr/local/ps2dev/ps2sdk/
    $ sudo chmod -R a+w samples/
    $ cd samples/hello/
    $ make
    $ make clean

    6. From now you can delete the ps2toolchain scripts is you wish:
    Code:
    $ cd
    $ rm -R ps2toolchain


    How to duplicate PS2DEV environment to allow you to use several dev environments (eg compile OPL and uLE for example)

    I strongly suggest you to move the ps2dev folder to /home partition, clone it, and set up it from here depending for which app to compile you're setting up this dev environment.


    1. Move the ps2dev directory to /home partition, change permissions:
    Code:
    $ cd
    $ mkdir -p PS2dev/SDK/
    $ sudo mv /usr/local/ps2dev ~/PS2dev/SDK/
    $ sudo chmod -R a+w ~/PS2dev/SDK/

    2. Duplicate the ps2dev directory specifically for OPL:
    Code:
    $ cp -R ~/PS2dev/SDK/ps2dev ~/PS2dev/SDK/ps2dev-OPL
    $ gedit ~/PS2dev/switch-ps2dev.sh
    paste this to the file:
    Code:
    #!/bin/bash
    if [ $# -eq 0 ]
    then
    echo "usage: sh $0 <dev env subname>"
    exit 1
    fi
    unlink /usr/local/ps2dev &>/dev/null
    ln -s ~/PS2dev/SDK/ps2dev-$1 /usr/local/ps2dev || exit 1
    echo "$1 dev environment ready."

    3. Make the script above executable
    Code:
    $ chmod +x ~/PS2dev/switch-ps2dev.sh

    4. Now you can switch between dev environments:
    Code:
    $ sudo sh ~/PS2dev/switch-ps2dev.sh OPL


    How to update the PS2SDK on Ubuntu?

    After setting up a working PS2DEV environment, it's advisable to update the
    PS2SDK every once in a while.


    1. Clone the current sources:
    Code:
    $ cd ~/PS2dev/
    $ hg clone https://bitbucket.org/ps2dev/ps2sdk
    $ cd ps2sdk/
    If you already have a working copy, simply update it:
    Code:
    $ hg pull -u

    2. Build/Intall the SDK:
    Code:
    $ make clean
    $ make
    $ make install


    Install the libraries OPL needs

    You need to install and build all libraries open-ps2-loader needs: ps2-packer, gsKit, zlib, libpng and libjpeg.

    Make sure you're using the good dev environment if you use several of them:

    Code:
    sudo sh ~/PS2dev/switch-ps2dev.sh OPL

    1. Download and build ps2-packer sources (ps2-packer needs a few packages):
    Code:
    $ sudo apt-get install zlib1g zlib1g-dev libucl1 libucl-dev
    $ source ~/.profile
    $ cd $PS2DEV
    $ hg clone https://bitbucket.org/ps2dev/ps2-packer
    $ cd ps2-packer/
    $ make
    $ make install

    2. Download and build the gsKit sources:
    Code:
    $ cd $PS2DEV
    $ hg clone https://bitbucket.org/ps2dev/gskit
    $ cd gskit/
    $ make
    Add GSKIT env var to your login script ~/.profile:
    Code:
    $ sudo gedit ~/.profile
    Then add the following at the end of the file:
    Code:
    export GSKIT=$PS2DEV/gskit

    3. Download ps2sdk-ports, build and install the zlib sources:
    Code:
    $ cd $PS2DEV
    $ hg clone https://bitbucket.org/ps2dev/ps2sdk-ports
    $ cd ps2sdk-ports/zlib/
    $ make
    $ make install

    4. Build and install the libpng sources:
    Code:
    $ cd ../libpng/
    $ make
    $ make install

    5. Build and install the libjpeg sources:
    Code:
    $ cd ../libjpeg/
    $ make
    $ make install


    Compile OPL

    You need to re-logon again to take new env vars in account, or simply source agin your profile script:
    Code:
    $ source ~/.profile

    1. Get OPL sources:
    Code:
    $ cd ~/PS2dev
    $ hg clone https://bitbucket.org/ifcaro/open-ps2-loader

    2. Compile OPL:
    Code:
    $ cd open-ps2-loader/
    $ make
    To get newest OPL revision:
    Code:
    $ cd ~/PS2dev/open-ps2-loader/
    $ hg pull -u
    To recompile OPL, simply use:
    Code:
    $ make rebuild
    For those who needs iso2opl command line tool to install some ISO files, you can compile OPL's PC tools:
    Code:
    $ make pc_tools


    Install and configure Samba for use with OPL's SMB core

    1. Install Samba:
    Code:
    $ sudo apt-get install samba smbclient

    2. Edit Samba configuration:
    Code:
    $ sudo gedit /etc/samba/smb.conf
    Search for this line in the smb.conf file, and add your 'PS2SMB' share definition below, the 'path' line must be filled with the path where you installed your games, it could also be a removable media of course:
    Code:
    #======================= Share Definitions =======================
    [PS2SMB]
        comment = PS2 OPL Games
        read only = yes
        locking = no
        path = /share/PS2SMB"
        guest ok = yes

    3. Restart Samba:
    Code:
    $ sudo /etc/init.d/samba restart

    4. Test PS2SMB share with smbclient:
    Code:
    $ smbclient -U GUEST -N //127.0.0.1/PS2SMB
    If everything goes well you should be prompted with smb, you can test to ls like below:
    Code:
    jimmikaelkael@PC-DE-JIM:~$ smbclient -U GUEST -N //127.0.0.1/PS2SMB
    Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.4.0]
    Server not using user level security and no password supplied.
    smb: \> ls
      .                                   D        0  Tue Feb 16 10:29:04 2010
      ..                                  D        0  Thu Feb 18 12:01:27 2010
      ul.A15B8D16.SLUS_202.30.02          A 793092096  Wed Dec 16 15:20:23 2009
      ul.726F6A14.SLES_543.55.00          A 1073741824  Wed Dec 16 15:35:42 2009
      ul.726F6A14.SLES_543.55.01          A 1073741824  Wed Dec 16 15:37:33 2009
      ul.726F6A14.SLES_543.55.02          A 1073741824  Wed Dec 16 15:39:16 2009
      ul.726F6A14.SLES_543.55.03          A 826441728  Wed Dec 16 15:40:35 2009
      ul.7639C4C3.SLES_524.58.00          A 616114176  Tue Jan  5 14:10:26 2010
      ul.788A8ADE.SLUS_218.70.00          A 1073741824  Thu Dec 10 15:03:15 2009
      ul.788A8ADE.SLUS_218.70.01          A 1073741824  Thu Dec 10 15:04:54 2009
      ul.788A8ADE.SLUS_218.70.02          A 545914880  Thu Dec 10 15:05:51 2009
      ul.A15B8D16.SLUS_202.30.00          A 1073741824  Wed Dec 16 15:17:39 2009
      ul.A15B8D16.SLUS_202.30.01          A 1073741824  Wed Dec 16 15:19:15 2009
      ul.C540288E.SLUS_217.07.00          A 975667200  Wed Dec  9 16:29:16 2009
      ul.cfg                              A      320  Tue Feb 16 10:29:04 2010
    
    		33791 blocks of size 2097152. 6026 blocks available
    smb: \> exit
    jimmikaelkael@PC-DE-JIM:~$
    If something goes wrong, review your samba configuration and restart Samba server, testparm sometimes help:
    Code:
    $ testparm -s

    Now all you need is to have games properly installed in the proper location, and have your network properly configured.
    For example, if you use PS2 wired to PC, Go to System->Preferences->Network Configuration, the connections window will open. Choose Wired tab, select 'Auto eth0' and click Modify. Go to IPv4 parameters tab and set addresses properly on manual configuration.


    Authors: misfire & jimmikaelkael.
    Last edited by jimmikaelkael; 08-16-2010 at 05:33 AM. Reason: Modified Ubuntu manual guide

  3. #3  
    jimmikaelkael is offline Member
    Join Date
    Mar 2008
    Location
    France
    Posts
    1,191
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Likes Given
    0
    Likes Received
    11
    Debian/Ubuntu/openSUSE/Fedora scripts

    You can install the PS2SDK with the scripts at the end of this post.

    Ubuntu/Debian Pre-Requisite:
    Go to 'System/Administration/Software Sources' and make sure 'universe' repository is selected.


    1. Download the scripts archive at the end of this post to your home user dir.

    2. Open a terminal, and uncompress the scripts:
    Code:
    $ tar xvf ps2sdk-scripts.tar.gz
    3. Enter the "ps2sdk-scripts" dir created at unpacking:
    Code:
    $ cd ps2sdk-scripts/
    4. Install the full dev environment needed for OPL (this can take a while):
    Code:
    $ sudo ./install-ps2sdk.sh
    5. Install OPL (the compressed OPL Elf will be built to /home/user/open-ps2-loader/OPNPS2LD.ELF):
    Code:
    $ sudo ./install-opl.sh
    You can update/rebuild OPL with:
    Code:
    $ sudo ./update-opl.sh
    Every once in a while it's advisable to update the PS2SDK (the following script will too update the libs OPL is depending on: ps2eth, gsKit, zlib and ps2-packer):
    Code:
    $ sudo ./update-ps2sdk.sh
    If you wish to use OPL's SMB core, please refer to the corresponding part in the manual guides below.


    Scripts provided by izdubar & jimmikaelkael.

    Please report any bug to the dedicated thread: Open-ps2-loader compile guide discussions/submissions
    Attached Files
    Last edited by jimmikaelkael; 08-17-2010 at 08:22 AM. Reason: fixed a bug in the scripts

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •