mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2024-11-22 05:55:38 +00:00
Move default RD logs folder to internal space, then dir_prep after user selects install location
This commit is contained in:
parent
4aba7708c5
commit
efad8a8ad9
|
@ -26,13 +26,14 @@ zip_compressable_extensions="$emuconfigs/defaults/retrodeck/reference_lists/zip_
|
||||||
easter_egg_checklist="$emuconfigs/defaults/retrodeck/reference_lists/easter_egg_checklist.cfg" # A config file listing days and times when special splash screens should show up
|
easter_egg_checklist="$emuconfigs/defaults/retrodeck/reference_lists/easter_egg_checklist.cfg" # A config file listing days and times when special splash screens should show up
|
||||||
input_validation="$emuconfigs/defaults/retrodeck/reference_lists/input_validation.cfg" # A config file listing valid CLI inputs
|
input_validation="$emuconfigs/defaults/retrodeck/reference_lists/input_validation.cfg" # A config file listing valid CLI inputs
|
||||||
finit_options_list="$emuconfigs/defaults/retrodeck/reference_lists/finit_options_list.cfg" # A config file listing available optional installs during finit
|
finit_options_list="$emuconfigs/defaults/retrodeck/reference_lists/finit_options_list.cfg" # A config file listing available optional installs during finit
|
||||||
splashscreen_dir="/var/config/ES-DE/resources/graphics/extra_splashes" # The default location of extra splash screens
|
splashscreen_dir="/var/config/ES-DE/resources/graphics/extra_splashes" # The default location of extra splash screens
|
||||||
current_splash_file="/var/config/ES-DE/resources/graphics/splash.svg" # The active splash file that will be shown on boot
|
current_splash_file="/var/config/ES-DE/resources/graphics/splash.svg" # The active splash file that will be shown on boot
|
||||||
default_splash_file="/var/config/ES-DE/resources/graphics/splash-orig.svg" # The default RetroDECK splash screen
|
default_splash_file="/var/config/ES-DE/resources/graphics/splash-orig.svg" # The default RetroDECK splash screen
|
||||||
multi_user_emulator_config_dirs="$emuconfigs/defaults/retrodeck/reference_lists/multi_user_emulator_config_dirs.cfg" # A list of emulator config folders that can be safely linked/unlinked entirely in multi-user mode
|
multi_user_emulator_config_dirs="$emuconfigs/defaults/retrodeck/reference_lists/multi_user_emulator_config_dirs.cfg" # A list of emulator config folders that can be safely linked/unlinked entirely in multi-user mode
|
||||||
rd_es_themes="/app/share/es-de/themes" # The directory where themes packaged with RetroDECK are stored
|
rd_es_themes="/app/share/es-de/themes" # The directory where themes packaged with RetroDECK are stored
|
||||||
lockfile="/var/config/retrodeck/.lock" # where the lockfile is located
|
lockfile="/var/config/retrodeck/.lock" # Where the lockfile is located
|
||||||
default_sd="/run/media/mmcblk0p1" # Steam Deck SD default path
|
default_sd="/run/media/mmcblk0p1" # Steam Deck SD default path
|
||||||
|
rd_logs_folder="/var/config/retrodeck/logs/" # A static location for RetroDECK logs to be written
|
||||||
hard_version="$(cat '/app/retrodeck/version')" # hardcoded version (in the readonly filesystem)
|
hard_version="$(cat '/app/retrodeck/version')" # hardcoded version (in the readonly filesystem)
|
||||||
rd_repo="https://github.com/XargonWan/RetroDECK" # The URL of the main RetroDECK GitHub repo
|
rd_repo="https://github.com/XargonWan/RetroDECK" # The URL of the main RetroDECK GitHub repo
|
||||||
es_themes_list="https://gitlab.com/es-de/themes/themes-list/-/raw/master/themes.json" # The URL of the ES-DE 2.0 themes list
|
es_themes_list="https://gitlab.com/es-de/themes/themes-list/-/raw/master/themes.json" # The URL of the ES-DE 2.0 themes list
|
||||||
|
@ -127,6 +128,7 @@ fi
|
||||||
# If there is no config file I initalize the file with the the default values
|
# If there is no config file I initalize the file with the the default values
|
||||||
if [[ ! -f "$rd_conf" ]]; then
|
if [[ ! -f "$rd_conf" ]]; then
|
||||||
create_dir /var/config/retrodeck
|
create_dir /var/config/retrodeck
|
||||||
|
create_dir /var/config/retrodeck/logs
|
||||||
log w "RetroDECK config file not found in $rd_conf"
|
log w "RetroDECK config file not found in $rd_conf"
|
||||||
log i "Initializing"
|
log i "Initializing"
|
||||||
# if we are here means that the we are in a new installation, so the version is valorized with the hardcoded one
|
# if we are here means that the we are in a new installation, so the version is valorized with the hardcoded one
|
||||||
|
@ -164,7 +166,7 @@ if [[ ! -f "$rd_conf" ]]; then
|
||||||
|
|
||||||
log i "Setting config file permissions"
|
log i "Setting config file permissions"
|
||||||
chmod +rw $rd_conf
|
chmod +rw $rd_conf
|
||||||
log i "RetroDECK config file initialized. Contents:\n\n$(cat $rd_conf\n)"
|
log i "RetroDECK config file initialized. Contents:\n\n$(cat $rd_conf)\n"
|
||||||
conf_read # Load new variables into memory
|
conf_read # Load new variables into memory
|
||||||
tmplog_merger
|
tmplog_merger
|
||||||
|
|
||||||
|
@ -200,4 +202,4 @@ else
|
||||||
multi_user_data_folder="$rdhome/multi-user-data" # The default location of multi-user environment profiles
|
multi_user_data_folder="$rdhome/multi-user-data" # The default location of multi-user environment profiles
|
||||||
fi
|
fi
|
||||||
|
|
||||||
logs_folder="$rdhome/logs" # The path of the logs folder, here we collect all the logs
|
logs_folder="$rdhome/logs" # The path of the logs folder, here we collect all the logs
|
||||||
|
|
|
@ -28,7 +28,7 @@ log() {
|
||||||
if [ -n "$3" ]; then
|
if [ -n "$3" ]; then
|
||||||
logfile="$3"
|
logfile="$3"
|
||||||
else
|
else
|
||||||
logfile="$logs_folder/retrodeck.log"
|
logfile="$rd_logs_folder/retrodeck.log"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if the shell is sh (not bash or zsh) to avoid colorization
|
# Check if the shell is sh (not bash or zsh) to avoid colorization
|
||||||
|
@ -100,16 +100,16 @@ log() {
|
||||||
# This function is merging the temporary log file into the actual one
|
# This function is merging the temporary log file into the actual one
|
||||||
tmplog_merger() {
|
tmplog_merger() {
|
||||||
|
|
||||||
create_dir "$logs_folder"
|
create_dir "$rd_logs_folder"
|
||||||
|
|
||||||
# Check if /tmp/retrodeck.log exists
|
# Check if /tmp/retrodeck.log exists
|
||||||
if [ -e "/tmp/retrodeck.log" ] && [ -e "$logs_folder/retrodeck.log" ]; then
|
if [ -e "/tmp/retrodeck.log" ] && [ -e "$rd_logs_folder/retrodeck.log" ]; then
|
||||||
|
|
||||||
# Sort both temporary and existing log files by timestamp
|
# Sort both temporary and existing log files by timestamp
|
||||||
sort -k1,1n -k2,2M -k3,3n -k4,4n -k5,5n "/tmp/retrodeck.log" "$logs_folder/retrodeck.log" > "$logs_folder/merged_logs.tmp"
|
sort -k1,1n -k2,2M -k3,3n -k4,4n -k5,5n "/tmp/retrodeck.log" "$rd_logs_folder/retrodeck.log" > "$rd_logs_folder/merged_logs.tmp"
|
||||||
|
|
||||||
# Move the merged logs to replace the original log file
|
# Move the merged logs to replace the original log file
|
||||||
mv "$logs_folder/merged_logs.tmp" "$logs_folder/retrodeck.log"
|
mv "$rd_logs_folder/merged_logs.tmp" "$rd_logs_folder/retrodeck.log"
|
||||||
|
|
||||||
# Remove the temporary file
|
# Remove the temporary file
|
||||||
rm "/tmp/retrodeck.log"
|
rm "/tmp/retrodeck.log"
|
||||||
|
@ -119,8 +119,8 @@ tmplog_merger() {
|
||||||
# Check if the source file exists
|
# Check if the source file exists
|
||||||
if [ -e "$ESDE_source_logs" ]; then
|
if [ -e "$ESDE_source_logs" ]; then
|
||||||
# Create the symlink in the logs folder
|
# Create the symlink in the logs folder
|
||||||
ln -sf "$ESDE_source_logs" "$logs_folder/ES-DE.log"
|
ln -sf "$ESDE_source_logs" "$rd_logs_folder/ES-DE.log"
|
||||||
log i "ES-DE log file linked to \"$logs_folder/ES-DE.log\""
|
log i "ES-DE log file linked to \"$rd_logs_folder/ES-DE.log\""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ prepare_component() {
|
||||||
fi
|
fi
|
||||||
done < <(grep -v '^\s*$' $rd_conf | awk '/^\[paths\]/{f=1;next} /^\[/{f=0} f')
|
done < <(grep -v '^\s*$' $rd_conf | awk '/^\[paths\]/{f=1;next} /^\[/{f=0} f')
|
||||||
create_dir "/var/config/retrodeck/godot"
|
create_dir "/var/config/retrodeck/godot"
|
||||||
|
dir_prep "$rd_logs_folder" "$logs_folder"
|
||||||
fi
|
fi
|
||||||
if [[ "$action" == "postmove" ]]; then # Update the paths of any folders that came with the retrodeck folder during a move
|
if [[ "$action" == "postmove" ]]; then # Update the paths of any folders that came with the retrodeck folder during a move
|
||||||
while read -r config_line; do
|
while read -r config_line; do
|
||||||
|
@ -35,6 +36,7 @@ prepare_component() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done < <(grep -v '^\s*$' $rd_conf | awk '/^\[paths\]/{f=1;next} /^\[/{f=0} f')
|
done < <(grep -v '^\s*$' $rd_conf | awk '/^\[paths\]/{f=1;next} /^\[/{f=0} f')
|
||||||
|
dir_prep "$rd_logs_folder" "$logs_folder"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue