Japanese Page

TOMOYO Linux kernel compilation

Last modified: $Date: 2011-11-20 09:56:56 +0900 (Sun, 20 Nov 2011) $

To compile kernel, the following packages are needed.

Run "make menuconfig" and choose the following options in "File systems" section.

The 2.6 kernels have a compilation option named CONFIG_DEBUG_INFO. If this option is enabled, the compiled code's size becomes about 10 times larger. Enabling this option consumes about 1 GB of extra disk space for /usr/src/ directory and about 300 MB of extra disk space for /lib/modules/ directory.
To save disk space, disable the following option.

Kernel hacking --->[ ]   Compile the kernel with debug info

Choose the version you want to use from the following list.


RedHat Linux 9

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-rhl9-2.4.20.sh
# Start compilation.
rpmbuild -bb --target i386 /tmp/ccs-kernel.spec

Fedora Core 3

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-fc3-2.6.12.sh
# Start compilation.
rpmbuild -bb --target i586 /tmp/ccs-kernel.spec

Fedora Core 4

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-fc4-2.6.17.sh
# Start compilation.
rpmbuild -bb --target i586 /tmp/ccs-kernel.spec

Fedora Core 5

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-fc5-2.6.20.sh
# Start compilation.
rpmbuild -bb --target i586 /tmp/ccs-kernel.spec

Fedora Core 6

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-fc6-2.6.22.sh
# Start compilation.
rpmbuild -bb --target i586 /tmp/ccs-kernel.spec

Fedora 7

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-f7-2.6.23.sh
# Start compilation.
rpmbuild -bb --target i586 /tmp/ccs-kernel.spec

Fedora 8

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-f8-2.6.26.sh
# Start compilation.
rpmbuild -bb --target i586 /tmp/ccs-kernel.spec

Fedora 9

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-f9-2.6.27.sh
# Start compilation.
rpmbuild -bb --target i586 /tmp/ccs-kernel.spec

Fedora 10

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-f10-2.6.27.sh
# Start compilation.
rpmbuild -bb --target i586 /tmp/ccs-kernel.spec

CentOS 4.7

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-c4-2.6.9.sh
# Start compilation.
rpmbuild -bb --target i586 /tmp/ccs-kernel.spec

CentOS 5.2

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-c5-2.6.18.sh
# Start compilation.
rpmbuild -bb --target i686 --without kabichk /tmp/ccs-kernel.spec

Debian Sarge (2.4.27)

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-debian_sarge-2.4.27.sh

Debian Sarge (2.6.8)

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-debian_sarge-2.6.8.sh

Debian Etch

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-debian_etch.sh

Debian Lenny

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-debian_lenny.sh

OpenSUSE 10.1

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-suse10.1-2.6.16.sh
# Start compilation.
rpmbuild -bb --target i586 /tmp/ccs-kernel.spec

OpenSUSE 10.2

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-suse10.2-2.6.18.sh
# Start compilation.
rpmbuild -bb --target i586 /tmp/ccs-kernel.spec

OpenSUSE 10.3

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-suse10.3-2.6.22.sh
# Start compilation.
rpmbuild -bb --target i586 /tmp/ccs-kernel.spec

OpenSUSE 11.0

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-suse11.0-2.6.25.sh
# Start compilation.
rpmbuild -bb --target i586 /tmp/ccs-kernel.spec

Asianux 2.0

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-ax2-2.6.9.sh
# Start compilation.
rpmbuild -bb --target i686 /tmp/ccs-kernel.spec

Asianux 3.0

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-ax3-2.6.18.sh
# Start compilation.
rpmbuild -bb --target i686 --without kabichk /tmp/ccs-kernel.spec

Ubuntu 6.06

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-ubuntu_6.06.sh

Ubuntu 6.10

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-ubuntu_6.10.sh

Ubuntu 7.04

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-ubuntu_7.04.sh

Ubuntu 7.10

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-ubuntu_7.10.sh

Ubuntu 8.04

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-ubuntu_8.04.sh

Ubuntu 8.10

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-ubuntu_8.10.sh

VineLinux 4.2

# Download tar ball and extract it.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Run build script.
sh specs/build-vl4.2-2.6.16.sh
# Start compilation.
rpmbuild -bb --target i586 /tmp/ccs-kernel.spec

Vanilla 2.6 kernels

2.6.11 to 2.6.28.x are supported. The following is the case of version 2.6.28.9 .

# Move to the source directory.
cd /usr/src/
# Download kernel source.
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.28.9.tar.bz2
# Extract.
tar -jxf linux-2.6.28.9.tar.bz2
# Move to the extracted directory.
cd linux-2.6.28.9
# Remove world writable permissions from the source code.
find -print0 | xargs -0 chmod go-w --
# Download TOMOYO Linux's kernel patch.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
# Extract.
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Apply the kernel patch.
patch -sp1 < patches/ccs-patch-2.6.28.diff
# Enable options for TOMOYO Linux.
make -s menuconfig
# Compile as usual.
make -s
make -s modules modules_install install

Vanilla 2.4 kernels

2.4.30 and later are supported. The following is the case of version 2.4.37 .

# Move to the source directory.
cd /usr/src/
# Download kernel source.
wget http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.37.tar.bz2
# Extract.
tar -jxf linux-2.4.37.tar.bz2
# Move to the extracted directory.
cd linux-2.4.37
# Remove world writable permissions from the source code.
find -print0 | xargs -0 chmod go-w --
# Download TOMOYO Linux's kernel patch.
wget -O ccs-patch-1.5.5-20090401.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/27219/ccs-patch-1.5.5-20090401.tar.gz'
# Extract.
tar -zxf ccs-patch-1.5.5-20090401.tar.gz
# Apply the kernel patch.
patch -sp1 < patches/ccs-patch-2.4.37.diff
# Enable options for TOMOYO Linux.
make -s menuconfig
# Compile as usual.
make -s dep
make -s
make -s modules modules_install install

sflogo.php