Skip to contentSkip to conversation

aufs-utils: initial release

PATCH New steffenhoenig 2 participants 5 messages Jul 28, 2014 – Jan 2, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 aufs-utils: initial release

---
 package/Config.in                |  1 +
 package/aufs-utils/Config.in     |  4 ++++
 package/aufs-utils/aufs-utils.mk | 27 +++++++++++++++++++++++++++
 3 files changed, 32 insertions(+)
 create mode 100644 package/aufs-utils/Config.in
 create mode 100644 package/aufs-utils/aufs-utils.mk
package/Config.in +1 -0
index 559b895..b49908c 100644
@@ -136,6 +136,7 @@ endif
 endmenu
 
 menu "Filesystem and flash utilities"
+	source "package/aufs-utils/Config.in"
 	source "package/btrfs-progs/Config.in"
 	source "package/cifs-utils/Config.in"
 	source "package/cramfs/Config.in"
package/aufs-utils/Config.in new file +4 -0
new file mode 100644
index 0000000..fc77218
@@ -0,0 +1,4 @@
+config BR2_PACKAGE_AUFS_UTILS
+	bool "aufs-utils"
+	help
+          Utilities for Aufs3
package/aufs-utils/aufs-utils.mk new file +27 -0
new file mode 100644
index 0000000..de14e81
@@ -0,0 +1,27 @@
+################################################################################
+#
+# aufs-utils
+#
+################################################################################
+
+AUFS_UTILS_VERSION = aufs3.9
+AUFS_UTILS_LICENCSE = GPLv2
+AUFS_UTILS_LICENSE_FILES = COPYING
+AUFS_UTILS_SITE = http://git.code.sf.net/p/aufs/aufs-util
+AUFS_UTILS_SITE_METHOD = git
+AUFS_UTILS_DEPENDENCIES = aufs
+
+AUFS_UTILS_SBIN = mount.aufs umount.aufs # auplink auibusy aumvdown
+AUFS_UTILS_UBIN = aubusy auchk aubrsync # auctl
+
+define AUFS_UTILS_BUILD_CMDS
+	$(MAKE) -C $(@D)/libau CPPFLAGS="-I$(STAGING_DIR)/usr/include" KDIR=$(LINUX_DIR) CC="$(TARGET_CC)" LD="$(TARGET_LD)" libau.so
+	$(MAKE) -C $(@D) CPPFLAGS="-I$(STAGING_DIR)/usr/include" KDIR=$(LINUX_DIR) CC="$(TARGET_CC)" LD="$(TARGET_LD)" $(AUFS_UTILS_SBIN)
+endef
+
+define AUFS_UTILS_INSTALL_TARGET_CMDS
+	$(foreach p,$(AUFS_UTILS_SBIN),$(INSTALL) -D -m 0755 $(@D)/$(p) $(TARGET_DIR)/sbin/;)
+	$(foreach p,$(AUFS_UTILS_UBIN),$(INSTALL) -D -m 0755 $(@D)/$(p) $(TARGET_DIR)/usr/bin/;)
+endef
+
+$(eval $(generic-package))
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/2 aufs: initial release (selects aufs-utils)

---
 package/Config.in      |  1 +
 package/aufs/Config.in | 36 ++++++++++++++++++++++++++++++++++++
 package/aufs/aufs.mk   | 36 ++++++++++++++++++++++++++++++++++++
 3 files changed, 73 insertions(+)
 create mode 100644 package/aufs/Config.in
 create mode 100644 package/aufs/aufs.mk
package/Config.in +1 -0
index b49908c..0225e9f 100644
@@ -136,6 +136,7 @@ endif
 endmenu
 
 menu "Filesystem and flash utilities"
+	source "package/aufs/Config.in"
 	source "package/aufs-utils/Config.in"
 	source "package/btrfs-progs/Config.in"
 	source "package/cifs-utils/Config.in"
