Changes

Jump to: navigation, search

Creating OpenVZ LiveCD

2,957 bytes added, 15:17, 16 April 2007
Step-by-step actions: aufs and cloop building info added
./cloop-2.05/create_compressed_fs KNOPPIX-modif.img 65536 > KNOPPIX-modif
</pre>
Now we need to compile aufs and cloop kernel modules for our new kernel. Let's start from cloop module.We uncomment one definition in source, because we're using RHEL-based kernel. The patch below shows what to do:<pre>--- cloop-2.05/compressed_loop.c.rh 2006-10-13 23:39:41.000000000 +0400+++ cloop-2.05/compressed_loop.c 2007-04-12 17:21:24.000000000 +0400@@ -31,7 +31,7 @@ #endif  /* Define this if you are using Greenshoe Linux */-/* #define REDHAT_KERNEL */+ #define REDHAT_KERNEL  #include <linux/kernel.h> #include <linux/version.h></pre>OK, let's compile cloop<pre>wget http://debian-knoppix.alioth.debian.org/sources/cloop_2.05-1.tar.gztar xzf cloop_2.05-1.tar.gzcd cloop-2.05/vim compressed_loop.c # uncommenting define heremake KERNEL_DIR=../linux-2.6.18-8.el5-028stab027/ module</pre>After that you should have cloop.ko file in current directory. Later we copy it to appropriate place.What about aufs? Get this module from cvs. I will write about it use this version (20061113), because this version is used in KNOPPIX 5.1.1.The following changes are required in AUFS, because we use rhel5-based kernel:<pre>--- aufs/fs/aufs/cpup.c.orig 2006-10-23 12:58:33.000000000 +0000+++ aufs/fs/aufs/cpup.c 2007-04-16 14:46:51.000000000 +0000@@ -85,9 +85,6 @@ void cpup_attr_all(struct inode *inode) inode->i_rdev = hidden_inode->i_rdev; } inode->i_blkbits = hidden_inode->i_blkbits;-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)- inode->i_blksize = hidden_inode->i_blksize;-#endif }  /* ---------------------------------------------------------------------- */--- aufs/fs/aufs/dir.c.orig 2006-10-23 12:59:29.000000000 +0000+++ aufs/fs/aufs/dir.c 2007-04-16 14:58:34.000000000 +0000@@ -223,7 +223,7 @@ struct test_empty_arg { };  static int test_empty_cb(void *__arg, const char *__name, int namelen,- loff_t offset, filldir_ino_t ino, unsigned int d_type)+ loff_t offset, u64 ino, unsigned int d_type) { struct test_empty_arg *arg = __arg; char *name = (void*)__name;--- aufs/fs/aufs/vdir.c.orig 2006-10-23 13:02:20.000000000 +0000+++ aufs/fs/aufs/vdir.c 2007-04-16 15:01:44.000000000 +0000@@ -389,7 +389,7 @@ struct fillvdir_arg { };  static int fillvdir(void *__arg, const char *__name, int namelen, loff_t offset,- filldir_ino_t hidden_ino, unsigned int d_type)+ u64 hidden_ino, unsigned int d_type) { struct fillvdir_arg *arg = __arg; ino_t ino;</pre>TODO: (FOR NEWER AUFS ONE MORE PATCH with "(deleted)"<pre></pre><pre>cvs -d:pserver:anonymous@aufs.cvs.sourceforge.net:/cvsroot/aufs logincvs -z3 -d:pserver:anonymous@aufs.cvs.sourceforge.net:/cvsroot/aufs co -D20061113 aufscd aufsmake KDIR=../../linux-2.6.18-8.el5-028stab027/ -f local.mk</pre>After this step you have an aufs.ko file in current directory.Next step is too create add this (and some other) modules to initrd. It'll be tomorrow.;) [TODO]CREATE GOOD CONTENTS TABLE OF THIS PART.
== Result ==
172
edits

Navigation menu