]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
aufs: new kernel extension
authorChristian Stewart <christian@paral.in>
Sun, 17 Jul 2016 12:50:37 +0000 (14:50 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 20 Sep 2016 17:03:46 +0000 (19:03 +0200)
Signed-off-by: Christian Stewart <christian@paral.in>
[Atul:
 - Removed the duplicate conditional block.
 - Updated the license to GPLv2.
 - Removed the visibilty of package from menuconfig.
 - Removed dependencies.
 - Removed the comment.
 - Changed the name of variable from BR2_PACKAGE_AUFS_STANDALONE_VERSION
   to BR2_LINUX_KERNEL_EXT_AUFS_VERSION.
 - Removed the AUFS_INSTALL_STAGING  and AUFS_INSTALL_TARGET  variables.
 - Removed the BR2_PACKAGE_AUFS_3X and BR2_PACKAGE_AUFS_4X variables.]
Signed-off-by: Atul Singh <atul.singh.mandla@rockwellcollins.com>
[yann.morin.1998@free.fr:
  - do not fail on version check if aufs ext is disabled
  - check for empty version
  - squash aufs package and linux extension in one patch
  - fail if the kernel already has aufs support
  - simplify handling of version]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
[Thomas:
 - Fix the apply patch logic, it was using a non-existent
   AUFS_VERSION_MAJOR variable. BR2_PACKAGE_AUFS_SERIES is used
   instead.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
linux/Config.ext.in
linux/linux-ext-aufs.mk [new file with mode: 0644]
package/Config.in
package/aufs/Config.in [new file with mode: 0644]
package/aufs/aufs.mk [new file with mode: 0644]

index da1ebd26bca9dd502e9aaab31ee47a8cb76c2ad0..5d5e7efbca3fdd3ef3ea8edbb975c4e010c835e6 100644 (file)
@@ -66,4 +66,56 @@ config BR2_LINUX_KERNEL_EXT_FBTFT
 
          https://github.com/notro/fbtft
 
+# aufs-standalone
+config BR2_LINUX_KERNEL_EXT_AUFS
+       bool "Aufs Filesystem Module patch"
+       select BR2_PACKAGE_AUFS
+       help
+         Aufs is split in two parts: a kernel part and a userspace
+         part. Enabling this option automatically selects the aufs
+         standalone (module) package and patches the Linux kernel
+         built by Buildroot with the aufs kernel part (ie fs/aufs).
+
+         It is important to use the correct branch of aufs-standalone.
+
+if BR2_LINUX_KERNEL_EXT_AUFS
+
+choice
+       bool "aufs-standalone series"
+       help
+         Select the major series of this version. This must match the
+         major version of your kernel (e.g. for kernels 3.x, select
+         aufs3.x; for kernels 4.x, select aufs4.x).
+
+         Note: neither aufs1.x nor aufs2.x (both for kernels older than
+         3.x) are supported.
+
+config BR2_LINUX_KERNEL_EXT_AUFS_SERIES_3
+       bool "aufs3.x"
+
+config BR2_LINUX_KERNEL_EXT_AUFS_SERIES_4
+       bool "aufs4.x"
+
+endchoice
+
+config BR2_LINUX_KERNEL_EXT_AUFS_SERIES
+       int
+       default 3 if BR2_LINUX_KERNEL_EXT_AUFS_SERIES_3
+       default 4 if BR2_LINUX_KERNEL_EXT_AUFS_SERIES_4
+
+config BR2_LINUX_KERNEL_EXT_AUFS_VERSION
+       string "aufs-standalone version"
+       default ""
+       help
+         The version you choose must match that of your kernel. Usually,
+         the sha1 of the cset you want to use; avoid using a branch name
+         as this yields non-reproducible builds.
+
+         See the following resources to see what versions are available:
+
+         For aufs3.x: https://sourceforge.net/p/aufs/aufs3-standalone/ref/master/branches/
+         For aufs4.x: https://github.com/sfjro/aufs4-standalone/branches/all
+
+endif # aufs
+
 endmenu
diff --git a/linux/linux-ext-aufs.mk b/linux/linux-ext-aufs.mk
new file mode 100644 (file)
index 0000000..fb2f356
--- /dev/null
@@ -0,0 +1,21 @@
+################################################################################
+# Linux Aufs extensions
+#
+# Patch the linux kernel with aufs extension
+################################################################################
+
+LINUX_EXTENSIONS += aufs
+
+define AUFS_PREPARE_KERNEL
+       if test -d $(@D)/fs/aufs/; then \
+               echo "Your kernel already supports AUFS."; \
+               exit 1; \
+       fi
+       $(APPLY_PATCHES) $(@D) $(AUFS_DIR) \
+               aufs$(BR2_PACKAGE_AUFS_SERIES)-kbuild.patch \
+               aufs$(BR2_PACKAGE_AUFS_SERIES)-base.patch \
+               aufs$(BR2_PACKAGE_AUFS_SERIES)-mmap.patch \
+               aufs$(BR2_PACKAGE_AUFS_SERIES)-standalone.patch
+       cp -r $(AUFS_DIR)/fs/aufs/ $(@D)/fs/
+       cp $(AUFS_DIR)/include/uapi/linux/aufs_type.h $(@D)/include/uapi/linux/
+endef
index 78573f0143a59bef3bcc1bcb7d0770350effefe2..78381441a5021bbc324aa9595f3f26256f2868d6 100644 (file)
@@ -148,6 +148,7 @@ menu "Development tools"
 endmenu
 
 menu "Filesystem and flash utilities"
+       source "package/aufs/Config.in"
        source "package/autofs/Config.in"
        source "package/btrfs-progs/Config.in"
        source "package/cifs-utils/Config.in"
diff --git a/package/aufs/Config.in b/package/aufs/Config.in
new file mode 100644 (file)
index 0000000..cc5ff36
--- /dev/null
@@ -0,0 +1,16 @@
+# Automatically selected by the corresponding linux extension
+config BR2_PACKAGE_AUFS
+       bool
+
+if BR2_PACKAGE_AUFS
+
+# Both come from the selection of the linux extension.
+config BR2_PACKAGE_AUFS_SERIES
+       int
+       default BR2_LINUX_KERNEL_EXT_AUFS_SERIES
+
+config BR2_PACKAGE_AUFS_VERSION
+       string
+       default BR2_LINUX_KERNEL_EXT_AUFS_VERSION
+
+endif
diff --git a/package/aufs/aufs.mk b/package/aufs/aufs.mk
new file mode 100644 (file)
index 0000000..1ba5508
--- /dev/null
@@ -0,0 +1,22 @@
+################################################################################
+#
+# aufs
+#
+################################################################################
+
+AUFS_VERSION = $(call qstrip,$(BR2_PACKAGE_AUFS_VERSION))
+AUFS_LICENSE = GPLv2
+AUFS_LICENSE_FILES = COPYING
+
+ifeq ($(BR2_PACKAGE_AUFS_SERIES),3)
+AUFS_SITE = http://git.code.sf.net/p/aufs/aufs3-standalone
+AUFS_SITE_METHOD = git
+else ifeq ($(BR2_PACKAGE_AUFS_SERIES),4)
+AUFS_SITE = $(call github,sfjro,aufs4-standalone,$(AUFS_VERSION))
+endif
+
+ifeq ($(BR_BUILDING):$(BR2_PACKAGE_AUFS):$(AUFS_VERSION),y:y:)
+$(error No aufs version specified)
+endif
+
+$(eval $(generic-package))