Skip to contentSkip to conversation

linux: add AUFS kernel extension

PATCH Superseded Floris Bos 1 participant 1 message Feb 15, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Floris Bos

author
#0 lore raw

PATCH 1/1 linux: add AUFS kernel extension

---
 linux/Config.ext.in     | 19 +++++++++++++++++++
 linux/linux-ext-aufs.mk | 24 ++++++++++++++++++++++++
 package/aufs/Config.in  | 11 +++++++++++
 package/aufs/aufs.mk    | 15 +++++++++++++++
 4 files changed, 69 insertions(+)
 create mode 100644 linux/linux-ext-aufs.mk
 create mode 100644 package/aufs/Config.in
 create mode 100644 package/aufs/aufs.mk
linux/Config.ext.in +19 -0
index 8f15687..04fe7a1 100644
@@ -29,6 +29,25 @@ config BR2_LINUX_KERNEL_EXT_XENOMAI_ADEOS_PATCH
 	  Download it at http://download.gna.org/adeos/patches/v2.6/$(ARCH)/
 	  and verify that your kernel version in buildroot matches.
 
+# AUFS
+config BR2_LINUX_KERNEL_EXT_AUFS
+	bool "AUFS patch"
+	select BR2_PACKAGE_AUFS
+	help
+	  AUFS patch
+
+	  This option patches the kernel.
+	  You need to enable CONFIG_AUFS_FS in kernel configuration seperately.
+
+	  http://aufs.sourceforge.net/
+
+config BR2_LINUX_KERNEL_EXT_AUFS_VERSION
+	depends on BR2_LINUX_KERNEL_EXT_AUFS
+	string "AUFS version"
+	help
+	  AUFS git branch, e.g. aufs3.18.1+
+	  Needs to match your kernel version.
+
 # RTAI
 config BR2_LINUX_KERNEL_EXT_RTAI
 	bool "RTAI Real-time patch"
linux/linux-ext-aufs.mk new file +24 -0
new file mode 100644
index 0000000..c3ff2dc
@@ -0,0 +1,24 @@
+################################################################################
+# Linux aufs extension
+#
+# Patch the linux kernel with aufs extension
+################################################################################
+
+ifeq ($(BR2_LINUX_KERNEL_EXT_AUFS),y)
+# Add dependency to aufs package (download helper for the aufs source)
+LINUX_DEPENDENCIES += aufs
+
+AUFS_PATCHES = kbuild base mmap standalone
+
+define AUFS_PREPARE_KERNEL
+	$(foreach p,$(AUFS_PATCHES),./support/scripts/apply-patches.sh $(LINUX_DIR) $(AUFS_DIR) *$(p).patch;)
+	cp -af $(AUFS_DIR)/fs $(AUFS_DIR)/Documentation $(LINUX_DIR)
+	cp -af $(AUFS_DIR)/include/uapi/linux/aufs_type.h \
+		$(LINUX_DIR)/include/uapi/linux
+	cp -af $(AUFS_DIR)/include/uapi/linux/aufs_type.h \
+		$(STAGING_DIR)/usr/include/linux
+endef
+
+LINUX_PRE_PATCH_HOOKS += AUFS_PREPARE_KERNEL
+
+endif #BR2_LINUX_KERNEL_EXT_AUFS
package/aufs/Config.in new file +11 -0
new file mode 100644
index 0000000..d924278
@@ -0,0 +1,11 @@
+# Prompt-less option, because this package is not doing anything
+# except downloading the AUFS sources. The real work is done by a
+# Linux extension.
+config BR2_PACKAGE_AUFS
+	bool
+	depends on BR2_LINUX_KERNEL
+	help
+	  AUFS
+	  This is only the download helper for the kernel patch.
+
+	  http://aufs.sourceforge.net/
package/aufs/aufs.mk new file +15 -0
new file mode 100644
index 0000000..fbee85c
@@ -0,0 +1,15 @@
+################################################################################
+#
+# AUFS download helper
+#
+################################################################################
+
+AUFS_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_EXT_AUFS_VERSION))
+AUFS_SITE = git://git.code.sf.net/p/aufs/aufs3-standalone
+AUFS_LICENSE = GPLv2
+
+ifeq ($(AUFS_VERSION),)
+$(error BR2_LINUX_KERNEL_EXT_AUFS_VERSION must be set to the AUFS branch matching your kernel, e.g. "aufs3.18.1+")
+endif
+
+$(eval $(generic-package))
Signature · 1 line
1.9.1