OK, I'm back, and as I write I'm testing a script I assembled from my actual separate scripts I use for remastering.

What this script does is it downloads a proper version of aufs from the repository, it also downloads the 2.6.12 kernel from kernel.org and then starts compiling the kernel along with the aufs and cloop modules and after that it creates a minirt.gz for use with this kernel (and KNOPPIX 5.3.1 of course).

This has just an instructional/educational purpose, at least for now, because even with the kernel compiled along with the modules, we still have to install the kernel in the KNOPPIX filesystem. That means the compressed filesystem has to be unpacked, chrooted into and the 2.6.12 kernel installed in it.

But whatever, I just want to show a script that does all the kernel stuff starting from as little as possible, using 2.6.12 as an example.

REQUIREMENTS:

- A computer with 2GB RAM
- The KNOPPIX 5.3.1 DVD
- The "2.6.12-knoppix-kernel-compiler-installer" script
- The ".config-2.6.12" file (kernel configuration for 2.6.12)
- The "aufs-patch-2.6.11.patch" file (aufs patch to make it work with 2.6.12 kernel)
- The "linuxrc" file (a script which is included in minirt.gz; this is modified by me in a few places)

So basically what you need is my script and three additional files. I posted all these four below as code.
You just have to save these four code sections with the names indicated above, make the "2.6.12-knoppix-kernel-compiler-installer" script executable and run it.
That's it.

=== EXTREMELY IMPORTANT !!!!!! ===
You will have to use your mouse and copy the code posted below. When doing this, please enlarge your web browser's window as much as possible until you see NO LINE in the script reaching the right margin of the window code. If you don't do that, some lines in the script being very long, they will be split on two rows and the code will not work.
You might want to use Iceweasel as browser for this (comes with Knoppix 5.3.1) and use the "Ctrl -" key combination (that is CTRL and the "minus" key on the numeric keypad) to make the fonts smaller so all the lines can fit your screen in one piece.
Scroll up and down and make sure you see NO LINE in the code reaching the right margin. After that, position your mouse cursor at the beginning of the code and keeping the left button pressed drag down until you select all the code. Then press Ctrl-C.
================================

