Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 160065 - sys-fs/aufs (new ebuild)
Summary: sys-fs/aufs (new ebuild)
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Thomas Sachau
Whiteboard: [sunrise-overlay]
Keywords: EBUILD, InOverlay
Depends on:
Reported: 2007-01-04 11:24 UTC by Matteo Spreafico
Modified: 2012-06-29 16:19 UTC (History)
11 users (show)

See Also:
Package list:
Runtime testing required: ---

Ebuild for aufs ~x86 (aufs-20070205.ebuild,2.32 KB, text/plain)
2007-02-08 09:19 UTC, Torsten Kockler
Ebuild aufs - Version 20070212 (aufs-20070212.ebuild,2.32 KB, text/plain)
2007-02-12 10:05 UTC, Torsten Kockler
aufs-20070409.ebuild (aufs-20070409.ebuild,3.34 KB, text/plain)
2007-04-21 18:01 UTC, Fernando Gutiérrez
CVS ebuild for aufs (aufs-30000000.ebuild,2.01 KB, text/plain)
2007-08-17 10:41 UTC, Account removed
Updated CVS ebuild for aufs (aufs-30000000.ebuild,2.14 KB, text/plain)
2008-07-17 18:46 UTC, Nick White
CVS ebuild based on aufs-20080422 (aufs-9999.ebuild,3.36 KB, text/plain)
2008-12-10 17:52 UTC, Rada
Emerge info (info.txt,11.87 KB, text/plain)
2008-12-11 19:48 UTC, NaiL
Fixed /etc/default/aufs problem (aufs-9999.ebuild,3.41 KB, text/plain)
2008-12-11 23:05 UTC, Rada
based off sys-fs/aufs-20081208-r1 (aufs-9999.ebuild,4.28 KB, text/plain)
2008-12-20 06:29 UTC, Rada
updated with patch for 2.6.29 (aufs-9999.ebuild,4.42 KB, text/plain)
2009-04-11 18:46 UTC, Rada
2.6.29 patch (aufs-9999-compile-fix.patch,5.30 KB, patch)
2009-04-11 18:46 UTC, Rada
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matteo Spreafico 2007-01-04 11:24:22 UTC
0. Introduction
Aufs was entirely re-designed and re-implemented Unionfs. After
many original ideas, approaches, improvements and implementations, it
becomes totally different from Unionfs while keeping the basic features.
Unionfs is being developed by Professor Erez Zadok at Stony Brook
University and his team.
If you don't know Unionfs, I recommend you to try and know it before
using aufs. Some terminology in aufs follows Unionfs's.

Bug reports (including my broken English), suggestions, comments
and donations are always welcome. Your bug report may help other users,
including future users.

1. Features
- unite several directories into a single virtual filesystem. The member
  directory is called as a branch.
- you can specify the permission flags to the branch, which are 'readonly',
  'readwrite' and 'whiteout-able.'
- by upper writable branch, internal copyup and whiteout, files/dirs on
  readonly branch are modifiable logically.
- dynamic branch manipulation, add, del.
- etc... see Unionfs in detail.

Also there are many enhancements in aufs, such like,,,
- simplified, safer and faster
- keep inode number by external inode number table
- keep the timestamps of file/dir in internal copyup operation
- seekable directory, support NFS readdir.
- support mmap(2) including /proc/PID/exe symlink, without page-copy
- whiteout is hardlinked in order to reduce the consumption of inodes
  on branch
- do not copyup, nor create a whiteout when it is unnecessary
- revert a single systemcall when an error occurs in aufs
- remount interface instead of ioctl
- maintain /etc/mtab by an external shell script, /sbin/mount.aufs.
- loopback mounted filesystem as a branch
- kernel thread for removing the dir who has a plenty of whiteouts
- support copyup sparse file (a file which has a 'hole' in it)
- default permission flags for branches
- selectable permission flags for ro branch, whether whiteout can
  exist or not
- and more... see aufs manual in detail

Aufs is in still development stage, especially,,,
- pseudo hardlink (hardlink over branches)
- NFS or remote filesystem branch
- allow a direct access manually to a file on branch,
  eg. bypassing aufs. including NFS or remote filesystem branch.
