[arch-dev-public] makechrootpkg without aufs2

Pierre Schmitz pierre at archlinux.de
Sat Jan 23 18:08:27 EST 2010


Hi devs,

I always had problems with aufs2 but during the recent rebuilds and KDE
development it really annoyed me. It seems the aufs2 kernel module triggers
all kinds of (not) so funny errors; especially on high I/O. E.g. building
kdebase-workspace with makechrootpkg is a good idea to check i your
filesystem or raid correctly recovers from a hard crash. Aside from FS and
RAID errors I had funny segfaults of umount on reboot, massive system
slowdowns etc..

In general I like the approach of makechrootpkg. Starting from a clean
base chroot environment is a good idea to avoid all kinds of packaging
issues. So I checked what other options there are. I thought it would be
less problematic if it could be handled in userspace. There are solutions
like unionfs-fuse; but unfortunately they are quite slow and cannot handle
all kinds of special fiels we need (fiofos etc.)

In the end I found a much simpler and cleaner way to handle this. All we
want is to build our package in a clean chroot and revert all changes when
building the next package. So why not just make just a copy of our base
system, work on that and revert it when we are done.

This can be easily done by changing this in makechrootpkg:

    mount -t aufs none -o "dirs=$chrootdir/$LAYER=rw:$chrootdir/root=ro"
"$uniondir"

to

    rsync -a --delete --progress -h -c -W "$chrootdir/root/" "$uniondir"

On my system this sync takes less than 40 seconds in worst case (if
uniondir is empty). On the other hand building the package is faster
because there is no aufs overhead. And the best thing is that this cannot
crash and freeze your system. :-)

Pierre

PS: We should probably get rid of aufs and merge this change into our
devtools.

-- 
Pierre Schmitz, https://users.archlinux.de/~pierre


More information about the arch-dev-public mailing list