Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runcommand - allow the runcommand log directory to be changed. #3556

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions scriptmodules/supplementary/runcommand/runcommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please modify [[ -z "$LOGDIR" ]] && LOGDIR="/dev/shm" to [[ -d "$LOGDIR" ]] || LOGDIR="/dev/shm".

If the $LOGDIR is unset or not a directory, default to /dev/shm. Though mind /dev/shm isn't guaranteed to be mounted. /tmp would be the safest bet.

LOG="$LOGDIR/runcommand.log"
fi

if [[ -n "$DISPLAY" ]] && $XRANDR &>/dev/null; then
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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() {
Expand Down