Additional cleanup.

This commit is contained in:
fewtarius 2023-04-22 20:55:24 +00:00
parent 6d622fa30f
commit 644a2218ba
No known key found for this signature in database
GPG key ID: F4AE55305D1B8C1A
8 changed files with 24 additions and 158 deletions

View file

@ -0,0 +1,10 @@
#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
. /etc/profile
### Set up our controller variables.
tocon "Configuring controller..."
/usr/bin/mkcontroller

View file

@ -86,6 +86,8 @@ makeinstall_target() {
cp ${PKG_BUILD}/retroarch ${INSTALL}/usr/bin
mkdir -p ${INSTALL}/usr/share/retroarch/filters
cp ${PKG_DIR}/scripts/mkcontroller ${INSTALL}/usr/bin
case ${ARCH} in
aarch64)
if [ -f ${ROOT}/build.${DISTRO}-${DEVICE}.arm/retroarch-*/.install_pkg/usr/bin/retroarch ]; then

View file

@ -1,6 +0,0 @@
#!/bin/sh
for i in 5 4 3 2 1 0; do [ -e /dev/snd/pcmC${i}D0p ] && export ALSA_CARD=$i; done
echo "ALSA_CARD=\"$ALSA_CARD\"" > /run/libreelec/retroarch.conf
echo "LD_LIBRARY_PATH=\"/usr/lib:/tmp/cores\"" >> /run/libreelec/retroarch.conf

View file

@ -5,12 +5,6 @@
. /etc/profile
if [ ! -L "/storage/.emulationstation" ] && \
[ -d /storage/.config/emulationstation ]
then
ln -sf /storage/.config/emulationstation /storage/.emulationstation
fi
if [ -d "/storage/cache/.cores" ]
then
rm -rf /storage/cache/.cores
@ -48,7 +42,3 @@ fi
### if it exists.
/usr/bin/clean_sysconfig
### Set up our controller variables.
tocon "Configuring controller..."
/usr/bin/mkcontroller

View file

@ -36,18 +36,6 @@ echo "Sync modules..." >>${LOG}
rsync -a /usr/config/modules/* /storage/.config/modules/
cp -f /usr/config/retroarch/retroarch-core-options.cfg /storage/.config/retroarch/retroarch-core-options.cfg
echo "Sync theme..." >>${LOG}
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
echo "Apply dev keys if available..." >>${LOG}
if [ -e /usr/config/ssh/authorized_keys ]
@ -60,133 +48,3 @@ echo "Update rsync configuration files..." >>${LOG}
rsync --ignore-existing /usr/config/rsync-rules.conf /storage/.config/
rsync --ignore-existing /usr/config/rsync.conf /storage/.config/
### Replace es_systems and es_features with links to manage them
echo "Sync ES configuration files..." >>${LOG}
for es_cfg in es_features.cfg es_systems.cfg
do
if [ -e "/storage/.config/emulationstation/${es_cfg}" ]
then
mv -f /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
# Default modules need to be updated to use the new stop/start ui function.
echo "Sync modules (tools)..." >>${LOG}
rsync -av /usr/config/modules/* /storage/.config/modules/
rm -f /storage/.config/modules/{"351Files.sh","Start 32bit Retroarch.sh","JelosAddOns.sh","PortMaster.sh","ThemeMaster.sh"} ||:
# Swap es_input back to a writeable file so external controller configuration works properly.
echo "Make sure es_input isn't a link..." >>${LOG}
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
# Disable integer scaling by default on Handheld
if [[ "${HW_DEVICE}" =~ AMD64 ]]
then
echo "No integer scaling (Handheld only)..." >>${LOG}
sed -i "s#.integerscale=1#.integerscale=0#g" /storage/.config/system/configs/system.cfg
fi
# If smb.conf doesn't exist in ~/.config, add it.
if [ ! -e "/storage/.config/smb.conf" ]
then
echo "Make sure smb.conf is in .config..." >>${LOG}
cp -f /usr/config/smb.conf /storage/.config
fi
# Set enhanced power saving off by default
ENHPOWER=$(get_setting system.powersave)
if [ -z "${ENHPOWER}" ]
then
echo "Set up enhanced power saving..." >>${LOG}
set_setting system.powersave 0
fi
# Set automatic hotkey management by default.
AUTOHOTKEYS=$(get_setting system.autohotkeys)
if [ -z "${AUTOHOTKEYS}" ]
then
echo "Set up hotkey management..." >>${LOG}
set_setting system.autohotkeys 1
fi
# Swap to schedutil as the default governor
GOVERNOR=$(get_setting system.cpugovernor)
if [ "${GOVERNOR}" = "interactive" ]
then
set_setting system.cpugovernor schedutil
schedutil
fi
# Set the default weston startup to ES
WESTONSTARTUP=$(get_setting weston.startup)
if [ -z "${WESTONSTARTUP}" ]
then
echo "Make sure weston is our default." >>${LOG}
set_setting weston.startup "/usr/bin/start_es.sh"
fi
# Disable PCSX2SA auto update check
if [ -e "/storage/.config/PCSX2/inis/PCSX2.ini" ] && \
[ ! "$(grep -i AutoUpdater /storage/.config/PCSX2/inis/PCSX2.ini)" ]
then
cat <<EOF >>/storage/.config/PCSX2/inis/PCSX2.ini
[AutoUpdater]
CheckAtStartup = false
EOF
fi
# the controller profile has been renamed.
if [ -e "/storage/.config/profile.d/99-controller" ]
then
rm -f /storage/.config/profile.d/99-controller
mkcontroller
fi
# Set a default GPU power savings mode
GPUMODE=$(get_setting system.gpuperf)
if [ -z "${GPUMODE}" ]
then
echo "Set a default GPU power savings mode." >>${LOG}
set_setting system.gpuperf auto
fi
# Set a default for the audio preamp
PREAMP=$(get_setting audio.preamp)
if [ -z "${PREAMP}" ]
then
echo "Set default preamp." >>${LOG}
set_setting audio.preamp 50
fi
# Disable IPv6 by default
IPV6=$(get_setting ipv6.enabled)
if [ -z "${IPV6}" ]
then
echo "Disable ipv6." >>${LOG}
set_setting ipv6.enabled 0
fi
SYNCTHING=$(get_setting syncthing.enabled)
if [ -z "${SYNCTHING}" ]
then
echo "Set syncthing default" >>${LOG}
set_setting syncthing.enabled=0
fi
### Force everyone to the stable repo
set_setting updates.branch stable
### Configure box86/64 defaults
for BOX in box86 box64
do
if [ ! -e "/storage/.config/${BOX}.${BOX}rc" ]
then
cp -f /usr/config/${BOX}.${BOX}rc /storage/.config/
fi
done

View file

@ -0,0 +1,12 @@
#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
. /etc/profile
if [ ! -L "/storage/.emulationstation" ] && \
[ -d /storage/.config/emulationstation ]
then
ln -sf /storage/.config/emulationstation /storage/.emulationstation
fi