package/aufs/Config.in new file +36 -0
new file mode 100644
index 0000000..e7842bd
@@ -0,0 +1,36 @@
+config BR2_PACKAGE_AUFS
+        bool "aufs"
+        select BR2_PACKAGE_AUFS_UTILS
+        help
+          Aufs3 -- advanced multi layered unification filesystem version 3.x
+
+comment "aufs needs a Linux kernel to be built"
+    depends on !BR2_LINUX_KERNEL
+
+if BR2_PACKAGE_AUFS
+
+choice 
+    prompt "version"
+
+config BR2_PACKAGE_AUFS_LATEST_VERSION
+    bool "aufs3.15"
+
+config BR2_PACKAGE_AUFS_CUSTOM_VERSION
+    bool "custom version"
+    help
+      This option allows to use a specific aufs kernel patch set
+
+      Note: you need to insert the version string like aufs3.12, aufs3.9, ...
+
+endchoice
+
+config BR2_PACKAGE_AUFS_CUSTOM_VERSION_VALUE
+    string ""
+    depends on BR2_PACKAGE_AUFS_CUSTOM_VERSION
+
+config BR2_PACKAGE_AUFS_VERSION
+    string
+    default "aufs3.15" if BR2_PACKAGE_AUFS_LATEST_VERSION
+    default BR2_PACKAGE_AUFS_CUSTOM_VERSION_VALUE \
+        if BR2_PACKAGE_AUFS_CUSTOM_VERSION
+endif
package/aufs/aufs.mk new file +36 -0
new file mode 100644
index 0000000..c1b21c4
@@ -0,0 +1,36 @@
+################################################################################
+#
+# aufs
+#
+################################################################################
+
+AUFS_VERSION = $(call qstrip,$(BR2_PACKAGE_AUFS_VERSION))
+AUFS_LICENCSE = GPLv2
+AUFS_LICENSE_FILES = COPYING
+
+AUFS_SITE = http://git.code.sf.net/p/aufs/aufs3-standalone
+AUFS_SITE_METHOD = git
+
+AUFS_DEPENDENCIES = linux
+AUFS_INSTALL_STAGING = YES
+
+AUFS_PATCHES = kbuild base mmap standalone
+
+define AUFS_BUILD_CMDS
+    $(foreach p,$(AUFS_PATCHES),./support/scripts/apply-patches.sh $(LINUX_DIR) $(@D) *$(p).patch;)
+	$(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KDIR=$(LINUX_DIR) aufs.ko
+endef
+
+define AUFS_INSTALL_STAGING_CMDS
+	$(MAKE) -C $(LINUX_DIR) $(LINUX_MAKE_FLAGS) -f scripts/Makefile.host \
+		scripts/unifdef
+	$(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KDIR=$(LINUX_DIR) usr/include/linux/aufs_type.h
+	$(INSTALL) -p -m 0644 $(@D)/usr/include/linux/aufs_type.h \
+		$(STAGING_DIR)/usr/include/linux
+endef
+
+define AUFS_INSTALL_TARGET_CMDS
+	$(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KDIR=$(LINUX_DIR) install
+endef
+
+$(eval $(generic-package))
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/2 aufs: initial release (selects aufs-utils)

Hello Steffen,

Sorry for the very late feedback about your patches. Are you still interested in getting aufs merged in Buildroot?

package/aufs/Config.in line 3

Quoted 9 lines · steffenhoenig
package/aufs/Config.in new file +3 -0
new file mode 100644
index 0000000..e7842bd
@@ -0,0 +1,36 @@
+config BR2_PACKAGE_AUFS
+        bool "aufs"
+        select BR2_PACKAGE_AUFS_UTILS

Why do you select BR2_PACKAGE_AUFS_UTILS here? My understanding is that the dependency is the other way around: you cannot build aufs-utils until the aufs package has installed the aufs_type.h header file.

package/aufs/Config.in line 8

Quoted 5 lines
package/aufs/Config.in new file +5 -0
+        help
+          Aufs3 -- advanced multi layered unification filesystem version 3.x
+
+comment "aufs needs a Linux kernel to be built"
+    depends on !BR2_LINUX_KERNEL

So there should be a "depends on BR2_LINUX_KERNEL" under the main aufs config option, above.

Quoted 18 lines
package/aufs/Config.in new file +18 -0
+
+if BR2_PACKAGE_AUFS
+
+choice 
+    prompt "version"
+
+config BR2_PACKAGE_AUFS_LATEST_VERSION
+    bool "aufs3.15"
+
+config BR2_PACKAGE_AUFS_CUSTOM_VERSION
+    bool "custom version"
+    help
+      This option allows to use a specific aufs kernel patch set
+
+      Note: you need to insert the version string like aufs3.12, aufs3.9, ...
+
+endchoice
+

package/aufs/Config.in line 36

Quoted 10 lines
package/aufs/Config.in new file +10 -0
+config BR2_PACKAGE_AUFS_CUSTOM_VERSION_VALUE
+    string ""
+    depends on BR2_PACKAGE_AUFS_CUSTOM_VERSION
+
+config BR2_PACKAGE_AUFS_VERSION
+    string
+    default "aufs3.15" if BR2_PACKAGE_AUFS_LATEST_VERSION
+    default BR2_PACKAGE_AUFS_CUSTOM_VERSION_VALUE \
+        if BR2_PACKAGE_AUFS_CUSTOM_VERSION
+endif

I don't think this complexity is necessary. Having a "latest" version for aufs doesn't make a lot of sense, because nobody wants the "latest"
version: everybody wants a version that matches the kernel version being used.

So I believe, you can replace that by a single "string" config option:

config BR2_PACKAGE_AUFS_VERSION
string "version"
help
Specify aufs3.9, aufs3.13, aufs3.17 or any other existing aufs version.

package/aufs/Config.in

Quoted 2 lines
package/aufs/Config.in new file +2 -0
+AUFS_VERSION = $(call qstrip,$(BR2_PACKAGE_AUFS_VERSION))
+AUFS_LICENCSE = GPLv2

LICENSE.

package/aufs/Config.in

Quoted 12 lines
package/aufs/Config.in new file +12 -0
+AUFS_LICENSE_FILES = COPYING
+
+AUFS_SITE = http://git.code.sf.net/p/aufs/aufs3-standalone
+AUFS_SITE_METHOD = git
+
+AUFS_DEPENDENCIES = linux
+AUFS_INSTALL_STAGING = YES
+
+AUFS_PATCHES = kbuild base mmap standalone
+
+define AUFS_BUILD_CMDS
+    $(foreach p,$(AUFS_PATCHES),./support/scripts/apply-patches.sh $(LINUX_DIR) $(@D) *$(p).patch;)

This cannot work, because AUFS_BUILD_CMDS will be executed *after* the Linux kernel has been built. So it's too late to patch the kernel.

Since aufs needs to patch the kernel, you'll have to handle it as a "Linux kernel extension", taking example on what we've done for RTAI in linux/linux-ext-rtai.mk. I can help with this, but before doing too much work, I'd like to make sure you are still interested in aufs.

package/aufs/Config.in

Quoted 6 lines
package/aufs/Config.in new file +6 -0
+	$(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KDIR=$(LINUX_DIR) aufs.ko
+endef
+
+define AUFS_INSTALL_STAGING_CMDS
+	$(MAKE) -C $(LINUX_DIR) $(LINUX_MAKE_FLAGS) -f scripts/Makefile.host \
+		scripts/unifdef

Why?

package/aufs/Config.in

Quoted 1 line
package/aufs/Config.in new file +1 -0
+	$(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KDIR=$(LINUX_DIR) usr/include/linux/aufs_type.h

This should be part of AUFS_BUILD_CMDS.

package/aufs/Config.in

Quoted 9 lines
package/aufs/Config.in new file +9 -0
+	$(INSTALL) -p -m 0644 $(@D)/usr/include/linux/aufs_type.h \
+		$(STAGING_DIR)/usr/include/linux
+endef
+
+define AUFS_INSTALL_TARGET_CMDS
+	$(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KDIR=$(LINUX_DIR) install
+endef
+
+$(eval $(generic-package))

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 1/2 aufs-utils: initial release

In reply to steffenhoenig

Steffen,

I believe this package depends on aufs, so this patch should be the second patch in the patch series, not the first one.

Your package/aufs-utils/Config.in file should have a "select BR2_PACKAGE_AUFS", and therefore also a "depends on BR2_LINUX_KERNEL".

package/aufs-utils/aufs-utils.mk line 7

Quoted 13 lines · steffenhoenig
package/aufs-utils/aufs-utils.mk new file +7 -0
new file mode 100644
index 0000000..de14e81
@@ -0,0 +1,27 @@
+################################################################################
+#
+# aufs-utils
+#
+################################################################################
+
+AUFS_UTILS_VERSION = aufs3.9

Why not using:

	$(call qstrip,$(BR2_PACKAGE_AUFS_VERSION))

here, so that both aufs and aufs-utils have the same version.

package/aufs-utils/aufs-utils.mk line 12

Quoted 5 lines
package/aufs-utils/aufs-utils.mk new file +5 -0
+AUFS_UTILS_LICENCSE = GPLv2
+AUFS_UTILS_LICENSE_FILES = COPYING
+AUFS_UTILS_SITE = http://git.code.sf.net/p/aufs/aufs-util
+AUFS_UTILS_SITE_METHOD = git
+AUFS_UTILS_DEPENDENCIES = aufs

Ah, you see, it's really aufs-utils that depends on aufs.

package/aufs-utils/aufs-utils.mk line 19

Quoted 7 lines
package/aufs-utils/aufs-utils.mk new file +7 -0
+
+AUFS_UTILS_SBIN = mount.aufs umount.aufs # auplink auibusy aumvdown
+AUFS_UTILS_UBIN = aubusy auchk aubrsync # auctl
+
+define AUFS_UTILS_BUILD_CMDS
+	$(MAKE) -C $(@D)/libau CPPFLAGS="-I$(STAGING_DIR)/usr/include" KDIR=$(LINUX_DIR) CC="$(TARGET_CC)" LD="$(TARGET_LD)" libau.so
+	$(MAKE) -C $(@D) CPPFLAGS="-I$(STAGING_DIR)/usr/include" KDIR=$(LINUX_DIR) CC="$(TARGET_CC)" LD="$(TARGET_LD)" $(AUFS_UTILS_SBIN)

Any reason to have two $(MAKE) calls with specific targets here, instead of just using the main Makefile of the project?

Also, instead of passing CPPFLAGS, CC and LD, you should use $(TARGET_CONFIGURE_OPTS), i.e something like:

	$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) KDIR=$(LINUX_DIR)

package/aufs-utils/aufs-utils.mk line 24

Quoted 3 lines
package/aufs-utils/aufs-utils.mk new file +3 -0
+define AUFS_UTILS_INSTALL_TARGET_CMDS
+	$(foreach p,$(AUFS_UTILS_SBIN),$(INSTALL) -D -m 0755 $(@D)/$(p) $(TARGET_DIR)/sbin/;)
+	$(foreach p,$(AUFS_UTILS_UBIN),$(INSTALL) -D -m 0755 $(@D)/$(p) $(TARGET_DIR)/usr/bin/;)

Why not using "make install" here?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH 1/2 aufs-utils: initial release

In reply to steffenhoenig

Dear steffenhoenig,

Quoted 8 lines · steffenhoenig
---
 package/Config.in                |  1 +
 package/aufs-utils/Config.in     |  4 ++++
 package/aufs-utils/aufs-utils.mk | 27 +++++++++++++++++++++++++++
 3 files changed, 32 insertions(+)
 create mode 100644 package/aufs-utils/Config.in
 create mode 100644 package/aufs-utils/aufs-utils.mk

I gave some feedback about your patches on November, 23th, and got no response. Since the patches cannot be applied as is, and nobody has worked on a version that actually works properly, I'll mark them as "Changes Requested" in our patch tracking system.

Please resubmit updated versions with the suggested changes if you want to have aufs supported in Buildroot.

Thanks a lot!

Thomas

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