From 4514ad03364468906dd71077bbef8058a23b92a2 Mon Sep 17 00:00:00 2001 From: Jools Wills Date: Wed, 15 Jun 2022 18:56:29 +0100 Subject: [PATCH] runcommand - allow the runcommand log directory to be changed. If an entry log_dir is made in /opt/retropie/configs/all/runcommand.cfg it will be used by runcommand for saving runcommand.log/runcommand.info files instead of the default /dev/shm It will also be used for generation of retropie_xinitrc and the generated/appended retroarch.cfg --- scriptmodules/supplementary/runcommand/runcommand.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scriptmodules/supplementary/runcommand/runcommand.sh b/scriptmodules/supplementary/runcommand/runcommand.sh index 3d19d89659..698eb9005d 100755 --- a/scriptmodules/supplementary/runcommand/runcommand.sh +++ b/scriptmodules/supplementary/runcommand/runcommand.sh @@ -79,7 +79,6 @@ ROOTDIR="/opt/retropie" CONFIGDIR="$ROOTDIR/configs" -LOG="/dev/shm/runcommand.log" RUNCOMMAND_CONF="$CONFIGDIR/all/runcommand.cfg" VIDEO_CONF="$CONFIGDIR/all/videomodes.cfg" @@ -119,6 +118,10 @@ function get_config() { iniGet "image_delay" IMAGE_DELAY="$ini_value" [[ -z "$IMAGE_DELAY" ]] && IMAGE_DELAY=2 + iniGet "log_dir" + LOGDIR="$ini_value" + [[ -z "$LOGDIR" ]] && LOGDIR="/dev/shm" + LOG="$LOGDIR/runcommand.log" fi if [[ -n "$DISPLAY" ]] && $XRANDR &>/dev/null; then @@ -928,7 +931,7 @@ function switch_fb_res() { function build_xinitrc() { local mode="$1" - local xinitrc="/dev/shm/retropie_xinitrc" + local xinitrc="$LOGDIR/retropie_xinitrc" case "$mode" in clear) @@ -1067,7 +1070,7 @@ function config_backend() { } function retroarch_append_config() { - local conf="/dev/shm/retroarch.cfg" + local conf="$LOGDIR/retroarch.cfg" local dim # only for retroarch emulators @@ -1308,7 +1311,7 @@ function launch_command() { } function log_info() { - echo -e "$SYSTEM\n$EMULATOR\n$ROM\n$COMMAND" >/dev/shm/runcommand.info + echo -e "$SYSTEM\n$EMULATOR\n$ROM\n$COMMAND" >"$LOGDIR/runcommand.info" } function runcommand() {