I don't know if anyone would find this useful but this is the Makefile I
use to generate a patch against an arbitrary kernel tree. We compile
aufs directly into the kernel rather than as a module so having the
patch is quite handy.
cheers,
Kris
# Initial checkout:
#
# $ cvs -d:pserver:[EMAIL PROTECTED]:/cvsroot/aufs login
# (CVS password is empty)
# $ cvs -z3 -d:pserver:[EMAIL PROTECTED]:/cvsroot/aufs co aufs
#
# Put this Makefile into the aufs dir.
#
# KDIR variable determines source location, otherwise uname -r is used.
#
# ie. "make KDIR=/usr/src/linux-source-2.6.24-ubuntu patch"
# to create a patch against that tree.
#
# make patch_clean to clean up after creating a patch - this is actually
# important since the existence of fs/aufs|aufs25/Kconfig is how the patch
# target knows which subtree to copy.
include local.mk
PREFIX=/usr/local
RELEASE=$(shell uname -r)
MODULE=/lib/modules/$(RELEASE)/misc
all: modules util
modules: aufs.ko
patch: kconfig
mkdir patches
mkdir -p a/fs
mkdir a/include
mkdir -p b/fs
if [ -f "fs/aufs/Kconfig" ] ; then \
cp -r fs/aufs b/fs ; \
else \
cp -r fs/aufs25 b/fs/aufs ; \
fi
cp -r include b
if [ -z '$(shell grep 'obj-$$(CONFIG_AUFS)' $(KDIR)/fs/Makefile)' ];
then \
cp $(KDIR)/fs/Makefile a/fs ; \
cp $(KDIR)/fs/Makefile b/fs ; \
echo 'obj-$$(CONFIG_AUFS) += aufs/' >>
b/fs/Makefile; \
fi
if [ -z "$(shell grep source\ \"fs\/aufs\/Kconfig\"
$(KDIR)/fs/Kconfig)" ]; then \
cp $(KDIR)/fs/Kconfig a/fs ; \
sed -e 's/endif # NETWORK_FILESYSTEMS/endif #
NETWORK_FILESYSTEMS"\n\nmenu "Layered Filesystems"\n\nsource
"fs\/aufs\/Kconfig"\n\nendmenu/' \
a/fs/Kconfig > b/fs/Kconfig ; \
fi
diff -Nrp -x 'CVS' a b > patches/aufs.patch || true
util: aufs.5 aufind.sh mount.aufs auplink aulchown umount.aufs
modules_install: modules
$(MAKE) -C $(KDIR) M=$(CURDIR)/fs/aufs modules_install
util_install: util
if [ ! -d $(PREFIX)/sbin ]; then \
mkdir $(PREFIX)/sbin; fi
install -m 755 -p mount.aufs umount.aufs auplink aulchown $(PREFIX)/sbin
install -m 755 -p -D aufs.5 $(PREFIX)/man/man5/aufs.5
bzip2 -f $(PREFIX)/man/man5/aufs.5
if [ ! -d /etc/default ]; then \
mkdir /etc/default; fi
if [ ! -f /etc/default/auplink ]; then \
echo FLUSH=ALL > /etc/default/auplink; fi
install: modules_install util_install
up:
cvs -z3 -d:pserver:[EMAIL PROTECTED]:/cvsroot/aufs update .
patch_clean:
rm -rf patches a b fs/aufs/Kconfig fs/aufs25/Kconfig
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/