- remount option copy/move between two branches, selecting writable branch
- O_DIRECT (unnecessary?)
- export via NFS (unnecessary?)
- light version, without branch manipulation.
- SMP, because I don't have such machine.
- xattr, acl
- and documentation
Comment 1 Torsten Kockler 2007-02-08 09:19:10 UTC
Created attachment 109488 [details]
Ebuild for aufs ~x86

I've tried to create an ebuild for aufs from the cvs Version 20070205. It worked for me. Please send me feedback so I can improve it.

Cheers, Torsten ;o)
Comment 2 Martin Väth 2007-02-09 18:02:41 UTC
Is it a problem of the ebuild or of upstream that it is x86-only?
On amd64, I get error messages when compiling super.o (x86 compiles fine with the same kernel version):

make[1]: Entering directory `/usr/src/linux-2.6.19-hardened-r5'
  CC [M] \
  CC [M] \
In file included from include/linux/timex.h:188,
                 from include/linux/sched.h:51,
                 from include/linux/radix-tree.h:23,
                 from include/linux/fs.h:277, from /var/tmp/portage/sys-fs/aufs-20070205/work/aufs-20070205/fs/aufs/debug.h:25, from /var/tmp/portage/sys-fs/aufs-20070205/work/aufs-20070205/fs/aufs/aufs.h:51,                 from /var/tmp/portage/sys-fs/aufs-20070205/work/aufs-20070205/fs/aufs/sbinfo.c:22:
include/asm/timex.h: In function 'get_cycles':
include/asm/timex.h:25: warning: left shift count >= width of type
include/asm/timex.h: In function 'get_cycles_sync':
include/asm/timex.h:38: warning: left shift count >= width of type
In file included from include/linux/hrtimer.h:20,
                 from include/linux/sched.h:85,
                 from include/linux/radix-tree.h:23,
                 from include/linux/fs.h:277, from /var/tmp/portage/sys-fs/aufs-20070205/work/aufs-20070205/fs/aufs/debug.h:25, from /var/tmp/portage/sys-fs/aufs-20070205/work/aufs-20070205/fs/aufs/aufs.h:51, from /var/tmp/portage/sys-fs/aufs-20070205/work/aufs-20070205/fs/aufs/sbinfo.c:22:
include/linux/ktime.h: In function 'ktime_set':
include/linux/ktime.h:78: warning: comparison is always false due to limited range of data type
{standard input}: Assembler messages:
{standard input}:38: Error: suffix or operands invalid for `push'
{standard input}:64: Error: suffix or operands invalid for `push'
[further errors, all of type "suffix or operands invalid for `push'"].

If it is useful, I can provide more information...
Comment 3 Torsten Kockler 2007-02-12 07:28:07 UTC

unfortunately I wasn't able to test the ebuild with amd64. The problem is most probably this line:

emake \
	ARCH=i386 \
	KDIR=${ROOT}/lib/modules/${KV_FULL}/build \

The ARCH Variable has always been set to x68 so aufs tried to compile with the Makefile in /usr/src/linux/arch/x86... (that doesn't exist). I had to set it to i386 as quick and dirty solution, because I didn't know an elegant (ebuild like) way of handling this problem.

I try to fix that :-). Thanks for the feedback.

Torsten ;-)
Comment 4 Torsten Kockler 2007-02-12 10:05:29 UTC
Created attachment 109937 [details]
Ebuild aufs - Version 20070212

Created a new ebuild for aufs version 20070212. I could only test it for ~x86, thats the reason I only added the ~x86 Keword. Maybe someone else can test it on other ARCHs ;)
Comment 5 Martin Väth 2007-02-12 16:13:37 UTC
It compiled fine on amd64, although with several worryingly warnings of type
  "warning: format '%d' expects type 'int', but argument 6 has type 'ssize_t"
(ssize_t is in contrast to int of course 64bit on amd64).

After emerge a manual "modules-update" was necessary before "modprobe aufs" could find the module.

There seems to be a bug in the mount.aufs script

# mkdir /root/{1,2,3}
# mount -v -t aufs br:/root/1:/root/3 /root/2
sed: -e expression #1, char 16: unknown option to `s'
mount: wrong fs type, bad option, bad superblock on br:/root/1:/root/3,
       missing codepage or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

failure bad /proc/mounts 1
sed: -e expression #1, char 15: unknown option to `s'
Comment 6 Martin Väth 2007-02-12 20:03:35 UTC
Oh, it seems this was only a typo in the examples section of the manpage:
With "-o" added (and of course "none" inserted in front of the last argument) everything works.

So I guess ~amd64 is OK...

(although the frightening %d warnings remain of course, and modules-update is missing somewhere in the ebuild).
Comment 7 Torsten Kockler 2007-02-12 21:34:18 UTC
Okay, thanks for testing it on ~amd64 because I tested the ebuild with the useflags "ksize" and "nfs" I always recompiled the kernel and rebooted the system after the emerge. Because at boot time a modules-update is done automatically I never realized that it was missing in the ebuild. So I will fix that tomorrow ;)
Comment 8 Martin Väth 2007-02-13 01:58:29 UTC
Since I had just compiled a new kernel: aufs does not occur in "module-rebuild list". I guess it should be entered somewhere into a database.
Comment 9 Torsten Kockler 2007-02-13 21:34:32 UTC
I commited a new version of the ebuild to the gentoo-sunrise project
Comment 10 Mike Gualtieri 2007-02-20 01:06:36 UTC
I'm happy this ebuild exists.  I needed it for the new version of the linux-live scripts.  The 2/12 ebuild builds fine for me (kernel 2.6.18).
Comment 11 Fernando Gutiérrez 2007-04-19 09:23:21 UTC
I tried to use the aufs ebuild from sunrise overlay (20070402) but the compilation randomly failed. Then I used the same ebuild with the 20070409 aufs from cvs and the kernel 2.6.20-gentoo-r2, but it didn't help (well it stopped giving me some warnings). So I found out that this behaviour was due to my MAKEOPTS="-j3" in make.conf, with -j1 it always succeeds. I'm using AMD64 and the nfs flag.

One possible fix would be adding to the ebuild:

