From 31c31c1de8d4bb0b9be832bb34f998ce998dd8e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20B=C3=BCtow?= Date: Wed, 19 Dec 2018 20:33:16 +0000 Subject: can compile for various kernel versions using docker now --- .gitignore | 2 +- Dockerfile.in | 13 +++++++++---- Makefile | 8 ++++---- README.md | 2 +- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 8faf1e8..1646026 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,5 @@ docs/latex/ ioriot/ioriot ioriot/tags systemtap/downloads/ -Dockerfile docker/ +Dockerfile diff --git a/Dockerfile.in b/Dockerfile.in index f3aacc0..60a49cf 100644 --- a/Dockerfile.in +++ b/Dockerfile.in @@ -1,11 +1,16 @@ FROM centos:7 -RUN yum install -y gcc systemtap yum-utils -ENV KERNEL KERNELVERSION -RUN yum install -y kernel-${KERNEL} kernel-devel-${KERNEL} -RUN debuginfo-install -y kernel-${KERNEL} +RUN sed -i 's/enabled=0/enabled=1/' /etc/yum.repos.d/CentOS-{Vault,Debuginfo}.repo +RUN yum install -y gcc systemtap yum-utils wget +ENV kernel KERNEL +RUN yum install -y kernel-${kernel} kernel-devel-${kernel} +RUN debuginfo-install -y kernel-${kernel} WORKDIR /ioriot ADD ./ /ioriot + +RUN mkdir -p /ioriot/systemtap/downloads RUN mkdir -p /opt/ioriot + VOLUME /opt +VOLUME /ioriot/systemtap/downloads diff --git a/Makefile b/Makefile index ac19433..e3cc8e1 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ KERNEL ?= $(shell uname -r) DESTDIR=/opt/ioriot all: - $(MAKE) -C ioriot $(MAKE) -C systemtap + $(MAKE) -C ioriot install: - $(MAKE) -C ioriot install $(MAKE) -C systemtap install + $(MAKE) -C ioriot install uninstall: test ! -z $(DESTDIR) && test -d $(DESTDIR) && rm -Rfv $(DESTDIR) || exit 0 deinstall: uninstall @@ -21,7 +21,7 @@ doxygen: test: $(MAKE) -C ioriot test dockerbuild: - sed s/KERNELVERSION/$(KERNEL)/ Dockerfile.in > Dockerfile + sed s/KERNEL/$(KERNEL)/ Dockerfile.in > Dockerfile docker build . -t ioriot:$(KERNEL) bash -c 'test ! -d /tmp/docker/opt/ && mkdir -p /tmp/docker/opt/; exit 0' - docker run -v /tmp/docker/opt:/opt -it ioriot:$(KERNEL) make all install + docker run -v /tmp/docker/opt:/opt -v /tmp/docker/downloads:/ioriot/systemtap/downloads -e 'KERNEL=$(KERNEL)' -it ioriot:$(KERNEL) make all install diff --git a/README.md b/README.md index 6eb2d9d..9fe3eb4 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ sudo make uninstall # Compiling I/O Riot using Docker -In case there is no suitable build host for I/O Riot (e.g. compiling on a Mac) it is possible to use Docker to do the job. In order to build everything for CentOS 7 and Linux Kernel 3.10.0-957.1.3.el7.x86_64 just run: +In case there is no suitable build host for I/O Riot (e.g. you want to compile the everything, including the SystemTap Kernel modules on a Mac) it is possible to use Docker for that. First of all you have to install Docker Engine. Depending on the system in use the steps may differ. Once Docker you can run the following commands to build everything for CentOS 7 and Linux Kernel 3.10.0-957.1.3.el7.x86_64 for example: ```sh export KERNEL=3.10.0-957.1.3.el7.x86_64 -- cgit v1.2.3