Last active
November 16, 2025 15:05
-
-
Save maatthc/792471812150010c935aedd34c93aedf to your computer and use it in GitHub Desktop.
LG WebOStv - Play games on RetroArch from USB drive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # === For rooted LG TVs with WebOsBrew installed only === | |
| # | |
| # On LG WebOStv, RetroArch only have access to a few jailed folders so to run games on a usb drive, | |
| # we need to 'merge' the USB mounting point with one of those jailed folders using OverlayFS. | |
| # The scripts on folder '/var/lib/webosbrew/init.d/' will run after every tv boot. | |
| # Remove the $STARTUP_FOLDER/$SCRIPT_TO_RUN_AFTER_BOOT and reboot to revert the change. | |
| # | |
| # Tested on 7.3.0-03.30.72 | |
| # | |
| # Steps: | |
| # - Copy this script to a pen drive and insert it to the TV | |
| # - Check if the folder '/tmp/usb/sda/sda1/' exists and have the content of your pen drive. | |
| # - Run the script | |
| # | |
| # The folder structure might be different depending of your TV version | |
| set -euo pipefail | |
| JAILED_FOLDER=/var/palm/jail/com.retroarch/media/internal | |
| USB_MOUTING_POINT1=/tmp/usb/sda/sda1/ | |
| USB_MOUTING_POINT2=/tmp/usb/sdb/sdb1/ | |
| USB_MOUTING_POINT3=/tmp/usb/sdc/sdc1/ | |
| SCRIPT_TO_RUN_AFTER_BOOT=add_usb_drive_to_retroarch_media_folder | |
| STARTUP_FOLDER=/var/lib/webosbrew/init.d | |
| echo -e "#!/bin/bash \nmount -t overlay -olowerdir=${JAILED_FOLDER}:${USB_MOUTING_POINT1},nofail overlay ${JAILED_FOLDER}" > $STARTUP_FOLDER/$SCRIPT_TO_RUN_AFTER_BOOT | |
| echo -e "\nmount -t overlay -olowerdir=${JAILED_FOLDER}:${USB_MOUTING_POINT2},nofail overlay ${JAILED_FOLDER}" > $STARTUP_FOLDER/$SCRIPT_TO_RUN_AFTER_BOOT | |
| echo -e "\nmount -t overlay -olowerdir=${JAILED_FOLDER}:${USB_MOUTING_POINT3},nofail overlay ${JAILED_FOLDER}" > $STARTUP_FOLDER/$SCRIPT_TO_RUN_AFTER_BOOT | |
| chmod +x $STARTUP_FOLDER/$SCRIPT_TO_RUN_AFTER_BOOT | |
| echo "Script ${STARTUP_FOLDER}/${SCRIPT_TO_RUN_AFTER_BOOT} created." | |
| echo "Press any key to reboot and activate changes or CRTL+C to quit." | |
| read -n 1 | |
| reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @maatthc
I’ve checked, but unfortunately the TV doesn’t have the components needed to mount the share. They might need to be compiled, but I’d rather not risk bricking the TV :-(
root@LGwebOSTV:
# which mount# which mount.nfs/bin/mount
root@LGwebOSTV:
root@LGwebOSTV:
# ls /sbin /bin /usr/sbin /usr/bin | grep nfs# lsmod | grep nfsroot@LGwebOSTV:
root@LGwebOSTV:~# lsmod
Module Size Used by
dm_eswap_ad 16384 0
dm_eswap 61440 3 dm_eswap_ad
wlan_mt7663_usb 1875968 0
btmtk_usb 106496 2
tfat 311296 0
tntfs 458752 0
a8303 16384 0
dvb_a8303_chip 16384 1 a8303
dvb_a8303_adapter 16384 1 dvb_a8303_chip
rda5815m 16384 0
dvb_rda5815m_chip 24576 1 rda5815m
dvb_rda_adapter 16384 1 dvb_rda5815m_chip
si2178b 16384 0
si2178b_atv 16384 0
dvb_si2178b_chip 188416 2 si2178b,si2178b_atv
dvb_silab_adapter 16384 1 dvb_si2178b_chip
dvb_dtv_soc 16384 0
dvb_dtv_soc_chip 49152 1 dvb_dtv_soc
dvb_common_adapter 16384 2 dvb_dtv_soc_chip,dvb_si2178b_chip
demod_khal 1167360 1 dvb_dtv_soc_chip
webos_tv 57344 10 dvb_a8303_chip,a8303,si2178b,dvb_dtv_soc_chip,dvb_dtv_soc,si2178b_atv,rda5815m,dvb_si2178b_chip,dvb_rda5815m_chip
mali_kbase 471040 8
mali_fb 20480 6
dma_buf_test_exporter 20480 28 mali_kbase
Best regards
Stefano