Commit Graph

138 Commits

Author SHA1 Message Date
David Sheets
473765c04b kernel: apply the AUFS patch to integrate with lockdep
AUFS introduces new lockdep relations which are beyond the maximum variants
that lockdep ships with. Without this patch, AUFS triggers lockdep BUG sanity
checks and disables lockdep for the rest of the system.

The present value of the patch is:

```diff
aufs4.4 lockdep patch

diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index c57e424..4153563 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -29,7 +29,7 @@ extern int lock_stat;
  */
 #define XXX_LOCK_USAGE_STATES		(1+3*4)

-#define MAX_LOCKDEP_SUBCLASSES		8UL
+#define MAX_LOCKDEP_SUBCLASSES		(8UL + 4)

 /*
  * NR_LOCKDEP_CACHING_CLASSES ... Number of classes
@@ -203,7 +203,7 @@ struct lock_chain {
 	u64				chain_key;
 };

-#define MAX_LOCKDEP_KEYS_BITS		13
+#define MAX_LOCKDEP_KEYS_BITS		(13 + 3)
 /*
  * Subtract one because we offset hlock->class_idx by 1 in order
  * to make 0 mean no class. This avoids overflowing the class_idx
diff --git a/kernel/locking/lockdep_internals.h b/kernel/locking/lockdep_internals.h
index 51c4b24..fba7557 100644
--- a/kernel/locking/lockdep_internals.h
+++ b/kernel/locking/lockdep_internals.h
@@ -54,9 +54,9 @@ enum {
  * table (if it's not there yet), and we check it for lock order
  * conflicts and deadlocks.
  */
-#define MAX_LOCKDEP_ENTRIES	32768UL
+#define MAX_LOCKDEP_ENTRIES	(32768UL << 5)

-#define MAX_LOCKDEP_CHAINS_BITS	16
+#define MAX_LOCKDEP_CHAINS_BITS	(16 + 5)
 #define MAX_LOCKDEP_CHAINS	(1UL << MAX_LOCKDEP_CHAINS_BITS)

 #define MAX_LOCKDEP_CHAIN_HLOCKS (MAX_LOCKDEP_CHAINS*5)
@@ -65,7 +65,7 @@ enum {
  * Stack-trace: tightly packed array of stack backtrace
  * addresses. Protected by the hash_lock.
  */
-#define MAX_STACK_TRACE_ENTRIES	524288UL
+#define MAX_STACK_TRACE_ENTRIES	(524288UL << 5)

 extern struct list_head all_lock_classes;
 extern struct lock_chain lock_chains[];
```

Signed-off-by: David Sheets <dsheets@docker.com>
2016-07-20 16:08:00 +01:00
David Sheets
1b43354bcb kernel: make sure to gitignore vmlinux
Signed-off-by: David Sheets <dsheets@docker.com>
2016-07-20 15:40:54 +01:00
David Sheets
25f3d06b7b kernel: add vmlinux target to make kernel debugging easier
With this patch, it is easy to get an unstripped kernel object to use with
gdb.

Signed-off-by: David Sheets <dsheets@docker.com>
2016-07-20 15:37:04 +01:00
Natanael Copa
907d1f8c0c improve kernel build makefile
- create an empty dummy file to indicate that docker image is built
- reuse same make rule to extract the different files from docker image
- make sure that we remove empty files on failure

This makes build more robust and improves parallelism.

Signed-off-by: Natanael Copa <natanael.copa@docker.com>
2016-07-13 18:03:16 +02:00
Rolf Neugebauer
9d5797cdd3 kernel: Update to 4.4.15
patches from: https://github.com/rneugeba/linux-stable/tree/v4.4.15-moby

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-07-12 10:36:57 +01:00
David Sheets
bd33169d49 linux: allow kernel module unloading
The ability to unload kernel modules helps with rapid development of kernel
modules or Moby-integrated functionality. It has no negative side effects
as far as I am aware.

Signed-off-by: David Sheets <dsheets@docker.com>
2016-07-11 11:48:46 -07:00
Justin Cormack
94d603971c Merge pull request #255 from justincormack/e1000
add e1000 drivers, allows qemu default setup to find an ethernet, and…
2016-07-08 16:28:24 +01:00
Justin Cormack
c8b5ffcef0 add e1000 drivers, allows qemu default setup to find an ethernet, and used frequently in emulated environments
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-07-08 16:26:16 +01:00
Rolf Neugebauer
f829fef36b linux: properly update kernel patches to v4.4.14
When we updated from 4.4.10 to 4.4.14 we copied the patches over.
This changeset properly updates the patches so that they apply cleanly.
0039-VSOCK-do-not-disconnect-socket-when-peer-has-shutdow.patch was
removed as it made it into 4.4.14 already.