Now, for those really unfamiliar with Linux in general, I will give some detailed instructions:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
What you have to do:
==================
- Start your computer with KNOPPIX 5.3.1 DVD
- Open a konsole window (it's on the taskbar on the left)
- Change the font for the konsole (from the menu, Settings -> Font -> Shrink Font, a few times until the font gets smaller)
- Change to root (type "su" and Enter)
- Run mc (Midnight Commander)
- From mc, create in /home/knoppix a directory with whatever name you want, let's say "kernel-test"
- cd into the directory you just created
- Press the "Shift+F4" key combination (this will start editing a new file)
- Press F9, the menu will show up, go to Options -> General and make sure the option for "Return Does Autoindent" is NOT CHECKED
- Click, drag, select and copy (Ctrl+C) the first code in this post as instructed previously.
- Go back to the konsole window in mc and press "Shift+Insert". This will paste the code in mc.
- Press F2 to save the code and give it the name "2.6.12-knoppix-kernel-compiler-installer"
- Make this script executable: type "chmod 755 2.6.12-knoppix-kernel-compiler-installer" at the command prompt in mc and then Enter
- Click, drag, select and copy (Ctrl+C) the second code in this post as instructed previously.
- Go back to the konsole window in mc and press "Shift+F4" again
- Press "Shift+Insert". This will paste the code in mc.
- Press F2 to save the code and give it the name ".config-2.6.12" (PAY ATTENTION, THE NAME STARTS WITH A DOT ".")
- Click, drag, select and copy (Ctrl+C) the third code in this post as instructed previously.
- Go back to the konsole window in mc and press "Shift+F4" again
- Press "Shift+Insert". This will paste the code in mc.
- Press F2 to save the code and give it the name "aufs-patch-2.6.11.patch"
- Click, drag, select and copy (Ctrl+C) the fourth code in this post as instructed previously.
- Go back to the konsole window in mc and press "Shift+F4" again
- Press "Shift+Insert". This will paste the code in mc.
- Press F2 to save the code and give it the name "linuxrc"
- Got to the konsole window menu, Settings -> History and set History to Unlimited. This way you will have the full log at the end to look through it if you want.
- Make sure these four files are in the same directory (the one you created, i.e. "kernel-test") and then just press Enter from mc on the script (2.6.12-knoppix-kernel-compiler-installer)
- Now relax and wait for it to finish
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

When all is done, you will notice some changes in the directory where you saved the files in the beginning.

A few new files appeared:

- "dvd/boot/isolinux/minirt-2.6.12.gz" and "dvd/boot/isolinux/vmlinuz-2.6.12" should be placed on the DVD, in the "dvd/boot/isolinux/" directory
- the "dvd/KNOPPIX/modules/2.6.12" directory should be copied on the DVD in the "dvd/KNOPPIX/modules/"
- the "kernels/linux-image-2.6.12_2.6.12-10.00.Custom_i386.deb" file is a debian package containing the 2.6.12 kernel. This should be installed in the KNOPPIX filesystem. That means uncompressing the filesystem somewhere on the harddrive, chrooting into it, and installing the package with "dpkg -i linux-image-2.6.12_2.6.12-10.00.Custom_i386.deb"
- the "kernels/loop-aes-modules-2.6.12_3.2b-5_i386.deb" is a debian package containing the loop-aes module. Should be installed the same way as the kernel package.
- For everything to work, there should be a few lines added to the "isolinux.cfg" on the dvd:

Code:
LABEL linux-2.6.12
KERNEL vmlinuz-2.6.12
APPEND ramdisk=100000 init=/etc/init lang=us apm=power-off vga=791 initrd=minirt-2.6.12.gz nomce noudev acpi=off dma noeject noprompt quiet BOOT_IMAGE=knoppix
============= The first code: save this as "2.6.12-knoppix-kernel-compiler-installer"

Code:
#!/bin/sh


[ ! -f ".config-2.6.12" ] && echo "2.6.12 kernel config is missing... exiting." && exit 0
[ ! -f "aufs-patch-2.6.11.patch" ] && echo "aufs patch is missing... exiting" && exit 0
odir=`pwd`
mkdir -pv dvd/KNOPPIX/modules/2.6.12 dvd/boot/isolinux system_scripts/2.6.12-19
mkdir -pv kernels/kernel.org
mv -f .config-2.6.12 kernels/
chmod 755 linuxrc
mv -f linuxrc system_scripts/2.6.12-19/
day="20070312"
cvs -d:pserver:[email protected]:/cvsroot/aufs login <<<$(echo -en "\n")
echo -en "\n\n===================================== Retrieving aufs $day      =====================================\n\n"
cvs -z3 -d:pserver:[email protected]:/cvsroot/aufs co -D "$day" aufs
mv aufs aufs-$day
tar -cf aufs-$day.tar aufs-$day
bzip2 -9 aufs-$day.tar
rm -rf aufs-$day
cd kernels/kernel.org
echo -en "\n\n===================================== Downloading 2.6.12 kernel =====================================\n\n"
dload="err"
while [ "$dload" = "err" ]; do
	rm -f linux-2.6.12.tar.bz2
	wget http://www.kernel.org/pub/linux/kern...2.6.12.tar.bz2 && dload="ok"
done

cd /usr/bin
rm -f gcc
rm -f g++
ln -s gcc-3.3 gcc
ln -s g++-3.3 g++
echo -en "\n\n===================================== Removing possible 2.6.12 kernel existing files ================\n\n"
[ -d /lib/modules/2.6.12 ] && echo -en "\n\n------------------------\nremoving /lib/modules/2.6.12 ..." && rm -rf /lib/modules/2.6.12 && echo "done."
rm -rfv /boot/*2.6.12
[ -d /usr/src/linux-2.6.12 ] && echo -n "removing /usr/src/linux-2.6.12 ..." && rm -rf /usr/src/linux-2.6.12 && echo "done."
[ -d /usr/share/doc/linux-image-2.6.12 ] && echo -n "removing /usr/share/doc/linux-image-2.6.12 ..." && rm -rf /usr/share/doc/linux-image-2.6.12 && echo "done."
[ -d /usr/src/modules/aufs-2.6.12 ] && echo -n "removing /usr/src/modules/aufs-2.6.12 ..." && rm -rf /usr/src/modules/aufs-2.6.12 && echo "done."
[ -d /usr/src/modules/cloop-2.6.12 ] && echo -n "removing /usr/src/modules/cloop-2.6.12 ..." && rm -rf /usr/src/modules/cloop-2.6.12 && echo "done."

echo -e "\n\n######################### COMPILING KERNEL 2.6.12  ################################\n\n"
cd /usr/src
echo "------------------------- extracting kernel ----------------------------"
tar -xjf $odir/kernels/kernel.org/linux-2.6.12.tar.bz2
echo "------------------------- changing /usr/src/linux link -----------------"
rm -fv linux
ln -sv linux-2.6.12 linux

cd /usr/src/linux
[ -f $odir/kernels/.config-2.6.12 ] || cp -fpv $odir/kernels/.config-k4.0.2 .config
[ -f $odir/kernels/.config-2.6.12 ] && cp -fpv $odir/kernels/.config-2.6.12 .config

############################# KERNEL PATCHING #################################
#patch -p1 </usr/src/modules/aufs-2.6.12/patch/deny_write_access.patch          ## >= 2.6.17
#sed -i -e "s/CONFIG_AUFS_DENY_WRITE_ACCESS_PATCH \=/CONFIG_AUFS_DENY_WRITE_ACCESS_PATCH = y/" /usr/src/modules/aufs-2.6.12/local.mk
#patch -p0 </usr/src/modules/aufs-2.6.12/patch/put_filp.patch                   ## >= 2.6.19
#sed -i -e "s/CONFIG_AUFS_PUT_FILP_PATCH \=/CONFIG_AUFS_PUT_FILP_PATCH = y/" /usr/src/modules/aufs-2.6.12/local.mk
#patch -p1 </usr/src/modules/aufs-2.6.25/patch/sec_perm-2.6.24.patch            ## >= 2.6.24
#sed -i -e "s/CONFIG_AUFS_SEC_PERM_PATCH \=/CONFIG_AUFS_SEC_PERM_PATCH = y/" /usr/src/modules/aufs-2.6.25/local.mk
#patch -p0 </usr/src/modules/aufs-2.6.25/patch/splice-2.6.23.patch              ## >= 2.6.23
#sed -i -e "s/CONFIG_AUFS_SPLICE_PATCH \=/CONFIG_AUFS_SPLICE_PATCH = y/" /usr/src/modules/aufs-2.6.25/local.mk
#patch -p0 </usr/src/modules/aufs-2.6.25/patch/sysfs_get_dentry.patch

#sed -i -e "s/CONFIG_AUFS_SYSAUFS \= y/CONFIG_AUFS_SYSAUFS =/" /usr/src/modules/aufs-2.6.25/local.mk    ## <= 2.6.24
#sed -i -e "s/CONFIG_AUFS_STAT \=/CONFIG_AUFS_STAT = y/" /usr/src/modules/aufs-2.6.25/local.mk          ## >= 2.6.25
#patch -p1 <../kernel-patches/knoppix-kernel.patch  ### USING sed INSTEAD
sed -i -e "s/console_loglevel \= 4/console_loglevel = 1/" init/main.c
###############################################################################

echo "------------------------ make menuconfig -------------------------------"
[ -f $odir/kernels/.config-2.6.12 ] || make menuconfig
cd ..
make kernel
#dpkg -i linux-image-2.6.12_2.6.12-10.00.Custom_i386.deb
dpkg-deb -x linux-image-2.6.12_2.6.12-10.00.Custom_i386.deb /
mv -f linux-image-2.6.12_2.6.12-10.00.Custom_i386.deb $odir/kernels/

echo "------------------------ make loop-aes ---------------------------------"
make loop-aes
dpkg -i modules/loop-aes-modules-2.6.12_3.2b-5_i386.deb
mv -f modules/loop-aes-modules-2.6.12_3.2b-5_i386.deb $odir/kernels/

echo "------------------------- make cloop -----------------------------------"
cd modules
tar -xzf cloop-2.06.tar.gz
mv -f cloop-2.06 cloop-2.6.12
cd cloop-2.6.12
make KERNEL_DIR=/usr/src/linux
cd ../..

echo "------------------------- extracting aufs ------------------------------"
cd modules
tar -xjf $odir/aufs-$day.tar.bz2
mv aufs-$day aufs-2.6.12
cd aufs-2.6.12
cp $odir/aufs-patch-2.6.11.patch .
patch -p1 <aufs-patch-2.6.11.patch

echo "------------------------- make aufs ------------------------------------"
make KDIR=/usr/src/linux -f local.mk

cp -fpv /usr/src/modules/cloop-2.6.12/cloop.ko $odir/dvd/KNOPPIX/modules/2.6.12/
cp -fpv /usr/src/modules/aufs-2.6.12/fs/aufs/aufs.ko $odir/dvd/KNOPPIX/modules/2.6.12/
cd ..

depmod -a 2.6.12

###############################################################################################

minirtgz_modules_search_replace(){

# Parameters to this script:
# $1: kernel version (ex. 2.6.12)
# $2: (optional) directory with filesystem root (where kernel is installed) (ex. /mnt/hda2/KNOPPIX)
# If $2 not given, / will be used

# This script is meant to be used when changing the minirt.gz for a remaster.
# After running the minirt.gz-cpio-edit, go to the unpacked minirt in the modules/ dir
#   and from there run this script (previously copied to /usr/local/bin)
#   giving as parameter the version of the kernel you are making this minirt.gz for.
#
# Ex.:  >  minirt.gz-modules-search-replace 2.6.25
#
# The result will be replacing all modules in the modules/ dir with their equivalent
# found in the /mnt/hda2/KNOPPIX/lib/modules/2.6.25/kernel/drivers dir. If any module
# is left unreplaced, it can be safely erased from the modules/ dir.

for j in *.ko; do
        src=$(find $2/lib/modules/$1/kernel/drivers -type f -name $j)
        [ -n "$src" ] && cp -fpv $src .
done

# The next operation is necessary if USB support is not built-in kernel

for j in usbcore.ko ehci-hcd.ko ohci-hcd.ko uhci-hcd.ko libusual.ko ff-memless.ko usbhid.ko usb-storage.ko ub.ko; do
        src=$(find $2/lib/modules/$1/kernel/drivers -type f -name $j)
        [ -n "$src" ] && cp -fpv $src .
done

}

###############################################################################################

# This script generates the necessary minirt-2.6.xx.gz files in initrd format
# for all kernels enumerated below.
# The files are then copied into dvd/KNOPPIX/boot/isolinux
# along with the vmlinuz-2.6.xx files.
# This script is indended to be run under the original Knoppix 5.3.1 environment

#odir=`pwd`
kernels="12"
workdir="/home/knoppix/tmp"
rootdir="new-root"
remaster_root=""

[ -d $workdir/$rootdir ] || mkdir -pv $workdir/$rootdir


cp -fpv /cdrom/boot/isolinux/minirt.gz $workdir/
gunzip $workdir/minirt.gz


for i in $kernels; do

    echo -en "\n\n====================== PROCESSING INITRD FOR 2.6.$i =======================\n\n"
    dd if=/dev/zero of=$workdir/minirt-2.6.$i bs=1M count=10
    losetup /dev/loop3 $workdir/minirt-2.6.$i
    mke2fs /dev/loop3
    mount -o rw /dev/loop3 $workdir/$rootdir
    cd $workdir/$rootdir

    #cpio -imvd --no-absolute-filenames -I ../tmp/minirt
    cpio -i -d -H newc -F $workdir/minirt --no-absolute-filenames
    cd modules
    minirtgz_modules_search_replace 2.6.$i ${remaster_root}
    cp -fpv $odir/dvd/KNOPPIX/modules/2.6.$i/aufs.ko .
    find . -perm /111 -a -name "*.ko" -exec rm -fv '{}' ';'
    cd ..
    [ $i -lt 20 ] && cp -fpv $odir/system_scripts/2.6.12-19/linuxrc .
    [ $i -gt 19 ] && cp -fpv $odir/system_scripts/linuxrc .
    cd ..

    umount /dev/loop3
    losetup -d /dev/loop3
    gzip -9 minirt-2.6.$i
    cp -fpv minirt-2.6.$i.gz $odir/dvd/boot/isolinux/

    cp -fpv ${remaster_root}/boot/vmlinuz-2.6.$i $odir/dvd/boot/isolinux/

done

rm -rfv $workdir/*
============= Next, copy this code and save it as ".config-2.6.12"

Code:
SORRY FOLKS, WHEN I TRIED TO POST THE KERNEL CONFIG, THE FORUM DID NOT TAKE IT ALL, THERE WAS SOME ERROR.

MAYBE WE'RE NOT SUPPOSED TO POST CODES THAT BIG ?...
============= Next, copy this code and save it as "aufs-patch-2.6.11.patch":

Code:
diff -up -r aufs-20070327/fs/aufs/aufs.h aufs-20070327-new/fs/aufs/aufs.h
--- aufs-20070327/fs/aufs/aufs.h        2007-03-27 23:41:11.000000000 +0200
+++ aufs-20070327-new/fs/aufs/aufs.h    2007-03-28 18:21:04.694373683 +0200
@@ -22,11 +22,19 @@
 #define __AUFS_H__

 #include <linux/version.h>
+#include <linux/types.h>    /* for size_t */

 /* ---------------------------------------------------------------------- */

-// limited support before 2.6.16, curretly 2.6.15 only.
-#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,15)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+#    define LOCK_INODE(inode)   mutex_lock(&(inode)->i_mutex)
+#    define UNLOCK_INODE(inode) mutex_unlock(&(inode)->i_mutex)
+#else
+#    define LOCK_INODE(inode)   down(&(inode)->i_sem)
+#    define UNLOCK_INODE(inode) up(&(inode)->i_sem)
+#endif
+
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
 #define atomic_long_t		atomic_t
 #define atomic_long_set		atomic_set
 #define timespec_to_ns(ts)	({(long long)(ts)->tv_sec;})
@@ -35,6 +43,19 @@
 #define D_CHILD			d_u.d_child
 #endif

+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
+# ifdef __CHECKER__
+#  define __bitwise__ __attribute__((bitwise))
+# else
+#  define __bitwise__
+# endif
+
+typedef unsigned __bitwise__ gfp_t;
+void *kzalloc(size_t size, gfp_t flags);
+
+#define do_exit(a)  /* not yet exported */
+#endif
+
 /* ---------------------------------------------------------------------- */

 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
diff -up -r aufs-20070327/fs/aufs/branch.c aufs-20070327-new/fs/aufs/branch.c
--- aufs-20070327/fs/aufs/branch.c      2007-03-27 23:41:11.000000000 +0200
+++ aufs-20070327-new/fs/aufs/branch.c  2007-03-28 16:16:01.956799716 +0200
@@ -740,5 +740,5 @@
 				dput(br->br_plink);
 				br->br_plink = NULL;
 			}
-#if 1 // test here
+#if 0 // test here
 			// no need file_list_lock() since sbinfo is locked
diff -up -r aufs-20070327/fs/aufs/branch.h aufs-20070327-new/fs/aufs/branch.h
--- aufs-20070327/fs/aufs/branch.h      2007-03-27 23:41:11.000000000 +0200
+++ aufs-20070327-new/fs/aufs/branch.h  2007-03-29 09:42:07.897314461 +0200
@@ -100,10 +100,10 @@
 /* --------------------------------------------------------------------- */

 #define _AufsNoNfsBranchMsg "NFS branch is not supported"
-#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,15)
-#define AufsNoNfsBranch
-#define AufsNoNfsBranchMsg _AufsNoNfsBranchMsg
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) \
+//#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
+//#define AufsNoNfsBranch
+//#define AufsNoNfsBranchMsg _AufsNoNfsBranchMsg
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) \
 	&& !defined(CONFIG_AUFS_LHASH_PATCH)
 #define AufsNoNfsBranch
 #define AufsNoNfsBranchMsg _AufsNoNfsBranchMsg \
diff -up -r aufs-20070327/fs/aufs/debug.h aufs-20070327-new/fs/aufs/debug.h
--- aufs-20070327/fs/aufs/debug.h       2007-03-27 23:41:12.000000000 +0200
+++ aufs-20070327-new/fs/aufs/debug.h   2007-03-28 15:40:51.459788803 +0200
@@ -31,10 +31,14 @@
 #define DEBUG_ON(a)	/* */
 #endif

