Projects
Eulaceura:Factory
igh-ethercat-xenomai
_service:obs_scm:ethercat-xeno-initd.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:ethercat-xeno-initd.patch of Package igh-ethercat-xenomai
--- ethercat-1.5.2-org/script/init.d/ethercat.in 2021-05-28 16:27:50.479179772 +0800 +++ ethercat-1.5.2-modify/script/init.d/ethercat.in 2021-05-28 16:35:05.629680995 +0800 @@ -53,7 +53,9 @@ MODINFO=/sbin/modinfo ETHERCAT=@prefix@/bin/ethercat_xeno MASTER_ARGS= - +kerName=`uname -r` +libEtherCatRtos=/lib/modules/$kerName/ethercat_rtos +libEtherCatGpos=/lib/modules/$kerName/ethercat_gpos #------------------------------------------------------------------------------ ETHERCAT_CONFIG=/etc/sysconfig/ethercat_xeno @@ -137,11 +139,27 @@ rc_reset fi +MASTERNAME=`lsmod | grep ec_master|awk '{print $1}'` +if [ ! -z ${MASTERNAME} ] ; then + if [ ${MASTERNAME} == "ec_master" ] ;then + echo "please stop ethercat master" + echo "/etc/init.d/ethercat stop" + exit + fi +fi + case "${1}" in start) echo -n "Starting EtherCAT master @VERSION@ " - + if [ -L $libEtherCatGpos ] ; then + rm -f /lib/modules/$kerName/ethercat_gpos + fi + + if [ ! -L $libEtherCatRtos ] ; then + ln -s /lib/modules/ethercat_rtos $libEtherCatRtos + fi + depmod -a # construct DEVICES and BACKUPS from configuration variables DEVICES="" BACKUPS="" @@ -208,15 +226,15 @@ continue # ec_* module not found fi if [ ${MODULE} != "generic_xeno" ]; then - if ${LSMOD} | grep "^${MODULE} " > /dev/null; then - if ! ${RMMOD} ${MODULE}; then + if ${LSMOD} | grep "^${MODULE%_xeno*} " > /dev/null; then + if ! ${RMMOD} ${MODULE%_xeno*}; then exit_fail fi fi fi if ! ${MODPROBE} ${MODPROBE_FLAGS} ${ECMODULE}; then if [ ${MODULE} != "generic_xeno" ]; then - ${MODPROBE} ${MODPROBE_FLAGS} ${MODULE} # try to restore + ${MODPROBE} ${MODPROBE_FLAGS} ${MODULE%_xeno*} # try to restore fi exit_fail fi @@ -244,8 +262,8 @@ # reload previous modules for MODULE in ${DEVICE_MODULES}; do if [ ${MODULE} != "generic_xeno" ]; then - if ! ${MODPROBE} ${MODPROBE_FLAGS} ${MODULE}; then - echo Warning: Failed to restore ${MODULE}. + if ! ${MODPROBE} ${MODPROBE_FLAGS} ${MODULE%_xeno*}; then + echo Warning: Failed to restore ${MODULE%_xeno*}. fi fi done
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2