PS2 How to build Open PS2 Loader using Docker container

uyjulian

Developer
Thanks to the usage of Docker, it is even easier than ever to build Open PS2 Loader.

To install Docker Engine, follow the instructions here: https://docs.docker.com/engine/install/

(Note: if you want to use podman instead, just replace "docker" with "podman" in the following steps below)

## Running the container and cloning the repository
To clone the Open PS2 Loader repository and change directory into it, open a new terminal and run the following commands:
Code:
docker run --name opl_build_tmp -it ghcr.io/ps2homebrew/ps2homebrew:main sh
cd ~
git clone https://github.com/ps2homebrew/Open-PS2-Loader.git
cd Open-PS2-Loader

## Building Open PS2 Loader
To build Open PS2 Loader, run the following command:
Code:
make

## Copying the built Open PS2 Loader
To copy the built "OPNPS2LD.ELF" out of the container, do the following:
Open a new terminal and run the following command to copy "OPNPS2LD.ELF" out of the container:
Code:
docker cp opl_build_tmp:/root/Open-PS2-Loader/opl.elf ./OPNPS2LD.ELF
where ./OPNPS2LD.ELF is the path where you want to place the output file on the host filesystem.

## Cleaning up
After you are finished with the container, in the terminal where you typed "docker run", type in the following:
Code:
exit

To clean up and remove any files related to the container, type in the following:
Code:
docker rm opl_build_tmp
 
Last edited:
How much size is the docker container for ps2dev/opl ?
Im asking just for curiosity sake, im learning about docker containers... and the first idea that comes to mind is this concept fits pretty well with having a USB flash stick dedicated to the project
You know... is needed to invest some money to buy a USB flash stick of a size close to the project files (or a bit bigger let say double the size for long term just incase), and you have your portable compilation enviroment
Also, is easy to backup it or/and sync it with several PC's by using tools like https://freefilesync.org/
 
Just an FYI ... before you can run "make build opl.elf", you'll have to "cd" into the OPL directory.

Code:
$ cd Open-PS2-Loader

@uyjulian missed that part ... :P

And for some reason, the Docker container isn't compiling for me tonight ...

