From 2e7430ffed6bf386b3aeaf525a403232c5ce5ea4 Mon Sep 17 00:00:00 2001 From: DrUm78 Date: Fri, 21 Mar 2025 18:41:33 +0100 Subject: [PATCH] Libretro cores are now stored by default in the Linux partition for a few purposes: - prevent any unintentional deletion - users can still override the default cores by placing theirs into Libretro/cores/ (launcher scripts will search this location first) - provide an easy way to restore the default cores: just remove yours from Libretro/cores/ and that's it! --- .../usr/games/launchers/gamegear_launch.sh | 6 +++++- .../rootfs-overlay/usr/games/launchers/gb_launch.sh | 6 +++++- .../usr/games/launchers/gba_launch_gpsp.sh | 7 +++++-- .../usr/games/launchers/lynx_launch.sh | 6 +++++- .../usr/games/launchers/megadrive_launch.sh | 6 +++++- .../rootfs-overlay/usr/games/launchers/nes_launch.sh | 6 +++++- .../rootfs-overlay/usr/games/launchers/ngp_launch.sh | 6 +++++- .../rootfs-overlay/usr/games/launchers/pce_launch.sh | 6 +++++- .../usr/games/launchers/psone_launch_pcsx.sh | 6 +++++- .../rootfs-overlay/usr/games/launchers/sms_launch.sh | 6 +++++- .../usr/games/launchers/snes_launch.sh | 6 +++++- .../usr/games/launchers/wonderswan_launch.sh | 6 +++++- FunKey/board/funkey/update_partition | 12 ++++++++++++ FunKey/configs/funkey_defconfig | 5 +++++ 14 files changed, 77 insertions(+), 13 deletions(-) diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gamegear_launch.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gamegear_launch.sh index d6b26a9..d44355a 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gamegear_launch.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gamegear_launch.sh @@ -2,7 +2,11 @@ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID -picoarch /mnt/Libretro/cores/picodrive_libretro.so "$1"& +if [ -e /mnt/Libretro/cores/picodrive_libretro.so ]; then + picoarch /mnt/Libretro/cores/picodrive_libretro.so "$1"& +else + picoarch /usr/games/picodrive_libretro.so "$1"& +fi pid record $! wait $! pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gb_launch.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gb_launch.sh index 3991574..2462273 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gb_launch.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gb_launch.sh @@ -2,7 +2,11 @@ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID -picoarch /mnt/Libretro/cores/gambatte_libretro.so "$1"& +if [ -e /mnt/Libretro/cores/gambatte_libretro.so ]; then + picoarch /mnt/Libretro/cores/gambatte_libretro.so "$1"& +else + picoarch /usr/games/gambatte_libretro.so "$1"& +fi pid record $! wait $! pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gba_launch_gpsp.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gba_launch_gpsp.sh index aac5742..ea4152a 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gba_launch_gpsp.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/gba_launch_gpsp.sh @@ -5,8 +5,11 @@ # Do not use asound.conf to avoid saturated sound rw mv -f /etc/asound.conf /etc/asound.conf.BAK -cd ${HOME} -picoarch /mnt/Libretro/cores/gpsp_libretro.so "$1"& +if [ -e /mnt/Libretro/cores/gpsp_libretro.so ]; then + picoarch /mnt/Libretro/cores/gpsp_libretro.so "$1"& +else + picoarch /usr/games/gpsp_libretro.so "$1"& +fi pid record $! wait $! pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/lynx_launch.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/lynx_launch.sh index a6ba7b5..2da59d9 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/lynx_launch.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/lynx_launch.sh @@ -9,7 +9,11 @@ fi # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID -picoarch /mnt/Libretro/cores/mednafen_lynx_libretro.so "$1"& +if [ -e /mnt/Libretro/cores/mednafen_lynx_libretro.so ]; then + picoarch /mnt/Libretro/cores/mednafen_lynx_libretro.so "$1"& +else + picoarch /usr/games/mednafen_lynx_libretro.so "$1"& +fi pid record $! wait $! pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/megadrive_launch.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/megadrive_launch.sh index d6b26a9..d44355a 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/megadrive_launch.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/megadrive_launch.sh @@ -2,7 +2,11 @@ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID -picoarch /mnt/Libretro/cores/picodrive_libretro.so "$1"& +if [ -e /mnt/Libretro/cores/picodrive_libretro.so ]; then + picoarch /mnt/Libretro/cores/picodrive_libretro.so "$1"& +else + picoarch /usr/games/picodrive_libretro.so "$1"& +fi pid record $! wait $! pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/nes_launch.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/nes_launch.sh index 458712c..9ebca66 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/nes_launch.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/nes_launch.sh @@ -2,7 +2,11 @@ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID -picoarch /mnt/Libretro/cores/fceumm_libretro.so "$1"& +if [ -e /mnt/Libretro/cores/fceumm_libretro.so ]; then + picoarch /mnt/Libretro/cores/fceumm_libretro.so "$1"& +else + picoarch /usr/games/fceumm_libretro.so "$1"& +fi pid record $! wait $! pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/ngp_launch.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/ngp_launch.sh index 5726939..50904c3 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/ngp_launch.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/ngp_launch.sh @@ -2,7 +2,11 @@ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID -picoarch /mnt/Libretro/cores/mednafen_ngp_libretro.so "$1"& +if [ -e /mnt/Libretro/cores/mednafen_ngp_libretro.so ]; then + picoarch /mnt/Libretro/cores/mednafen_ngp_libretro.so "$1"& +else + picoarch /usr/games/mednafen_ngp_libretro.so "$1"& +fi pid record $! wait $! pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/pce_launch.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/pce_launch.sh index 7600c1e..c3d95e8 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/pce_launch.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/pce_launch.sh @@ -2,7 +2,11 @@ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID -picoarch /mnt/Libretro/cores/mednafen_supergrafx_libretro.so "$1"& +if [ -e /mnt/Libretro/cores/mednafen_supergrafx_libretro.so ]; then + picoarch /mnt/Libretro/cores/mednafen_supergrafx_libretro.so "$1"& +else + picoarch /usr/games/mednafen_supergrafx_libretro.so "$1"& +fi pid record $! wait $! pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/psone_launch_pcsx.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/psone_launch_pcsx.sh index c4a6962..c83a6a5 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/psone_launch_pcsx.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/psone_launch_pcsx.sh @@ -2,7 +2,11 @@ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID -picoarch /mnt/Libretro/cores/pcsx_rearmed_libretro.so "$1"& +if [ -e /mnt/Libretro/cores/pcsx_rearmed_libretro.so ]; then + picoarch /mnt/Libretro/cores/pcsx_rearmed_libretro.so "$1"& +else + picoarch /usr/games/pcsx_rearmed_libretro.so "$1"& +fi pid record $! wait $! pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/sms_launch.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/sms_launch.sh index d6b26a9..d44355a 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/sms_launch.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/sms_launch.sh @@ -2,7 +2,11 @@ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID -picoarch /mnt/Libretro/cores/picodrive_libretro.so "$1"& +if [ -e /mnt/Libretro/cores/picodrive_libretro.so ]; then + picoarch /mnt/Libretro/cores/picodrive_libretro.so "$1"& +else + picoarch /usr/games/picodrive_libretro.so "$1"& +fi pid record $! wait $! pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/snes_launch.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/snes_launch.sh index fdd33ec..5b595ac 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/snes_launch.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/snes_launch.sh @@ -2,7 +2,11 @@ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID -picoarch /mnt/Libretro/cores/snes9x2005_libretro.so "$1"& +if [ -e /mnt/Libretro/cores/snes9x2005_libretro.so ]; then + picoarch /mnt/Libretro/cores/snes9x2005_libretro.so "$1"& +else + picoarch /usr/games/snes9x2005_libretro.so "$1"& +fi pid record $! wait $! pid erase diff --git a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/wonderswan_launch.sh b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/wonderswan_launch.sh index c80de7f..1997172 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/wonderswan_launch.sh +++ b/FunKey/board/funkey/rootfs-overlay/usr/games/launchers/wonderswan_launch.sh @@ -2,7 +2,11 @@ # Launch the process in background, record the PID into a file, wait # for the process to terminate and erase the recorded PID -picoarch /mnt/Libretro/cores/mednafen_wswan_libretro.so "$1"& +if [ -e /mnt/Libretro/cores/mednafen_wswan_libretro.so ]; then + picoarch /mnt/Libretro/cores/mednafen_wswan_libretro.so "$1"& +else + picoarch /usr/games/mednafen_wswan_libretro.so "$1"& +fi pid record $! wait $! pid erase diff --git a/FunKey/board/funkey/update_partition b/FunKey/board/funkey/update_partition index f38423e..aa83cd2 100755 --- a/FunKey/board/funkey/update_partition +++ b/FunKey/board/funkey/update_partition @@ -63,6 +63,18 @@ do_postinst() rm /mnt/Emulators/wonderswan_mednafen_funkey-s.opk rm /mnt/Applications/commander-funkey-s.opk + # Remove Libretro cores from previous location + rm /mnt/Libretro/cores/fceumm_libretro.so + rm /mnt/Libretro/cores/gambatte_libretro.so + rm /mnt/Libretro/cores/gpsp_libretro.so + rm /mnt/Libretro/cores/mednafen_lynx_libretro.so + rm /mnt/Libretro/cores/mednafen_ngp_libretro.so + rm /mnt/Libretro/cores/mednafen_supergrafx_libretro.so + rm /mnt/Libretro/cores/mednafen_wswan_libretro.so + rm /mnt/Libretro/cores/pcsx_rearmed_libretro.so + rm /mnt/Libretro/cores/picodrive_libretro.so + rm /mnt/Libretro/cores/snes9x2005_libretro.so + # Unmount Rootfs umount ${root_mount} if [ $? -ne 0 ]; then diff --git a/FunKey/configs/funkey_defconfig b/FunKey/configs/funkey_defconfig index 36275d0..3f1781b 100644 --- a/FunKey/configs/funkey_defconfig +++ b/FunKey/configs/funkey_defconfig @@ -61,12 +61,17 @@ BR2_PACKAGE_E2FSPROGS=y # BR2_PACKAGE_E2FSPROGS_FSCK is not set BR2_PACKAGE_E2FSPROGS_RESIZE2FS=y BR2_PACKAGE_FBGRAB=y +BR2_PACKAGE_SDL=y +BR2_PACKAGE_SDL_GFX=y +BR2_PACKAGE_SDL_IMAGE=y BR2_PACKAGE_SDL_IMAGE_GIF=y BR2_PACKAGE_SDL_IMAGE_JPEG=y BR2_PACKAGE_SDL_IMAGE_PNG=y +BR2_PACKAGE_SDL_MIXER=y BR2_PACKAGE_SDL_NET=y BR2_PACKAGE_SDL_SOUND=y BR2_PACKAGE_SDL_SOUND_PLAYSOUND=y +BR2_PACKAGE_SDL_TTF=y BR2_PACKAGE_GPTFDISK=y BR2_PACKAGE_GPTFDISK_GDISK=y BR2_PACKAGE_GPTFDISK_SGDISK=y