Compile tested only

For reference the patches were generated from:
https://github.com/rneugeba/linux-stable/tree/v4.4.14-moby

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-07-08 16:10:51 +01:00
Justin Cormack
880966311c Updated kernel config
Remove one module, Xen ones not removeable. Make oldconfig.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-07-04 17:03:10 +01:00
Ian Campbell
7378c6e282 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 <ian.campbell@docker.com>
2016-07-04 15:44:48 +01:00
Justin Cormack
b39033bd09 update linux to 4.4.14 and update aufs to 20160627
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-06-26 16:16:57 -07:00
Daniel Hiltgen
b06eb1eb77 Add SATA disk support
Increase the number of hypervisors where Moby can run and detect
the disks.  With this change, I'm able to boot under KVM and see
the disk detected, formatted and mounted as expected.
2016-06-17 08:11:46 -07:00
Daniel Hiltgen
56c6c3a0a9 Add support for console on tty1
When running moby under other hypervisors, requiring troubleshooting on
the serial port can be painful.  This change enables console support on
tty1 similar to the way prior boot2docker images worked.
2016-06-16 17:17:34 -07:00
Justin Cormack
ed34c13840 Kernel config for CDROM support (for Azure)
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-06-14 11:30:47 +01:00
Justin Cormack
9c426928ef Add CRIU support
Also enables expert so a bunch of other options showing

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-06-13 16:33:31 +01:00
Justin Cormack
7f99dffed7 update kernel to 4.4.13 and aufs to 20160613
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-06-13 15:06:25 +01:00
Ian Campbell
5165a6c795 Add || true to the docker rmi invocations in the clean target
Linux xargs calls the command with no arguments if it gets no inputs, which
`docker rmi` complains about. It provides -r / --no-run-if-empty to prevent
this but unfortunately this isn't supported on OSX.

Ignore errors from `docker rmi` so that `make clean` will keep going and clean
up later stuff.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2016-06-08 13:59:47 +01:00
Madhu Venugopal
9d7835d6c4 Enabling IPVS kernel configs to support built-in load-balancing
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-06-06 15:34:30 -07:00
Justin Cormack
9241e0c8df Merge pull request #177 from justincormack/ipvs
add ipvs conntrack and other missing net options
2016-06-06 23:18:19 +01:00
Justin Cormack
3db42c2753 add ipvs conntrack and other missing net options
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-06-06 23:17:44 +01:00
Justin Cormack
6b5c0495f1 update to linux 4.4.12 and aufs 20160530
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-06-06 23:05:41 +01:00
Rolf Neugebauer
07a5affe3b kernel: update kernel patches
Added a patch to reduce verbosity of vmbus for unknown GUIDs.
Thes happen on every Hyper-V socket connection.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-05-23 19:01:13 +01:00
Rolf Neugebauer
57921ac699 kernel: update VMBus fix patch from MSFT
Also rebase patches to 4.4.10 (no code changes)

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-05-21 11:28:02 +01:00
Justin Cormack
2dc7c66e0d update Linux to 4.4.11 stable release
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-05-20 10:21:52 -07:00
Rolf Neugebauer
255a92a3dc kernel: enable VFAT and ISO9660 Filesystems in the kernel
DOS filesystems are handy for embedded development. ISO FS was
requested/suggested somewhere on a forum.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-05-19 10:35:53 +01:00
Justin Cormack
8b24be487b Merge pull request #133 from rneugeba/vmbus-up
kernel: cherry-pick more VMBus patches, fix for yet another kernel crash
2016-05-17 08:01:20 -05:00
Natanael Copa
26ae4693e1 update to kernel 4.4.10, aufs 20160516
Signed-off-by: Natanael Copa <natanael.copa@docker.com>
2016-05-17 12:55:24 +02:00
Rolf Neugebauer
61b38236a9 kernel: cherry-pick more VMBus patches, fix for yet another kernel crash
These are most of the changes to channel.c and channel_mgmt.c from upstream.

They are needed to apply a proposed patch to fix yet another kernel crash
we reported. This patch is also included.

With these patches applied many thousand connections with random data and up
to 10 concurrent connections are sustained without kernel crashes.

This patch also updates the core Hyper-V socket support to v11 (which
also obsoletes the previous patch added to work around a kernel bug)

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-05-17 11:06:07 +01:00
Rolf Neugebauer
58b500ccd9 kernel: Fix Null pointer de-reference in af_hvsock code
The Hyper-V socket patch has a bug which was triggered by a race condition when
the client connected and then immediately closed the connection before the
server would call accept(). This caused a kernel crash.

