Skip to content

This script will help you to install RetroArch from a Lakka image to an already working OS LibreELEC with Kodi.

License

Notifications You must be signed in to change notification settings

basilean/retroarch_install

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This script will help you to install RetroArch from a Lakka image to an already working OS LibreELEC with Kodi.

Original post:
https://forum.libreelec.tv/thread/29500-libreelec-kodi-lakka-retroarch

Getting Started

Connect to LibreElec device by ssh.

ssh root@LibreElec

Once there, run the script.

wget -q -O - https://raw.githubusercontent.com/basilean/retroarch_install/refs/heads/main/retroarch_install.sh | bash

It takes approx 25 minutes to complete.

Now you have a RetroArch link in your favourites, click on it and wait 5 seconds (first time takes longer).

Hacking It

Download the script.

wget -q https://raw.githubusercontent.com/basilean/retroarch_install/refs/heads/main/retroarch_install.sh

Edit it.

vi retroarch_install.sh
VERSION=6.x-20250207-0af7dae

It needs to be a valid version from releases or nightly.
https://github.com/libretro/Lakka-LibreELEC/releases
https://nightly.builds.lakka.tv/latest

DIR_INSTALL=${HOME}/retroarch

Destination for retroarch.
Also used as temporal over installation by default.

DIR_TMP=${DIR_INSTALL}/tmp

DEVICE=
ARCH=

Empty DEVICE or ARCH will get it from the "/etc/release" file.

Run it.

bash retroarch_install.sh

Clean to Start Over

Remove install directory.
${DIR_INSTALL}

Usually: /storage/retroarch

Remove link.
${HOME}/.config/retroarch

Usually: /storage/.config/retroarch

Troubleshoot RetroArch

Edit systemd service.

vi /storage/.config/system.d/retroarch.service

Change this line adding arguments.

ExecStart=/storage/retroarch/retroarch -v --log-file=/tmp/retroarch.log

Reload systemd

systemctl daemon-reload

Next time you run it it will create log file.

tail /tmp/retroarch.log

BIOS

I wrote this script to help download BIOS from a Internet Archive collection.

wget -q -O - https://raw.githubusercontent.com/basilean/retroarch_install/refs/heads/main/retrobios_install.py | python3

Run as IAGL External Command

It came from the original post.

Create a wrapper script to handle environment variables for service.

vi  /storage/retroex.sh 
echo "SYSTEM=${1}" > /tmp/iagl.conf # Manual for list.
echo "ROM=${2}" >> /tmp/iagl.conf # XXROM_PATHXX

systemctl start retroarch

Make it executable.

chmod 755 /storage/retroex.sh

Change service

vi /storage/.config/system.d/retroarch.service
# Comment old exec line.
# ExecStart=/storage/retroarch/retroarch

# Add script output file with vars.
EnvironmentFile=/tmp/iagl.conf

# Customize retroarch init flags to your like!
ExecStart=/storage/retroarch/retroarch -L ${SYSTEM} ${ROM}

Remember to reload systemd

systemctl daemon-reload

When set external command for a list at IAGL, follow this pattern:

/storage/retroex.sh SYSTEM "ROM"

SYSTEM -> Whatever goes with -L indicating core to use, set it manually for that list.
ROM -> It is replaced by iagl with rom path of your choice. Note that is important to use quotes to avoid issues with white spaces. NOTE: XXROM_PATHXX is an IAGL meta variable representing rom path.

/storage/retroex.sh fbneo "XXROM_PATHXX"

About

This script will help you to install RetroArch from a Lakka image to an already working OS LibreELEC with Kodi.

Topics

Resources

License

Stars

Watchers

Forks