[r2]: / trunk / wharfie / examples / CODESYS / Wharfile  Maximize  Restore  History

Download this file

64 lines (51 with data), 2.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#
# This is an example of a Wharfie image
# with CODESYS.
#

FROM debian_armel_stretch
TO raspberrypi.tar

#
# Base System
#
# Update the system and install desired tools
RUN apt-get update
RUN apt-get install -y --no-install-recommends systemd-sysv openssh-server net-tools wireless-tools kmod wpasupplicant dhcpcd5

# Add user 'wharfie' with password 'wharfie' for interactive login
RUN useradd -ms /bin/bash wharfie; echo "wharfie:wharfie" | chpasswd; echo "root:root" | chpasswd;

# Add fstab
ADD ../common/files/fstab /etc/fstab

# Change Hostname
RUN HOST [ -f /usr/share/dict/words ] && printf "Wharfie-%s" $(grep '^[A-Z]' /usr/share/dict/words | sed -n "$(expr ${RANDOM} % $(grep '^[A-Z]' /usr/share/dict/words | wc -l))p" | sed "s,'.*,,") > etc/hostname

#
# Wireless
#
# Add files for wireless network configuration
ADD ../common/files/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
ADD ../common/files/wireless.conf /etc/modules-load.d/wireless.conf
RUN sed -i 's,^Requires,#Requires,' /lib/systemd/system/wpa_supplicant@.service
RUN systemctl enable wpa_supplicant@wlan0.service

#
# Add CODESYS package
#
# download package and extract it
RUN HOST \
    [ ! -f ../../common/files/codesys.package ] && wget --output-document=../../common/files/codesys.package 'https://store.codesys.com/ftp_download/3S/RaspberryPI_SL/603001/3.5.11.20/CODESYS%20Control%20for%20Raspberry%20PI%203.5.11.20.package' || true; \
    [ ! -f ../../common/files/codesys.deb ] && unzip -p ../../common/files/codesys.package '*.deb' > ../../common/files/codesys.deb || true; \
    cp ../../common/files/codesys.deb tmp/codesys.deb

# install
RUN dpkg -i /tmp/codesys.deb

# workaround for using binaries, built for Raspbian on an Raspi 1 / Zero / ...
RUN [ ! -f ld-linux-armhf.so.3 ] && ln -s /lib/ld-linux.so.3 /lib/ld-linux-armhf.so.3 || true

#
# Legal stuff
#
# Opational packages, which are containing
# legal stuff and a toolchain to do cross builds.
#SOURCE sources.tar
#LICENSE license.tar
#TOOLCHAIN toolchain.tar

#
# Bootstrategy: Raspberry PI
#
RUN HOST \
    ../../bootstrategy/raspberrypi.sh rpi.img