+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
 static inline void MtxMustLock(struct mutex *mtx)
 {
        DEBUG_ON(!mutex_is_locked(mtx));
 }
+#else
+#define MtxMustLock(a) /* */
+#endif
 
 /* ---------------------------------------------------------------------- */
 
diff -up -r aufs-20070327/fs/aufs/file.c aufs-20070327-new/fs/aufs/file.c
--- aufs-20070327/fs/aufs/file.c        2007-03-27 23:41:12.000000000 +0200
+++ aufs-20070327-new/fs/aufs/file.c    2007-03-28 20:46:58.563987042 +0200
@@ -702,7 +702,7 @@ static int aufs_commit_write(struct file
 {BUG();return 0;}
 static int aufs_writepage(struct page *page, struct writeback_control *wbc)
 {BUG();return 0;}
-#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,15)
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
 static int aufs_sync_page(struct page *page)
 {BUG(); return 0;}
 #else
@@ -724,6 +724,6 @@
 static int aufs_set_page_dirty(struct page *page)
 {BUG();return 0;}
-#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,15)
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
 static int aufs_invalidatepage (struct page *page, unsigned long offset)
 {BUG(); return 0;}
 #else
@@ -810,7 +810,9 @@
 	.invalidatepage	= aufs_invalidatepage,
 	.releasepage	= aufs_releasepage,
 	.direct_IO	= aufs_direct_IO,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
 	.get_xip_page	= aufs_get_xip_page,
 	//.migratepage	= aufs_migratepage
 #endif
+#endif
 };
