Info: Version 1.7.x is available.

Japanese Page

TOMOYO Linux kernel compilation

Last modified: $Date: 2013-03-04 22:48:51 +0900 (Mon, 04 Mar 2013) $

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.


CentOS 3.9

# Download TOMOYO Linux's kernel patch.
wget -O ccs-patch-1.6.9-20130117.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/30297/ccs-patch-1.6.9-20130117.tar.gz'
# Check signature.
wget -O ccs-patch-1.6.9-20130117.tar.gz.asc 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/30297/ccs-patch-1.6.9-20130117.tar.gz.asc'
gpg ccs-patch-1.6.9-20130117.tar.gz.asc
# Extract.
tar -zxf ccs-patch-1.6.9-20130117.tar.gz
# Run build script.
sh specs/build-c3-2.4.21.sh
# Start compilation.
rpmbuild -bb --target i586 /tmp/ccs-kernel.spec

CentOS 4.9

# Download TOMOYO Linux's kernel patch.
wget -O ccs-patch-1.6.9-20130117.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/30297/ccs-patch-1.6.9-20130117.tar.gz'
# Check signature.
wget -O ccs-patch-1.6.9-20130117.tar.gz.asc 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/30297/ccs-patch-1.6.9-20130117.tar.gz.asc'
gpg ccs-patch-1.6.9-20130117.tar.gz.asc
# Extract.
tar -zxf ccs-patch-1.6.9-20130117.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.9

# Download TOMOYO Linux's kernel patch.
wget -O ccs-patch-1.6.9-20130117.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/30297/ccs-patch-1.6.9-20130117.tar.gz'
# Check signature.
wget -O ccs-patch-1.6.9-20130117.tar.gz.asc 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/30297/ccs-patch-1.6.9-20130117.tar.gz.asc'
gpg ccs-patch-1.6.9-20130117.tar.gz.asc
# Extract.
tar -zxf ccs-patch-1.6.9-20130117.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 Lenny

# Download TOMOYO Linux's kernel patch.
wget -O ccs-patch-1.6.9-20130117.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/30297/ccs-patch-1.6.9-20130117.tar.gz'
# Check signature.
wget -O ccs-patch-1.6.9-20130117.tar.gz.asc 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/30297/ccs-patch-1.6.9-20130117.tar.gz.asc'
gpg ccs-patch-1.6.9-20130117.tar.gz.asc
# Extract.
tar -zxf ccs-patch-1.6.9-20130117.tar.gz
# Run build script.
sh specs/build-debian_lenny.sh

Asianux 2.0

# Download TOMOYO Linux's kernel patch.
wget -O ccs-patch-1.6.9-20130117.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/30297/ccs-patch-1.6.9-20130117.tar.gz'
# Check signature.
wget -O ccs-patch-1.6.9-20130117.tar.gz.asc 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/30297/ccs-patch-1.6.9-20130117.tar.gz.asc'
gpg ccs-patch-1.6.9-20130117.tar.gz.asc
# Extract.
tar -zxf ccs-patch-1.6.9-20130117.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 TOMOYO Linux's kernel patch.
wget -O ccs-patch-1.6.9-20130117.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/30297/ccs-patch-1.6.9-20130117.tar.gz'
# Check signature.
wget -O ccs-patch-1.6.9-20130117.tar.gz.asc 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/30297/ccs-patch-1.6.9-20130117.tar.gz.asc'
gpg ccs-patch-1.6.9-20130117.tar.gz.asc
# Extract.
tar -zxf ccs-patch-1.6.9-20130117.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 8.04

# Download TOMOYO Linux's kernel patch.
wget -O ccs-patch-1.6.9-20130117.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/30297/ccs-patch-1.6.9-20130117.tar.gz'
# Check signature.
wget -O ccs-patch-1.6.9-20130117.tar.gz.asc 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/30297/ccs-patch-1.6.9-20130117.tar.gz.asc'
gpg ccs-patch-1.6.9-20130117.tar.gz.asc
# Extract.
tar -zxf ccs-patch-1.6.9-20130117.tar.gz
# Run build script.
sh specs/build-ubuntu_8.04.sh

VineLinux 5.2

# Download TOMOYO Linux's kernel patch.
wget -O ccs-patch-1.6.9-20130117.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/30297/ccs-patch-1.6.9-20130117.tar.gz'
# Check signature.
wget -O ccs-patch-1.6.9-20130117.tar.gz.asc 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/30297/ccs-patch-1.6.9-20130117.tar.gz.asc'
gpg ccs-patch-1.6.9-20130117.tar.gz.asc
# Extract.
tar -zxf ccs-patch-1.6.9-20130117.tar.gz
# Run build script.
sh specs/build-vl5.2-2.6.27.sh
# Start compilation.
rpmbuild -bb --target i586 /tmp/ccs-kernel.spec

Gentoo

# Install layman package.
emerge layman
# Install subversion package.
emerge subversion
# Add sunrise repository.
layman -f -a sunrise
# Configure /etc/make.conf to include layman's make.conf .
echo "source /usr/local/portage/layman/make.conf" >> /etc/make.conf
# Download kernel source.
emerge ccs-sources
# Run genkernel to build.
genkernel --menuconfig all
# Configure grub . See http://www.gentoo.org/doc/en/kernel-upgrade.xml for detail.

Vanilla 2.6 kernels

2.6.27 to 2.6.31 are supported. The following is the case of version 2.6.31.14 .

# Move to the source directory.
cd /usr/src/
# Download kernel source.
wget https://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.31.14.tar.bz2
# Extract.
tar -jxf linux-2.6.31.14.tar.bz2
# Move to the extracted directory.
cd linux-2.6.31.14
# 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.6.9-20130117.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/30297/ccs-patch-1.6.9-20130117.tar.gz'
# Check signature.
wget -O ccs-patch-1.6.9-20130117.tar.gz.asc 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/30297/ccs-patch-1.6.9-20130117.tar.gz.asc'
gpg ccs-patch-1.6.9-20130117.tar.gz.asc
# Extract.
tar -zxf ccs-patch-1.6.9-20130117.tar.gz
# Apply the kernel patch.
patch -sp1 < patches/ccs-patch-2.6.31.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.37 is supported. The following is the case of version 2.4.37.11 .

# Move to the source directory.
cd /usr/src/
# Download kernel source.
wget https://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.37.11.tar.bz2
# Extract.
tar -jxf linux-2.4.37.11.tar.bz2
# Move to the extracted directory.
cd linux-2.4.37.11
# 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.6.9-20130117.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/30297/ccs-patch-1.6.9-20130117.tar.gz'
# Check signature.
wget -O ccs-patch-1.6.9-20130117.tar.gz.asc 'http://sourceforge.jp/frs/redir.php?m=jaist&f=/tomoyo/30297/ccs-patch-1.6.9-20130117.tar.gz.asc'
gpg ccs-patch-1.6.9-20130117.tar.gz.asc
# Extract.
tar -zxf ccs-patch-1.6.9-20130117.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