Fix #206: allow to customize utilities from configure

`ethercatctl` calls some utilites actually hardcoded in the script.
Provide a way to customize them from configure.

The default values are choosen to be backward compatible with the old
behavior, but more sensible values would be preferred, e.g.:

OPTION      ACTUAL DEFAULT      PREFERRED DEFAULT
kmod-dir    /sbin               $sbindir
ip-cmd      /bin/ip             $sbindir/ip

In a major future release this can be changed.
This commit is contained in:
Nicola Fontana
2026-03-02 12:09:59 +01:00
parent 90f9feb0ad
commit b86d2163f1
3 changed files with 35 additions and 7 deletions
+2
View File
@@ -68,6 +68,8 @@ endif
# Any precious variable used inside script_templates should appear here
expand_script = $(SED) \
-e 's,[@]VERSION[@],$(VERSION),g' \
-e 's,[@]ipcmd[@],$(ipcmd),g' \
-e 's,[@]kmoddir[@],$(kmoddir),g' \
-e 's,[@]bindir[@],$(bindir),g' \
-e 's,[@]sbindir[@],$(sbindir),g' \
-e 's,[@]sysconfdir[@],$(sysconfdir),g'
+7 -7
View File
@@ -25,13 +25,13 @@
#
#------------------------------------------------------------------------------
LSMOD=/sbin/lsmod
MODPROBE=/sbin/modprobe
RMMOD=/sbin/rmmod
MODINFO=/sbin/modinfo
IP=/bin/ip
LSMOD="@kmoddir@/lsmod"
MODPROBE="@kmoddir@/modprobe"
RMMOD="@kmoddir@/rmmod"
MODINFO="@kmoddir@/modinfo"
IP="@ipcmd@"
ETHERCAT=@bindir@/ethercat
ETHERCAT="@bindir@/ethercat"
#------------------------------------------------------------------------------
@@ -39,7 +39,7 @@ if [ "$1" = "-c" ]; then
ETHERCAT_CONFIG="$2"
COMMAND="$3"
else
ETHERCAT_CONFIG=@sysconfdir@/ethercat.conf
ETHERCAT_CONFIG="@sysconfdir@/ethercat.conf"
COMMAND="$1"
fi