distribution/packages/jelos/sources/post-update

57 lines
1.9 KiB
Text
Raw Normal View History

#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
. /etc/profile
2022-11-01 11:55:34 +00:00
LOG="/var/log/boot.log"
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.
### Items in this block should always run after updates.
################################################################################
2022-11-01 11:55:34 +00:00
echo "Rebuild library cache..." >>${LOG}
### Rebuild the library cache
rm -f /storage/.cache/ld.so.cache
ldconfig -X
2022-11-01 11:55:34 +00:00
echo "Sync configuration files..." >>${LOG}
### Sync configurations
2022-03-28 23:53:26 +00:00
if [ -d "/storage/.config/system/configs" ]
then
EXCLUDE="--exclude=configs"
fi
2022-09-16 02:34:00 +00:00
rsync -a --delete ${EXCLUDE} /usr/config/system/ /storage/.config/system/
rsync -a --ignore-existing /usr/config/game /storage/.config/
rsync -a /usr/config/modules /storage/.config/
2022-03-28 23:53:26 +00:00
2022-11-01 11:55:34 +00:00
echo "Update logo..." >>${LOG}
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-11-01 11:55:34 +00:00
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
### Apply developer ssh keys if they exist
2022-11-01 11:55:34 +00:00
echo "Apply dev keys if available..." >>${LOG}
if [ -e /usr/config/ssh/authorized_keys ]
then
cp /usr/config/ssh/authorized_keys /storage/.ssh
fi
### Sync rsync configs
2022-11-01 11:55:34 +00:00
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/
### Add items below this line that are safe to remove after a period of time.
################################################################################