├── .gitignore ├── README.debianize ├── etherlabmaster └── debian │ ├── changelog │ ├── compat │ ├── control │ ├── dkms │ ├── postbld │ └── postrm │ ├── etherlabmaster-dev.install │ ├── etherlabmaster.dkms │ ├── etherlabmaster.install │ ├── etherlabmaster.postinst │ ├── etherlabmaster.postrm │ ├── etherlabmaster.prerm │ ├── extras │ ├── etc │ │ └── udev │ │ │ └── rules.d │ │ │ └── 99-ethercat.rules │ └── usr │ │ └── sbin │ │ └── update-ethercat-config │ ├── patches │ ├── 10_fix_distclean.diff │ ├── 20_fix_read_pdo_count.diff │ ├── 30_relax_al_state_change_timeout.diff │ ├── 40_safe_rt_mutex_enable.patch │ └── series │ ├── rules │ └── source │ └── format └── get_source.sh /.gitignore: -------------------------------------------------------------------------------- 1 | /*.deb 2 | /*.diff.gz 3 | /*.dsc 4 | /*.buildinfo 5 | /*.changes 6 | /*.orig.tar.gz 7 | /*.debian.tar.xz 8 | /etherlabmaster/* 9 | !/etherlabmaster/debian/ 10 | /etherlabmaster/debian/etherlabmaster*/ 11 | /etherlabmaster/debian/tmp/ 12 | /etherlabmaster/debian/*.log 13 | /etherlabmaster/debian/*.substvars 14 | /etherlabmaster/debian/*.debhelper 15 | /etherlabmaster/debian/*-stamp 16 | /etherlabmaster/debian/autoreconf.* 17 | /etherlabmaster/debian/files 18 | /etherlabmaster/debian/.pc/ 19 | 20 | -------------------------------------------------------------------------------- /README.debianize: -------------------------------------------------------------------------------- 1 | DESCRIPTION 2 | ----------- 3 | 4 | This directory contain files that are needed to build a debian package of the 5 | IgH EtherCAT-Master. In contrast to IgH's method to start the master via an 6 | init script (and unloading existing standard ethernet drivers before statup), 7 | the config file (/etc/default/ethercat) is used by a script named 8 | update-ethercat-config that should be called after config changes. The script 9 | updates /etc/modules-load.d/ethercat.conf and /etc/modprobe.d/ethercat.conf 10 | to reflect the configuration so that unneeded/unwanted standard drivers get 11 | blacklisted and the EtherCAT drivers and master are automatically loaded at 12 | system startup with the right parameters. 13 | 14 | BUILD PROCESS 15 | ------------- 16 | 17 | The build process was testet unter Debian 9 (stretch) with RT-Kernel. 18 | 19 | to build the packages: 20 | # ./get_source.sh (checkout source from IGH's HG repos and build source tar) 21 | # cd etherlabmaster 22 | # dpkg-checkbuilddeps (and install missing deps) 23 | # dpkg-buildpackage 24 | 25 | 26 | INSTALLATION 27 | ------------ 28 | 29 | Just do a 'sudo dpkg -i ethercat__.deb' to install the diver. After 30 | the required config settings in /etc/default/ethercat (please take a look to 31 | the documentation) you should run 'sudo update-ethercat-config'. Then do a 32 | reboot or load the ec*-modules manually (see /etc/modules), the master should 33 | now be functional. 34 | 35 | To build the LinuxCNC EtherCAT HAL driver you also need to install the 36 | development package with 'sudo dpkg -i ethercat-dev__.deb' 37 | 38 | ABOUT RTAI 39 | ---------- 40 | 41 | I've decided to drop support for RTAI to be able to move quickly to recent 42 | Debian versions and because the master code is not heavily tested against 43 | RTAI anymore. Latency seems to be OK (at least for me) with linux-rt and 44 | the generic driver. On the other hand you'll get a cleaner build process 45 | with DKMS support. 46 | 47 | -------------------------------------------------------------------------------- /etherlabmaster/debian/changelog: -------------------------------------------------------------------------------- 1 | etherlabmaster (1.5.2+20190904hg33b922p8ea394-1) lucid; urgency=low 2 | 3 | * updated to patchset 20190904 4 | * add /etc/network/interfaces.d config to update-ethercat-config 5 | * safe enable of rt mutex for kernels without rt mutex support 6 | 7 | -- Sascha Ittner Tue, 23 Oct 2019 15:25:23 +0200 8 | 9 | etherlabmaster (1.5.2+20180622hg33b922p50696d-3) lucid; urgency=low 10 | 11 | * integrated Gavin Lambert patch set (see https://sourceforge.net/u/uecasm/etherlab-patches/ci/default/tree/#readme) 12 | 13 | -- Sascha Ittner Tue, 27 Sep 2018 12:59:21 +0200 14 | 15 | etherlabmaster (1.5.2+20180317hg9e65f7-2) lucid; urgency=low 16 | 17 | * fixed quilt usage 18 | * added patch to relax AL state change timeout 19 | * do not try to blacklist generic original driver 20 | 21 | -- Sascha Ittner Wed, 19 Mar 2018 14:17:37 +0100 22 | 23 | etherlabmaster (1.5.2+20180317hg9e65f7-1) lucid; urgency=low 24 | 25 | * upgrade to current hg 1.5 branch 26 | * added --enable-sii-assign configure option 27 | * added --enable-hrtimer configure option 28 | * removed outdated xenomai and driver patches 29 | 30 | -- Sascha Ittner Wed, 17 Mar 2018 13:24:42 +0100 31 | 32 | etherlabmaster (1.5.2+20170303hg3be68a-1) stretch; urgency=low 33 | 34 | * upgrade to current hg 1.5 branch 35 | * added dkms support 36 | * remove RTAI support 37 | 38 | -- Sascha Ittner Sat, 24 Jun 2017 15:55:31 +0200 39 | 40 | etherlabmaster (1.5.2+20150219hg4b0b90-1) lucid; urgency=low 41 | 42 | * upgrade to current hg 1.5 branch 43 | 44 | -- Sascha Ittner Wed, 04 May 2015 13:57:05 +0200 45 | 46 | etherlabmaster (1.5.2-2) lucid; urgency=low 47 | 48 | * fixed udev rule and group for /dev/EtherCAT* 49 | 50 | -- Sascha Ittner Wed, 11 Mar 2015 12:02:32 +0200 51 | 52 | etherlabmaster (1.5.2-1) lucid; urgency=low 53 | 54 | * update to version 1.5.2 55 | 56 | -- Sascha Ittner Sun, 31 Mar 2013 12:31:20 +0200 57 | 58 | etherlabmaster (1.5.1-1) lucid; urgency=low 59 | 60 | * first debian package 61 | * fixed make distclean; 62 | * fixed read-pdo-count for stoeber servo drive 63 | 64 | -- Sascha Ittner Mon, 19 Mar 2012 13:06:05 +0100 65 | 66 | -------------------------------------------------------------------------------- /etherlabmaster/debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /etherlabmaster/debian/control: -------------------------------------------------------------------------------- 1 | Source: etherlabmaster 2 | Section: misc 3 | Priority: extra 4 | Maintainer: Sascha Ittner 5 | Build-Depends: debhelper (>> 4.0.0), dkms, gettext, autoconf, automake, libtool, quilt 6 | Standards-Version: 2.1.0 7 | 8 | Package: etherlabmaster 9 | Replaces: ethercat, etherlabmaster 10 | Conflicts: ethercat, etherlabmaster 11 | Provides: ethercat, etherlabmaster 12 | Architecture: any 13 | Depends: ${shlibs:Depends}, dkms, procps, ifupdown 14 | Description: IgH EtherCAT master for Linux 15 | 16 | Package: etherlabmaster-dev 17 | Replaces: ethercat-dev, etherlabmaster-dev 18 | Conflicts: ethercat-dev, etherlabmaster-dev 19 | Provides: ethercat-dev, etherlabmaster-dev 20 | Architecture: any 21 | Depends: etherlabmaster 22 | Description: IgH EtherCAT master for Linux (development files) 23 | 24 | -------------------------------------------------------------------------------- /etherlabmaster/debian/dkms/postbld: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ksrc_dir="$1" 4 | build_dir="$2" 5 | 6 | cp "$build_dir/Module.symvers" "$ksrc_dir/ethercat.symvers" 7 | 8 | mkdir -p "$ksrc_dir/include/ethercat" 9 | cp "$build_dir/devices/ecdev.h" "$ksrc_dir/include/ethercat" 10 | 11 | -------------------------------------------------------------------------------- /etherlabmaster/debian/dkms/postrm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ksrc_dir="$1" 4 | build_dir="$2" 5 | 6 | rm -f "$ksrc_dir/ethercat.symvers" 7 | 8 | rm -f "$ksrc_dir/include/ethercat/ecdev.h" 9 | rmdir --ignore-fail-on-non-empty "$ksrc_dir/include/ethercat" 10 | 11 | -------------------------------------------------------------------------------- /etherlabmaster/debian/etherlabmaster-dev.install: -------------------------------------------------------------------------------- 1 | usr/include/*.h 2 | usr/lib/*/*.a 3 | usr/lib/*/*.la 4 | -------------------------------------------------------------------------------- /etherlabmaster/debian/etherlabmaster.dkms: -------------------------------------------------------------------------------- 1 | # DKMS configuration for the etherlabmaster modules 2 | 3 | # The version is replaced at build time by dh_dkms invoked in debian/rules. 4 | PACKAGE_NAME="etherlabmaster" 5 | PACKAGE_VERSION="#MODULE_VERSION#" 6 | 7 | BUILT_MODULE_NAME[0]="master/ec_master" 8 | DEST_MODULE_NAME[0]="ec_master" 9 | DEST_MODULE_LOCATION[0]="/updates/dkms" 10 | 11 | AUTOINSTALL=yes 12 | 13 | MAKE[0]="make -C \${kernel_source_dir} M=$dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION/build modules" 14 | CLEAN="make -C \${kernel_source_dir} M=$dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION/build clean" 15 | 16 | BUILT_MODULE_NAME[1]="devices/ccat/ec_ccat" 17 | DEST_MODULE_NAME[1]="ec_ccat" 18 | DEST_MODULE_LOCATION[1]="/updates/dkms" 19 | 20 | BUILT_MODULE_NAME[2]="devices/ec_generic" 21 | DEST_MODULE_NAME[2]="ec_generic" 22 | DEST_MODULE_LOCATION[2]="/updates/dkms" 23 | 24 | BUILT_MODULE_NAME[3]="examples/mini/ec_mini" 25 | DEST_MODULE_NAME[3]="ec_mini" 26 | DEST_MODULE_LOCATION[3]="/updates/dkms" 27 | 28 | POST_BUILD="postbld \${kernel_source_dir} $dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION/build" 29 | POST_REMOVE="postrm \${kernel_source_dir} $dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION/build" 30 | 31 | -------------------------------------------------------------------------------- /etherlabmaster/debian/etherlabmaster.install: -------------------------------------------------------------------------------- 1 | debian/extras/* / 2 | etc/sysconfig/* etc/default/ 3 | usr/bin/* 4 | usr/sbin/* 5 | usr/lib/*/*.so* 6 | 7 | -------------------------------------------------------------------------------- /etherlabmaster/debian/etherlabmaster.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | #DEBHELPER# 4 | getent group ethercat >/dev/null || groupadd -r ethercat 5 | if [ "$1" = "configure" ] ; then 6 | depmod -a 7 | update-ethercat-config 8 | fi 9 | exit 0 10 | -------------------------------------------------------------------------------- /etherlabmaster/debian/etherlabmaster.postrm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | if [ "$1" = "remove" ] ; then 4 | rm -f /etc/modules-load.d/ethercat.conf 5 | rm -f /etc/modprobe.d/ethercat.conf 6 | fi 7 | if [ "$1" = "purge" ] ; then 8 | getent group ethercat >/dev/null && groupdel ethercat 9 | fi 10 | #DEBHELPER# 11 | exit 0 12 | -------------------------------------------------------------------------------- /etherlabmaster/debian/etherlabmaster.prerm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | if [ "$1" = "remove" ] ; then 4 | cat /proc/modules | grep "^ec_" | while read mod dummy; do 5 | if [ "$mod" != "ec_master" ] ; then 6 | rmmod $mod 7 | fi 8 | done 9 | cat /proc/modules | grep -q "^ec_master" && rmmod ec_master 10 | fi 11 | #DEBHELPER# 12 | exit 0 13 | -------------------------------------------------------------------------------- /etherlabmaster/debian/extras/etc/udev/rules.d/99-ethercat.rules: -------------------------------------------------------------------------------- 1 | KERNEL=="EtherCAT[0-9]*", MODE="0664", GROUP="ethercat" 2 | -------------------------------------------------------------------------------- /etherlabmaster/debian/extras/usr/sbin/update-ethercat-config: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #------------------------------------------------------------------------------ 4 | 5 | MODCONF=/etc/modprobe.d/ethercat.conf 6 | MODLOAD=/etc/modules-load.d/ethercat.conf 7 | IFACES=/etc/network/interfaces.d/ethercat 8 | 9 | #------------------------------------------------------------------------------ 10 | 11 | ETHERCAT_CONFIG=/etc/default/ethercat 12 | 13 | MODPROBE_FLAGS="" 14 | 15 | if [ ! -r ${ETHERCAT_CONFIG} ]; then 16 | echo "${ETHERCAT_CONFIG} not existing" 17 | exit 6 18 | fi 19 | 20 | . ${ETHERCAT_CONFIG} 21 | 22 | #------------------------------------------------------------------------------ 23 | 24 | exit_success() { 25 | echo "done." 26 | exit 0 27 | } 28 | 29 | #------------------------------------------------------------------------------ 30 | 31 | exit_fail() { 32 | echo "failed!" 33 | exit 1 34 | } 35 | 36 | #------------------------------------------------------------------------------ 37 | 38 | parse_mac_address() { 39 | if [ -z "${1}" ]; then 40 | MAC="" 41 | IFACE="" 42 | elif echo ${1} | grep -qE '^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$'; then 43 | MAC=$(echo ${1} | tr [A-F] [a-f]) 44 | IFACE="" 45 | for FN in $(find /sys/class/net -mindepth 1 -maxdepth 1); do 46 | if [ "$(cat ${FN}/address | tr [A-F] [a-f])" = "${MAC}" ]; then 47 | IFACE=$(basename $FN) 48 | break; 49 | fi 50 | done 51 | else 52 | echo "Invalid MAC address \"${1}\" in ${ETHERCAT_CONFIG}" 53 | exit_fail 54 | fi 55 | } 56 | 57 | #------------------------------------------------------------------------------ 58 | 59 | add_interface() { 60 | if [ -n "${1}" ]; then 61 | echo "" >> ${IFACES} 62 | echo "allow-hotplug ${1}" >> ${IFACES} 63 | echo "iface ${1} inet manual" >> ${IFACES} 64 | echo "pre-up sysctl net.ipv6.conf.${1}.disable_ipv6=1" >> ${IFACES} 65 | fi 66 | } 67 | 68 | #------------------------------------------------------------------------------ 69 | 70 | echo "Updating EtherCAT master confiuration" 71 | 72 | # check if master is loaded 73 | MASTER_LOADED="" 74 | grep -q '^ec_master ' /proc/modules && MASTER_LOADED="y" 75 | 76 | # unload ethercat network drivers 77 | for ECMODULE in `grep '^ec_' /proc/modules | grep -v '^ec_master ' | cut -d ' ' -f 1`; do 78 | rmmod ${ECMODULE} || exit_fail 79 | done 80 | 81 | # unload master, if loaded 82 | if [ -n "${MASTER_LOADED}" ]; then 83 | rmmod ec_master || exit_fail 84 | fi 85 | 86 | # write config headers 87 | rm -f ${MODCONF} 88 | echo "# !! DO NOT EDIT THIS FILE !!" >> ${MODCONF} 89 | echo "# please use update-ethercat-config" >> ${MODCONF} 90 | echo "#" >> ${MODCONF} 91 | 92 | rm -f ${IFACES} 93 | echo "# !! DO NOT EDIT THIS FILE !!" >> ${IFACES} 94 | echo "# please use update-ethercat-config" >> ${IFACES} 95 | echo "#" >> ${IFACES} 96 | 97 | # cleanup modules list 98 | echo "ec_master" >${MODLOAD}.tmp 99 | 100 | # check for modules to replace 101 | for MODULE in ${DEVICE_MODULES}; do 102 | ECMODULE=ec_${MODULE} 103 | if ! modinfo ${ECMODULE} > /dev/null; then 104 | continue # ec_* module not found 105 | fi 106 | 107 | if [ "${MODULE}" != "generic" ] ; then 108 | # blacklist normal driver 109 | echo "blacklist ${MODULE}" >> ${MODCONF} 110 | 111 | # unload normal driver, if loaded 112 | if grep -q "^${MODULE} " /proc/modules; then 113 | rmmod ${MODULE} || exit_fail 114 | fi 115 | fi 116 | 117 | # add ethercat driver 118 | echo "${ECMODULE}" >>${MODLOAD}.tmp 119 | done 120 | 121 | # construct DEVICES and BACKUPS from configuration variables 122 | DEVICES="" 123 | BACKUPS="" 124 | MASTER_INDEX=0 125 | while true; do 126 | DEVICE=$(eval echo "\${MASTER${MASTER_INDEX}_DEVICE}") 127 | BACKUP=$(eval echo "\${MASTER${MASTER_INDEX}_BACKUP}") 128 | if [ -z "${DEVICE}" ]; then break; fi 129 | 130 | if [ ${MASTER_INDEX} -gt 0 ]; then 131 | DEVICES=${DEVICES}, 132 | BACKUPS=${BACKUPS}, 133 | fi 134 | 135 | parse_mac_address ${DEVICE} 136 | DEVICES=${DEVICES}${MAC} 137 | add_interface ${IFACE} 138 | 139 | parse_mac_address ${BACKUP} 140 | BACKUPS=${BACKUPS}${MAC} 141 | add_interface ${IFACE} 142 | 143 | MASTER_INDEX=$(expr ${MASTER_INDEX} + 1) 144 | done 145 | 146 | # configure master module 147 | echo "options ec_master main_devices=${DEVICES} backup_devices=${BACKUPS}" >> ${MODCONF} 148 | 149 | # reload master and network drivers 150 | if [ -n "${MASTER_LOADED}" ]; then 151 | for MODULE in `grep '^ec_' ${MODLOAD}.tmp`; do 152 | modprobe ${MODPROBE_FLAGS} ${MODULE} || exit_fail 153 | done 154 | fi 155 | 156 | # set module list productive 157 | mv ${MODLOAD}.tmp ${MODLOAD} 158 | 159 | # update initramfs 160 | update-initramfs -u 161 | 162 | exit_success 163 | 164 | #------------------------------------------------------------------------------ 165 | -------------------------------------------------------------------------------- /etherlabmaster/debian/patches/10_fix_distclean.diff: -------------------------------------------------------------------------------- 1 | --- a/devices/ccat/Makefile.am 2019-06-24 08:28:32.000000000 +0200 2 | +++ etherlabmaster_1.5.2+20190904hg33b922p8ea394/devices/ccat/Makefile.am 2019-10-23 14:53:50.068366901 +0200 3 | @@ -46,6 +46,6 @@ 4 | INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)" modules_install 5 | 6 | clean-local: 7 | - $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 8 | + $(MAKE) -i -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 9 | 10 | #------------------------------------------------------------------------------ 11 | --- a/devices/cx2100/Makefile.am 2019-06-24 08:28:32.000000000 +0200 12 | +++ etherlabmaster_1.5.2+20190904hg33b922p8ea394/devices/cx2100/Makefile.am 2019-10-23 14:53:50.068366901 +0200 13 | @@ -51,6 +51,6 @@ 14 | INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)" modules_install 15 | 16 | clean-local: 17 | - $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 18 | + $(MAKE) -i -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 19 | 20 | #------------------------------------------------------------------------------ 21 | --- a/devices/e1000/Makefile.am 2019-06-24 08:28:32.000000000 +0200 22 | +++ etherlabmaster_1.5.2+20190904hg33b922p8ea394/devices/e1000/Makefile.am 2019-10-23 14:53:50.064366849 +0200 23 | @@ -435,6 +435,6 @@ 24 | INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)" modules_install 25 | 26 | clean-local: 27 | - $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 28 | + $(MAKE) -i -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 29 | 30 | #------------------------------------------------------------------------------ 31 | --- a/devices/e1000e/Makefile.am 2019-06-24 08:28:32.000000000 +0200 32 | +++ etherlabmaster_1.5.2+20190904hg33b922p8ea394/devices/e1000e/Makefile.am 2019-10-23 14:53:50.064366849 +0200 33 | @@ -692,6 +692,6 @@ 34 | INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)" modules_install 35 | 36 | clean-local: 37 | - $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 38 | + $(MAKE) -i -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 39 | 40 | #------------------------------------------------------------------------------ 41 | --- a/devices/igb/Makefile.am 2019-06-24 08:28:32.000000000 +0200 42 | +++ etherlabmaster_1.5.2+20190904hg33b922p8ea394/devices/igb/Makefile.am 2019-10-23 14:53:50.068366901 +0200 43 | @@ -281,6 +281,6 @@ 44 | INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)" modules_install 45 | 46 | clean-local: 47 | - $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 48 | + $(MAKE) -i -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 49 | 50 | #------------------------------------------------------------------------------ 51 | --- a/devices/Makefile.am 2019-06-24 08:28:32.000000000 +0200 52 | +++ etherlabmaster_1.5.2+20190904hg33b922p8ea394/devices/Makefile.am 2019-10-23 14:53:50.064366849 +0200 53 | @@ -230,6 +230,6 @@ 54 | INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)" modules_install 55 | 56 | clean-local: 57 | - $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 58 | + $(MAKE) -i -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 59 | 60 | #------------------------------------------------------------------------------ 61 | --- a/examples/dc_rtai/Makefile.am 2019-06-24 08:28:32.000000000 +0200 62 | +++ etherlabmaster_1.5.2+20190904hg33b922p8ea394/examples/dc_rtai/Makefile.am 2019-10-23 14:53:50.064366849 +0200 63 | @@ -44,6 +44,6 @@ 64 | INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)" modules_install 65 | 66 | clean-local: 67 | - $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 68 | + $(MAKE) -i -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 69 | 70 | #------------------------------------------------------------------------------ 71 | --- a/examples/mini/Makefile.am 2019-06-24 08:28:32.000000000 +0200 72 | +++ etherlabmaster_1.5.2+20190904hg33b922p8ea394/examples/mini/Makefile.am 2019-10-23 14:53:50.064366849 +0200 73 | @@ -46,6 +46,6 @@ 74 | INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)" modules_install 75 | 76 | clean-local: 77 | - $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 78 | + $(MAKE) -i -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 79 | 80 | #------------------------------------------------------------------------------ 81 | --- a/examples/rtai/Makefile.am 2019-06-24 08:28:32.000000000 +0200 82 | +++ etherlabmaster_1.5.2+20190904hg33b922p8ea394/examples/rtai/Makefile.am 2019-10-23 14:53:50.064366849 +0200 83 | @@ -44,6 +44,6 @@ 84 | INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)" modules_install 85 | 86 | clean-local: 87 | - $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 88 | + $(MAKE) -i -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 89 | 90 | #------------------------------------------------------------------------------ 91 | --- a/examples/tty/Makefile.am 2019-06-24 08:28:32.000000000 +0200 92 | +++ etherlabmaster_1.5.2+20190904hg33b922p8ea394/examples/tty/Makefile.am 2019-10-23 14:53:50.068366901 +0200 93 | @@ -50,6 +50,6 @@ 94 | INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)" modules_install 95 | 96 | clean-local: 97 | - $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 98 | + $(MAKE) -i -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 99 | 100 | #------------------------------------------------------------------------------ 101 | --- a/Makefile.am 2019-06-24 08:28:32.000000000 +0200 102 | +++ etherlabmaster_1.5.2+20190904hg33b922p8ea394/Makefile.am 2019-10-23 14:53:50.068366901 +0200 103 | @@ -93,7 +93,7 @@ 104 | INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)" modules_install 105 | 106 | clean-local: 107 | - $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 108 | + $(MAKE) -i -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 109 | 110 | mydist: 111 | hg log --style=changelog $(srcdir) > ChangeLog 112 | --- a/master/Makefile.am 2019-06-24 08:28:32.000000000 +0200 113 | +++ etherlabmaster_1.5.2+20190904hg33b922p8ea394/master/Makefile.am 2019-10-23 14:53:50.068366901 +0200 114 | @@ -95,6 +95,6 @@ 115 | INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)" modules_install 116 | 117 | clean-local: 118 | - $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 119 | + $(MAKE) -i -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 120 | 121 | #------------------------------------------------------------------------------ 122 | --- a/tty/Makefile.am 2019-06-24 08:28:32.000000000 +0200 123 | +++ etherlabmaster_1.5.2+20190904hg33b922p8ea394/tty/Makefile.am 2019-10-23 14:53:50.068366901 +0200 124 | @@ -46,6 +46,6 @@ 125 | INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)" modules_install 126 | 127 | clean-local: 128 | - $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 129 | + $(MAKE) -i -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 130 | 131 | #------------------------------------------------------------------------------ 132 | -------------------------------------------------------------------------------- /etherlabmaster/debian/patches/20_fix_read_pdo_count.diff: -------------------------------------------------------------------------------- 1 | --- a/master/fsm_pdo_entry.c 2 | +++ b/master/fsm_pdo_entry.c 3 | @@ -224,7 +224,13 @@ void ec_fsm_pdo_entry_read_state_count( 4 | return; 5 | } 6 | 7 | - if (fsm->request.data_size != sizeof(uint8_t)) { 8 | + if (fsm->request.data_size == sizeof(uint8_t)) { 9 | + fsm->entry_count = EC_READ_U8(fsm->request.data); 10 | + } else if (fsm->request.data_size == sizeof(uint16_t)) { 11 | + fsm->entry_count = EC_READ_U16(fsm->request.data); 12 | + } else if (fsm->request.data_size == sizeof(uint32_t)) { 13 | + fsm->entry_count = EC_READ_U32(fsm->request.data); 14 | + } else { 15 | EC_SLAVE_ERR(fsm->slave, "Invalid data size %zu at uploading" 16 | " SDO 0x%04X:%02X.\n", 17 | fsm->request.data_size, fsm->request.index, 18 | @@ -233,8 +239,6 @@ void ec_fsm_pdo_entry_read_state_count( 19 | return; 20 | } 21 | 22 | - fsm->entry_count = EC_READ_U8(fsm->request.data); 23 | - 24 | EC_SLAVE_DBG(fsm->slave, 1, "%u PDO entries mapped.\n", fsm->entry_count); 25 | 26 | // read first PDO entry 27 | -------------------------------------------------------------------------------- /etherlabmaster/debian/patches/30_relax_al_state_change_timeout.diff: -------------------------------------------------------------------------------- 1 | --- a/master/fsm_change.c 2 | +++ b/master/fsm_change.c 3 | @@ -42,7 +42,7 @@ 4 | 5 | /** Timeout while waiting for AL state change [s]. 6 | */ 7 | -#define EC_AL_STATE_CHANGE_TIMEOUT 5 8 | +#define EC_AL_STATE_CHANGE_TIMEOUT 15 9 | 10 | /*****************************************************************************/ 11 | 12 | -------------------------------------------------------------------------------- /etherlabmaster/debian/patches/40_safe_rt_mutex_enable.patch: -------------------------------------------------------------------------------- 1 | diff -Naur etherlabmaster_1.5.2+20190904hg33b922p8ea394.orig/master/locks.h etherlabmaster_1.5.2+20190904hg33b922p8ea394/master/locks.h 2 | --- etherlabmaster_1.5.2+20190904hg33b922p8ea394.orig/master/locks.h 2019-06-24 08:28:32.000000000 +0200 3 | +++ etherlabmaster_1.5.2+20190904hg33b922p8ea394/master/locks.h 2019-10-23 15:21:49.338907238 +0200 4 | @@ -47,7 +47,7 @@ 5 | 6 | /*****************************************************************************/ 7 | 8 | -#ifdef EC_USE_RTMUTEX 9 | +#if defined(CONFIG_RT_MUTEXES) && defined(EC_USE_RTMUTEX) 10 | 11 | #include 12 | 13 | -------------------------------------------------------------------------------- /etherlabmaster/debian/patches/series: -------------------------------------------------------------------------------- 1 | 10_fix_distclean.diff 2 | 20_fix_read_pdo_count.diff 3 | 30_relax_al_state_change_timeout.diff 4 | 40_safe_rt_mutex_enable.patch 5 | -------------------------------------------------------------------------------- /etherlabmaster/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | VERSION ?= $(shell dpkg-parsechangelog | sed -rne 's/^Version: ([0-9.]+(\+[0-9]*hg[0-9a-z]*)?).*$$/\1/p') 4 | 5 | CONFFLAGS += --disable-eoe --enable-sii-assign 6 | 7 | ifeq ($(DEB_HOST_ARCH_OS),linux) 8 | CONFFLAGS += --enable-kernel --enable-generic --enable-ccat --disable-8139too --disable-e100 --disable-e1000 --disable-e1000e --disable-r8169 --enable-hrtimer --enable-rtmutex 9 | endif 10 | 11 | default: 12 | echo "$(VERSION)" 13 | 14 | %: 15 | dh $@ --with autoreconf,dkms 16 | 17 | override_dh_autoreconf: 18 | touch ChangeLog 19 | dh_autoreconf 20 | 21 | override_dh_clean: 22 | rm -f ChangeLog 23 | dh_clean 24 | 25 | override_dh_auto_configure: 26 | dh_auto_configure -- \ 27 | $(CONFFLAGS) 28 | 29 | override_dh_install: 30 | dh_install --list-missing 31 | 32 | dh_install -petherlabmaster config.h globals.h Kbuild usr/src/etherlabmaster-$(VERSION) 33 | dh_install -petherlabmaster -X.o -X.ko -XMakefile -X.in -X.am examples/ include/ master/ tty/ usr/src/etherlabmaster-$(VERSION) 34 | dh_install -petherlabmaster debian/dkms/* usr/src/etherlabmaster-$(VERSION) 35 | dh_install -petherlabmaster devices/Kbuild devices/ecdev.h devices/generic.c usr/src/etherlabmaster-$(VERSION)/devices 36 | dh_install -petherlabmaster -X.o -X.ko -XMakefile -X.in -X.am devices/ccat/ usr/src/etherlabmaster-$(VERSION)/devices 37 | 38 | override_dh_dkms: 39 | dh_dkms -V $(VERSION) 40 | -------------------------------------------------------------------------------- /etherlabmaster/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /get_source.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DEB_VERSION=`(cd etherlabmaster && dpkg-parsechangelog | sed -rne 's/^Version: ([0-9.]+(\+[0-9]*hg[0-9a-z]*)?).*$$/\1/p')` 4 | DEB_ORIG="etherlabmaster_$DEB_VERSION.orig.tar.gz" 5 | 6 | HG_REPOS="http://hg.code.sf.net/p/etherlabmaster/code" 7 | HG_COMMIT=`(echo "$DEB_VERSION" | sed -rne 's/^[0-9.]+\+[0-9]*hg([0-9a-z]*)p([0-9a-z]*).*$$/\1/p')` 8 | HG_DIR="etherlabmaster-hg" 9 | 10 | PATCH_REPOS="http://hg.code.sf.net/u/uecasm/etherlab-patches" 11 | PATCH_COMMIT=`(echo "$DEB_VERSION" | sed -rne 's/^[0-9.]+\+[0-9]*hg([0-9a-z]*)p([0-9a-z]*).*$$/\2/p')` 12 | 13 | function cleanup { 14 | rm -rf "$HG_DIR" 15 | } 16 | trap cleanup EXIT 17 | set -e 18 | 19 | echo "Cloning HG commit $HG_COMMIT..." 20 | hg clone $HG_REPOS "$HG_DIR" -r $HG_COMMIT 21 | 22 | echo "Cloning patchset commit $PATCH_COMMIT..." 23 | hg clone $PATCH_REPOS "$HG_DIR/.hg/patches" -r $PATCH_COMMIT 24 | 25 | echo "Apply patchset..." 26 | (cd $HG_DIR && hg qpush -a) 27 | 28 | echo "Create source archive..." 29 | (cd $HG_DIR && hg archive "../$DEB_ORIG") 30 | 31 | echo "Extracting source..." 32 | (cd etherlabmaster && tar xfz "../$DEB_ORIG" --strip 1) 33 | 34 | echo "DONE." 35 | 36 | --------------------------------------------------------------------------------