2022-03-16 22:03:28 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
|
|
|
|
|
|
|
|
. /etc/profile
|
|
|
|
|
2022-03-28 23:53:26 +00:00
|
|
|
### This script contains items that we only want to execute after a JELOS upgrade,
|
|
|
|
### or after a fresh installation.
|
|
|
|
|
2022-07-31 15:12:57 +00:00
|
|
|
### Rebuild the library cache
|
|
|
|
rm -f /storage/.cache/ld.so.cache
|
|
|
|
ldconfig -X
|
|
|
|
|
2022-08-03 11:46:37 +00:00
|
|
|
### Sync configurations
|
2022-03-28 23:53:26 +00:00
|
|
|
if [ -d "/storage/.config/system/configs" ]
|
|
|
|
then
|
|
|
|
EXCLUDE="--exclude=configs"
|
|
|
|
fi
|
|
|
|
|
|
|
|
rsync -a --delete ${EXCLUDE} /usr/config/system/ /storage/.config/system/ &
|
2022-04-03 17:01:59 +00:00
|
|
|
rsync -a --ignore-existing /usr/config/game /storage/.config/ &
|
2022-03-28 23:53:26 +00:00
|
|
|
rsync -a /usr/config/modules /storage/.config/ &
|
|
|
|
|
2022-08-26 23:18:56 +00:00
|
|
|
if [ ! -L "/storage/.config/emulationstation/resources/logo.png" ]
|
|
|
|
then
|
|
|
|
rm -f /storage/.config/emulationstation/resources/logo.png ||:
|
|
|
|
ln -sf /usr/config/splash/splash.png /storage/.config/emulationstation/resources/logo.png
|
|
|
|
fi
|
|
|
|
|
2022-08-03 11:46:37 +00:00
|
|
|
### Update add-ons and themes
|
2022-03-28 23:53:26 +00:00
|
|
|
wait < <(jobs -p)
|
2022-03-16 22:03:28 +00:00
|
|
|
|
2022-04-09 13:26:40 +00:00
|
|
|
cp -f /usr/config/modules/gamelist.xml /storage/.config/modules
|
2022-04-26 16:51:27 +00:00
|
|
|
cp -f /usr/config/retroarch/retroarch-core-options.cfg /storage/.config/retroarch/retroarch-core-options.cfg
|
2022-05-13 13:19:07 +00:00
|
|
|
rm -rf /storage/roms/ports/JelosAddOns*
|
2022-05-13 16:53:23 +00:00
|
|
|
cp -r /usr/share/JelosAddOns /storage/roms/ports/
|
2022-05-13 15:24:28 +00:00
|
|
|
mv /storage/roms/ports/JelosAddOns/JelosAddOns.sh /storage/roms/ports/JelosAddOns.sh
|
2022-07-11 19:31:23 +00:00
|
|
|
chmod +x /storage/roms/ports/JelosAddOns.sh
|
2022-03-16 22:03:28 +00:00
|
|
|
|
2022-08-03 11:46:37 +00:00
|
|
|
cd /usr/share/themes
|
|
|
|
for theme in *
|
|
|
|
do
|
|
|
|
if [ ! -L /storage/.config/emulationstation/themes/${theme} ] && \
|
|
|
|
[ ! -e /storage/.config/emulationstation/themes/${theme} ]
|
|
|
|
then
|
|
|
|
ln -s /usr/share/themes/${theme} /storage/.config/emulationstation/themes
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
cd -
|
|
|
|
|
|
|
|
### Apply developer ssh keys if they exist
|
2022-07-13 21:59:42 +00:00
|
|
|
if [ -e /usr/config/ssh/authorized_keys ]
|
|
|
|
then
|
2022-06-06 18:09:55 +00:00
|
|
|
cp /usr/config/ssh/authorized_keys /storage/.ssh
|
|
|
|
fi
|
|
|
|
|
2022-04-03 17:01:59 +00:00
|
|
|
rsync --ignore-existing /usr/config/rsync-rules.conf /storage/.config/
|
|
|
|
rsync --ignore-existing /usr/config/rsync.conf /storage/.config/
|
|
|
|
|
2022-08-20 14:12:53 +00:00
|
|
|
### Replace es_systems and es_features with links to manage them
|
|
|
|
for es_cfg in es_features.cfg es_systems.cfg
|
|
|
|
do
|
2022-08-21 16:23:26 +00:00
|
|
|
if [ -e "/storage/.config/emulationstation/${es_cfg}" ]
|
2022-08-20 14:12:53 +00:00
|
|
|
then
|
|
|
|
mv /storage/.config/emulationstation/${es_cfg} /storage/.config/emulationstation/last_${es_cfg}
|
|
|
|
fi
|
|
|
|
ln -s /usr/config/emulationstation/${es_cfg} /storage/.config/emulationstation/${es_cfg}
|
|
|
|
done
|
|
|
|
|
2022-08-03 11:46:37 +00:00
|
|
|
### Safe to make changes below this line.
|
|
|
|
|
2022-07-13 21:59:42 +00:00
|
|
|
# Swap es_input back to a writeable file so external controller configuration works properly.
|
|
|
|
if [ -L "/storage/.config/emulationstation/es_input.cfg" ]
|
|
|
|
then
|
|
|
|
rm -f /storage/.config/emulationstation/es_input.cfg
|
|
|
|
cp -f /usr/config/emulationstation/es_input.cfg /storage/.config/emulationstation/es_input.cfg
|
|
|
|
fi
|
2022-07-30 23:34:43 +00:00
|
|
|
|
|
|
|
# Re-introduce overlayfs for retroarch.
|
|
|
|
sed -i 's#^overlay_directory.*$#overlay_directory = "/tmp/overlays"#g' /storage/.config/retroarch/retroarch.cfg
|
|
|
|
sed -i 's#^video_shader_dir.*$#video_shader_dir = "/tmp/shaders"#g' /storage/.config/retroarch/retroarch.cfg
|
|
|
|
sed -i 's#^joypad_autoconfig_dir.*$#joypad_autoconfig_dir = "/tmp/joypads"#g' /storage/.config/retroarch/retroarch.cfg
|
|
|
|
sed -i 's#^cheat_database_path.*$#cheat_database_path = "/tmp/database/cht"#g' /storage/.config/retroarch/retroarch.cfg
|
|
|
|
sed -i 's#^content_database_path.*$#content_database_path = "/tmp/database/rdb"#g' /storage/.config/retroarch/retroarch.cfg
|
|
|
|
sed -i 's#^assets_directory.*$#assets_directory = "/tmp/assets"#g' /storage/.config/retroarch/retroarch.cfg
|
|
|
|
sed -i 's#^libretro_directory.*$#libretro_directory = "/tmp/cores"#g' /storage/.config/retroarch/retroarch.cfg
|
|
|
|
sed -i 's#^libretro_info_path.*$#libretro_info_path = "/tmp/cores"#g' /storage/.config/retroarch/retroarch.cfg
|