Code:
/ # apk add build-base git zip
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
(1/28) Installing libgcc (11.2.1_git20220219-r2)
(2/28) Installing libstdc++ (11.2.1_git20220219-r2)
(3/28) Installing binutils (2.38-r3)
(4/28) Installing libmagic (5.41-r0)
(5/28) Installing file (5.41-r0)
(6/28) Installing libgomp (11.2.1_git20220219-r2)
(7/28) Installing libatomic (11.2.1_git20220219-r2)
(8/28) Installing gmp (6.2.1-r2)
(9/28) Installing isl22 (0.22-r0)
(10/28) Installing mpfr4 (4.1.0-r0)
(11/28) Installing mpc1 (1.2.1-r0)
(12/28) Installing gcc (11.2.1_git20220219-r2)
(13/28) Installing musl-dev (1.2.3-r0)
(14/28) Installing libc-dev (0.7.2-r3)
(15/28) Installing g++ (11.2.1_git20220219-r2)
(16/28) Installing make (4.3-r0)
(17/28) Installing fortify-headers (1.1-r1)
(18/28) Installing patch (2.7.6-r7)
(19/28) Installing build-base (0.5-r3)
(20/28) Installing ca-certificates (20220614-r0)
(21/28) Installing brotli-libs (1.0.9-r6)
(22/28) Installing nghttp2-libs (1.47.0-r0)
(23/28) Installing libcurl (7.83.1-r2)
(24/28) Installing expat (2.4.8-r0)
(25/28) Installing pcre2 (10.40-r0)
(26/28) Installing git (2.36.2-r0)
(27/28) Installing unzip (6.0-r9)
(28/28) Installing zip (3.0-r9)
Executing busybox-1.35.0-r17.triggerExecuting ca-certificates-20220614-r0.trigger
OK: 201 MiB in 42 packages
/ # cd ~
~ # git clone https://github.com/ps2homebrew/Open-PS2-Loader.git
Cloning into 'Open-PS2-Loader'...
remote: Enumerating objects: 18048, done.
remote: Counting objects: 100% (52/52), done.
remote: Compressing objects: 100% (39/39), done.
remote: Total 18048 (delta 14), reused 33 (delta 12), pack-reused 17996
Receiving objects: 100% (18048/18048), 12.41 MiB | 6.96 MiB/s, done.
Resolving deltas: 100% (13276/13276), done.
~ # cd Open-PS2-Loader/
~/Open-PS2-Loader # ls -l
total 248
-rw-r--r--    1 root     root         10680 Aug 22 19:38 CHANGELOG
-rw-r--r--    1 root     root          1548 Aug 22 19:38 CREDITS
-rw-r--r--    1 root     root         10291 Aug 22 19:38 LICENSE
-rw-r--r--    1 root     root         25576 Aug 22 19:38 Makefile
-rw-r--r--    1 root     root        102953 Aug 22 19:38 OLD_DETAILED_CHANGELOG
-rw-r--r--    1 root     root          9965 Aug 22 19:38 README.md
drwxr-xr-x    2 root     root          4096 Aug 22 19:38 audio
-rwxr-xr-x    1 root     root           389 Aug 22 19:38 download_lng.sh
drwxr-xr-x    4 root     root          4096 Aug 22 19:38 ee_core
drwxr-xr-x    2 root     root          4096 Aug 22 19:38 gfx
drwxr-xr-x    2 root     root          4096 Aug 22 19:38 include
drwxr-xr-x    6 root     root          4096 Aug 22 19:38 labs
-rw-r--r--    1 root     root          6144 Aug 22 19:38 lang_compiler.py
-rw-r--r--    1 root     root          1783 Aug 22 19:38 lang_decompiler.py
drwxr-xr-x    2 root     root          4096 Aug 22 19:38 lng
-rwxr-xr-x    1 root     root          3374 Aug 22 19:38 lng_pack.sh
drwxr-xr-x    2 root     root          4096 Aug 22 19:38 lng_tmpl
-rwxr-xr-x    1 root     root          2425 Aug 22 19:38 make_changelog.sh
drwxr-xr-x    2 root     root          4096 Aug 22 19:38 misc
drwxr-xr-x   13 root     root          4096 Aug 22 19:38 modules
drwxr-xr-x    5 root     root          4096 Aug 22 19:38 pc
-rw-r--r--    1 root     root            12 Aug 22 19:38 requirements.txt
drwxr-xr-x    2 root     root          4096 Aug 22 19:38 src
drwxr-xr-x    2 root     root          4096 Aug 22 19:38 thirdparty
~/Open-PS2-Loader # make clean opl.elf
Cleaning...
-Interface
-EE core
make[1]: Entering directory '/root/Open-PS2-Loader/ee_core'
rm -f -r obj/ ee_core.elf ee_core.map
make[1]: Leaving directory '/root/Open-PS2-Loader/ee_core'
-IOP core
 -imgdrv
make[1]: Entering directory '/root/Open-PS2-Loader/modules/iopcore/imgdrv'
rm -r -f imgdrv.irx obj/imgdrv.o obj/imports.o obj/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/iopcore/imgdrv'
 -cdvdman
