[r48]: / trunk / wharfie / examples / RaspiRT / Wharfile  Maximize  Restore  History

Download this file

84 lines (68 with data), 2.4 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#
# This is an example of a Wharfie image
# with CODESYS.
#

FROM debian_armhf_stretch

#
# Base System
#
# Update the system and install desired tools
RUN apt-get update; \
    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

# 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

#
# Compile an RT-Preempt Kernel
#
RUN wget --output-document=/usr/src/osadl.sh https://www.osadl.org/monitoring/showpatchscript.php?veryshorthost=r7s3s; \
    cd /usr/src; \
    chmod 755 osadl.sh; \
    ./osadl.sh;

RUN cd /usr/src/linux-*-rt*; \
    export KERNEL=kernel7; \
    yes | make oldconfig; \
    make -j 9 && \
    make -j 9 modules && \
    make modules_install && \
    make -j 9 zImage && \

RUN cd /usr/src/linux-*-rt*; \
    export KERNEL=kernel7; \
    release=$(cut -d" " -f3 include/generated/utsrelease.h | tr -d '"') && \
    mkdir -p /boot-rt/ && \
    cp arch/arm/boot/zImage /boot-rt/zImage-$release && \
    cp arch/arm/boot/zImage /boot-rt/$KERNEL.img && \
    cp arch/arm/boot/dts/bcm*.dtb /boot-rt && \
    du -shx /usr/src && \
    cd .. && \
    tar -czf linux-rt-sources.tar.gz linux-*-rt* && \
    rm -rf linux-*-rt* && \
    du -shx /usr/src

RUN apt-get install -y --no-install-recommends unzip


RUN [ ! -f boot.zip ] && wget --output-document=boot.zip 'https://github.com/raspberrypi/firmware/archive/master.zip' || true; \
    unzip boot.zip && \
    rm -Rf boot/* && \
    mv firmware-master/boot/* boot/ && \
    mv /boot-rt/* /boot/ && \
    rmdir /boot-rt && \
    rm -rf firmware-master;

ADD config.txt /boot/config.txt
ADD cmdline.txt /boot/cmdline.txt

#
# 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