Skip to content

Commit 2a070f4

Browse files
committed
connect dkms and ethercat systemd services
1 parent 6bafff7 commit 2a070f4

File tree

5 files changed

+43
-18
lines changed

5 files changed

+43
-18
lines changed

README.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,6 @@ And one can check the master status as follows:
4343
etherlabmaster (master)$ ethercat master
4444
```
4545

46-
## Notice
47-
48-
Even if we buid the kernel DKMS, one needs the following commands after new Kernel install.
49-
50-
```
51-
$ sudo dkms autoinstall
52-
$ sudo systemctl restart ethercat
53-
54-
```
5546

5647
## Steps
5748

@@ -73,15 +64,20 @@ Fixed scheduler settings in dc_user example; use CLOCK_MONOTONIC.
7364
### make install
7465
* Ethercat program (configuration, lib, and others) installation
7566

76-
### make modules_build
77-
* Kernel modules compiliation
67+
### make dkms_add
68+
* dkms add
69+
70+
### make dkms_build
71+
* dkms build via dkms
72+
7873

79-
### make modules_install
80-
* Kernel modules installation
74+
### make dkms_install
75+
* Kernel modules installation via dkms
8176

8277
### make setup
8378

8479
* Activate the EtherCAT master Network Port
80+
* Setup the dkms systemd service
8581
* Setup the ethercat systemd service
8682
* Put the UDEV rule to allow an user to access the ethercat master port
8783
* Create the symbolic link for the ethercat executable command

patch/Site/HISTORY.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,12 @@ This patch allows us to use the installed etherlab master configuration in a loc
55

66
* created by Jeong Han Lee, han.lee@esss.se
77
* Thursday, May 24 11:51:52 CEST 2018
8+
9+
10+
# after_dkms_service_patch.p0.patch
11+
12+
The dkms.service demon should be run before the ethercat.service will be started.
13+
14+
```
15+
etherlabmaster-code (master)$ hg diff script/ethercat.service.in > ../patch/Site/after_dkms_service_patch.p0.patch
16+
```

patch/Site/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ $hg diff script/ethercatctl.in > ../use_prefix_for_ethercat_conf_path.p0.patch
2222
```
2323
And remove a/b in user_prefix_for_ethercat_conf_path.p0.patch manually.
2424

25+
26+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
diff -r 9e65f782e8a1 script/ethercat.service.in
2+
--- script/ethercat.service.in Tue Feb 13 17:16:01 2018 +0100
3+
+++ script/ethercat.service.in Fri Jul 27 00:04:00 2018 +0200
4+
@@ -9,8 +9,10 @@
5+
# Uncomment this, if the generic Ethernet driver is used. It assures, that the
6+
# network interfaces are configured, before the master starts.
7+
#
8+
-#Requires=network.service # Stop master, if network is stopped
9+
-#After=network.service # Start master, after network is ready
10+
+# Stop ethercat.service, if dkms.service is stopped
11+
+Requires=dkms.service
12+
+# Start ethercat.service, after dkms.service is ready
13+
+After=dkms.service
14+
15+
#
16+
# Uncomment this, if a native Ethernet driver is used. It assures, that the

scripts/etherlab_setup.bash

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
#
1919
# Author : Jeong Han Lee
2020
# email : jeonghan.lee@gmail.com
21-
# Date : Thursday, July 26 01:15:45 CEST 2018
22-
# version : 0.0.5
21+
# Date : Friday, July 27 00:06:10 CEST 2018
22+
# version : 0.0.6
2323

2424
declare -gr SC_SCRIPT="$(realpath "$0")"
2525
declare -gr SC_SCRIPTNAME=${0##*/}
@@ -294,6 +294,11 @@ ${SUDO_CMD} -v
294294
activate_ethercat_master_network
295295

296296

297+
# Setup Systemd for the DKMS autoinstall
298+
# dkms.sevice will be started before ethercat.service be started.
299+
setup_dkms_systemd
300+
301+
297302
## Setup Systemd for the etercat.service
298303
## We can put all configuration files and scrpits in ${ETHERLAB_TARGET_PATH}
299304
## However, we cannot put ${ECAT_MASTER_SYSTEMD} in any customzied path
@@ -306,9 +311,6 @@ put_udev_rule "${ECAT_KMOD_NAME}"
306311

307312
trigger_udev_rule
308313

309-
# Setup Systemd for the DKMS autoinstall
310-
#
311-
setup_dkms_systemd
312314

313315

314316
${SUDO_CMD} ln -sf ${ETHERLAB_TARGET_PATH}/bin/ethercat /usr/bin/ethercat

0 commit comments

Comments
 (0)