wok-backports rev 24

Add aufs
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Jan 12 10:16:35 2014 +0000 (2014-01-12)
parents 30aba2976e24
children d4b1fccb5c8f
files aufs-utils/receipt aufs-utils/stuff/fix-kdir.patch aufs/receipt aufs/stuff/aufs2-module-2.6.36.patch linux/receipt
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/aufs-utils/receipt	Sun Jan 12 10:16:35 2014 +0000
     1.3 @@ -0,0 +1,35 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="aufs-utils"
     1.7 +VERSION="20130311"
     1.8 +CATEGORY="system-tools"
     1.9 +SHORT_DESC="The aufs utils."
    1.10 +MAINTAINER="pankso@slitaz.org"
    1.11 +LICENSE="GPL2"
    1.12 +TARBALL="$PACKAGE-$VERSION.tar.bz2"
    1.13 +WEB_SITE="http://aufs.sourceforge.net/"
    1.14 +WGET_URL="git|git://aufs.git.sourceforge.net/gitroot/aufs/aufs-util.git"
    1.15 +BRANCH="origin/aufs3.0"
    1.16 +
    1.17 +DEPENDS="aufs"
    1.18 +BUILD_DEPENDS="git linux-module-headers aufs"
    1.19 +
    1.20 +# Rules to configure and make the package.
    1.21 +compile_rules()
    1.22 +{
    1.23 +	KERNEL_VERSION=`grep  ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
    1.24 +	cd $src
    1.25 +	sed -i 's|.*AUFS_XINO_TRUNC_|// &|' c2tmac.c
    1.26 +	sed -i 's/-m 644 -T/-m 644/' Makefile
    1.27 +	make && 
    1.28 +	make DESTDIR=$DESTDIR install
    1.29 +}
    1.30 +
    1.31 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.32 +genpkg_rules()
    1.33 +{
    1.34 +	mkdir -p $fs/usr
    1.35 +	cp -a $install/sbin $fs
    1.36 +	cp -a $install/usr/bin $fs/usr
    1.37 +}
    1.38 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/aufs-utils/stuff/fix-kdir.patch	Sun Jan 12 10:16:35 2014 +0000
     2.3 @@ -0,0 +1,64 @@
     2.4 +diff --git a/Makefile b/Makefile
     2.5 +index dc1ba7a..239a21b 100644
     2.6 +--- a/Makefile
     2.7 ++++ b/Makefile
     2.8 +@@ -15,21 +15,7 @@
     2.9 + # along with this program; if not, write to the Free Software
    2.10 + # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301	 USA
    2.11 + 
    2.12 +-ifndef KDIR
    2.13 +-KDIR = /lib/modules/$(shell uname -r)/build
    2.14 +-endif
    2.15 +-ifneq "t" "$(shell test -e ${KDIR}/include/linux/stddef.h && echo t)"
    2.16 +-$(error incorrect KDIR)
    2.17 +-endif
    2.18 +-
    2.19 +-ifndef ARCH
    2.20 +-ARCH := $(shell uname -m)
    2.21 +-endif
    2.22 +-ARCH := $(shell echo ${ARCH} | sed -e 's/_64$$//')
    2.23 +-ArchDir = ${KDIR}/arch/${ARCH}/include
    2.24 +-
    2.25 +-CFLAGS += -I${KDIR}/include -I./libau
    2.26 +-CFLAGS += $(shell test -d ${ArchDir} && echo -I${ArchDir})
    2.27 ++CFLAGS += -I./libau
    2.28 + CFLAGS += -O -Wall
    2.29 + 
    2.30 + Cmd = umount.aufs auchk aubrsync
    2.31 +diff --git a/README b/README
    2.32 +index f1240e5..a95196d 100644
    2.33 +--- a/README
    2.34 ++++ b/README
    2.35 +@@ -9,17 +9,21 @@ And these are not for aufs1 essentially, except aubrsync. See below in
    2.36 + detail.
    2.37 + 
    2.38 + Makefile in this tree has some customizable make-variables.
    2.39 +-- KDIR
    2.40 +-  specify your kernel source path if necessary.
    2.41 +-  Note: this path should point kernel _source_ path, instead of kernel
    2.42 +-  _build_ path. Don't confuse with the path in "make O=<kdir>" when you
    2.43 +-  build a kernel in a different dir.
    2.44 +-- CPPFLAGS or ARCH
    2.45 +-  specify the include path to your aufs2-standalone tree, if necessary.
    2.46 +-  the makefile finds the correct ${KDIR}/arch/${ARCH}/include dir and
    2.47 +-  sets the include path to CPPFLAGS="-I...". if the logic in Makefile is
    2.48 +-  poor and doesn't support your build environment, then set the
    2.49 +-  variables directly.
    2.50 ++- CPPFLAGS
    2.51 ++  specify the include path if necessary.
    2.52 ++  Some of linux kernel header files are necessary including
    2.53 ++  linux/aufs_type.h. If you have installed kernel header files to
    2.54 ++  /usr/include, then you may not need to specify CPPFLAGS.
    2.55 ++  Otherwise you need to do something like this sample.
    2.56 ++  + run "make headers_install" in your kernel source tree, and
    2.57 ++    $LinuxSrc/usr/include is created and header files are installed
    2.58 ++    there.
    2.59 ++  + if you build aufs2 as module from aufs2-standalone.git, then
    2.60 ++    $Aufs2Stdalone/usr/include is created and header files are
    2.61 ++    installed there.
    2.62 ++  + and specify
    2.63 ++	CPPFLAGS="-I $LinuxSrc/usr/include -I $Aufs2Stdalone/usr/include"
    2.64 ++
    2.65 + - DESTDIR
    2.66 +   specify your install path if necessary.
    2.67 +   some commands have to be installed under /sbin.
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/aufs/receipt	Sun Jan 12 10:16:35 2014 +0000
     3.3 @@ -0,0 +1,74 @@
     3.4 +# SliTaz package receipt.
     3.5 +
     3.6 +PACKAGE="aufs"
     3.7 +VERSION="20130311"
     3.8 +CATEGORY="base-system"
     3.9 +SHORT_DESC="aufs3 kernel module"
    3.10 +MAINTAINER="slaxemulator@gmail.com"
    3.11 +LICENSE="GPL2"
    3.12 +WEB_SITE="http://aufs.sf.net/"
    3.13 +PROVIDE="linux-aufs"
    3.14 +TARBALL="$PACKAGE-$VERSION.tar.bz2"
    3.15 +WGET_URL="git|git://aufs.git.sourceforge.net/gitroot/aufs/aufs3-standalone.git"
    3.16 +BRANCH="origin/${PACKAGE}3.2"
    3.17 +COOK_OPT="!remove_src"
    3.18 +
    3.19 +DEPENDS="linux"
    3.20 +BUILD_DEPENDS="linux-module-headers git xz"
    3.21 +
    3.22 +# Rules to configure and make the package.
    3.23 +compile_rules()
    3.24 +{
    3.25 +	cd $src
    3.26 +
    3.27 +	sed -i 's|CONFIG_AUFS_BRANCH_MAX_127 =.*|CONFIG_AUFS_BRANCH_MAX_127 =|' \
    3.28 +		config.mk || return 1
    3.29 +	sed -i 's|#CONFIG_AUFS_BRANCH_MAX_32767 =.*|CONFIG_AUFS_BRANCH_MAX_32767 = y|' \
    3.30 +		config.mk || return 1
    3.31 +	sed -i 's|CONFIG_AUFS_HNOTIFY =.*|CONFIG_AUFS_HNOTIFY = y|' \
    3.32 +		config.mk || return 1
    3.33 +	sed -i 's|CONFIG_AUFS_HFSNOTIFY =.*|CONFIG_AUFS_HFSNOTIFY = y|' \
    3.34 +		config.mk || return 1
    3.35 +	sed -i 's|CONFIG_AUFS_EXPORT =.*|CONFIG_AUFS_EXPORT = y|' \
    3.36 +		config.mk || return 1
    3.37 +	sed -i 's|CONFIG_AUFS_SHWH =.*|CONFIG_AUFS_SHWH = y|' \
    3.38 +		config.mk || return 1
    3.39 +	sed -i 's|CONFIG_AUFS_BDEV_LOOP =.*|CONFIG_AUFS_BDEV_LOOP = y|' \
    3.40 +		config.mk || return 1
    3.41 +	sed -i 's|CONFIG_AUFS_BR_RAMFS =.*|CONFIG_AUFS_BR_RAMFS = y|' \
    3.42 +		config.mk || return 1
    3.43 +	sed -i 's|CONFIG_AUFS_DEBUG =.*|CONFIG_AUFS_DEBUG =|' \
    3.44 +		config.mk || return 1
    3.45 +
    3.46 +	# The sed fixes are from gentoo portage build.
    3.47 +	sed -i "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" Makefile
    3.48 +	sed -i "s:__user::g" include/linux/aufs_type.h
    3.49 +	make -j 1 KDIR=/usr/src/linux
    3.50 +	xz -f fs/aufs/aufs.ko
    3.51 +}
    3.52 +
    3.53 +# Rules to gen a SliTaz package suitable for Tazpkg.
    3.54 +genpkg_rules()
    3.55 +{
    3.56 +	KERNEL_VERSION=`grep  ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
    3.57 +	BASEVER=${KERNEL_VERSION:0:3}
    3.58 +	EXTRAVERSION=_$BASEVER
    3.59 +	mkdir -p $fs/lib/modules/$BASEVER-slitaz/kernel/fs/aufs
    3.60 +	cp $src/fs/aufs/aufs.ko.xz $fs/lib/modules/$BASEVER-slitaz/kernel/fs/aufs/
    3.61 +	chown root $fs/lib/modules/$BASEVER-slitaz/kernel/fs/aufs/aufs.ko.xz
    3.62 +	chmod 0644 $fs/lib/modules/$BASEVER-slitaz/kernel/fs/aufs/aufs.ko.xz
    3.63 +	install -D -m 644 $src/include/linux/aufs_type.h \
    3.64 +		$fs/usr/include/linux/aufs_type.h
    3.65 +}
    3.66 +
    3.67 +post_install()
    3.68 +{
    3.69 +	echo "Processing post-install commands..."
    3.70 +	chroot "$1/" depmod -a ${EXTRAVERSION#_}-slitaz
    3.71 +}
    3.72 +
    3.73 +post_remove()
    3.74 +{
    3.75 +	echo "Processing post-remove commands..."
    3.76 +	chroot "$1/" depmod -a ${EXTRAVERSION#_}-slitaz
    3.77 +}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/aufs/stuff/aufs2-module-2.6.36.patch	Sun Jan 12 10:16:35 2014 +0000
     4.3 @@ -0,0 +1,47 @@
     4.4 +diff --git a/ubuntu/aufs/branch.c b/ubuntu/aufs/branch.c
     4.5 +index cd4463c..ff6b158 100644
     4.6 +--- a/fs/aufs/branch.c
     4.7 ++++ b/fs/aufs/branch.c
     4.8 +@@ -22,6 +22,8 @@
     4.9 + 
    4.10 + #include <linux/file.h>
    4.11 + #include <linux/statfs.h>
    4.12 ++#include <linux/lglock.h>
    4.13 ++#include <linux/percpu.h>
    4.14 + #include "aufs.h"
    4.15 + 
    4.16 + /*
    4.17 +@@ -851,7 +853,8 @@ static int au_br_mod_files_ro(struct super_block *sb, aufs_bindex_t bindex)
    4.18 + 		goto out;
    4.19 + 
    4.20 + 	/* no need file_list_lock() since sbinfo is locked? defered? */
    4.21 +-	list_for_each_entry(file, &sb->s_files, f_u.fu_list) {
    4.22 ++        lg_global_lock(files_lglock);
    4.23 ++	do_file_list_for_each_entry(sb, file) {
    4.24 + 		if (special_file(file->f_dentry->d_inode->i_mode))
    4.25 + 			continue;
    4.26 + 
    4.27 +@@ -861,6 +864,7 @@ static int au_br_mod_files_ro(struct super_block *sb, aufs_bindex_t bindex)
    4.28 + 			err = -EBUSY;
    4.29 + 			FiMustNoWaiters(file);
    4.30 + 			fi_read_unlock(file);
    4.31 ++			lg_global_unlock(files_lglock);
    4.32 + 			goto out_free;
    4.33 + 		}
    4.34 + 
    4.35 +@@ -889,10 +893,13 @@ static int au_br_mod_files_ro(struct super_block *sb, aufs_bindex_t bindex)
    4.36 + 			if (p) {
    4.37 + 				a = p;
    4.38 + 				a[n++] = hf;
    4.39 +-			} else
    4.40 ++			} else {
    4.41 ++				lg_global_unlock(files_lglock);
    4.42 + 				goto out_free;
    4.43 ++			}
    4.44 + 		}
    4.45 +-	}
    4.46 ++	} while_file_list_for_each_entry;
    4.47 ++	lg_global_unlock(files_lglock);
    4.48 + 
    4.49 + 	err = 0;
    4.50 + 	if (n)
     5.1 --- a/linux/receipt	Sun Jan 12 10:13:45 2014 +0000
     5.2 +++ b/linux/receipt	Sun Jan 12 10:16:35 2014 +0000
     5.3 @@ -2,7 +2,6 @@
     5.4  
     5.5  PACKAGE="linux"
     5.6  VERSION="3.2.53"
     5.7 -_AUFSVER="20130311"
     5.8  KBASEVER="${VERSION:0:3}"
     5.9  CATEGORY="base-system"
    5.10  SHORT_DESC="The Linux kernel and modules."
    5.11 @@ -86,7 +85,7 @@
    5.12  
    5.13  	# Check for Aufs and cook it if unbuilt.
    5.14  	echo "Checking for Aufs packages..."
    5.15 -	#_AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
    5.16 +	_AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
    5.17  	if [ -x /usr/bin/cook ]; then
    5.18  		# Give info an redirect to /dev/null since aufs got it own log.
    5.19  		AUFSDIR=$WOK/aufs/source/aufs-${_AUFSVER}