Browse Source

Merge pull request #44762 from AkihiroSuda/fix-btrfs-kernel-requirement

graphdriver/btrfs: needs kernel headers >= 4.12, not >= 4.7
Bjorn Neergaard 2 years ago
parent
commit
1ef0a1b1be
2 changed files with 7 additions and 1 deletions
  1. 6 0
      daemon/graphdriver/btrfs/btrfs.go
  2. 1 1
      project/PACKAGERS.md

+ 6 - 0
daemon/graphdriver/btrfs/btrfs.go

@@ -8,6 +8,12 @@ package btrfs // import "github.com/docker/docker/daemon/graphdriver/btrfs"
 #include <stdio.h>
 #include <dirent.h>
 
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0)
+    #error "Headers from kernel >= 4.12 are required to build with Btrfs support."
+    #error "HINT: Set 'DOCKER_BUILDTAGS=exclude_graphdriver_btrfs' to build without Btrfs."
+#endif
+
 #include <linux/btrfs.h>
 #include <linux/btrfs_tree.h>
 

+ 1 - 1
project/PACKAGERS.md

@@ -139,7 +139,7 @@ by having support for them in the kernel or userspace. A few examples include:
 
 * AUFS graph driver (requires AUFS patches/support enabled in the kernel, and at
   least the "auplink" utility from aufs-tools)
-* BTRFS graph driver (requires suitable kernel headers: `linux/btrfs.h` and `linux/btrfs_tree.h`, present in 4.7+; and BTRFS support enabled in the kernel)
+* BTRFS graph driver (requires suitable kernel headers: `linux/btrfs.h` and `linux/btrfs_tree.h`, present in 4.12+; and BTRFS support enabled in the kernel)
 * ZFS graph driver (requires userspace zfs-utils and a corresponding kernel module)
 * Libseccomp to allow running seccomp profiles with containers