jt0.org Proudly serving you since Tomorrow

Welcome


Welcome to the homepage for all of Jess Telford's projects.

You'll find here my more recent work in software design, application development, and game creation.
Work including games for the Nintendo DS, Windows PCs, and Misc Applications I have written.

To browse around, use the navigation bar on the right under the Places To Go heading.

Enjoy the site, and remember that Open Source keeps the indi scene alive!

Compiling unionfs

for 2.6.29
4th June '09 - Edited: 04-06-2009

Recently, I posted about Squashing /usr and the 2.6.29 kernel, which is aimed at freeing up space by compressing the /usr directory.

When doing this, I forgot that this then makes the directory read-only, meaning you cannot install/remove/upgrade any packages on your system. The next vital step is to use unionfs which makes the compressed directory read and write.

So, I will be covering that step now;

UnionFS for the 2.6.29 kernel

Be sure to have followed the instructions for installing the 2.6.29 kernel in the previous post.
As an additional to this, you will need to install the source, so download http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.29/linux-source-2.6.29_2.6.29-020629_all.deb and install it.

You will need to patch the source to include the relevant unionfs source and files. To do so, download the 2.6.29-rc2 patch: http://download.filesystems.org/unionfs/unionfs-2.x/unionfs-2.5.1_for_2.6.29-rc2.diff.gz

Setup the linux source with the following commands;
sudo su
cd /usr/src
tar -jxvf linux-source*.tar.bz2


Note: The above commands will put you in super user mode, which we will continue to use for the rest of this tutorial.

Decompress the patch;
gzip -cd /PATH/TO/PATCH/unionfs*.gz


Apply the patch;
cd /usr/src/linux-source*
patch -p1 < /PATH/TO/PATCH/unionfs*.diff


Now you need to set up the source ready to compile unionfs;
make oldconfig && make prepare

You should be prompted three times for unionfs ending in "[N/m/y] (NEW)", or something to that effect. Make sure you enter "m" for each option.

Finally, we need to properly set up the Makefile which controls how unionfs is compiled for what we need. To do so, we're going to add a couple of lines to the Makefile which will depend on the location of the source directory. First, enter the following commands;
cd fs/unionfs
gedit Makefile

Then, add the following lines to the end, entering the directory where your source is (most likely /usr/src/linux-source-2.6.29);
all:
make -C /PATH/TO/SOURCE M=$(PWD) modules

clean:
make -C /PATH/TO/SOURCE M=$(PWD) clean


Note: The two lines above starting with "make" must have a tab before them.

Save and close the file.

Now we're ready to compile unionfs with the command;
make


This should create a file called unionfs.ko (as shown in the output) in the current directory.

If all went smooth, then we can install the module, and everything should be good to go for the next boot;
mkdir /lib/modules/'uname -r'/kernel/fs/unionfs
cp unionfs.ko /lib/modules/'uname -r'/kernel/fs/unionfs
depmod -a



Enjoy

On your next boot, you should have a working unionfs with your new kernel 2.6.29.
Last Next   First   Previous
Most Popular...

Project:
Spider Solitaire DS
News Item:
Teddy's 21st
TGC Web-ring


Against Trusted Computing
Copyright © 2006 - 2008 Jess Telford