This patch was discussed with Dexuan Cui <decui@microsoft.com>, the original
author of the Hyper-V socket support.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-05-15 12:59:55 +01:00
Rolf Neugebauer
8a8896f477 kernel: Update Hyper-V socket patch to v10
This required pulling in the Qualcom IPC patches as those changed
the socket family enumeration.

All other patches should be the same.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-05-13 16:14:19 +01:00
Justin Cormack
3c3a89b8c7 add Intel 10g VF for AWS, other useful network options
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-05-10 11:01:48 +01:00
Justin Cormack
fe9e4f0f1a update to kernel 4.4.9, aufs 20160509
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-05-10 10:54:01 +01:00
Justin Cormack
6165133e8b add Xen net device
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-05-07 10:15:10 +01:00
Justin Cormack
375439e2f9 add xen blockdev support
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-05-06 17:45:17 +01:00
Ian Campbell
a806c5cc8d Update vsock patch to version accepted upstream
No practical change, but adds the "cherry-picked from" to aid tracking. This
has also been queued for stable so will eventually show up in a 4.4.x and can
be dropped from here.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2016-05-06 10:57:50 +01:00
Justin Cormack
ceb7bbf3e4 add framebuffer console support
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-05-04 18:28:06 +01:00
Justin Cormack
63f5178cf8 add nfs client and server support, fix #117
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-05-04 13:24:48 +01:00
Ian Campbell
7ae99c1b51 Add bugfix patch for partial AF_VSOCK shutdown
Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2016-05-03 17:27:14 +01:00
Nathan LeClaire
6ade5f97e9 Cache kernel source download
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2016-04-27 22:45:17 +00:00
Justin Cormack
95e37843cc Add a local prefix '-moby' to the kernel name
We are now using a custom kernel not unmodified upstream, so
best to identify it.

Also fix https://github.com/docker/pinata/issues/2153

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-04-26 12:25:56 +01:00
Justin Cormack
8a4b9a7819 Switch from busybox mdev to kernel devtmpfs
This is simpler, and as a by-product should resolve
https://github.com/docker/pinata/issues/1968
as it uses the now-more-correct loop device names
that newer util-linux expects.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-04-25 12:03:32 +01:00
Justin Cormack
6621512ed6 fix arm kernel build see #96
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-04-18 10:46:57 +01:00
Rolf Neugebauer
73a0d1671e kernel,initrd: add CIFS to the kernel and cifs-utils to the initrd
Needed to enable SMB/CIFS mounts on Windows hosts

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 14:51:27 +01:00
Ian Campbell
5aa8173876 hyperv-socks: Backport patches.
Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2016-04-12 14:36:58 +01:00
Ian Campbell
f2171c7beb Update vsock patches
Upstream commit 598881800825 ("vsock: Fix blocking ops call in
prepare_to_wait") was subsequently reverted in 6f57e56a1527, which said:

    The commit reverted with this patch caused us to potentially miss wakeups.
    Since the condition is not checked between the prepare_to_wait and the
    schedule(), if a wakeup happens after the condition is checked but before
    the sleep happens, we will miss it. ( A description of the problem can be
    found here: http://www.makelinux.net/ldd3/chp-6-sect-2 ).

The underlying issue has been fixed instead with f7f9b5e7f8ec ("AF_VSOCK:
Shrink the area influenced by prepare_to_wait").

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2016-04-12 14:33:32 +01:00
Ian Campbell
eb221b4d4f Add VSOCK patches
These are WIP taken from git@github.com:stefanha/linux.git#vsock
(==4c9d2a6be1c6, using "cherry-pick -x") and correspond to RFC v5 of the
frontend patches posted in
http://thread.gmane.org/gmane.linux.kernel.virtualization/27455

There is no corresponding spec proposal update yet, but this set of patches
correspond (roughly) to addressing the feedback on v4 of the spec proposal
http://thread.gmane.org/gmane.comp.emulators.virtio.devel/1062.

kernel_config.arm modifications copied from x86, not tested.

Added /etc/kernel-patches/ directory to the image to be consumed by the
licensing.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2016-04-05 13:40:36 +01:00
Justin Cormack
6dc57f8817 update to 4.4.6 stable kernel series
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-04-04 14:04:55 +01:00
Justin Cormack
7d13618c2c update to 4.1.20
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-03-30 17:02:22 +01:00
Justin Cormack
cbd7af5e1d store source info for kernel and kernel patches in image for #45
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-03-18 13:53:26 +00:00