src_compile() {
        emake -j1 ${BUILD_PARAMS} ${BUILD_TARGETS} || die "emake failed"

but of course fixing the aufs makefile (if the problem is there, it usually is) would be better.
I'm not sure if tc-arch after emake is needed. set_arch_to_kernel() and set_arch_to_portage() can also be used but the eclass says they are legacy wrappers.

Thanks for making this ebuild, it's been very useful.
Comment 12 Fernando Gutiérrez 2007-04-21 18:01:56 UTC
Created attachment 116920 [details]

Patches were not working with 20070402 version from sunrise overlay due to a change in format from 20070212.
Remember that the ebuild I uploaded is for version 20070409, so you will need to edit the SRC_URI, perhaps using you own webserver to host the file
Comment 13 NaiL 2007-08-11 18:23:45 UTC
Incompatible with kernel 2.6.22, please update.

/var/tmp/portage/sys-fs/aufs-20070402/work/aufs-20070402/fs/aufs/sysaufs.c: In function 'sysaufs_fin':
/var/tmp/portage/sys-fs/aufs-20070402/work/aufs-20070402/fs/aufs/sysaufs.c:472: error: 'struct kset' has no member named 'kset'
/var/tmp/portage/sys-fs/aufs-20070402/work/aufs-20070402/fs/aufs/sysaufs.c: In function 'sysaufs_init':
/var/tmp/portage/sys-fs/aufs-20070402/work/aufs-20070402/fs/aufs/sysaufs.c:487: error: 'struct kset' has no member named 'kset'
/var/tmp/portage/sys-fs/aufs-20070402/work/aufs-20070402/fs/aufs/sysaufs.c:499: error: 'struct kset' has no member named 'kset'
make[2]: *** [/var/tmp/portage/sys-fs/aufs-20070402/work/aufs-20070402/fs/aufs/sysaufs.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [_module_/var/tmp/portage/sys-fs/aufs-20070402/work/aufs-20070402/fs/aufs] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.22-gentoo-r2'
make: *** [fs/aufs/aufs.ko] Error 2

!!! ERROR: sys-fs/aufs-20070402 failed.
Call stack:, line 1632:   Called dyn_compile, line 983:   Called qa_call 'src_compile', line 44:   Called src_compile, line 1322:   Called linux-mod_src_compile
  linux-mod.eclass, line 516:   Called die
Comment 14 Account removed 2007-08-17 10:41:05 UTC
Created attachment 128385 [details]
CVS ebuild for aufs

Checks out the newest version from CVS
Comment 15 Matteo Spreafico 2007-09-01 16:29:31 UTC

*** This bug has been marked as a duplicate of bug 189573 ***
Comment 16 Russell Harmon 2007-09-02 02:07:09 UTC
This is not a duplicate, the other bug is for the userspace utilities only.
Comment 17 Matteo Spreafico 2007-09-02 08:18:02 UTC
Sorry. Reopening...
Comment 18 Nick White 2008-07-17 18:46:22 UTC
Created attachment 160657 [details]
Updated CVS ebuild for aufs

An update of the CVS ebuild, to work with 2.6.24+ kernels
Comment 19 Federico Della Ricca 2008-11-02 16:59:52 UTC
With kernel 2.6.27 ebuild it give me sandbox violations. (it tries to write tmp files in /usr/src/linux):

--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE = "/var/log/sandbox/sandbox-17731.log"

open_wr:   /usr/src/linux-2.6.27-gentoo/.17817.tmp
open_wr:   /usr/src/linux-2.6.27-gentoo/.17823.tmp
open_wr:   /usr/src/linux-2.6.27-gentoo/.17854.tmp

with FEATURES="-sandbox" emerge -av aufs

it compiles, but I can't modprobe it because of an unknown symbol.
Comment 20 Federico Della Ricca 2008-11-02 17:41:52 UTC
(In reply to comment #19)

> it compiles, but I can't modprobe it because of an unknown symbol.
resolved with:

cd /usr/src/linux
patch -p1 < /usr/portage/distfiles/cvs-src/aufs/patch/sec_perm-2.6.24.patch 

and rebuild of kernel, reboot and reemerging aufs.
Comment 21 Rada 2008-12-10 17:52:59 UTC
Created attachment 174878 [details]
CVS ebuild based on aufs-20080422

This ebuild is based on the most recent version of aufs available in the sunrise overlay. It has more USE variables and a few more checks for kernel versions. It doesn't have the ksize USE variable, though as far as I know, it is not really needed anymore.
Comment 22 NaiL 2008-12-11 19:46:58 UTC
(In reply to comment #21)
> Created an attachment (id=174878) [edit]
> CVS ebuild based on aufs-20080422
> This ebuild is based on the most recent version of aufs available in the
> sunrise overlay. It has more USE variables and a few more checks for kernel
> versions. It doesn't have the ksize USE variable, though as far as I know, it
> is not really needed anymore.

I had to mask this package, because the mount script fails on my system, maybe it misses some dependencies :S

First it said that the file /etc/default/aufs was missing, then I touched it.
Second it said that the command SetDir doesn't exist.
Third I masked the package.

I've attached the emerge info.
Comment 23 NaiL 2008-12-11 19:48:06 UTC
Created attachment 174988 [details]
Emerge info
Comment 24 Rada 2008-12-11 23:05:25 UTC
Created attachment 175011 [details]
Fixed /etc/default/aufs problem
Comment 25 Rada 2008-12-20 06:29:49 UTC
Created attachment 175928 [details]
based off sys-fs/aufs-20081208-r1

Updated the CVS ebuild to reflect the changes in the 20081208 ebuild
Comment 26 Ian Stakenvicius (RETIRED) gentoo-dev 2009-04-01 21:10:57 UTC
Yesterday I bumped the version of sys-fs/aufs on sunrise to the last in the aufs1 series (20090126), and I also re-added the use flag and adjusted kernel patches (tested with up to 2.6.28) for NFS branch support.
Comment 27 Laurento Frittella (mrfree) 2009-04-10 12:22:42 UTC
The latest sunrise ebuild doesn't compile on 2.6.29
Comment 28 Rada 2009-04-11 18:46:17 UTC
Created attachment 188010 [details]
updated with patch for 2.6.29
Comment 29 Rada 2009-04-11 18:46:35 UTC
Created attachment 188011 [details, diff]
2.6.29 patch
Comment 30 Marian Kyral 2009-04-22 18:17:23 UTC
(In reply to comment #28)
> Created an attachment (id=188010) [edit]
> updated with patch for 2.6.29

Correctly compiled on ~amd64

Comment 31 Thomas Sachau gentoo-dev 2012-06-29 16:16:55 UTC
sys-fs/aufs is already in the main tree for a pretty long time, so closing this bug as fixed
Comment 32 Thomas Sachau gentoo-dev 2012-06-29 16:19:17 UTC
just as a side note for those searching for it: you want to look for sys-fs/aufs2 or sys-fs/aufs3