This is taken from OpenOCD User’s manual
Configuration files and scripts are searched for in
- the current directory,
- any search dir specified on the command line using the
-s
option, - any search dir specified using the
add_script_search_dir
command, - a directory in the
OPENOCD_SCRIPTS
environment variable (if set), -
%APPDATA%/OpenOCD
(only on Windows),
-
$HOME/Library/Preferences/org.openocd
(only on Darwin),
-
$XDG_CONFIG_HOME/openocd
($XDG_CONFIG_HOME
defaults to$HOME/.config
), -
$HOME/.openocd
, - the site wide script library
$pkgdatadir/site
($pkgdatadir
is compile time variable and usually set to/usr/share/openocd/
, and - the OpenOCD-supplied script library
$pkgdatadir/scripts
.
The first found file with a matching file name will be used.