diff -up -r aufs-20070327/fs/aufs/f_op.c aufs-20070327-new/fs/aufs/f_op.c
--- aufs-20070327/fs/aufs/f_op.c        2007-03-27 23:41:12.000000000 +0200
+++ aufs-20070327-new/fs/aufs/f_op.c    2007-03-28 17:48:41.118229760 +0200
@@ -18,7 +18,10 @@
 
 /* $Id: f_op.c,v 1.21 2007/03/27 12:49:00 sfjro Exp $ */
 
+#include <linux/version.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
 #include <linux/fsnotify.h>
+#endif
 #include <linux/pagemap.h>
 #include <linux/poll.h>
 #include <linux/security.h>
diff -up -r aufs-20070327/fs/aufs/inode.h aufs-20070327-new/fs/aufs/inode.h
--- aufs-20070327/fs/aufs/inode.h       2007-03-27 23:41:12.000000000 +0200
+++ aufs-20070327-new/fs/aufs/inode.h   2007-03-28 15:42:06.004684827 +0200
@@ -22,7 +22,9 @@
 #define __AUFS_INODE_H__

 #include <linux/fs.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
 #include <linux/inotify.h>
+#endif
 #include <linux/version.h>
 #include <linux/aufs_type.h>
 #include "misc.h"