make[1]: Entering directory '/root/Open-PS2-Loader/modules/iopcore/cdvdman'
rm -r -f bdm_cdvdman.irx obj.bdm/cdvdman.o obj.bdm/ioops.o obj.bdm/ncmd.o obj.bdm/scmd.o obj.bdm/searchfile.o obj.bdm/streaming.o obj.bdm/ioplib_util.o obj.bdm/smsutils.o obj.bdm/imports.o obj.bdm/exports.o obj.bdm/../../isofs/zso.o obj.bdm/../../isofs/lz4.o obj.bdm/device-bdm.o obj.bdm/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/iopcore/cdvdman'
make[1]: Entering directory '/root/Open-PS2-Loader/modules/iopcore/cdvdman'
rm -r -f smb_cdvdman.irx obj.smb/cdvdman.o obj.smb/ioops.o obj.smb/ncmd.o obj.smb/scmd.o obj.smb/searchfile.o obj.smb/streaming.o obj.smb/ioplib_util.o obj.smb/smsutils.o obj.smb/imports.o obj.smb/exports.o obj.smb/../../isofs/zso.o obj.smb/../../isofs/lz4.o obj.smb/device-smb.o obj.smb/smb.o obj.smb/dev9.o obj.smb/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/iopcore/cdvdman'
make[1]: Entering directory '/root/Open-PS2-Loader/modules/iopcore/cdvdman'
rm -r -f hdd_cdvdman.irx obj.hdd/cdvdman.o obj.hdd/ioops.o obj.hdd/ncmd.o obj.hdd/scmd.o obj.hdd/searchfile.o obj.hdd/streaming.o obj.hdd/ioplib_util.o obj.hdd/smsutils.o obj.hdd/imports.o obj.hdd/exports.o obj.hdd/../../isofs/zso.o obj.hdd/../../isofs/lz4.o obj.hdd/device-hdd.o obj.hdd/atad.o obj.hdd/dev9.o obj.hdd/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/iopcore/cdvdman'
make[1]: Entering directory '/root/Open-PS2-Loader/modules/iopcore/cdvdman'
rm -r -f hdd_hdpro_cdvdman.irx obj.hdpro/cdvdman.o obj.hdpro/ioops.o obj.hdpro/ncmd.o obj.hdpro/scmd.o obj.hdpro/searchfile.o obj.hdpro/streaming.o obj.hdpro/ioplib_util.o obj.hdpro/smsutils.o obj.hdpro/imports.o obj.hdpro/exports.o obj.hdpro/../../isofs/zso.o obj.hdpro/../../isofs/lz4.o obj.hdpro/device-hdd.o obj.hdpro/hdpro_atad.o obj.hdpro/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/iopcore/cdvdman'
 -cdvdfsv
make[1]: Entering directory '/root/Open-PS2-Loader/modules/iopcore/cdvdfsv'
rm -r -f cdvdfsv.irx obj/cdvdfsv.o obj/searchfile.o obj/ncmd.o obj/scmd.o obj/imports.o obj/exports.o obj/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/iopcore/cdvdfsv'
 -resetspu
make[1]: Entering directory '/root/Open-PS2-Loader/modules/iopcore/resetspu'
rm -r -f resetspu.irx obj/resetspu.o obj/imports.o obj/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/iopcore/resetspu'
  -patches
   -iremsnd
make[1]: Entering directory '/root/Open-PS2-Loader/modules/iopcore/patches/iremsndpatch'
rm -r -f iremsndpatch.irx obj/main.o obj/asm.o obj/imports.o obj/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/iopcore/patches/iremsndpatch'
   -apemod
make[1]: Entering directory '/root/Open-PS2-Loader/modules/iopcore/patches/apemodpatch'
rm -r -f apemodpatch.irx obj/main.o obj/imports.o obj/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/iopcore/patches/apemodpatch'
   -f2techiop
make[1]: Entering directory '/root/Open-PS2-Loader/modules/iopcore/patches/f2techioppatch'
rm -r -f f2techioppatch.irx obj/main.o obj/imports.o obj/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/iopcore/patches/f2techioppatch'
   -cleareffects
make[1]: Entering directory '/root/Open-PS2-Loader/modules/iopcore/patches/cleareffects'
rm -r -f cleareffects.irx obj/main.o obj/imports.o obj/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/iopcore/patches/cleareffects'
 -isofs
make[1]: Entering directory '/root/Open-PS2-Loader/modules/isofs'
rm -r -f isofs.irx obj/isofs.o obj/zso.o obj/lz4.o obj/imports.o obj/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/isofs'
 -bdmevent
make[1]: Entering directory '/root/Open-PS2-Loader/modules/bdmevent'
rm -r -f bdmevent.irx obj/main.o obj/imports.o obj/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/bdmevent'
 -SMSUTILS
make[1]: Entering directory '/root/Open-PS2-Loader/modules/network/SMSUTILS'
rm -r -f SMSUTILS.irx obj/SMSUTILS.o obj/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/network/SMSUTILS'
 -SMSTCPIP
