Skip to contentSkip to conversation

linux: add AUFS kernel extension

PATCH New Floris Bos 2 participants 2 messages Feb 15, 2015 – Jul 13, 2015

lore
Share & tools
lore

Floris Bos

author
#0 lore raw

PATCH v2 1/1 linux: add AUFS kernel extension

---
Changes v1 -> v2:
- Fix AUFS version may not be empty check

---
 linux/Config.ext.in     | 19 +++++++++++++++++++
 linux/linux-ext-aufs.mk | 24 ++++++++++++++++++++++++
 package/aufs/Config.in  | 11 +++++++++++
 package/aufs/aufs.mk    | 17 +++++++++++++++++
 4 files changed, 71 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 +17 -0
new file mode 100644
index 0000000..83dd00f
@@ -0,0 +1,17 @@
+################################################################################
+#
+# 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 ($(BR2_LINUX_KERNEL_EXT_AUFS),y)
+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
+endif
+
+$(eval $(generic-package))
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/1 linux: add AUFS kernel extension

Hi Floris,

Le 15/02/2015 14:33, Floris Bos a ?crit :

Quoted 22 lines

---
Changes v1 -> v2:
- Fix AUFS version may not be empty check

---
 linux/Config.ext.in     | 19 +++++++++++++++++++
 linux/linux-ext-aufs.mk | 24 ++++++++++++++++++++++++
 package/aufs/Config.in  | 11 +++++++++++
 package/aufs/aufs.mk    | 17 +++++++++++++++++
 4 files changed, 71 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 +0 -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.

linux/Config.ext.in config BR2_LINUX_KERNEL_EXT_XENOMAI_ADEOS_PATCH · line 40

Quoted 10 lines
linux/Config.ext.in +9 -0
 
+# 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.

s/seperately/separately/

Quoted 19 lines
linux/Config.ext.in +10 -0
+
+	  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 +0 -0
new file mode 100644
index 0000000..c3ff2dc

linux/linux-ext-aufs.mk line 6

Quoted 6 lines
linux/linux-ext-aufs.mk new file +6 -0
@@ -0,0 +1,24 @@
+################################################################################
+# Linux aufs extension
+#
+# Patch the linux kernel with aufs extension
+################################################################################
+

The linux-ext-aufs.mk should be converted to use the new linux-ext infra introduced in 2015.05.

linux/linux-ext-aufs.mk line 7

Quoted 1 line
linux/linux-ext-aufs.mk new file +1 -0
+ifeq ($(BR2_LINUX_KERNEL_EXT_AUFS),y)

This can be removed

linux/linux-ext-aufs.mk line 9

Quoted 2 lines
linux/linux-ext-aufs.mk new file +2 -0
+# Add dependency to aufs package (download helper for the aufs source)
+LINUX_DEPENDENCIES += aufs

Use LINUX_EXTENSIONS to use linux-ext infra, so the aufs dependency is added to the linux package.

linux/linux-ext-aufs.mk line 14

Quoted 5 lines
linux/linux-ext-aufs.mk new file +5 -0
+
+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;)

I think $(TOPDIR)/support should be used instead of ./support

linux/linux-ext-aufs.mk line 22

Quoted 9 lines
linux/linux-ext-aufs.mk new file +8 -0
+	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

This can be removed, since it's automatically added by the linux-ext infra.

linux/linux-ext-aufs.mk

Quoted 2 lines
linux/linux-ext-aufs.mk new file +2 -0
+
+endif #BR2_LINUX_KERNEL_EXT_AUFS

This can be removed

Quoted 23 lines
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 +0 -0
new file mode 100644
index 0000000..83dd00f

package/aufs/aufs.mk line 8

Quoted 8 lines
package/aufs/aufs.mk new file +8 -0
@@ -0,0 +1,17 @@
+################################################################################
+#
+# AUFS download helper
+#
+################################################################################
+
+AUFS_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_EXT_AUFS_VERSION))
+AUFS_SITE = git://git.code.sf.net/p/aufs/aufs3-standalone

There is a new aufs4 git repository [1] for latest 4.x kernel, it would be good to support these kernel too.

Also there was a patch to add aufs-utils [2]. By reading the aufs-util's README
[3] it would be good to complete your series to add aufs-util in Buildroot.

"These utilities are always necessary for aufs.
If you forget to install them, your aufs may not work correctly."

Thanks !

Best regards,
Romain Naour

[1] git://github.com/sfjro/aufs4-standalone.git
[2] http://lists.busybox.net/pipermail/buildroot/2014-July/102997.html
[3] http://sourceforge.net/p/aufs/aufs-util/ci/aufs3.14/tree/README

Quoted 10 lines
package/aufs/aufs.mk new file +9 -0
+AUFS_LICENSE = GPLv2
+
+ifeq ($(BR2_LINUX_KERNEL_EXT_AUFS),y)
+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
+endif
+
+$(eval $(generic-package))