From 7378c6e2820b42d91b81f86a3815372c9984e38f Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Mon, 4 Jul 2016 15:42:49 +0100 Subject: [PATCH] Populate /lib/modules/`uname -r` This is less to do with installing modules (which we generally don't expect to use in Moby) but to populate /lib/modules/`uname -r`/modules.builtin which turns: moby:~# modprobe ip_vs modprobe: FATAL: Module ip_vs not found in directory /lib/modules/4.4.14-moby moby:~# modprobe nf_nat modprobe: FATAL: Module nf_nat not found in directory /lib/modules/4.4.14-moby moby:~# into: moby:~# modprobe ip_vs moby:~# modprobe nf_nat moby:~# which reduces the amount noise in the logs, e.g. in docker.log: time="2016-07-04T11:21:58Z" level=warning msg="Running modprobe nf_nat failed with message: `modprobe: WARNING: Module nf_nat not found in directory /lib/modules/4.4.14-moby`, error: exit status 1" A fair number of these appear in the logs. This also stops various tools logging about /lib/modules/`uname -r` not existing (there was one in the boot log until recently I think) Signed-off-by: Ian Campbell --- alpine/Dockerfile | 1 + alpine/kernel/.gitignore | 1 + alpine/kernel/Dockerfile | 2 ++ alpine/kernel/Makefile | 2 ++ 4 files changed, 6 insertions(+) diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 64890b672..b04615932 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -34,6 +34,7 @@ ADD kernel/aufs-utils.tar / COPY mkinitrd.sh /bin/ COPY kernel/kernel-source-info /etc/ ADD kernel/kernel-patches.tar /etc/kernel-patches +ADD kernel/kernel-modules.tar / COPY packages/proxy/slirp-proxy /usr/bin/ COPY packages/proxy/slirp-proxy /sbin/proxy-vsockd diff --git a/alpine/kernel/.gitignore b/alpine/kernel/.gitignore index 786849bd6..d91708baa 100644 --- a/alpine/kernel/.gitignore +++ b/alpine/kernel/.gitignore @@ -2,4 +2,5 @@ vmlinuz64 zImage aufs-utils.tar kernel-patches.tar +kernel-modules.tar kernel-source-info diff --git a/alpine/kernel/Dockerfile b/alpine/kernel/Dockerfile index b947e64cb..6a8759f69 100644 --- a/alpine/kernel/Dockerfile +++ b/alpine/kernel/Dockerfile @@ -74,6 +74,8 @@ RUN jobs=$(nproc); \ make ARCH=$ARCH defconfig && \ make ARCH=$ARCH oldconfig && \ make ARCH=$ARCH -j ${jobs} && \ + make ARCH=$ARCH INSTALL_MOD_PATH=/tmp/kernel-modules modules_install && \ + ( cd /tmp/kernel-modules && tar cf /kernel-modules.tar . ) && \ make ARCH=$ARCH INSTALL_HDR_PATH=/tmp/kernel-headers headers_install # Build aufs tools, do this here as they need kernel headers and to match aufs diff --git a/alpine/kernel/Makefile b/alpine/kernel/Makefile index 06ef5f792..c7e266449 100644 --- a/alpine/kernel/Makefile +++ b/alpine/kernel/Makefile @@ -6,6 +6,7 @@ vmlinuz64: kernel_config Dockerfile docker run --rm mobykernel:build cat /aufs-utils.tar > aufs-utils.tar docker run --rm mobykernel:build cat /kernel-source-info > kernel-source-info docker run --rm mobykernel:build cat /kernel-patches.tar > kernel-patches.tar + docker run --rm mobykernel:build cat /kernel-modules.tar > kernel-modules.tar arm: zImage @@ -15,6 +16,7 @@ zImage: kernel_config.arm Dockerfile docker run --rm mobyarmkernel:build cat /aufs-utils.tar > aufs-utils.tar docker run --rm mobyarmkernel:build cat /kernel-source-info > kernel-source-info docker run --rm mobyarmkernel:build cat /kernel-patches.tar > kernel-patches.tar + docker run --rm mobyarmkernel:build cat /kernel-modules.tar > kernel-modules.tar clean: rm -f zImage vmlinuz64 aufs-utils.tar kernel-source-info kernel-patches.tar