a | b/trunk/wharfie/examples/RaspiRT/Wharfile | ||
---|---|---|---|
1 | # |
||
2 | # This is an example of a Wharfie image |
||
3 | # with CODESYS. |
||
4 | # |
||
5 | |||
6 | FROM debian_armhf_stretch |
||
7 | |||
8 | # |
||
9 | # Base System |
||
10 | # |
||
11 | # Update the system and install desired tools |
||
12 | RUN apt-get update; \ |
||
13 | apt-get install -y --no-install-recommends systemd-sysv openssh-server net-tools wireless-tools kmod wpasupplicant dhcpcd5 git build-essential bison flex bc libssl-dev ca-certificates wget quilt |
||
14 | |||
15 | # Add user 'wharfie' with password 'wharfie' for interactive login |
||
16 | RUN useradd -ms /bin/bash wharfie; \ |
||
17 | echo "wharfie:wharfie" | chpasswd; \ |
||
18 | echo "root:root" | chpasswd; |
||
19 | |||
20 | # Add fstab |
||
21 | ADD ../common/files/fstab /etc/fstab |
||
22 | |||
23 | # Change Hostname |
||
24 | 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 |
||
25 | |||
26 | # |
||
27 | # Compile an RT-Preempt Kernel |
||
28 | # |
||
29 | RUN wget --output-document=/usr/src/osadl.sh https://www.osadl.org/monitoring/showpatchscript.php?veryshorthost=r7s3s; \ |
||
30 | cd /usr/src; \ |
||
31 | chmod 755 osadl.sh; \ |
||
32 | ./osadl.sh; |
||
33 | |||
34 | RUN cd /usr/src/linux-*-rt*; \ |
||
35 | export KERNEL=kernel7; \ |
||
36 | yes | make oldconfig; \ |
||
37 | make -j 9 && \ |
||
38 | make -j 9 modules && \ |
||
39 | make modules_install && \ |
||
40 | make -j 9 zImage && \ |
||
41 | |||
42 | RUN cd /usr/src/linux-*-rt*; \ |
||
43 | export KERNEL=kernel7; \ |
||
44 | release=$(cut -d" " -f3 include/generated/utsrelease.h | tr -d '"') && \ |
||
45 | mkdir -p /boot-rt/ && \ |
||
46 | cp arch/arm/boot/zImage /boot-rt/zImage-$release && \ |
||
47 | cp arch/arm/boot/zImage /boot-rt/$KERNEL.img && \ |
||
48 | cp arch/arm/boot/dts/bcm*.dtb /boot-rt && \ |
||
49 | du -shx /usr/src && \ |
||
50 | cd .. && \ |
||
51 | tar -czf linux-rt-sources.tar.gz linux-*-rt* && \ |
||
52 | rm -rf linux-*-rt* && \ |
||
53 | du -shx /usr/src |
||
54 | |||
55 | RUN apt-get install -y --no-install-recommends unzip |
||
56 | |||
57 | |||
58 | RUN [ ! -f boot.zip ] && wget --output-document=boot.zip 'https://github.com/raspberrypi/firmware/archive/master.zip' || true; \ |
||
59 | unzip boot.zip && \ |
||
60 | rm -Rf boot/* && \ |
||
61 | mv firmware-master/boot/* boot/ && \ |
||
62 | mv /boot-rt/* /boot/ && \ |
||
63 | rmdir /boot-rt && \ |
||
64 | rm -rf firmware-master; |
||
65 | |||
66 | ADD config.txt /boot/config.txt |
||
67 | ADD cmdline.txt /boot/cmdline.txt |
||
68 | |||
69 | # |
||
70 | # Legal stuff |
||
71 | # |
||
72 | # Opational packages, which are containing |
||
73 | # legal stuff and a toolchain to do cross builds. |
||
74 | SOURCE sources.tar |
||
75 | LICENSE license.tar |
||
76 | TOOLCHAIN toolchain.tar |
||
77 | |||
78 | # |
||
79 | # Bootstrategy: Raspberry PI |
||
80 | # |
||
81 | RUN HOST \ |
||
82 | ../../bootstrategy/raspberrypi.sh rpi.img |
||
83 |