<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>TOMOYO Linux Install manual</title>
<link rel="stylesheet" href="http://tomoyo.sourceforge.jp/tomoyo.css" media="all" type="text/css">
</head>
<body>
<p>This page is for TOMOYO 2.2 (for Linux 2.6.30 - 2.6.35 kernels). Please jump to <a href="../2.3/">this page</a> for TOMOYO 2.3 (for Linux 2.6.36 and later kernels).</p>
<p style="text-align:right;"><a href="install.html.ja">Japanese Page</a></p>
<p style="text-align:right;">Last modified: $Date: 2012-04-14 22:44:49 +0900 (Sat, 14 Apr 2012) $</p>
<h1>Phase 1: Installing TOMOYO Linux kernels and tools.</h1>

<p>This page describes how to install TOMOYO Linux's kernel and userland tools.</p>

<hr>

<h2>Step 1: Compiling the kernel.</h2>

<h3>Determine if your kernel has TOMOYO Linux enabled</h3>

<p>TOMOYO Linux 2.2.x is integrated with the upstream kernel source, but is only enabled when certain kernel configuration options are set. You can determine if your kernel has TOMOYO Linux enabled by running the following command:</p>

<table border="1">
<tr><td>
$ grep tomoyo_io_printf /proc/kallsyms<br>
ffffffff8115e460 T tomoyo_io_printf
</td></tr>
</table>

<p>If you found a line containing tomoyo_io_printf in "/proc/kallsyms", proceed to <a href="#bootloader">Update bootloader configuration</a> because your kernel was built with TOMOYO Linux.</p>

<p>If you are using CentOS 6, you don't need to compile kernel because you can install TOMOYO Linux enabled binary kernels from CentOS+ repository. To install, change from enabled=0 to enabled=1 in the [centosplus] section of /etc/yum.repos.d/CentOS-Base.repo and run "yum update". Then, proceed to <a href="#bootloader">Update bootloader configuration</a>.</p>

<p>If not, then your kernel was not built with TOMOYO Linux and you should follow the steps below.</p>

<p>If you wish to obtain the most functionality out of TOMOYO Linux, then you may wish to use either the 1.x branch (which requires you to build your own kernel), or AKARI (which is a module and does not require you to build your own kernel). AKARI module currently provides more functionality than the 2.x branch, but is missing a small number of features that the 1.x branch provides. It is easy to use with any kernel from Linux 2.6.0 and later, depending on how the kernel has been configured and the CPU architecture. <a href="http://akari.sourceforge.jp/comparison.html.en">This chart</a> provides a detailed comparison between AKARI and both the 1.x and 2.x branches. If you would prefer to use this module, please visit the <a href="http://akari.sourceforge.jp/">AKARI website</a>.</p>

<p>If you are planning to compile 2.6.33 and later kernels but have no reason not to use <a href="../2.5/">TOMOYO 2.5</a>, use of TOMOYO 2.5 is recommended. TOMOYO 2.5 is more powerful and user friendly.</p>

<h3>Compile TOMOYO Linux enabled kernel</h3>

<p>To compile kernel, the following packages are needed.</p>

<ul>
<li>gcc</li>
<li>make</li>
<li>ncurses</li>
<li>patch</li>
</ul>

<p>Download source code from "<a href="http://www.kernel.org/pub/linux/kernel/v2.6/longterm/v2.6.35/linux-2.6.35.14.tar.bz2">linux-2.6.35.14.tar.bz2</a>" and extract it.</p>

<p>There may be bugfixes that are too late to get merged in the upstream kernel releases. Download all patches that match your kernel version (e.g. 2.6.35-tomoyo-\*.patch for 2.6.35 kernels) from <a href="http://tomoyo.sourceforge.jp/2.2/patches/">http://tomoyo.sourceforge.jp/2.2/patches/</a> and run below command from the kernel's top directory. (Below command will skip already applied patch if any.)</p>

<table border="1">
<tr><td>
[user@tomoyo ~]$ for i in 2.6.*-tomoyo-*.patch; do patch -Nt -p1 --dry-run &lt; $i &amp;&amp; patch -p1 &lt; $i; done
</td></tr>
</table>

<p>Next, create a kernel config with TOMOYO Linux enabled.</p>

<table border="1">
<tr><td>
[user@tomoyo ~]$ make -s menuconfig
</td></tr>
</table>

<p>Go to "Security options" screen and select "Enable different security models" and "TOMOYO Linux Support".</p>

<pre>
[&nbsp;] Enable access key retention support
[*] Enable different security models
-*- Enable the securityfs filesystem
[&nbsp;] Socket and Networking Security Hooks
-*- Security hooks for pathname based access control
[&nbsp;] File POSIX Capabilities
(0) Low address space to protect from user allocation
[*] TOMOYO Linux Support
</pre>

<p>After creating a kernel config, compile the kernel.</p>

<table border="1">
<tr><td>
[user@tomoyo ~]$ make -s<br>
[user@tomoyo ~]$ su<br>
[root@tomoyo ~]# make -s modules_install install
</td></tr>
</table>

<p>Create initrd if you need.</p>

<h3><a name="bootloader">Update bootloader configuration</a></h3>

<p>Now edit your bootloader (e.g. GRUB) to include the kernel you have just compiled. If your kernel config does not contain "CONFIG_DEFAULT_SECURITY_TOMOYO=y", then edit your bootloader to include "security=tomoyo" in the kernel boot options. Depending on your distribution, the bootloader configuration file will probably be one of "/boot/grub/grub.conf" or "/boot/grub/menu.lst" (for GRUB version 1) or "/boot/grub/grub.cfg" or "/boot/grub2/grub.cfg" (for GRUB version 2). Consult your distribution documentation for information on how to configure the bootloader.</p>

<hr>

<h2>Step 2: Installing the tools package.</h2>

<p>To compile tool, run the following commands.</p>

<table border="1">
<tr><td>
[root@tomoyo ~]# wget -O tomoyo-tools-2.2.0-20120414.tar.gz 'http://sourceforge.jp/frs/redir.php?m=jaist&amp;f=/tomoyo/41908/tomoyo-tools-2.2.0-20120414.tar.gz'<br>
[root@tomoyo ~]# tar -zxf tomoyo-tools-2.2.0-20120414.tar.gz<br>
[root@tomoyo ~]# make -C tomoyo-tools/ install
</td></tr>
</table>

<hr>

<p><a href="index.html.en">Return to index page.</a></p>
<p><a href="http://sourceforge.jp/"><img src="http://sourceforge.jp/sflogo.php?group_id=1973" width="96" height="31" alt="sflogo.php" title="SourceForge.jp"></a></p>
</body>
</html>
