--- a +++ b/trunk/wharfie/examples/RaspiRT/Wharfile @@ -0,0 +1,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 +