make[1]: Entering directory '/root/Open-PS2-Loader/modules/network/SMSTCPIP'
rm -r -f SMSTCPIP.irx obj/ps2ip.o obj/inet.o obj/ip.o obj/ip_addr.o obj/ip_frag.o obj/etharp.o obj/tcp_in.o obj/tcp_out.o obj/tcp.o obj/tcpip.o obj/mem.o obj/api_lib.o obj/api_msg.o obj/sockets.o obj/netif.o obj/udp.o obj/memp.o obj/icmp.o obj/pbuf.o obj/timers.o obj/exports.o obj/imports.o obj/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/network/SMSTCPIP'
 -in-game SMAP
make[1]: Entering directory '/root/Open-PS2-Loader/modules/network/smap-ingame'
rm -r -f smap.irx obj/main.o obj/smap.o obj/xfer.o obj/imports.o obj/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/network/smap-ingame'
 -smbinit
make[1]: Entering directory '/root/Open-PS2-Loader/modules/network/smbinit'
rm -r -f smbinit.irx obj/main.o obj/smbauth.o obj/des.o obj/md4.o obj/imports.o obj/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/network/smbinit'
 -nbns
make[1]: Entering directory '/root/Open-PS2-Loader/modules/network/nbns'
rm -r -f nbns.irx obj/main.o obj/nbns.o obj/imports.o obj/exports.o obj/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/network/nbns'
 -httpclient
make[1]: Entering directory '/root/Open-PS2-Loader/modules/network/httpclient'
rm -r -f httpclient.irx obj/main.o obj/httpclient.o obj/imports.o obj/exports.o obj/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/network/httpclient'
 -xhdd
make[1]: Entering directory '/root/Open-PS2-Loader/modules/hdd/xhdd'
rm -r -f xhdd.irx obj/xhdd.o obj/xatad.o obj/hdpro.o obj/imports.o obj/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/hdd/xhdd'
 -mcemu
make[1]: Entering directory '/root/Open-PS2-Loader/modules/mcemu'
rm -r -f bdm_mcemu.irx obj.bdm/mcemu.o obj.bdm/mcemu_io.o obj.bdm/mcemu_sys.o obj.bdm/mcemu_var.o obj.bdm/mcemu_rpc.o obj.bdm/imports.o obj.bdm/device-bdm.o obj.bdm/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/mcemu'
make[1]: Entering directory '/root/Open-PS2-Loader/modules/mcemu'
rm -r -f hdd_mcemu.irx obj.hdd/mcemu.o obj.hdd/mcemu_io.o obj.hdd/mcemu_sys.o obj.hdd/mcemu_var.o obj.hdd/mcemu_rpc.o obj.hdd/imports.o obj.hdd/device-hdd.o obj.hdd/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/mcemu'
make[1]: Entering directory '/root/Open-PS2-Loader/modules/mcemu'
rm -r -f smb_mcemu.irx obj.smb/mcemu.o obj.smb/mcemu_io.o obj.smb/mcemu_sys.o obj.smb/mcemu_var.o obj.smb/mcemu_rpc.o obj.smb/imports.o obj.smb/device-smb.o obj.smb/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/mcemu'
 -genvmc
make[1]: Entering directory '/root/Open-PS2-Loader/modules/vmc/genvmc'
rm -r -f genvmc.irx obj/genvmc.o obj/imports.o obj/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/vmc/genvmc'
 -lwnbdsvr
make[1]: Entering directory '/root/Open-PS2-Loader/modules/network/lwnbdsvr'
rm -r -f lwnbdsvr.irx obj/lwnbdsvr.o obj/imports.o obj/exports.o obj/lwnbd.o obj/nbd_protocol.o obj/drivers/atad_d.o obj/drivers/ioman_d.o obj/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/network/lwnbdsvr'
 -udptty-ingame
make[1]: Entering directory '/root/Open-PS2-Loader/modules/debug/udptty-ingame'
rm -r -f udptty.irx obj/udptty.o obj/imports.o obj/exports.o obj/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/debug/udptty-ingame'
 -ps2link
make[1]: Entering directory '/root/Open-PS2-Loader/modules/debug/ps2link'
rm -r -f ps2link.irx obj/net_fsys.o obj/net_fio.o obj/ps2link.o obj/cmdHandler.o obj/nprintf.o obj/excepHandler.o obj/imports.o obj/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/debug/ps2link'
 -ds34usb