@@ -60,7 +60,7 @@
 	struct aufs_iinfo iinfo;
 	struct inode vfs_inode;
 };

-#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,15)
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
 #define i_lock(i)		down(&(i)->i_sem)
 #define i_unlock(i)		up(&(i)->i_sem)
diff -up -r aufs-20070327/fs/aufs/misc.c aufs-20070327-new/fs/aufs/misc.c
--- aufs-20070327/fs/aufs/misc.c        2007-03-27 23:41:12.000000000 +0200
+++ aufs-20070327-new/fs/aufs/misc.c    2007-03-28 17:43:12.461373007 +0200
@@ -24,5 +24,15 @@
 #include <asm/uaccess.h>
 #include "aufs.h"

+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
+void *kzalloc(size_t size, gfp_t flags)
+{
+        void *ret = kmalloc(size, flags);
+        if (ret)
+                memset(ret, 0, size);
+        return ret;
+}
+#endif
+
 /*
  * @hidden_dir: must be locked.
@@ -263,9 +273,14 @@
 	/* the last block may be a hole */
 	if (unlikely(!err && all_zero)) {
 		struct iattr ia = {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
 			.ia_size	= dst->f_pos,
 			.ia_valid	= ATTR_SIZE | ATTR_FILE,
 			.ia_file	= dst
+#else
+			.ia_size	= dst->f_pos,
+			.ia_valid	= ATTR_SIZE,
+#endif
 		};
 		struct dentry *h_d = dst->f_dentry;
 		struct inode *h_i = h_d->d_inode;
diff -up -r aufs-20070327/fs/aufs/whout.c aufs-20070327-new/fs/aufs/whout.c
--- aufs-20070327/fs/aufs/whout.c       2007-03-27 23:41:12.000000000 +0200
+++ aufs-20070327-new/fs/aufs/whout.c   2007-03-28 17:37:27.529700059 +0200
@@ -20,6 +20,7 @@
 
 #include <linux/fs.h>
 #include <linux/kthread.h>
+#include <linux/kernel.h>
 #include <linux/namei.h>
 #include <linux/random.h>
 #include <linux/security.h>
diff -up -r aufs-20070327/fs/aufs/xino.c aufs-20070327-new/fs/aufs/xino.c
--- aufs-20070327/fs/aufs/xino.c        2007-03-27 23:41:13.000000000 +0200
+++ aufs-20070327-new/fs/aufs/xino.c    2007-03-28 17:49:08.086895101 +0200
@@ -19,7 +19,10 @@
 /* $Id: xino.c,v 1.22 2007/03/27 12:51:44 sfjro Exp $ */
 
 //#include <linux/fs.h>
+#include <linux/version.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
 #include <linux/fsnotify.h>
+#endif
 #include <asm/uaccess.h>
 #include "aufs.h"
 
diff -up -r aufs-20070327/local.mk aufs-20070327-new/local.mk
--- aufs-20070327/local.mk      2007-03-27 23:41:11.000000000 +0200
+++ aufs-20070327-new/local.mk  2007-03-28 15:54:57.778188118 +0200
@@ -16,5 +16,5 @@
 CONFIG_AUFS_LHASH_PATCH =
 CONFIG_AUFS_KSIZE_PATCH =
-CONFIG_AUFS_DEBUG = y
+CONFIG_AUFS_DEBUG =
 CONFIG_AUFS_DEBUG_RWSEM =
 CONFIG_AUFS_COMPAT =
============= Next, copy this code and save it as "linuxrc":

Code:
SAME GOES HERE, THE LINUXRC SCRIPT SEEMS TO BE TOO BIG TO BE POSTED HERE, THE FORUM DID NOT TAKE IT ALL