FS#14923 - [kernel26] aufs as separate package and/or update + config change

Attached to Project: Arch Linux
Opened by Michael Towers (gradgrind) - Tuesday, 02 June 2009, 15:41 GMT
Last edited by Tobias Powalowski (tpowa) - Thursday, 10 September 2009, 15:39 GMT
Task Type Feature Request
Category Kernel
Status Closed
Assigned To Tobias Powalowski (tpowa)
Thomas Bächler (brain0)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Is there any particular reason why aufs is compiled together with the kernel? It is easy enough to compile it separately as a package, which would allow updates and configuration changes to be done more easily. You just have to apply the aufs2-standalone.patch to the kernel sources.

Also the latest version includes some bug-fixes, including to handling of the configuration options. For example in the present Arch configuration there is AUFS_INO_T_64 set to 'y' even on the 32-bit version, which will fail with the new aufs version because it is now recognized properly.

My specific interest is in having the new SHWH option enabled, but if you don't want that for some reason it would be easy enough for me to compile my own aufs package, so long as it is separated out from the kernel package.

Anyway, here is a sketch of how I have built an aufs package.

1) Get aufs standalone code:
#!/bin/sh

git clone http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git aufs2-standalone.git
cd aufs2-standalone.git
git checkout origin/aufs2-29 # for instance, aufs2-27 for linux-2.6.27
# aufs2 (no -xx) for the latest -rc version.

#*** apply "aufs2-standalone.patch" to your kernel source files.

rm -rf aufs2-2.6.29_20090601
cp -a aufs2-standalone.git aufs2-2.6.29_20090601
tar -czf aufs2/aufs2-2.6.29_20090601.tar.gz --exclude=.git aufs2-2.6.29_20090601


2) PKGBUILD
pkgname=aufs2
pkgver=2.6.29_20090601
pkgrel=1
_kernver=${pkgver%_*}-ARCH
pkgdesc="Another Unionfs Implementation"
arch=('i686' 'x86_64')
url="http://aufs.sourceforge.net/"
license=('GPL2')
depends=('kernel26>=2.6.29' 'kernel26<2.6.30' 'aufs2-util')
install=${pkgname}.install
source=(${pkgname}-${pkgver}.tar.gz)

build() {
cd ${srcdir}/${pkgname}-${pkgver} || return 1

sed -i 's|CONFIG_AUFS_DEBUG =.*|CONFIG_AUFS_DEBUG =|' \
config.mk || return 1

sed -i 's|CONFIG_AUFS_BDEV_LOOP =.*|CONFIG_AUFS_BDEV_LOOP = y|' \
config.mk || return 1

if [ "${CARCH}" = "x86_64" ]; then
inot64=" y"
else
inot64=""
fi
sed -i "s|CONFIG_AUFS_INO_T_64 =.*|CONFIG_AUFS_INO_T_64 =${inot64}|" \
config.mk || return 1

sed -i 's|CONFIG_AUFS_EXPORT =.*|CONFIG_AUFS_EXPORT = y|' \
config.mk || return 1

sed -i 's|CONFIG_AUFS_SHWH =.*|CONFIG_AUFS_SHWH = y|' \
config.mk || return 1

# build

make KDIR=/usr/src/linux-${_kernver} || return 1

# install
install -D -m644 fs/aufs/aufs.ko \
$startdir/pkg/lib/modules/${_kernver}/kernel/fs/aufs/aufs.ko || return 1

# tweak the install script for the right kernel version
sed -i -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
$startdir/$pkgname.install || return 1
}


Alright, I see I've got $startdir there - but that can be changed!

This task depends upon

Closed by  Tobias Powalowski (tpowa)
Thursday, 10 September 2009, 15:39 GMT
Reason for closing:  Fixed
Comment by Tobias Powalowski (tpowa) - Thursday, 04 June 2009, 09:51 GMT
would be an option for next .30 series, at the moment the standalone patch doesn't apply
Comment by Tobias Powalowski (tpowa) - Friday, 12 June 2009, 08:00 GMT
ok in .30 this doesn't work, tons of undefined symbols detected, probably we need to return to in kernel building.
Comment by Michael Towers (gradgrind) - Monday, 29 June 2009, 09:56 GMT
  • Field changed: Percent Complete (100% → 0%)
The latest aufs (from 2009.06.29) now fixes the problems with the undefined symbols, so aufs can now be built as a separate module (I have tested it). I have no problems with the current kernel build, but if you are interested in having aufs as a separate package - there are probably advantages if someone needs different options - it should now be easy. I can send you a rough PKGBUILD if you like.
Comment by Aaron Griffin (phrakture) - Monday, 29 June 2009, 16:34 GMT
I like this. Let's try to get aufs as a separate package
Comment by Tobias Powalowski (tpowa) - Thursday, 10 September 2009, 15:38 GMT
Done in 2.6.31 again.

Loading...