make[1]: Entering directory '/root/Open-PS2-Loader/modules/ds34usb'
make -C iopclean
make[2]: Entering directory '/root/Open-PS2-Loader/modules/ds34usb/iop'
rm -r -f ds34usb.irx obj/ds34usb.o obj/smsutils.o obj/imports.o obj/ 
make[2]: Leaving directory '/root/Open-PS2-Loader/modules/ds34usb/iop'
make -C eeclean
make[2]: Entering directory '/root/Open-PS2-Loader/modules/ds34usb/ee'
rm -f -r libds34usb.o libds34usb.a
make[2]: Leaving directory '/root/Open-PS2-Loader/modules/ds34usb/ee'
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/ds34usb'
 -ds34bt
make[1]: Entering directory '/root/Open-PS2-Loader/modules/ds34bt'
make -C iopclean
make[2]: Entering directory '/root/Open-PS2-Loader/modules/ds34bt/iop'
rm -r -f ds34bt.irx obj/ds34bt.o obj/smsutils.o obj/imports.o obj/ 
make[2]: Leaving directory '/root/Open-PS2-Loader/modules/ds34bt/iop'
make -C eeclean
make[2]: Entering directory '/root/Open-PS2-Loader/modules/ds34bt/ee'
rm -f -r libds34bt.o libds34bt.a
make[2]: Leaving directory '/root/Open-PS2-Loader/modules/ds34bt/ee'
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/ds34bt'
 -pademu
make[1]: Entering directory '/root/Open-PS2-Loader/modules/pademu'
rm -r -f bt_pademu.irx obj.bt/pademu.o obj.bt/sys_utils.o obj.bt/imports.o obj.bt/exports.o obj.bt/padmacro.o obj.bt/ds34common.o obj.bt/ds34bt.o obj.bt/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/pademu'
make[1]: Entering directory '/root/Open-PS2-Loader/modules/pademu'
rm -r -f usb_pademu.irx obj.usb/pademu.o obj.usb/sys_utils.o obj.usb/imports.o obj.usb/exports.o obj.usb/padmacro.o obj.usb/ds34common.o obj.usb/ds34usb.o obj.usb/ 
make[1]: Leaving directory '/root/Open-PS2-Loader/modules/pademu'
-pc tools
make[1]: Entering directory '/root/Open-PS2-Loader/pc'
make -C iso2opl clean
make[2]: Entering directory '/root/Open-PS2-Loader/pc/iso2opl'
rm -f -r bin
rm -f src/*.o
make[2]: Leaving directory '/root/Open-PS2-Loader/pc/iso2opl'
make -C opl2iso clean
make[2]: Entering directory '/root/Open-PS2-Loader/pc/opl2iso'
rm -f -r bin
rm -f src/*.o
make[2]: Leaving directory '/root/Open-PS2-Loader/pc/opl2iso'
make -C genvmc clean
make[2]: Entering directory '/root/Open-PS2-Loader/pc/genvmc'
rm -f -r bin
rm -f src/*.o
make[2]: Leaving directory '/root/Open-PS2-Loader/pc/genvmc'
make[1]: Leaving directory '/root/Open-PS2-Loader/pc'
In file included from src/menusys.c:12:
./include/lang.h:4:10: fatal error: lang_autogen.h: No such file or directory
    4 | #include "lang_autogen.h"
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:722: obj/menusys.o] Error 1
~/Open-PS2-Loader # docker ps
sh: docker: not found
~/Open-PS2-Loader # exit

That's the output of Docker Engine (Windows & Arch Linux) ...
 
Last edited:
Hello. Thank you for your good tutorial. I was able to build the OPNPS2LD.ELF file with your method. But the size of this file is about 12 MB. How can I reduce the size to 1 MB?
 
The latest version of opl 1.2 beta has many bugs and does not recognize many USB flash drives in fat32 mode and does not run many games, version 1.1.0 also has the problem of fat32, the best version is 1.0.0. Can you create a Docker image? To compile version 1.0.0 for each?
An image that supports both homebrew and dailybuild versions
can you make please
 

Similar threads

Back
Top