forked from batocera-linux/batocera.linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request batocera-linux#7139 from batocera-linux/batocera.c…
…onf_default batocera.conf default values by board
- Loading branch information
Showing
4 changed files
with
40 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
package/batocera/core/batocera-settings/batocera-settings-get-master
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# this script can be used by values that can have a default value by board | ||
|
||
KEY=$1 | ||
|
||
# prefer the user value | ||
batocera-settings-get "${KEY}" && exit 0 | ||
|
||
BOARD_MODEL=$(cat /sys/firmware/devicetree/base/model 2>/dev/null | sed -e s+"[^A-Za-z0-9]"+"_"+g) | ||
if test -z "${BOARD_MODEL}" | ||
then | ||
# give an other chance with dmi | ||
BOARD_MODEL=$(cat /sys/devices/virtual/dmi/id/board_name 2>/dev/null | sed -e s+"[^A-Za-z0-9]"+"_"+g) | ||
fi | ||
|
||
# prefer the board value | ||
if test -e "/usr/share/batocera/sysconfigs/batocera.conf.${BOARD_MODEL}" | ||
then | ||
batocera-settings-get -f "/usr/share/batocera/sysconfigs/batocera.conf.${BOARD_MODEL}" "${KEY}" && exit 0 | ||
fi | ||
|
||
# prefer the general value | ||
if test -e "/usr/share/batocera/sysconfigs/batocera.conf" | ||
then | ||
batocera-settings-get -f "/usr/share/batocera/sysconfigs/batocera.conf" "${KEY}" && exit 0 | ||
fi | ||
|
||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters