Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/3 v3] aufs: new kernel extension (branch yem/aufs)
@ 2016-07-17 12:50 Yann E. MORIN
  2016-07-17 12:50 ` [Buildroot] [PATCH 1/3 v3] aufs: new kernel extension Yann E. MORIN
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Yann E. MORIN @ 2016-07-17 12:50 UTC (permalink / raw)
  To: buildroot

Hello All!


This series is an attempt to introduce the aufs stacking filesystem as a
Linux kernel extension, along with the corresponding userland tools.

It is based on a work by Christian Stewart, refined by Atul Singh, with
further cleanups by me.

The first patch introduces the extension proper: a no-prompt package
provides the source files, then used to patch the kernel code.

The second patch allows packages to instruct the kernel to isntall its
userland headers, when such package needs those headers rather than the
one from the toolchain (e.g. to gain access to inernals of the running
kernel, like filesystems or the netrwork stack, possibly added by a
kernel extension).

The third patch adds the userland aufs-util suite, used to assemble and
otherwise control any aufs stack. This needs the userland headers of the
running kernel because it needs to talk to the uafs internals.


Changes v2 -> v3:
  - cleanups in the aufs extension: better version handling and check,
    squash the extension and the package in the same patch;
  - add the kernel patch to install userland headers;
  - fix build of aufs-util, make it not depend on the kernel extension
    so it can be used on already-patched kernels;
  - misc other minor cleanups


Regards,
Yann E. MORIN.


The following changes since commit 97308d8e9ae0f096ec2df8275deb063266583b91

  package/ti-gfx: list supported SoCs in Config.in help text (2016-07-16 22:53:55 +0200)


are available in the git repository at:

  https://gitlab.com/ymorin/buildroot.git

for you to fetch changes up to e5d42509736f56a587767b61bf0f9ceb8efd41e4

  aufs-util: new package (2016-07-17 14:35:13 +0200)


----------------------------------------------------------------
Christian Stewart (2):
      aufs: new kernel extension
      aufs-util: new package

Yann E. MORIN (1):
      linux: add an option to install runtime headers

 linux/Config.ext.in                                | 52 ++++++++++++++++++++++
 linux/Config.in                                    |  9 ++++
 linux/linux-ext-aufs.mk                            | 21 +++++++++
 linux/linux.mk                                     | 12 +++++
 package/Config.in                                  |  2 +
 package/aufs-util/0001-remove-user-settings.patch  | 16 +++++++
 package/aufs-util/0002-no-check-ver.patch          | 24 ++++++++++
 package/aufs-util/0003-no-strip-lib.patch          | 18 ++++++++
 package/aufs-util/0004-no-override-readdir64.patch | 27 +++++++++++
 package/aufs-util/Config.in                        | 36 +++++++++++++++
 package/aufs-util/aufs-util.mk                     | 41 +++++++++++++++++
 package/aufs/Config.in                             | 16 +++++++
 package/aufs/aufs.mk                               | 28 ++++++++++++
 13 files changed, 302 insertions(+)
 create mode 100644 linux/linux-ext-aufs.mk
 create mode 100644 package/aufs-util/0001-remove-user-settings.patch
 create mode 100644 package/aufs-util/0002-no-check-ver.patch
 create mode 100644 package/aufs-util/0003-no-strip-lib.patch
 create mode 100644 package/aufs-util/0004-no-override-readdir64.patch
 create mode 100644 package/aufs-util/Config.in
 create mode 100644 package/aufs-util/aufs-util.mk
 create mode 100644 package/aufs/Config.in
 create mode 100644 package/aufs/aufs.mk

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 1/3 v3] aufs: new kernel extension
  2016-07-17 12:50 [Buildroot] [PATCH 0/3 v3] aufs: new kernel extension (branch yem/aufs) Yann E. MORIN
@ 2016-07-17 12:50 ` Yann E. MORIN
  2016-09-20 17:18   ` Thomas Petazzoni
  2016-07-17 12:50 ` [Buildroot] [PATCH 2/3 v3] linux: add an option to install runtime headers Yann E. MORIN
  2016-07-17 12:50 ` [Buildroot] [PATCH 3/3 v3] aufs-util: new package Yann E. MORIN
  2 siblings, 1 reply; 7+ messages in thread
From: Yann E. MORIN @ 2016-07-17 12:50 UTC (permalink / raw)
  To: buildroot

From: Christian Stewart <christian@paral.in>

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 at 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>
---
 linux/Config.ext.in     | 52 +++++++++++++++++++++++++++++++++++++++++++++++++
 linux/linux-ext-aufs.mk | 21 ++++++++++++++++++++
 package/Config.in       |  1 +
 package/aufs/Config.in  | 16 +++++++++++++++
 package/aufs/aufs.mk    | 28 ++++++++++++++++++++++++++
 5 files changed, 118 insertions(+)
 create mode 100644 linux/linux-ext-aufs.mk
 create mode 100644 package/aufs/Config.in
 create mode 100644 package/aufs/aufs.mk

diff --git a/linux/Config.ext.in b/linux/Config.ext.in
index 755c23b..b88cfdb 100644
--- a/linux/Config.ext.in
+++ b/linux/Config.ext.in
@@ -64,4 +64,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
index 0000000..f71e172
--- /dev/null
+++ b/linux/linux-ext-aufs.mk
@@ -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$(AUFS_VERSION_MAJOR)-kbuild.patch \
+		aufs$(AUFS_VERSION_MAJOR)-base.patch \
+		aufs$(AUFS_VERSION_MAJOR)-mmap.patch \
+		aufs$(AUFS_VERSION_MAJOR)-standalone.patch
+	cp -r $(AUFS_DIR)/fs/aufs/ $(@D)/fs/
+	cp $(AUFS_DIR)/include/uapi/linux/aufs_type.h $(@D)/include/uapi/linux/
+endef
diff --git a/package/Config.in b/package/Config.in
index 009b828..a9b004b 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -147,6 +147,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
index 0000000..0a2aa0e
--- /dev/null
+++ b/package/aufs/Config.in
@@ -0,0 +1,16 @@
+# Automatically selected by the corresponding linux extension
+config BR2_PACKAGE_AUFS
+	bool
+
+if BR2_PACKAGE_AUFS
+
+# Both come from the seclection 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
index 0000000..cbb6635
--- /dev/null
+++ b/package/aufs/aufs.mk
@@ -0,0 +1,28 @@
+################################################################################
+#
+# aufs
+#
+# patches for the linux kernel, used by the extension.
+#
+################################################################################
+
+AUFS_VERSION = $(call qstrip,$(BR2_PACKAGE_AUFS_VERSION))
+AUFS_LICENSE = GPLv2
+AUFS_LICENSE_FILES = COPYING
+
+ifeq ($(BR2_PACKAGE_AUFS),y)
+
+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):$(AUFS_VERSION),y:)
+$(error No aufs version specified)
+endif
+
+endif # BR2_PACKAGE_AUFS
+
+$(eval $(generic-package))
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 2/3 v3] linux: add an option to install runtime headers
  2016-07-17 12:50 [Buildroot] [PATCH 0/3 v3] aufs: new kernel extension (branch yem/aufs) Yann E. MORIN
  2016-07-17 12:50 ` [Buildroot] [PATCH 1/3 v3] aufs: new kernel extension Yann E. MORIN
@ 2016-07-17 12:50 ` Yann E. MORIN
  2016-09-20 17:18   ` Thomas Petazzoni
  2016-07-17 12:50 ` [Buildroot] [PATCH 3/3 v3] aufs-util: new package Yann E. MORIN
  2 siblings, 1 reply; 7+ messages in thread
From: Yann E. MORIN @ 2016-07-17 12:50 UTC (permalink / raw)
  To: buildroot

When the Linux kernel is patched with new externsions (e.g. aufs), it
exposes new userland headers that were not necessarily available in the
headers used to build the toolchain. Those headers will expose new
features, like new filesystems internals.

Add an option for such packages to request the kernel installs its
headers.

We do install those headers in a non-standard location, so that:

  - they do not override those provided by the toolchain;

  - they do not get inadvertently used.

Packages that really need those headers will have to add the correct -I
path to their CPPFLAGS.

Note: this is not documented on-purpose, as we expect the set of
packages that need that to be very limited. In which case, we'll
notice they need those headers, and we can instruct the submitter
to use these option and variable.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 linux/Config.in |  9 +++++++++
 linux/linux.mk  | 12 ++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/linux/Config.in b/linux/Config.in
index 310f18b..ab47dd2 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -14,6 +14,15 @@ if BR2_LINUX_KERNEL
 config BR2_LINUX_NEEDS_MODULES
 	bool
 
+# Packages that need the userland headers of the *running* kernel
+# rather than those of the toolchain (e.g. because they need to talk
+# to low-level stuff like filesystems internals or the network stack
+# internals) can select this option.
+# They can then refer to the variable $(LINUX_RUNTIME_HEADERS_DIR) as
+# the base where they are installed.
+config BR2_LINUX_NEEDS_RUNTIME_HEADERS
+	bool
+
 #
 # Version selection. We provide the choice between:
 #
diff --git a/linux/linux.mk b/linux/linux.mk
index fb844ef..73ebd21 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -336,6 +336,18 @@ LINUX_APPEND_DTB += ; \
 endif
 endif
 
+ifeq ($(BR2_LINUX_NEEDS_RUNTIME_HEADERS),y)
+LINUX_INSTALL_STAGING = YES
+LINUX_RUNTIME_HEADERS_DIR = $(STAGING_DIR)/opt/linux
+define LINUX_INSTALL_USERLAND_HEADERS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
+		$(LINUX_MAKE_FLAGS) \
+		INSTALL_HDR_PATH=$(LINUX_RUNTIME_HEADERS_DIR) \
+		headers_install
+endef
+LINUX_POST_INSTALL_STAGING_HOOKS += LINUX_INSTALL_USERLAND_HEADERS
+endif # BR2_LINUX_NEEDS_HEADERS
+
 # Compilation. We make sure the kernel gets rebuilt when the
 # configuration has changed.
 define LINUX_BUILD_CMDS
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 3/3 v3] aufs-util: new package
  2016-07-17 12:50 [Buildroot] [PATCH 0/3 v3] aufs: new kernel extension (branch yem/aufs) Yann E. MORIN
  2016-07-17 12:50 ` [Buildroot] [PATCH 1/3 v3] aufs: new kernel extension Yann E. MORIN
  2016-07-17 12:50 ` [Buildroot] [PATCH 2/3 v3] linux: add an option to install runtime headers Yann E. MORIN
@ 2016-07-17 12:50 ` Yann E. MORIN
  2016-09-20 17:19   ` Thomas Petazzoni
  2 siblings, 1 reply; 7+ messages in thread
From: Yann E. MORIN @ 2016-07-17 12:50 UTC (permalink / raw)
  To: buildroot

From: Christian Stewart <christian@paral.in>

Signed-off-by: Christian Stewart <christian@paral.in>
[Atul:
 - Updated the default to empty.
 - Updated the license to GPLv2.
 - Used patches instead of SED commands.
 - CC and LD are replaced by TARGET_CC and TARGET_LD.
]
Signed-off-by: Atul Singh <atul.singh.mandla@rockwellcollins.com>
[yann.morin.1998 at free.fr:
  - drop the headers_install command
  - instead, instruct the kernel to install them
  - add patches 0002..0004
  - properly build the host tools
  - don't depend on the aufs extension, for kernel already patched
  - fix comment
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
---
 package/Config.in                                  |  1 +
 package/aufs-util/0001-remove-user-settings.patch  | 16 +++++++++
 package/aufs-util/0002-no-check-ver.patch          | 24 +++++++++++++
 package/aufs-util/0003-no-strip-lib.patch          | 18 ++++++++++
 package/aufs-util/0004-no-override-readdir64.patch | 27 ++++++++++++++
 package/aufs-util/Config.in                        | 36 +++++++++++++++++++
 package/aufs-util/aufs-util.mk                     | 41 ++++++++++++++++++++++
 7 files changed, 163 insertions(+)
 create mode 100644 package/aufs-util/0001-remove-user-settings.patch
 create mode 100644 package/aufs-util/0002-no-check-ver.patch
 create mode 100644 package/aufs-util/0003-no-strip-lib.patch
 create mode 100644 package/aufs-util/0004-no-override-readdir64.patch
 create mode 100644 package/aufs-util/Config.in
 create mode 100644 package/aufs-util/aufs-util.mk

diff --git a/package/Config.in b/package/Config.in
index a9b004b..8a81c93 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -148,6 +148,7 @@ endmenu
 
 menu "Filesystem and flash utilities"
 	source "package/aufs/Config.in"
+	source "package/aufs-util/Config.in"
 	source "package/autofs/Config.in"
 	source "package/btrfs-progs/Config.in"
 	source "package/cifs-utils/Config.in"
diff --git a/package/aufs-util/0001-remove-user-settings.patch b/package/aufs-util/0001-remove-user-settings.patch
new file mode 100644
index 0000000..7eebc95
--- /dev/null
+++ b/package/aufs-util/0001-remove-user-settings.patch
@@ -0,0 +1,16 @@
+install: drop setting ownership
+
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+
+diff --git a/Makefile b/Makefile
+--- a/Makefile
++++ b/Makefile
+@@ -21,7 +21,7 @@
+ override CPPFLAGS += -DAUFHSM_CMD=\"/usr/bin/aufhsm\"
+ override CFLAGS += -O -Wall
+ INSTALL ?= install
+-Install = ${INSTALL} -o root -g root -p
++Install = ${INSTALL} -p
+ ManDir = /usr/share/man
+ 
+ #
diff --git a/package/aufs-util/0002-no-check-ver.patch b/package/aufs-util/0002-no-check-ver.patch
new file mode 100644
index 0000000..5fe6920
--- /dev/null
+++ b/package/aufs-util/0002-no-check-ver.patch
@@ -0,0 +1,24 @@
+Makefile: do not check version
+
+The aufs-util package tries to ensure that its version is compatible
+with the one in the running kernel. However, this test is flawed: the
+version string in the aufs4x branch for aufs-util is aufs3.x, so it does
+not match the version in the kernel when it is aufs4.x.
+
+Disengage this check, ion the assumption the user knows what he is
+doing.
+
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+
+diff --git a/Makefile b/Makefile
+--- a/Makefile
++++ b/Makefile
+@@ -62,7 +62,7 @@
+ $(foreach v, CPPFLAGS CFLAGS INSTALL Install ManDir LibUtilHdr, \
+ 	$(eval MAKE += ${v}="$${${v}}"))
+ 
+-all: ver_test ${Man} ${Bin} ${Etc}
++all: ${Man} ${Bin} ${Etc}
+ 	${MAKE} -C libau $@
+ 	ln -sf ./libau/libau*.so .
+ 	$(call MakeFHSM, $@)
diff --git a/package/aufs-util/0003-no-strip-lib.patch b/package/aufs-util/0003-no-strip-lib.patch
new file mode 100644
index 0000000..1583050
--- /dev/null
+++ b/package/aufs-util/0003-no-strip-lib.patch
@@ -0,0 +1,18 @@
+install: do not strip libs when installing
+
+We want unstripped binaries in staging; stripping is done by Buildroot
+as a whole in target-finalize if needed, anyway.
+
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+
+diff --git a/libau/Makefile b/libau/Makefile
+--- a/libau/Makefile
++++ b/libau/Makefile
+@@ -37,7 +37,6 @@
+ 	ln -sf $< $@
+ ${LibSo}.${LibSoMajor}: ${LibSo}.${LibSoMajor}.${LibSoMinor}
+ 	ln -sf $< $@
+-${LibSo}.${LibSoMajor}.${LibSoMinor}: override LDFLAGS += -s
+ ${LibSo}.${LibSoMajor}.${LibSoMinor}: override LDLIBS += -ldl -lpthread
+ ${LibSo}.${LibSoMajor}.${LibSoMinor}: ${LibSoObj}
+ 	${CC} --shared -Wl,-soname,${LibSo}.${LibSoMajor} ${LDFLAGS} \
diff --git a/package/aufs-util/0004-no-override-readdir64.patch b/package/aufs-util/0004-no-override-readdir64.patch
new file mode 100644
index 0000000..da0693b
--- /dev/null
+++ b/package/aufs-util/0004-no-override-readdir64.patch
@@ -0,0 +1,27 @@
+libaufs: do not include rdu64
+
+rdu64 is supposed to provide the LFS variant of readdir(), readdir64().
+
+However, because Buildroot is always LFS0-enabled, readdir() is always
+the LFS variant.
+
+Besides, the comment about rdu64 is utterly wrong: it refers to 64-bit
+systems, when in fact it really is about support for LFS.
+
+Drop it from the build, as it causes build failures due to multiple
+implementations of readdir64().
+
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+
+diff --git a/libau/Makefile b/libau/Makefile
+--- a/libau/Makefile
++++ b/libau/Makefile
+@@ -18,7 +18,7 @@
+ LibSoMinor = 7
+ LibSo = libau.so
+ LibSoObj = libau.o \
+-	rdu_lib.o rdu.o rdu64.o \
++	rdu_lib.o rdu.o \
+ 	pathconf.o
+ LibSoHdr = libau.h rdu.h
+ 
diff --git a/package/aufs-util/Config.in b/package/aufs-util/Config.in
new file mode 100644
index 0000000..6896c0c
--- /dev/null
+++ b/package/aufs-util/Config.in
@@ -0,0 +1,36 @@
+comment "aufs-util needs a linux kernel and a toolchain w/ threads"
+	depends on BR2_USE_MMU
+	depends on !BR2_LINUX_KERNEL || !BR2_TOOLCHAIN_HAS_THREADS
+
+config BR2_PACKAGE_AUFS_UTIL
+	bool "aufs-util"
+	depends on BR2_USE_MMU
+	depends on BR2_LINUX_KERNEL
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	select BR2_LINUX_NEEDS_RUNTIME_HEADERS
+	help
+	  Aufs command line utilities.
+
+	  Needs a kernel with aufs support. A kernel
+	  extension package is available.
+
+	  http://sourceforge.net/p/aufs/aufs-util/
+
+if BR2_PACKAGE_AUFS_UTIL
+
+config BR2_PACKAGE_AUFS_UTIL_VERSION
+	string "aufs-util version"
+	default ""
+	help
+	  The version you choose must match that of the uafs support
+	  in your kernel. Usually, this is aufs3.x for kerenls 3.x and
+	  aufs4.x for kernels 4.x.
+
+	  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:
+
+	  https://sourceforge.net/p/aufs/aufs-util/ci/master/tree/
+
+endif
diff --git a/package/aufs-util/aufs-util.mk b/package/aufs-util/aufs-util.mk
new file mode 100644
index 0000000..91be9ab
--- /dev/null
+++ b/package/aufs-util/aufs-util.mk
@@ -0,0 +1,41 @@
+################################################################################
+#
+# aufs-util
+#
+################################################################################
+
+# linux-headers
+AUFS_UTIL_VERSION = $(call qstrip,$(BR2_PACKAGE_AUFS_UTIL_VERSION))
+AUFS_UTIL_SITE = http://git.code.sf.net/p/aufs/aufs-util
+AUFS_UTIL_SITE_METHOD = git
+AUFS_UTIL_LICENSE = GPLv2
+AUFS_UTIL_LICENSE_FILES = COPYING
+
+AUFS_UTIL_DEPENDENCIES = linux
+
+AUFS_UTIL_HOST_CPPFLAGS = \
+	$(HOST_CPPFLAGS) \
+	-I$(LINUX_RUNTIME_HEADERS_DIR)/include
+
+AUFS_UTIL_CPPFLAGS = \
+	$(TARGET_CPPFLAGS) \
+	-I$(LINUX_RUNTIME_HEADERS_DIR)/include
+
+# First, we build the host tools, needed to build the target tools.
+define AUFS_UTIL_BUILD_CMDS
+	$(MAKE) -C $(@D) \
+		$(HOST_CONFIGURE_OPTS) \
+		CPPFLAGS="$(AUFS_UTIL_HOST_CPPFLAGS)" \
+		HOSTCC="$(HOSTCC)" HOSTLD="$(HOSTLD)" \
+		INSTALL="$(INSTALL)" c2sh c2tmac
+	$(MAKE1) -C $(@D) \
+		$(TARGET_CONFIGURE_OPTS) \
+		CPPFLAGS="$(AUFS_UTIL_CPPFLAGS)" \
+		INSTALL="$(INSTALL)" all
+endef
+
+define AUFS_UTIL_INSTALL_TARGET_CMDS
+	$(MAKE) -C $(@D) INSTALL="$(INSTALL)" DESTDIR="$(TARGET_DIR)" install
+endef
+
+$(eval $(generic-package))
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 1/3 v3] aufs: new kernel extension
  2016-07-17 12:50 ` [Buildroot] [PATCH 1/3 v3] aufs: new kernel extension Yann E. MORIN
@ 2016-09-20 17:18   ` Thomas Petazzoni
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2016-09-20 17:18 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 17 Jul 2016 14:50:37 +0200, Yann E. MORIN wrote:
> From: Christian Stewart <christian@paral.in>
> 
> 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 at 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>
> ---
>  linux/Config.ext.in     | 52 +++++++++++++++++++++++++++++++++++++++++++++++++
>  linux/linux-ext-aufs.mk | 21 ++++++++++++++++++++
>  package/Config.in       |  1 +
>  package/aufs/Config.in  | 16 +++++++++++++++
>  package/aufs/aufs.mk    | 28 ++++++++++++++++++++++++++
>  5 files changed, 118 insertions(+)
>  create mode 100644 linux/linux-ext-aufs.mk
>  create mode 100644 package/aufs/Config.in
>  create mode 100644 package/aufs/aufs.mk

Applied to master, with the following changes:

    [Thomas:
     - Fix the apply patch logic, it was using a non-existent
       AUFS_VERSION_MAJOR variable. BR2_PACKAGE_AUFS_SERIES is used
       instead.]

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 2/3 v3] linux: add an option to install runtime headers
  2016-07-17 12:50 ` [Buildroot] [PATCH 2/3 v3] linux: add an option to install runtime headers Yann E. MORIN
@ 2016-09-20 17:18   ` Thomas Petazzoni
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2016-09-20 17:18 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 17 Jul 2016 14:50:38 +0200, Yann E. MORIN wrote:
> When the Linux kernel is patched with new externsions (e.g. aufs), it
> exposes new userland headers that were not necessarily available in the
> headers used to build the toolchain. Those headers will expose new
> features, like new filesystems internals.
> 
> Add an option for such packages to request the kernel installs its
> headers.
> 
> We do install those headers in a non-standard location, so that:
> 
>   - they do not override those provided by the toolchain;
> 
>   - they do not get inadvertently used.
> 
> Packages that really need those headers will have to add the correct -I
> path to their CPPFLAGS.
> 
> Note: this is not documented on-purpose, as we expect the set of
> packages that need that to be very limited. In which case, we'll
> notice they need those headers, and we can instruct the submitter
> to use these option and variable.
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

I have not applied this patch. Instead, I've tuned a bit the aufs-util
package so that we can directly use the headers from
$(LINUX_DIR)/include/uapi.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 3/3 v3] aufs-util: new package
  2016-07-17 12:50 ` [Buildroot] [PATCH 3/3 v3] aufs-util: new package Yann E. MORIN
@ 2016-09-20 17:19   ` Thomas Petazzoni
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2016-09-20 17:19 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 17 Jul 2016 14:50:39 +0200, Yann E. MORIN wrote:
> From: Christian Stewart <christian@paral.in>
> 
> Signed-off-by: Christian Stewart <christian@paral.in>
> [Atul:
>  - Updated the default to empty.
>  - Updated the license to GPLv2.
>  - Used patches instead of SED commands.
>  - CC and LD are replaced by TARGET_CC and TARGET_LD.
> ]
> Signed-off-by: Atul Singh <atul.singh.mandla@rockwellcollins.com>
> [yann.morin.1998 at free.fr:
>   - drop the headers_install command
>   - instead, instruct the kernel to install them
>   - add patches 0002..0004
>   - properly build the host tools
>   - don't depend on the aufs extension, for kernel already patched
>   - fix comment
> ]
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>

Applied with those changes:

    [Thomas:
     - Remove the patch 0004-no-override-readdir64.patch, since it no longer
       applies to the latest version of aufs-util. Instead, add a post-patch
       hook that tweaks the Makefile to remove the problematic rdu64.o from
       the build process.
     - Use directly the kernel headers from the kernel source tree, rather
       than having to install them. This only requires a minor trick to
       define "__user" to empty.]

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-09-20 17:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-17 12:50 [Buildroot] [PATCH 0/3 v3] aufs: new kernel extension (branch yem/aufs) Yann E. MORIN
2016-07-17 12:50 ` [Buildroot] [PATCH 1/3 v3] aufs: new kernel extension Yann E. MORIN
2016-09-20 17:18   ` Thomas Petazzoni
2016-07-17 12:50 ` [Buildroot] [PATCH 2/3 v3] linux: add an option to install runtime headers Yann E. MORIN
2016-09-20 17:18   ` Thomas Petazzoni
2016-07-17 12:50 ` [Buildroot] [PATCH 3/3 v3] aufs-util: new package Yann E. MORIN
2016-09-20 17:19   ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox