Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
etherlabmaster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ICS Control System Infrastructure
etherlabmaster
Commits
0932f3c2
Commit
0932f3c2
authored
18 years ago
by
Florian Pose
Browse files
Options
Downloads
Patches
Plain Diff
Better installer and startup scripts.
parent
78ded7bd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Makefile
+8
-8
8 additions, 8 deletions
Makefile
ethercat.conf.tmpl
+3
-3
3 additions, 3 deletions
ethercat.conf.tmpl
ethercat.sh
+77
-0
77 additions, 0 deletions
ethercat.sh
install.sh
+36
-12
36 additions, 12 deletions
install.sh
with
124 additions
and
23 deletions
Makefile
+
8
−
8
View file @
0932f3c2
#------------------------------------------------------------------------------
#
# Globales Makefile
#
# IgH EtherCAT-Treiber
# EtherCAT Makefile
#
# $Id$
#
...
...
@@ -11,7 +9,7 @@
ifneq
($(KERNELRELEASE),)
#------------------------------------------------------------------------------
#
K
build
-Abschnitt
#
k
build
section
obj-m
:=
master/ devices/
...
...
@@ -20,15 +18,17 @@ obj-m := master/ devices/
else
#------------------------------------------------------------------------------
#
D
efault
-Abschnitt
#
d
efault
section
ifneq
($(wildcard ethercat.conf),)
include
ethercat.conf
else
KERNEL
DIR
:=
/usr/src/linux
INSTALLDIR
:=
/opt/ethercat
KERNEL
:=
`
uname
-r
`
DEVICEINDEX
:=
99
endif
KERNELDIR
:=
/lib/modules/
$(
KERNEL
)
/build
modules
:
$(
MAKE
)
-C
$(
KERNELDIR
)
M
=
`
pwd
`
...
...
@@ -36,7 +36,7 @@ clean:
$(
MAKE
)
-C
$(
KERNELDIR
)
M
=
`
pwd
`
clean
install
:
@
./install.sh
$(
INSTALLDIR
)
@
./install.sh
$(
KERNEL
)
$(
DEVICEINDEX
)
#------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
ethercat.conf.tmpl
+
3
−
3
View file @
0932f3c2
...
...
@@ -10,9 +10,9 @@
#------------------------------------------------------------------------------
# The kernel to compile the EtherCAT sources against
KERNEL
DIR = /usr/src/linux
KERNEL
:= `uname -r`
#
Install directory used by "make install"
INSTALLDIR := /opt/ethercat
#
PCI index of the EtherCAT device
DEVICEINDEX := 99
#------------------------------------------------------------------------------
This diff is collapsed.
Click to expand it.
ethercat.sh
0 → 100755
+
77
−
0
View file @
0932f3c2
#!/bin/sh
#------------------------------------------------------------------------------
#
# EtherCAT rc script
#
# $Id$
#
#------------------------------------------------------------------------------
CONFIGFILE
=
/etc/sysconfig/ethercat
#------------------------------------------------------------------------------
print_usage
()
{
echo
"Usage
$0
{ start | stop }"
}
unload_module
()
{
if
lsmod |
grep
^
$1
>
/dev/null
;
then
echo
" unloading module
\"
$1
\"
..."
rmmod
$1
||
exit
1
fi
}
#------------------------------------------------------------------------------
# Get parameters
if
[
$#
-eq
0
]
;
then
print_usage
exit
1
fi
ACTION
=
$1
# Load configuration from sysconfig
if
[
-f
$CONFIGFILE
]
;
then
.
$CONFIGFILE
else
echo
"ERROR: Configuration file
\"
$CONFIGFILE
\"
not found!"
exit
1
fi
case
$ACTION
in
start
)
echo
"Starting EtherCAT master..."
# remove modules
unload_module 8139too
unload_module 8139cp
unload_module ec_8139too
unload_module ec_master
echo
" loading master modules..."
if
!
modprobe ec_8139too
ec_device_index
=
$DEVICEINDEX
;
then
echo
"ERROR: Failed to load module!"
exit
1
fi
;;
stop
)
echo
"Stopping EtherCAT master..."
unload_module ec_8139too
unload_module ec_master
if
!
modprobe 8139too
;
then
echo
"Warning: Failed to restore 8139too module."
fi
;;
*
)
print_usage
exit
1
esac
echo
"done."
exit
0
#------------------------------------------------------------------------------
This diff is collapsed.
Click to expand it.
install.sh
+
36
−
12
View file @
0932f3c2
...
...
@@ -8,11 +8,15 @@
#
#------------------------------------------------------------------------------
CONFIGFILE
=
/etc/sysconfig/ethercat
#------------------------------------------------------------------------------
# install function
install
()
{
echo
"
installing
$1
"
echo
"
$1
"
if
!
cp
$1
$INSTALLDIR
;
then
exit
1
;
fi
}
...
...
@@ -20,28 +24,48 @@ install()
# Fetch parameter
if
[
$#
-
eq
0
]
;
then
echo
"Usage:
$0
<
INSTALLDIR
>"
if
[
$#
-
ne
2
]
;
then
echo
"Usage:
$0
<
KERNEL> <DEVICEINDEX
>"
exit
1
fi
INSTALLDIR
=
$1
echo
"EtherCAT installer. Target:
$INSTALLDIR
"
KERNEL
=
$1
DEVICEINDEX
=
$2
# Create installation directory
if
[
!
-d
$INSTALLDIR
]
;
then
echo
" creating target directory."
if
!
mkdir
$INSTALLDIR
;
then
exit
1
;
fi
fi
INSTALLDIR
=
/lib/modules/
$KERNEL
/kernel/drivers/net
echo
"EtherCAT installer - Kernel:
$KERNEL
"
# Copy files
echo
" installing modules..."
install
master/ec_master.ko
install
devices/ec_8139too.ko
# Finished
# Update dependencies
echo
" building module dependencies..."
depmod
# Create configuration file
if
[
-f
$CONFIGFILE
]
;
then
echo
" notice: using existing configuration file."
else
echo
" creating
$CONFIGFILE
..."
echo
"DEVICEINDEX=
$DEVICEINDEX
"
>
$CONFIGFILE
||
exit
1
fi
# Install rc script
echo
" installing startup script..."
cp
ethercat.sh /etc/init.d/ethercat
||
exit
1
if
[
!
-L
/usr/sbin/rcethercat
]
;
then
ln
-s
/etc/init.d/ethercat /usr/sbin/rcethercat
||
exit
1
fi
# Finish
echo
"EtherCAT installer done."
exit
0
#------------------------------------------------------------------------------
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment