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
--- /dev/null
+################################################################################
+# 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
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"
--- /dev/null
+# 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
--- /dev/null
+################################################################################
+#
+# 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))