This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

Gentoo Linux mips ハンドブック: Gentoo をインストールする

From Gentoo Wiki (test)
Jump to:navigation Jump to:search
This page is a translated version of the page Handbook:MIPS/Full/Installation and the translation is 100% complete.
MIPS ハンドブック
インストール
インストールについて
メディアの選択
ネットワーク設定
ディスクの準備
stage3のインストール
Gentooベースシステムのインストール
カーネルの設定
システムの設定
ツールのインストール
ブートローダの設定
締めくくり
Gentooの操作
Portageについて
USEフラグ
Portageの機能
Initスクリプトシステム
環境変数
Portageの操作
ファイルとディレクトリ
変数
ソフトウェアブランチの併用
追加ツール
カスタムPortageツリー
高度な機能
ネットワーク設定
はじめに
高度な設定
モジュール式ネットワーク
無線
機能の追加
動的な管理


はじめに

ようこそ

まずはじめに、Gentooへようこそ!あなたは、選択と性能の世界に入ろうとしています。Gentooでは、全てが選択です。そのことは、インストールするときにもたびたび明らかになります。コンパイルを何回やらせたいか、Gentooをどのようにインストールしたいか、システムのロギングツールに何を使用したいかなどなど、ユーザに選択権があります。

Gentooは、高速で現代的なメタディストリビューションで、整理された柔軟なデザインになっています。Gentooは、フリーソフトウェアのエコシステムの上に成り立っており、内部をユーザに隠匿することがありません。Gentooで用いるパッケージ管理システムであるPortageはPythonで書かれていますので、ソースコードを容易に閲覧したり改変したりすることができます。Gentooで採用しているパッケージ化の手法は、(コンパイル済パッケージにも対応していますが、)ソースコードを用いるものです。Gentooの設定は、一般的なテキストファイルで行います。つまり言い換えれば、Gentooは、全てをユーザーに開放しています。

Gentooに実行させることの選択肢を全員が理解していることは、きわめて重要です。望まざることをユーザーに強いないよう、我々は努めています。もしかりにこれに反するようなことがあったならば、バグリポートを送ってください。

インストール作業の順序

Gentoo のインストール作業工程は、次章以降で説明する10のステップに分けられます。それぞれの段階を適切に完了させましょう。

ステップ 結果
1 Gentoo をインストール可能な作業環境にします。
2 Gentoo をインストールするためのインターネット接続の準備が完了します。
3 インストールする Gentoo をホストするハードディスクを初期化します。
4 インストールする環境を準備し、新たな環境にユーザーが chroot 可能にします。
5 Gentoo をインストールする全ての場合に共通する中核的なパッケージをインストールします。
6 Linux カーネルをインストールします。
7 Gentoo システムの主な設定ファイルを完成させます。
8 必要なシステムツールをインストールします。
9 適切なブートローダーもインストールし設定します。
10 インストールしたての Gentoo Linux 環境に繰り出す準備が完了します。

このハンドブックでは、一定の選択肢を提示したときには必ず、賛否両論の併記に努めます。デフォルトの選択肢で進める記載をした際にも(見出しに「デフォルト:」と記載)、他に取りうる選択肢も記載します(見出しに「代替案:」と記載)。決して、「デフォルトは Gentoo のお勧めだ」と考えないでください。デフォルトはあくまでも、多くのユーザーが利用すると思われる選択肢にすぎません。

ときには、追加可能な手順が続くことがあります。そのような手順は「追加可能:」と記載します。つまりこの手順は、Gentoo のインストール自体には必須ではありません。とはいえ、以前にした決断によっては必須になる追加手順もあります。その際には、その追加手順の説明の直前に、この旨を明記するとともに、原因となった決断をした時期も記載します。

Gentooのインストール方法

Gentoo は、さまざまな方法でインストールすることができます。ダウンロードしてインストールすることも、CD/DVD等の公式インストールメディアからインストールすることもできます。インストールメディアは USB メモリにインストールすることも、ネットワークブートすることもできます。さらには、インストール済の異なるディストリビューション環境や、(例えば Knoppix のような)Gentoo 以外のブータブルディスクといった非公式メディアからインストールすることも可能です。

この文書が扱っているのは、公式の Gentoo インストールメディアを用いる方法と、場合によってはネットワークブートによる方法です。

注意
Gentoo 以外のCDを用いる場合などの、ほかのインストール方法については、『Alternative installation guide』を読んでください。

また、我々が提供している『Gentoo インストールのヒントとトリック』 という文書も役にたつかもしれません。

トラブルがあったときは

インストール中に (またはインストールを説明しているハンドブックに) 何か問題を見つけたら、バグトラッキングシステムで既知のバグとして報告されていないかどうか、確認してみてください。 もし無いようであれば、私たちが対応できるように、その問題をバグ報告してください。 その (あなたが報告した) バグを担当する開発者たちを恐れないでください。取って喰われるようなことは (滅多に) ありませんから。

あなたが今読んでいる文書は、特定のアーキテクチャ向けということになっていますが、 他のアーキテクチャの情報も、その中に紛れ込んでしまっているかもしれない、ということを一応、先に言っておきます。これはGentooハンドブックの多くの部分が、全てのアーキテクチャに共通のテキストを使用していることに因ります (重複作業を減らして開発リソースを節約するため)。混乱しないように、このような部分は最小限に抑えていきたいと思っています。

その問題が、ユーザーの問題 (文書をよく読んだにもかかわらず起きたあなたのミス) なのか、ソフトウェアの問題 (インストール/文書をよくテストしたにもかかわらず起きた私たちのミス) なのか、はっきりしないときには、irc.freenode.net の #gentoo チャンネルに気軽に参加してみてください。そんなときじゃなくても全然かまわないんですけどね。

そういえば、Gentooについて何か分からないことがあったら、よくある質問を見てみてください。Gentoo Forums上にあるFAQsもあります。





MIPS ハンドブック
インストール
インストールについて
メディアの選択
ネットワーク設定
ディスクの準備
stage3のインストール
Gentooベースシステムのインストール
カーネルの設定
システムの設定
ツールのインストール
ブートローダの設定
締めくくり
Gentooの操作
Portageについて
USEフラグ
Portageの機能
Initスクリプトシステム
環境変数
Portageの操作
ファイルとディレクトリ
変数
ソフトウェアブランチの併用
追加ツール
カスタムPortageツリー
高度な機能
ネットワーク設定
はじめに
高度な設定
モジュール式ネットワーク
無線
機能の追加
動的な管理


ハードウェア要件

CPU (Big Endian port) MIPS3, MIPS4, MIPS5 or MIPS64-class CPU
CPU (Little Endian port) MIPS4, MIPS5 or MIPS64-class CPU
Memory 128 MB
Disk space 3.0 GB (excluding swap space)
Swap space At least 256 MB

For more information, read MIPS Hardware Requirements.

Installation notes

On many architectures, the processor has gone through several generations, each newer generation builds on the foundation of the previous one. MIPS is no exception. There are several generations of CPU covered under the MIPS architecture. In order to choose the right netboot image stage tarball and CFLAGS appropriately, it is necessary to be aware of which family the system's CPU belongs in. These families are referred to as the Instruction Set Architecture.

MIPS ISA 32/64-bit CPUs Covered
MIPS 1 32-bit R2000, R3000
MIPS 2 32-bit R6000
MIPS 3 64-bit R4000, R4400, R4600, R4700
MIPS 4 64-bit R5000, RM5000, RM7000 R8000, R9000, R10000, R12000, R14000, R16000
MIPS 5 4-bit None As Yet
MIPS32 32-bit AMD Alchemy series, 4kc, 4km, many others... There are a few revisions in the MIPS32 ISA.
MIPS64 64-bit Broadcom SiByte SB1, 5kc ... etc... There are a few revisions in the MIPS64 ISA.
Note
The MIPS5 ISA level was designed by Silicon Graphics back in 1994, but never actually got used in a real life CPU. It lives on as part of the MIPS64 ISA.
Note
The MIPS32 and MIPS64 ISAs are a common source of confusion. The MIPS64 ISA level is actually a superset of the MIPS5 ISA, so it includes all instructions from MIPS5 and earlier ISAs. MIPS32 is the 32-bit subset of MIPS64, it exists because most applications only require 32-bit processing.

Also, another important concept to grasp is the concept of endianness. Endianness refers to the way that a CPU reads words from main memory. A word can be read as either big endian (most significant byte first), or little endian (least significant byte first). Intel x86 machines are generally Little endian, whilst Apple and Sparc machines are Big Endian. On MIPS, they can be either. To separate them apart, we append el to the architecture name to denote little endian.

Architecture 32/64-bit Endianness Machines covered
mips 32-bit Big Endian Silicon Graphics
mipsel 32-bit Little Endian Cobalt Servers
mips64 64-bit Big Endian Silicon Graphics
mips64el 64-bit Little Endian Cobalt Servers

For those willing to learn more about ISAs, the following websites may be of assistance:

Netbooting overview

In this section, we'll cover what is needed to successfully network boot a Silicon Graphics workstation or Cobalt Server appliance. This is just a brief guide, it is not intended to be thorough, for more information, it is recommended to read the Diskless nodes article.

Depending on the machine, there is a certain amount of hardware that is needed in order to successfully netboot and install Linux.

  • In General:
    • DHCP/BOAMD Alchemy series, 4kc, 4km, many others... There are a few revisions in the MIPS32 ISA.OTP server (ISC DHCPd recommended)
    • Patience -- and lots of it
  • For Silicon Graphics workstations:
    • TFTP server (tftp-hpa recommended)
    • When the serial console needs to be used:
      • MiniDIN8 --> RS-232 serial cable (only needed for IP22 and IP28 systems)
      • Null-modem cable
      • VT100 or ANSI compatible terminal capable of 9600 baud
  • For Cobalt Servers (NOT the original Qube):
    • NFS server
    • Null-modem cable
    • VT100 or ANSI compatible terminal capable of 115200 baud
Note
SGI machines use a MiniDIN 8 connector for the serial ports. Apparently Apple modem cables work just fine as serial cables, but with Apple machines being equipped with USB & internal modems, these are getting harder to find. One wiring diagram is available from the Linux/MIPS Wiki, and most electronics stores should stock the plugs required.
Note
For the terminal, this could be a real VT100/ANSI terminal, or it could be a PC running terminal emulation software (such as HyperTerminal, Minicom, seyon, Telex, xc, screen - whatever your preference). It doesn't matter what platform this machine runs - just so long as it has one RS-232 serial port available, and appropriate software.
Note
This guide does NOT cover the original Qube. The original Qube server appliance lacks a serial port in its default configuration, and therefore it is not possible to install Gentoo onto it without the aid of a screwdriver and a surrogate machine to do the installation.

Setting up TFTP and DHCP

As mentioned earlier -- this is not a complete guide, this is a bare-bones config that will just get things rolling. Either use this when starting a setup from scratch, or use the suggestions to amend an existing setup to support netbooting.

It is worth noting that the servers used need not be running Gentoo Linux, they could very well be using FreeBSD or any Unix-like platform. However, this guide will assume to be using Gentoo Linux. If desired, it is also possible to run TFTP/NFS on a separate machine to the DHCP server.

Warning
The Gentoo/MIPS Team cannot help with setting up other operating systems as netboot servers.

First Step -- configuring DHCP. In order for the ISC DHCP daemon to respond to BOOTP requests (as required by the SGI & Cobalt BOOTROM) first enable dynamic BOOTP on the address range in use; then set up an entry for each client with pointers to the boot image.

root #emerge --ask net-misc/dhcp

Once installed, create the /etc/dhcp/dhcpd.conf file. Here's a bare-bones config to get started.

FILE /etc/dhcp/dhcpd.confBare Bones dhcpd.conf
# Tell dhcpd to disable dynamic DNS.
# dhcpd will refuse to start without this.
ddns-update-style none;
  
# Create a subnet:
subnet 192.168.10.0 netmask 255.255.255.0 {
  # Address pool for our booting clients. Don't forget the 'dynamic-bootp' bit!
  pool {
    range dynamic-bootp 192.168.10.1 192.168.10.254;
  }
  
  # DNS servers and default gateway -- substitute as appropriate
  option domain-name-servers 203.1.72.96, 202.47.56.17;
  option routers 192.168.10.1;
  
  # Tell the DHCP server it's authoritative for this subnet.
  authoritative;
  
  # Allow BOOTP to be used on this subnet.
  allow bootp;
}

With that setup, one can then add any number of clients within the subnet clause. We will cover what to put in later in this guide.

Next step - Setting up TFTP server. It is recommended to use tftp-hpa as it is the only TFTP daemon known to work correctly. Proceed by installing it as shown below:

root #emerge --ask net-ftp/tftp-hpa

This will create /tftproot to store the netboot images. Move this elsewhere if necessary. For the purposes of this guide, it is assumed that it is kept in the default location.

Netbooting on SGI stations

Downloading a netboot image

Depending on the system the installation is meant for, there are several possible images available for download. These are all labelled according to the system type and CPU they are compiled for. The machine types are as follows:

Codename Machines
IP22 Indy, *Indigo 2, Challenge S
IP26 *Indigo 2 Power
IP27 Origin 200, Origin 2000
IP28 *Indigo 2 Impact
IP30 Octane
IP32 O2
Note
Indigo 2 - It is a common mistake to mix up the IRIS Indigo (IP12 w/ R3000 CPU or IP20 with a R4000 CPU, neither of which run Linux), the Indigo 2 (IP22, which runs Linux fine), the R8000-based Indigo 2 Power (which doesn't run Linux at all) and the R10000-based Indigo 2 Impact (IP28, which is highly experimental). Please bear in mind that these are different machines.

Also in the filename, r4k refers to R4000-series processors, r5k for R5000, rm5k for the RM5200 and r10k for R10000. The images are available on the Gentoo mirrors.

DHCP configuration for an SGI client

After downloading the file, place the decompressed image file in the /tftproot/ directory. (Use bzip2 -d to decompress). Then edit the /etc/dhcp/dhcpd.conf file and add the appropriate entry for the SGI client.

FILE /etc/dhcp/dhcpd.confsnippet for SGI Workstation
subnet xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx {
  # ... usual stuff here ...
  
  # SGI Workstation... change 'sgi' to your SGI machine's hostname.
  host sgi {
  
    # MAC Address of SGI Machine. Normally this is written on the back
    # or base of the machine.
    hardware ethernet 08:00:69:08:db:77;
  
    # TFTP Server to download from (by default, same as DHCP server)
    next-server 192.168.10.1;
  
    # IP address to give to the SGI machine
    fixed-address 192.168.10.3;
  
    # Filename for the PROM to download and boot
    filename "/gentoo-r4k.img";
  }
}

Kernel options

We're almost done, but there's a couple of little tweaks still to be done. Pull up a console with root privileges.

Disable "Path Maximum Transfer Unit", otherwise SGI PROM won't find the kernel:

root #echo 1 > /proc/sys/net/ipv4/ip_no_pmtu_disc

Set the port range usable by the SGI PROM:

root #echo "2048 32767" > /proc/sys/net/ipv4/ip_local_port_range

This should be sufficient to allow the Linux server to play nice with SGI's PROM.

Starting the daemons

At this point, start the daemons.

root #/etc/init.d/dhcp start
root #/etc/init.d/in.tftpd start

If nothing went wrong in that last step then everything is all set to power on the workstation and proceed with the guide. If the DHCP server isn't firing up for whatever reason, try running dhcpd on the command line and see what it says - if all is well, it should just fork into the background, otherwise it will display 'exiting.' just below its complaint.

An easy way to verify if the tftp daemon is running is to type the following command and confirm the output:

root #netstat -al | grep ^udp
udp        0      0 *:bootpc                *:*
udp        0      0 *:631                   *:*
udp        0      0 *:xdmcp                 *:*
udp        0      0 *:tftp                  *:* <-- (look for this line)

Netbooting the SGI station

Okay, everything is set, DHCP is running as is TFTP. Now it is time to fire up the SGI machine. Power the unit on - when "Running power-on diagnostics" comes on the screen, either click "Stop For Maintenance" or press Escape. A menu similar to the following will show up.

Running power-on diagnostics
System Maintenance Menu
  
1) Start System
2) Install System Software
3) Run Diagnostics
4) Recover System
5) Enter Command Monitor
Option?

Type in 5 to enter the command monitor. On the monitor, start the BootP process:

>>bootp(): root=/dev/ram0

From this point, the machine should start downloading the image, then, roughly 20 seconds later, start booting Linux. If all is well, a busybox ash shell will be started as shown below and the installation of Gentoo Linux can continue.

CODE When things are going right...
init started:  BusyBox v1.00-pre10 (2004.04.27-02:55+0000) multi-call binary
  
Gentoo Linux; http://www.gentoo.org/
 Copyright 2001-2004 Gentoo Technologies, Inc.; Distributed under the GPL
  
 Gentoo/MIPS Netboot for Silicon Graphics Machines
 Build Date: April 26th, 2004
  
 * To configure networking, do the following:
  
 * For Static IP:
 * /bin/net-setup <IP Address> <Gateway Address> [telnet]
  
 * For Dynamic IP:
 * /bin/net-setup dhcp [telnet]
  
 * If you would like a telnetd daemon loaded as well, pass "telnet"
 * As the final argument to /bin/net-setup.
  
Please press Enter to activate this console.

Troubleshooting

If the machine is being stubborn and refusing to download its image, it can be one of two things:

  1. The instructions were not followed correctly, or
  2. It needs a little gentle persuasion (No, put that sledge hammer down!)

Here's a list of things to check:

  • dhcpd is giving the SGI Machine an IP Address. There should be some messages about a BOOTP request in the system logs. tcpdump is also useful here.
  • Permissions are set properly in the tftp folder (typically /tftproot/ - should be world readable)
  • Check system logs to see what the tftp server is reporting (errors perhaps)

If everything on the server is checked, and timeouts or other errors occur on the SGI machine, try typing this into the console.

>>resetenv
>>unsetenv netaddr
>>unsetenv dlserver
>>init
>>bootp(): root=/dev/ram0

Netbooting on Cobalt stations

Overview of the netboot procedure

Unlike the SGI machines, Cobalt servers use NFS to transfer their kernel for booting. Boot the machine by holding down the left & right arrow buttons whilst powering the unit on. The machine will then attempt to obtain an IP number via BOOTP, mount the /nfsroot/ directory from the server via NFS, then try to download and boot the file vmlinux_raq-2800.gz (depending on the model) which it assumes to be a standard ELF binary.

Downloading a Cobalt netboot image

Inside http://distfiles.gentoo.org/experimental/mips/historical/netboot/cobalt/ the necessary boot images for getting a Cobalt up and running are made available. The files will have the name nfsroot-KERNEL-COLO-DATE-cobalt.tar - select the most recent one and unpack it to / as shown below:

root #tar -C / -xvf nfsroot-2.6.13.4-1.19-20051122-cobalt.tar

NFS server configuration

Since this machine uses NFS to download its image, it is necessary to export /nfsroot/ on the server. Install the net-fs/nfs-utils package:

root #emerge --ask net-fs/nfs-utils

Once that is done, place the following in the /etc/exports file.

FILE /etc/exportsExporting the /nfsroot directory
/nfsroot      *(ro,sync)

Now, once that is done, start the NFS server:

root #/etc/init.d/nfs start

If the NFS server was already running at the time, tell it to take another look at its exports file using exportfs.

root #exportfs -av

DHCP configuration for a Cobalt machine

Now, the DHCP side of things is relatively straightforward. Add the following to the /etc/dhcp/dhcpd.conf file.

FILE /etc/dhcp/dhcpd.confSnippet for Cobalt server
subnet xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx {
  # ... usual stuff here ...
  
  # Configuration for a Cobalt Server
  # Set the hostname here:
  host qube {
    # Path to the nfsroot directory.
    # This is mainly for when using the TFTP boot option on CoLo
    # You shouldn't need to change this.
    option root-path "/nfsroot";
  
    # Cobalt server's ethernet MAC address
    hardware ethernet 00:10:e0:00:86:3d;
  
    # Server to download image from
    next-server 192.168.10.1;
  
    # IP address of Cobalt server
    fixed-address 192.168.10.2;
  
    # Location of the default.colo file relative to /nfsroot
    # You shouldn't need to change this.
    filename "default.colo";
  }
}

Starting daemons

Now start the daemons. Enter the following:

root #/etc/init.d/dhcp start
root #/etc/init.d/nfs start

If nothing went wrong in that last step all should be set to power on the workstation and proceed with the guide. If the DHCP server isn't firing up for whatever reason, try running dhcpd on the command line and see what it tells - if all is well, it should just fork into the background, otherwise it will show 'exiting.' just below its complaint.

Netbooting the Cobalt machine

Now it is time to fire up the Cobalt machine. Hook up the null modem cable, and set the serial terminal to use 115200 baud, 8 bits, no parity, 1 stop bit, VT100 emulation. Once that is done, hold down the left and right arrow buttons whilst powering the unit on.

The back panel should display "Net Booting", and some network activity should be visible, closely followed by CoLo kicking in. On the rear panel, scroll down the menu until the "Network (NFS)" option then press Enter. Notice that the machine starts booting on the serial console.

...
elf: 80080000 <-- 00001000 6586368t + 192624t
elf: entry 80328040
net: interface down
CPU revision is: 000028a0
FPU revision is: 000028a0
Primary instruction cache 32kB, physically tagged, 2-way, linesize 32 bytes.
Primary data cache 32kB 2-way, linesize 32 bytes.
Linux version 2.4.26-mipscvs-20040415 (root@khazad-dum) (gcc version 3.3.3...
Determined physical RAM map:
 memory: 08000000 @ 00000000 (usable)
Initial ramdisk at: 0x80392000 (3366912 bytes)
On node 0 totalpages: 32768
zone(0): 32768 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: console=ttyS0,115200 root=/dev/ram0
Calibrating delay loop... 249.85 BogoMIPS
Memory: 122512k/131072k available (2708k kernel code, 8560k reserved, 3424k dat)

A busybox ash shell will pop up as shown below, from which the Gentoo Linux installation can continue.

CODE When things are going right...
VFS: Mounted root (ext2 filesystem) readonly.
Freeing unused kernel memory: 280k freed
init started:  BusyBox v1.00-pre10 (2004.04.27-02:55+0000) multi-call binary
  
Gentoo Linux; http://www.gentoo.org/
 Copyright 2001-2004 Gentoo Technologies, Inc.; Distributed under the GPL
  
 Gentoo/MIPS Netboot for Cobalt Microserver Machines
 Build Date: April 26th, 2004
  
 * To configure networking, do the following:
  
 * For Static IP:
 * /bin/net-setup <IP Address> <Gateway Address> [telnet]
  
 * For Dynamic IP:
 * /bin/net-setup dhcp [telnet]
  
 * If you would like a telnetd daemon loaded as well, pass "telnet"
 * As the final argument to /bin/net-setup.
  
Please press Enter to activate this console.

Troubleshooting

If the machine is being stubborn and refusing to download its image, it can be one of two things:

  1. the instructions have not been followed correctly, or
  2. it needs a little gentle persuasion. (No, put that sledge hammer down!)

Here's a list of things to check:

  • dhcpd is giving the Cobalt Machine an IP Address. Notice messages about a BOOTP request in the system logs. tcpdump is also useful here.
  • Permissions are set properly in the /nfsroot/ folder (should be world readable).
  • Make sure the NFS server is running and exporting the /nfsroot/ directory. Check this using exportfs -v on the server.


インストール CD を用いる

On Silicon Graphics machines, it is possible to boot from a CD in order to install operating systems. (This is how one installs IRIX for instance) Recently, images for such bootable CDs to install Gentoo have been made possible. These CDs are designed to work in the same way.

At the moment the Gentoo/MIPS Live CD will only work on the SGI Indy, Indigo 2 and O2 workstations equipped with R4000 and R5000-series CPUs, however other platforms may be possible in future.

The Live CD images can be found under the experimental/mips/livecd/ directory on a Gentoo mirror.

Warning
These CDs are highly experimental at this time. They may or may not work at this time. Please report success or failures either on Bugzilla, this forum thread or in the #gentoo-mips IRC channel.


[[インストールについて|← <ul><li>The symbol "[[" was used in a place where it is not useful.</li> <!--br--><li>The part "]]" of the query was not understood.Results might not be as expected.</li></ul>|class=btn btn-default|title=Previous part]] Home [[ネットワーク設定|<ul><li>The symbol "[[" was used in a place where it is not useful.</li> <!--br--><li>The part "]]" of the query was not understood.Results might not be as expected.</li></ul> →|class=btn btn-default|title=Next part]]


MIPS ハンドブック
インストール
インストールについて
メディアの選択
ネットワーク設定
ディスクの準備
stage3のインストール
Gentooベースシステムのインストール
カーネルの設定
システムの設定
ツールのインストール
ブートローダの設定
締めくくり
Gentooの操作
Portageについて
USEフラグ
Portageの機能
Initスクリプトシステム
環境変数
Portageの操作
ファイルとディレクトリ
変数
ソフトウェアブランチの併用
追加ツール
カスタムPortageツリー
高度な機能
ネットワーク設定
はじめに
高度な設定
モジュール式ネットワーク
無線
機能の追加
動的な管理


ネットワークの自動検出

動いているかも?

もしあなたのシステムが、DHCPサーバを持つEthernetネットワークに接続されているなら、おそらく既にネットワーク設定は自動的に完了しているでしょう。その場合には、sshscppingirssiwgetlinksなど、インストールCDに含まれるネットワーク接続が必要な多くのコマンドはすぐに使うことができるでしょう。

インターフェース名を決定する

ifconfig コマンド

ネットワークが設定されているならば、ifconfigコマンドで、lo以外のネットワークインターフェースを一覧表示できるはずです。次の例ではeth0が見えています:

root #ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:BA:8F:61:7A
          inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::50:ba8f:617a/10 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1498792 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1284980 errors:0 dropped:0 overruns:0 carrier:0
          collisions:1984 txqueuelen:100
          RX bytes:485691215 (463.1 Mb)  TX bytes:123951388 (118.2 Mb)
          Interrupt:11 Base address:0xe800 

predictable network interface namesへ移行した結果、システム上のインターフェース名は古い命名規則によるeth0とはかなり違うものになっているかもしれません。最近のインストールメディアはeno0ens1enp5s0など、命名規則に則ったネットワークインターフェース名を表示するかもれません。ifconfigの出力から、あなたのローカルネットワーク上のIPアドレスが設定されたインターフェースを探してください。

Tip
標準の ifconfig コマンドを使ってインターフェースが表示されないなら、同コマンドを -a オプション付きで使ってみてください。このオプションは、システムが検出したすべてのネットワークインターフェースを、その状態が up であるか down であるかに関わらず、強制的に表示させます。ifconfig -a が何の効果もないのなら、ハードウェアに問題があるか、そのインターフェースのためのドライバがカーネルにロードされていないかです。どちらの状況も、このハンドブックの対象範囲を外れています。#gentoo に助けを求めてください。

ip コマンド

ifconfig の代替として、インターフェース名を決定するために ip コマンドが使えます。次の例に ip addr の出力を示します。別のシステムでの出力なので、表示される情報は前の例とは異なっています:

root #ip addr
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether e8:40:f2:ac:25:7a brd ff:ff:ff:ff:ff:ff
    inet 10.0.20.77/22 brd 10.0.23.255 scope global eno1
       valid_lft forever preferred_lft forever
    inet6 fe80::ea40:f2ff:feac:257a/64 scope link 
       valid_lft forever preferred_lft forever

この出力結果はさっきより少し分かりづらいかもしれません。この例でのインターフェース名は、番号のすぐ後ろに続いている、eno1 です。

以降、このドキュメントでは、扱っているネットワークインターフェース名はeth0であると仮定します。

追加可能: プロキシを設定する

プロキシを経由してインターネットにつなぐ場合には、インストール作業の中でプロキシ情報を設定する必要があります。プロキシを設定するのはとても簡単です:プロキシサーバ情報を変数に設定するだけです。

ほとんどの場合、プロキシサーバのホスト名を設定するだけで十分です。例えば、ホスト名はproxy.gentoo.org、ポート番号は8080であるとしましょう。

HTTPプロキシ(HTTPとHTTPS通信のため)を設定するには:

root #export http_proxy="http://proxy.gentoo.org:8080"

FTPプロキシを設定するには:

root #export ftp_proxy="ftp://proxy.gentoo.org:8080"

RSYNCプロキシを設定するには:

root #export RSYNC_PROXY="proxy.gentoo.org:8080"

ユーザ名とパスワードが必要ならば、次の構文で変数を設定します:

CODE ユーザ名とパスワードをプロキシ変数に追加する
http://username:password@proxy.gentoo.org:8080

ネットワークのテスト

あなたのISPのDNSサーバ(/etc/resolv.confで見つかります)と、好きなウェブサイトへのpingを試してみましょう。これにより、ネットワークが正常に機能しているか、ネットワークパケットがインターネットに到達できるか、DNS名前解決が正常に機能しているか、等のことを確認できます。

root #ping -c 3 www.gentoo.org

これがすべてうまくいくのなら、この章の残りの部分を読み飛ばして、インストールマニュアルの次のステップ(ディスクの準備)へ進むことができます。

自動でのネットワーク設定

起動しただけではネットワークが使えない場合は、インストールメディアにnet-setup(通常のネットワークや無線ネットワーク用)や、pppoe-setup(ADSL用)や、pptp (PPTP用)などのツールが含まれているなら、それらを使って設定できます。

お使いのインストールメディアがこれらのツールを含んでいない場合は、#手動でのネットワーク設定へ進んでください。

デフォルト: net-setupを使う

ネットワークが自動で設定されなかった場合に、ネットワークを設定するための最も簡単な方法がnet-setupスクリプトを実行することです:

root #net-setup eth0

net-setupはあなたのネットワーク環境について、いくつかの質問をします。すべてに答えると、ネットワーク接続が使えるようになるはずです。上に書いた方法でネットワークをテストしてください。すべてのテストをパスできたなら、おめでとうございます! この章の残りを飛ばしてディスクの準備へ進みましょう。

それでもネットワークが使えない場合は、#手動でのネットワーク設定へ進んでください。

代替案: PPPを使う

インターネットへの接続にPPPoEが必要なら、インストールCD(どのバージョンでも可)に含まれるpppが設定を楽にしてくれます。提供されるpppoe-setupスクリプトを使ってネットワークを設定しましょう。セットアップ中には、ADSLモデムに接続されたEthernetデバイスの名前、ユーザ名とパスワード、DNSサーバのIPアドレス、基本的なファイアウォールが必要かどうかが聞かれます。

root #pppoe-setup
root #pppoe-start

何かがおかしいときは、etc/ppp/pap-secretsまたは/etc/ppp/chap-secretsを見てユーザ名とパスワードが正しいかダブルチェックしてください。加えて、正しいEthernetデバイスを使っているか確認してください。もしEthernetデバイスが無い場合は、適切なネットワークモジュールをロードする必要があります。そのような場合には手動でのネットワーク設定へ進んでください。そこで適切なネットワークモジュールをロードする方法を説明します。

すべてうまくいったら、ディスクの準備へ進みましょう。

代替案: PPTPを使う

PPTPサポートが必要なら、インストールCDが提供するpptpclientを使ってください。でもその前に、設定が正しいか確認してください。/etc/ppp/pap-secretsまたは/etc/ppp/chap-secretsを編集して、正しいユーザ名/パスワードの組み合わせを設定してください。

root #nano -w /etc/ppp/chap-secrets

必要ならば/etc/ppp/options.pptpを修正してください:

root #nano -w /etc/ppp/options.pptp

これが全部終わったら、pptpを(options.pptpで設定できないオプションがあれば、それもいっしょに付けて)実行し、サーバに接続します:

root #pptp <server ip>

それではディスクの準備へ進みましょう。

手動でのネットワーク設定

適切なネットワークモジュールをロードする

インストールCDの起動時に、インストールCDはすべてのハードウェアデバイスを検出し、そのハードウェアをサポートする適切なカーネルモジュール(ドライバ)のロードを試みます。ほとんどの場合、この機能はとてもよくやってくれます。しかし稀に、必要なカーネルモジュールが自動でロードされないこともあります。

net-setupまたはpppoe-setupが失敗したという場合、ネットワークカードを起動時に見つけられなかった可能性があります。つまり、ユーザが適切なカーネルモジュールを手動でロードする必要があるかもしれません。

ネットワーク設定のためのカーネルモジュールの一覧を見るには、lsコマンドを使います:

root #ls /lib/modules/`uname -r`/kernel/drivers/net

お使いのネットワークデバイスのためのドライバがあった場合は、modprobeでカーネルモジュールをロードしましょう。例えば、pcnet32モジュールをロードするには:

root #modprobe pcnet32

ネットワークカードが検出されているかどうかチェックするには、ifconfigを使います。ネットワークカードが検出されていれば、以下のように表示されるでしょう(繰り返しますが、ここでのeth0は一例です):

root #ifconfig eth0
eth0      Link encap:Ethernet  HWaddr FE:FD:00:00:00:00  
          BROADCAST NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

しかし次のようなエラーが表示される場合、ネットワークカードは検出されていません:

root #ifconfig eth0
eth0: error fetching interface information: Device not found

現在のシステムで利用可能なネットワークインターフェース名は、/sysファイルシステムを通して一覧表示できます:

root #ls /sys/class/net
dummy0  eth0  lo  sit0  tap0  wlan0

上の例では、6個のインターフェースが見つかっています。eth0がおそらく(有線の)Ethernetアダプタで、wlan0は無線のアダプタです。

ネットワークカードがこれで検出できたとして、net-setupまたはpppoe-setupをもう一度試してください(今度はうまくいくはずです)。しかし上級者のために、手動でのネットワーク設定についても説明していきます。

あなたのネットワーク構成に応じて、次の節のうちからひとつを選んでください:

DHCPを使う

DHCP (Dynamic Host Configuration Protocol) を使うと、自動でネットワーク接続情報(IPアドレス、ネットマスク、ブロードキャストアドレス、ゲートウェイ、ネームサーバ、等)を受信することができます。この機能は、DHCPサーバがネットワーク内に存在しないと(または、ISPがDHCPサービスを提供していないと)動作しません。ネットワークインターフェースに接続情報を自動で受信させるようにするには、dhcpcdを使います:

root #dhcpcd eth0

DHCPサーバが提供するホスト名とドメイン名をシステムで使うようにと、ネットワーク管理者から要求されている場合もあるでしょう。そのような場合には:

root #dhcpcd -HD eth0

これが動作すれば(インターネット上のサーバ、例えばGoogleに、pingしてみましょう)、設定は完了です。次に進む準備ができました。この節の残りの部分を飛ばして、ディスクの準備に進みましょう。

無線接続を準備する

Note
iwコマンドの対応状況はアーキテクチャによって異なるかもしれません。このコマンドが使えない場合は、net-wireless/iwパッケージが作業中のアーキテクチャにおいて利用可能であるか確かめてください。net-wireless/iwパッケージがインストールされていないと、iwコマンドを使用することはできないでしょう。

無線(802.11)カードを使っている場合には、まず第一に無線の設定をする必要があります。無線カードの現在の設定を確認するためには、iwを使うことができます。iwはこのようなものを表示するでしょう:

root #iw dev wlp9s0 info
Interface wlp9s0
	ifindex 3
	wdev 0x1
	addr 00:00:00:00:00:00
	type managed
	wiphy 0
	channel 11 (2462 MHz), width: 20 MHz (no HT), center1: 2462 MHz
	txpower 30.00 dBm

現在の接続を確認するには:

root #iw dev wlp9s0 link
Not connected.

または

root #iw dev wlp9s0 link
Connected to 00:00:00:00:00:00 (on wlp9s0)
	SSID: GentooNode
	freq: 2462
	RX: 3279 bytes (25 packets)
	TX: 1049 bytes (7 packets)
	signal: -23 dBm
	tx bitrate: 1.0 MBit/s
Note
無線カードのデバイス名は、wlp9s0の代わりにwlan0またはra0のような名前かもしれません。正しいデバイス名を調べるには、ip linkを実行してください。

ほとんどのユーザにとって、接続するのに必要な設定は、ESSID(無線ネットワーク名とも言います)と、場合によってはWEPキー、この2つだけです。

  • まず、インターフェースがアクティブになっていることを確認してください:
root #ip link set dev wlp9s0 up
  • GentooNodeという名前のオープンネットワークに接続するには:
root #iw dev wlp9s0 connect -w GentooNode
  • 16進WEPキーを使って接続するには、キーの前にd:を付けてください:
root #iw dev wlp9s0 connect -w GentooNode key 0:d:1234123412341234abcd
  • ASCII WEPキーで接続するには:
root #iw dev wlp9s0 connect -w GentooNode key 0:some-password
Note
無線ネットワークがWPAまたはWPA2で設定されている場合には、wpa_supplicantを使う必要があります。Gentoo Linuxでのネットワーク設定のさらなる情報については、Gentooハンドブックの無線ネットワークの章を読んでください。

iw dev wlp9s0 linkを使って、無線の設定ができたか確認してください。無線が機能したら、次節(ネットワーク用語を理解する)に示す、IPレベルのネットワークオプションの設定に進むか、先に示したnet-setupツールを使ってください。

ネットワーク用語を理解する

Note
IPアドレス、ブロードキャストアドレス、ネットマスクやネームサーバーのことを知っているなら、このサブセクションを飛ばして ifconfigrouteを使うに進んでください。

もし上記のすべてが失敗したら、ネットワークは手動で設定される必要があります。これは少しも難しくありませんが、幾ばくかのネットワーク用語と基礎的な概念の知識は必要でしょう。この章を読んだあとには、ユーザーはゲートウェイが何で、ネットマスクがなんの役に立っていて、ブロードキャストアドレスがどのように作られてなぜシステムがネームサーバーを必要とするのかがわかるでしょう。

ネットワーク内部では、ホストはIPアドレス(インターネットプロトコルアドレス)によって識別されます。少なくともIPv4 (IP バージョン4)を使うときは、そのようなアドレスは0から255の間の4つの数字の組み合わせです。実際は、IPv4アドレスは32ビット(0と1の集合)からできています。例をみてみましょう。

CODE IPv4アドレスの例
IP Address (数字):   192.168.0.2
IP Address (ビット): 11000000 10101000 00000000 00000010
                        -------- -------- -------- --------
                           192      168       0        2
Note
IPv4の後継であるIPv6は128ビット(0と1の集合)を使っています。この章ではIPv4アドレスに焦点を合わせています。

そのようなIPアドレスはすべての接続可能なネットワークが関わっている範囲で一意に定まっています。つまり到達可能でありたいホストはどれも、唯一なIPアドレスを持たなければならないということです。ネットワークの内部と外部を区別するために、IPアドレスはネットワーク部とホスト部の2つの部分に分かれています。

0の並びのあとに1の並びが続くネットマスクによって、その分かれ目は記録されています。1が位置しているIPの部分はネットワーク部で、そうでない部分はホスト部です。普通は、ネットマスクはIPアドレスとして記録されるでしょう。

CODE ネットワークとホストの分離の例
IP address:    192      168      0         2
            11000000 10101000 00000000 00000010
Netmask:    11111111 11111111 11111111 00000000
               255      255     255        0
           +--------------------------+--------+
                    Network              Host

言い換えると、192.168.0.14は例のネットワークの一部ですが、192.168.1.2はそうではありません。

ブロードキャストアドレスは、ネットワークと同じネットワーク部を持ち、ホスト部がすべて1であるようなIPアドレスです。同じネットワーク上にあるすべてのホストは、このIPアドレスで通信を受けられます。このアドレスは、パケットをブロードキャストするためだけに存在します。

CODE ブロードキャストアドレス
IP address:    192      168      0         2
            11000000 10101000 00000000 00000010
Broadcast:  11000000 10101000 00000000 11111111
               192      168      0        255
           +--------------------------+--------+
                     Network             Host

インターネットに接続するためには、ネットワーク内のそれぞれのコンピュータは、どのホストがインターネット接続を共有してくれるのかを知っている必要があります。そのようなホストをゲートウェイといいます。ゲートウェイも普通のホストなので、普通のIPアドレスを持っています(例: 192.168.0.1)。

最初に、すべてのホストは一意にIPアドレスを持つと書きました。ホストを(IPアドレスの代わりに)名前で指定できるようにするためには、名前(例: dev.gentoo.org)をIPアドレス(例: 64.5.62.82)に変換するサービスが必要になります。このようなサービスを「ネームサービス」といいます。ネームサービスを利用するには、ネームサーバを/etc/resolv.conf内に定義しておく必要があります。

ゲートウェイがネームサーバを兼ねていることもあります。そうでない場合には、ISPが提供するネームサーバをこのファイルに書く必要があります。

まとめると、続けるには次の情報が必要になります:

ネットワーク設定項目
システムのIPアドレス 192.168.0.2
ネットマスク 255.255.255.0
ブロードキャスト 192.168.0.255
ゲートウェイ 192.168.0.1
ネームサーバ 195.130.130.5, 195.130.130.133

ifconfigとrouteを使う

3つのステップでネットワークの設定ができます。

  1. ifconfigを使ってIPアドレスを割り当てる
  2. routeを使ってゲートウェイへのルーティングを設定する
  3. ネームサーバのIPアドレスを/etc/resolv.confに書いて完了

IPアドレスを割り当てるには、IPアドレス、ブロードキャストアドレス、ネットマスクの情報が必要になります。${IP_ADDR}を正しいIPアドレスに、${BROADCAST}を正しいブロードキャストアドレスに、${NETMASK}を正しいネットマスクに置き換えて、次のコマンドを実行してください:

root #ifconfig eth0 ${IP_ADDR} broadcast ${BROADCAST} netmask ${NETMASK} up

routeを使ってルーティングの設定を行います。${GATEWAY}を正しいゲートウェイのIPアドレスに置き換えてください:

root #route add default gw ${GATEWAY}

/etc/resolv.confを開いてください:

root #nano -w /etc/resolv.conf

次のテンプレートを使って、ネームサーバの情報を入力してください。${NAMESERVER1}${NAMESERVER2}は正しいネームサーバのアドレスに置き換えてください:

CODE /etc/resolv.conf 用のデフォルトテンプレート
nameserver ${NAMESERVER1}
nameserver ${NAMESERVER2}

これで終わりです。インターネット上のサーバ(Googleなど)にpingをして、ネットワークのテストを行ってください。うまくいったなら、おめでとうございます。ディスクの準備へ進んでください。




MIPS ハンドブック
インストール
インストールについて
メディアの選択
ネットワーク設定
ディスクの準備
stage3のインストール
Gentooベースシステムのインストール
カーネルの設定
システムの設定
ツールのインストール
ブートローダの設定
締めくくり
Gentooの操作
Portageについて
USEフラグ
Portageの機能
Initスクリプトシステム
環境変数
Portageの操作
ファイルとディレクトリ
変数
ソフトウェアブランチの併用
追加ツール
カスタムPortageツリー
高度な機能
ネットワーク設定
はじめに
高度な設定
モジュール式ネットワーク
無線
機能の追加
動的な管理


ブロックデバイスの概要

ブロックデバイス

Gentoo Linuxの、そしてLinux一般の、Linuxファイルシステム、パーティション、ブロックデバイスを含めた、ディスク中心の考え方について詳しく見てみましょう。ディスクの入出力とファイルシステムについて理解することで、Gentoo Linuxインストールのためのパーティションとファイルシステムを構築できるようになります。

まずはブロックデバイスについて見ていきます。最も有名なブロックデバイスはおそらく、Linuxシステム上で1番目のドライブを表す、/dev/sdaでしょう。SCSIとSerial ATAドライブは/dev/sd*と名付けられます。より新しいlibataフレームワークがカーネルに組み込まれていれば、IDEデバイスも/dev/sd*と名付けられます。古いデバイスフレームワークを使っていれば、1番目のIDEドライブは/dev/hdaになるでしょう。

上のブロックデバイスは、ディスクへの抽象的なインターフェースを表しています。ユーザープログラムはこれらのブロックデバイスを用いて、デバイスがIDE、SCSI、もしくは他のものであるかどうかを心配することなしにディスクと通信することができます。プログラムは容易にディスク上の記憶領域を、ランダムアクセスできる512バイトごとの連続領域としてアドレッシングできます。


パーティション

Although it is theoretically possible to use a full disk to house your Linux system, this is almost never done in practice. Instead, full disk block devices are split up in smaller, more manageable block devices. These are called partitions.

Designing a partition scheme

How many partitions and how big?

The number of partitions is highly dependent on the environment. For instance, if there are lots of users, then it is advised to have /home/ separate as it increases security and makes backups easier. If Gentoo is being installed to perform as a mail server, then /var/ should be separate as all mails are stored inside /var/. A good choice of filesystem will then maximize the performance. Game servers will have a separate /opt/ as most gaming servers are installed there. The reason is similar for the /home/ directory: security and backups. In most situations, /usr/ is to be kept big: not only will it contain the majority of applications, it typically also hosts the Gentoo ebuild repository (by default located at /usr/portage) which already takes around 650 MiB. This disk space estimate excludes the packages/ and distfiles/ directories that are generally stored within this ebuild repository.

It very much depends on what the administrator wants to achieve. Separate partitions or volumes have the following advantages:

  • Choose the best performing filesystem for each partition or volume.
  • The entire system cannot run out of free space if one defunct tool is continuously writing files to a partition or volume.
  • If necessary, file system checks are reduced in time, as multiple checks can be done in parallel (although this advantage is more with multiple disks than it is with multiple partitions).
  • Security can be enhanced by mounting some partitions or volumes read-only, nosuid (setuid bits are ignored), noexec (executable bits are ignored) etc.

However, multiple partitions have disadvantages as well. If not configured properly, the system might have lots of free space on one partition and none on another. Another nuisance is that separate partitions - especially for important mount points like /usr/ or /var/ - often require the administrator to boot with an initramfs to mount the partition before other boot scripts start. This isn't always the case though, so results may vary.

There is also a 15-partition limit for SCSI and SATA unless the disk uses GPT labels.

What about swap space?

There is no perfect value for the swap partition. The purpose of swap space is to provide disk storage to the kernel when internal memory (RAM) is under pressure. A swap space allows for the kernel to move memory pages that are not likely to be accessed soon to disk (swap or page-out), freeing memory. Of course, if that memory is suddenly needed, these pages need to be put back in memory (page-in) which will take a while (as disks are very slow compared to internal memory).

When the system is not going to run memory intensive applications or the system has lots of memory available, then it probably does not need much swap space. However, swap space is also used to store the entire memory in case of hibernation. If the system is going to need hibernation, then a bigger swap space is necessary, often at least the amount of memory installed in the system.


fdisk を用いる

SGI machines: Creating an SGI disk label

All disks in an SGI System require an SGI Disk Label, which serves a similar function as Sun & MS-DOS disklabels -- It stores information about the disk partitions. Creating a new SGI Disk Label will create two special partitions on the disk:

  • SGI Volume Header (9th partition): This partition is important. It is where the bootloader will reside, and in some cases, it will also contain the kernel images.
  • SGI Volume (11th partition): This partition is similar in purpose to the Sun Disklabel's third partition of "Whole Disk". This partition spans the entire disk, and should be left untouched. It serves no special purpose other than to assist the PROM in some undocumented fashion (or it is used by IRIX in some way).
Warning
The SGI Volume Header must begin at cylinder 0. Failure to do so means a failure to boot from the disk.

The following is an example excerpt from an fdisk session. Read and tailor it to personal preference...

root #fdisk /dev/sda

Switch to expert mode:

Command (m for help):x

With m the full menu of options is displayed:

Expert command (m for help):m
Command action
   b   move beginning of data in a partition
   c   change number of cylinders
   d   print the raw data in the partition table
   e   list extended partitions
   f   fix partition order
   g   create an IRIX (SGI) partition table
   h   change number of heads
   m   print this menu
   p   print the partition table
   q   quit without saving changes
   r   return to main menu
   s   change number of sectors/track
   v   verify the partition table
   w   write table to disk and exit

Build an SGI disk label:

Expert command (m for help):g
Building a new SGI disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content will be irrecoverably lost.

Return to the main menu:

Expert command (m for help):r

Take a look at the current partition layout:

Command (m for help):p
Disk /dev/sda (SGI disk label): 64 heads, 32 sectors, 17482 cylinders
Units = cylinders of 2048 * 512 bytes
  
----- partitions -----
Pt#     Device  Info     Start       End   Sectors  Id  System
 9:  /dev/sda1               0         4     10240   0  SGI volhdr
11:  /dev/sda2               0     17481  35803136   6  SGI volume
----- Bootinfo -----
Bootfile: /unix
----- Directory Entries -----
Note
If the disk already has an existing SGI Disklabel, then fdisk will not allow the creation of a new label. There are two ways around this. One is to create a Sun or MS-DOS disklabel, write the changes to disk, and restart fdisk. The second is to overwrite the partition table with null data via the following command: dd if=/dev/zero of=/dev/sda bs=512 count=1

Resizing the SGI volume header

Important
This step is often needed, due to a bug in fdisk. For some reason, the volume header isn't created correctly, the end result being it starts and ends on cylinder 0. This prevents multiple partitions from being created. To get around this issue... read on.

Now that an SGI Disklabel is created, partitions may now be defined. In the above example, there are already two partitions defined. These are the special partitions mentioned above and should not normally be altered. However, for installing Gentoo, we'll need to load a bootloader, and possibly multiple kernel images (depending on system type) directly into the volume header. The volume header itself can hold up to eight images of any size, with each image allowed eight-character names.

The process of making the volume header larger isn't exactly straight-forward; there's a bit of a trick to it. One cannot simply delete and re-add the volume header due to odd fdisk behavior. In the example provided below, we'll create a 50MB Volume header in conjunction with a 50MB /boot/ partition. The actual layout of a disk may vary, but this is for illustrative purposes only.

Create a new partition:

Command (m for help):n
Partition number (1-16): 1
First cylinder (5-8682, default 5): 51
 Last cylinder (51-8682, default 8682): 101

Notice how fdisk only allows Partition #1 to be re-created starting at a minimum of cylinder 5? If we attempted to delete & re-create the SGI Volume Header this way, this is the same issue we would have encountered. In our example, we want /boot/ to be 50MB, so we start it at cylinder 51 (the Volume Header needs to start at cylinder 0, remember?), and set its ending cylinder to 101, which will roughly be 50MB (+/- 1-5MB).

Delete the partition:

Command (m for help):d
Partition number (1-16): 9

Now recreate it:

Command (m for help):n
Partition number (1-16): 9
First cylinder (0-50, default 0): 0
 Last cylinder (0-50, default 50): 50

If unsure how to use fdisk have a look down further at the instructions for partitioning on Cobalts. The concepts are exactly the same -- just remember to leave the volume header and whole disk partitions alone.

Once this is done, create the rest of your partitions as needed. After all the partitions are laid out, make sure to set the partition ID of the swap partition to 82, which is Linux Swap. By default, it will be 83, Linux Native.

Partitioning Cobalt drives

On Cobalt machines, the BOOTROM expects to see a MS-DOS MBR, so partitioning the drive is relatively straightforward -- in fact, it's done the same way as done for an Intel x86 machine. However there are some things you need to bear in mind.

  • Cobalt firmware will expect /dev/sda1 to be a Linux partition formatted EXT2 Revision 0. EXT2 Revision 1 partitions will NOT WORK! (The Cobalt BOOTROM only understands EXT2r0)
  • The above said partition must contain a gzipped ELF image, vmlinux.gz in the root of that partition, which it loads as the kernel

For that reason, it is recommended to create a ~20MB /boot/ partition formatted EXT2r0 upon which to install CoLo & kernels. This allows the user to run a modern filesystem (EXT3 or ReiserFS) for the root filesystem.

In the example, it is assumed that /dev/sda1 is created to mount later as a /boot/ partition. To make this /, keep the PROM's expectations in mind.

So, continuing on... To create the partitions type fdisk /dev/sda at the prompt. The main commands to know are these:

CODE List of important fdisk commands
    o: Wipe out old partition table, starting with an empty MS-DOS partition table
    n: New Partition
    t: Change Partition Type
        Use type 82 for Linux Swap, 83 for Linux FS
    d: Delete a partition
    p: Display (print) Partition Table
    q: Quit -- leaving old partition table as is.
    w: Quit -- writing partition table in the process.
root #fdisk /dev/sda
The number of cylinders for this disk is set to 19870.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Start by clearing out any existing partitions:

Command (m for help):o
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
  
  
The number of cylinders for this disk is set to 19870.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Now verify the partition table is empty using the p command:

Command (m for help):p
Disk /dev/sda: 10.2 GB, 10254827520 bytes
16 heads, 63 sectors/track, 19870 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
  
   Device Boot      Start         End      Blocks   Id  System

Create the /boot partition:

Command (m for help):n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-19870, default 1):
Last cylinder or +size or +sizeM or +sizeK (1-19870, default 19870): +20M

When printing the partitions, notice the newly created one:

Command (m for help):p
Disk /dev/sda: 10.2 GB, 10254827520 bytes
16 heads, 63 sectors/track, 19870 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
  
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          40       20128+  83  Linux

Let's now create an extended partition that covers the remainder of the disk. In that extended partition, we'll create the rest (logical partitions):

Command (m for help):n
Command action
   e   extended
   p   primary partition (1-4)
e
Partition number (1-4): 2
First cylinder (41-19870, default 41):
Using default value 41
Last cylinder or +size or +sizeM or +sizeK (41-19870, default 19870):
Using default value 19870

Now we create the / partition, /usr, /var, et.

Command (m for help):n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (41-19870, default 41):<Press ENTER>
Using default value 41
Last cylinder or +size or +sizeM or +sizeK (41-19870, default 19870): +500M

Repeat this as needed.

Last but not least, the swap space. It is recommended to have at least 250MB swap, preferrably 1GB:

Command (m for help):n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (17294-19870, default 17294): <Press ENTER>
Using default value 17294
Last cylinder or +size or +sizeM or +sizeK (1011-19870, default 19870): <Press ENTER>
Using default value 19870

When checking the partition table, everything should be ready - one thing notwithstanding.

Command (m for help):p
Disk /dev/sda: 10.2 GB, 10254827520 bytes
16 heads, 63 sectors/track, 19870 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
  
Device Boot      Start         End      Blocks      ID  System
/dev/sda1               1          21       10552+  83  Linux
/dev/sda2              22       19870    10003896    5  Extended
/dev/sda5              22        1037      512032+  83  Linux
/dev/sda6            1038        5101     2048224+  83  Linux
/dev/sda7            5102        9165     2048224+  83  Linux
/dev/sda8            9166       13229     2048224+  83  Linux
/dev/sda9           13230       17293     2048224+  83  Linux
/dev/sda10          17294       19870     1298776+  83  Linux

Notice how #10, the swap partition is still type 83? Let's change that to the proper type:

Command (m for help):t
Partition number (1-10): 10
Hex code (type L to list codes): 82
Changed system type of partition 10 to 82 (Linux swap)

Now verify:

Command (m for help):p
Disk /dev/sda: 10.2 GB, 10254827520 bytes
16 heads, 63 sectors/track, 19870 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
  
Device Boot      Start         End      Blocks      ID  System
/dev/sda1               1          21       10552+  83  Linux
/dev/sda2              22       19870    10003896    5  Extended
/dev/sda5              22        1037      512032+  83  Linux
/dev/sda6            1038        5101     2048224+  83  Linux
/dev/sda7            5102        9165     2048224+  83  Linux
/dev/sda8            9166       13229     2048224+  83  Linux
/dev/sda9           13230       17293     2048224+  83  Linux
/dev/sda10          17294       19870     1298776+  82  Linux Swap

We write out the new partition table:

Command (m for help):w
The partition table has been altered!
  
Calling ioctl() to re-read partition table.
Syncing disks.


ファイルシステムを作成する

はじめに

パーティションが作成できたら、その上にファイルシステムを作成します。次の節ではLinuxがサポートする各種ファイルシステムを紹介します。どのファイルシステムを使うかをすでに決めているなら、パーティションにファイルシステムを適用するへ進みましょう。そうでなければ、次の節を読んで利用可能なファイルシステムについて知るのがよいでしょう。

ファイルシステム

利用可能なファイルシステムは複数あります。そのうちいくつかはアーキテクチャmips上で安定して動作するとされています--重要なパーティションに実験的なファイルシステムを選択するときは、事前にファイルシステムのサポート状況を十分に知っておくことを推奨します。

btrfs
スナップショット、チェックサムによる自己修復、透過的圧縮、サブボリューム、RAIDの統合など、多くの先進機能を提供する次世代のファイルシステムです。いくつかのディストリビューションはこれをすぐに使えるオプションとして提供し始めていますが、未だ製品に使える状態ではありません。ファイルシステムが壊れたという報告はよくあります。開発者はユーザーに、安全のため最新のカーネルバージョンを使うようしきりに促しています。古いカーネルには既知の問題があるからです。この状況は何年も続いており、事態が変わってきたと判断するには早すぎます。問題への修正が古いカーネルにバックポートされることは滅多にありません。このファイルシステムを使う際は十分注意を払うようにしてください。
ext2
試練を受けた本当のLinuxファイルシステムですが、メタデータジャーナリングがないため、起動時に行われる毎回のext2ファイルシステムチェックは時間のかかるものになります。今ではジャーナルの効く新世代の、整合性を非常に素早くチェックできるファイルシステムの選択肢が数多くありますから、一般的にはそちらのほうが、ジャーナルの効かない対抗馬より好まれます。ジャーナルの効くファイルシステムは、システム起動の際たまたまファイルシステムに不整合があった場合の長い遅延を防いでくれます。
ext3
ジャーナルが有効になった ext2 ファイルシステムであり、full data及びordered dataジャーナリングといった強力なジャーナリングモードに加え、高速な修復のためのメタデータジャーナリングをサポートします。HTreeインデックスによって、ほぼすべての状況で高いパフォーマンスが可能になります。簡単にいえば、ext3 はとても優れた信頼できるファイルシステムです。
ext4
もともと ext3 のフォークとして作られた ext4 は、新機能、パフォーマンスの向上と、ディスク上でのフォーマットの適度な変更による、サイズ制限の撤廃を提供します。ボリュームは1EBまで広げることができ、最大のファイルサイズは16TBです。古典的なext2/3のbitmap block割当ての代わりに、ext4 はextentを使い、大きなファイルでのパフォーマンスを向上し、断片化を減らしています。ext4は他にもより洗練されたアロケーションアルゴリズム(遅延割当てと複数ブロック割当て)を提供し、ファイルシステムドライバーに、ディスク上のデータのレイアウトを最適化するより多くの方法を与えています。ext4 は推奨される、全目的、全プラットフォームのファイルシステムです。
f2fs
Flash-Friendly File Systemはもともと、SamsungによってNANDフラッシュメモリで利用するために作られました。2016年Q2現在、このファイルシステムはまだ未熟なものと思われますが、GentooをmicroSDカードやUSBスティックや他のフラッシュベースの記憶装置にインストールする際にはすばらしい選択でしょう。
JFS
IBMの高パフォーマンスジャーナリングファイルシステムです。JFSは軽量、高速かつ信頼できる、B+木ベースのファイルシステムで、様々な条件で良いパフォーマンスが出ます。
ReiserFS
B+木ベースのジャーナルが有効なファイルシステムで、全体的に良いパフォーマンスが出ます。特に、大量の小さなファイルを扱う際は、CPUサイクルを多く消費するものの、高いパフォーマンスを得ることができます。ReiserFSは他のファイルシステムと比べるとあまり保守されていないように思われます。
XFS
メタデータジャーナリングのあるファイルシステムで、堅牢な機能セットを持ち、スケーラビリティに最適化されています。XFSはどうやら、様々なハードウェアの問題に対してはあまり寛大ではないようです。
vfat
別名FAT32。Linuxでサポートされていますが、いかなるパーミッションの設定もサポートされていません。ほとんど、他のOS(主にMicrosoft Windows)との相互運用性のために使われていますが、いくつかのシステムファームウェア(たとえばUEFI)でも必要になります。
NTFS
この "New Technology" ファイルシステムは、Microsoft Windowsのフラッグシップファイルシステムです。上記のvfatと同様、BSDやLinuxが正しく動作するために必要なパーミッション設定や拡張属性を保持しないため、ルートファイルシステムとして使うことはできません。Microsoft Windowsとの相互運用のためにのみ使うべきです(「のみ」の強調に注意してください)。

ext2、ext3、ext4を(8GB以下の)小さいパーティションに使用するときは、十分なinode数を確保できるように適切なオプションを指定してファイルシステムを作成する必要があります。mke2fs (mkfs.ext2)アプリケーションは、「inodeあたりのバイト数」を指定することで、ファイルシステムが持つべきinode数を計算することができます。もっと小さいパーティションでは、計算されたinode数よりも大きい値を設定するとよいでしょう。

ext2では、これは次のコマンドで実行できます:

root #mkfs.ext2 -T small /dev/<device>

ext3とext4では、ジャーナリングを有効にするために-jオプションを追加しましょう:

root #mkfs.ext2 -j -T small /dev/<device>

上のコマンドは通常では、「inodeあたりのバイト数」を16kBから4kBに減らすので、ファイルシステムに4倍のinode数を確保できます。比率を指定することで、さらに細かく調節することもできます:

root #mkfs.ext2 -i <ratio> /dev/<device>

パーティションにファイルシステムを適用する

パーティションまたはボリュームの上にファイルシステムを作成するには、ファイルシステムごとに異なるユーザースペースのユーティリティが利用可能です。下表でファイルシステムの名前をクリックすると、それぞれに追加の情報が得られます:

ファイルシステム 作成コマンド Minimal CD にある? パッケージ
btrfs mkfs.btrfs はい sys-fs/btrfs-progs
ext2 mkfs.ext2 はい sys-fs/e2fsprogs
ext3 mkfs.ext3 はい sys-fs/e2fsprogs
ext4 mkfs.ext4 はい sys-fs/e2fsprogs
f2fs mkfs.f2fs はい sys-fs/f2fs-tools
jfs mkfs.jfs はい sys-fs/jfsutils
reiserfs mkfs.reiserfs はい sys-fs/reiserfsprogs
xfs mkfs.xfs はい sys-fs/xfsprogs
vfat mkfs.vfat はい sys-fs/dosfstools
NTFS mkfs.ntfs はい sys-fs/ntfs3g

例えば、パーティション構造例の通りに、ブートパーティション(/dev/sda1)をext2に、ルートパーティション(/dev/sda5)をext4に設定するには、次のコマンドが使えます:

root #mkfs.ext2 /dev/sda1
root #mkfs.ext4 /dev/sda5

それでは、新しく作成したパーティション(または論理ボリューム)にファイルシステムを作成しましょう。

スワップパーティションを有効にする

mkswapはスワップパーティションを初期化するために使われるコマンドです:

root #mkswap /dev/sda10

スワップパーティションを有効化するには、swaponを使います:

root #swapon /dev/sda10

上述のコマンドで、スワップを作成して有効化しましょう。

マウント

パーティションが初期化され、ファイルシステムを格納したので、それらのパーティションをマウントする時です。 mount コマンドを使用しますが、作成されたすべてのパーティションに必要なマウントディレクトリを作成することを忘れないでください。例として、 root と boot パーティションをマウントします。

root #mount /dev/sda5 /mnt/gentoo
root #mkdir /mnt/gentoo/boot
root #mount /dev/sda1 /mnt/gentoo/boot
Note
もし/tmp/を別のパーティションに置く必要があるなら、マウントしたあと権限の変更を忘れずに行ってください:
root #chmod 1777 /mnt/gentoo/tmp
/var/tmpについても同様です。

このあと解説の中で、proc ファイルシステム(仮想的なカーネルとのインターフェース)が、他のカーネル擬似ファイルシステムと同様にマウントされますが、まず最初は、Gentooインストールファイルをインストールします。




MIPS ハンドブック
インストール
インストールについて
メディアの選択
ネットワーク設定
ディスクの準備
stage3のインストール
Gentooベースシステムのインストール
カーネルの設定
システムの設定
ツールのインストール
ブートローダの設定
締めくくり
Gentooの操作
Portageについて
USEフラグ
Portageの機能
Initスクリプトシステム
環境変数
Portageの操作
ファイルとディレクトリ
変数
ソフトウェアブランチの併用
追加ツール
カスタムPortageツリー
高度な機能
ネットワーク設定
はじめに
高度な設定
モジュール式ネットワーク
無線
機能の追加
動的な管理


stage tarballをインストールする

日時を設定する

Gentoo をインストールする前に、日付と時刻が正しく設定されていることを確認するといいでしょう。時刻が正しく設定されていないと、おかしな結果を導くかもしれません。例えば、ベースシステムのファイルは、タイムスタンプを正確に保ったまま展開されるべきです。実際、いくつかのウェブサイトやウェブサービスでは暗号化された通信(SSL/TLS)を利用しているため、システム時刻があまりにもずれていると、インストール用ファイルをまったくダウンロードできないということもありえます!

date コマンドを実行して、現在の日付と時刻が正しいか確認してください。

root #date
Mon Oct  3 13:16:22 PDT 2016

表示された日時が間違っていたら、以下に示す方法に従って、自動または手動で更新してください。

Note
リアルタイムクロック(RTC)を搭載していないマザーボードでは、自動的にシステム時刻を時刻サーバと同期するように設定するべきでしょう。これはRTCを搭載しているけれど、バッテリーがだめになってしまったシステムについてもいえます。

自動

公式 Gentoo インストールメディアには、ntpd コマンド(net-misc/ntp パッケージを通して利用可能です)が含まれています。公式メディアには、 ntp.org 時刻サーバを指定した設定ファイルも含まれています。これによって、時刻サーバを利用して、システム時刻を UTC 時刻と自動で同期することができます。この方法はネットワーク設定を必要とし、アーキテクチャによっては利用できないかもしれません。

Warning
自動時刻同期によって犠牲になるものもあります。例えば、システムのIPアドレスや、関連するネットワークの情報が、時刻サーバ(下の例では ntp.org)に明らかにされます。プライバシーが心配なユーザーは、下記の方法でシステム時刻を設定する前に、このことを理解しておくべきです。
root #ntpd -q -g

手動

date コマンドはシステム時刻を手動設定するのにも使えます。MMDDhhmmYYYY(月(MM)、日(DD)、時(hh)、分(mm)、年(YYYY))という形式で日時を更新してください。

すべての Linux システムでは UTC で時刻を設定することが推奨されます。タイムゾーンはインストール中にあとで設定します。タイムゾーンを設定すると、時刻の表示がローカル時刻に切り替わります。

例えば、2016年の10月3日 13時16分に設定するには以下のようにします。

root #date 100313162016

stage tarballを選択する

multilib (32ビットと64ビット)

ベースとなるtarballを適切に選ぶことで、この後に続くインストールプロセスの相当な時間を短縮できます。特に適切なプロファイルを選ぶで効果があります。ステージtarballの選択はこの後のシステム設定に直接影響し、頭痛の種もしくはtwo later on down the lineを減らします。multilib tarballは64ビットのライブラリを使えるときはそれを使用し、互換性を必要とする場合は32ビットのライブラリを使用します。これはインストールされるほとんどのソフトにとってすばらしい選択肢となります。プロファイルを簡単に変更できるシステムが必要な場合は、そのプロセッサアーキテクチャにあったmultilib tarballをダウンロードしなければなりません。

大部分のユーザは、'advanced'なtar ballを選択すべきではありません。これらは特定のソフトウェアもしくはハードウェアのみに必要です。

非multilib (64ビットのみ)

システムのベースとして非multilibのtarballを選択することで、完全な64ビット環境を構築できます。これは事実上、multilibプロファイルへの変更を(可能ではありますが)困難にします。非mutilibを必要とする明確な理由がなく、単にGentooを使いたいというケースでは、非multilibを選択すべきではありません。

警告
非multilibからmutilibシステムへの変更は、Gentooの深い知識と低レベルのツールチェーンが必要だということを忘れないでください(これはおそらく私たちのToolchain developersを身震いさせるでしょう)。これは気の弱い人への警告ではなく、このガイドの範囲外になるということです。

stage tarball をダウンロードする

ルートファイルシステムがマウントされている場所、Gentooのマウントポイント(おそらく/mnt/gentoo)に移動してください。

root #cd /mnt/gentoo

インストールメディアを使ってstage tarballをダウンロードするのに必要なたった1つのツールが、ウェブブラウザです。

グラフィカルブラウザ

完全なグラフィカルウェブブラウザがある環境を使っているひとには、stageファイルのURLをメインウェブサイトのダウンロードセクションからコピーするのに何の問題も無いでしょう。単純に適切なタブを選択して、stageファイルへのリンクを右クリックして、Copy link address (Firefox) または Copy link location (Chromium)してクリップボードにリンクをコピーして、コマンドライン上でwgetユーティリティにリンクをペーストして、stage tarballをダウンロードします。

root #wget <PASTED_STAGE_URL>

コマンドラインブラウザ

伝統的な読者や'古参'のGentooユーザで、コマンドラインのみで作業をする人たちは、グラフィカル環境を必要としないメニュー形式のブラウザであるlinksを使うほうを好むかもしれません。stageをダウンロードするために、Gentooミラーリストに飛んでください。

root #links https://www.gentoo.org/downloads/mirrors/

linksでHTTPプロキシを使うには、-http-proxyオプションにプロキシのURLを渡してください。

root #links -http-proxy proxy.server.com:8080 https://www.gentoo.org/downloads/mirrors/

linksに似たlynxというブラウザもあります。linksと同じくグラフィカル環境を必要としませんが、メニューはありません。

root #lynx https://www.gentoo.org/downloads/mirrors/

プロキシを定義する必要があるならば、http_proxyftp_proxy変数をexportしてください。

root #export http_proxy="http://proxy.server.com:port"
root #export ftp_proxy="http://proxy.server.com:port"

ミラーリストから、近くのミラーを選んでください。通常はHTTPミラーで十分ですが、他のプロトコルも使えます。releases/mips/autobuilds/ ディレクトリに移動してください。入手可能なすべてのstageファイルが列挙されています。ファイルは、サブアーキテクチャにちなんだ名前のサブティレクトリの中にあることもあります。ファイルを選び、dを押してダウンロードしてください。

stageファイルのダウンロードが完了したら、整合性を検証してstage tarballのコンテンツが正当か確認することができます。興味のあるひとは次節へ進んでください。

stageファイルの検証と確認に興味が無いひとは、qを押すことでコマンドラインブラウザを終了して、stage tarball を展開する節へすぐに進むことができます。

検証して確認する

Note
一部の tarball は xz 圧縮で提供されています。.tar.xz で終わる tarball をダウンロードした場合は、以下のコマンドに出現する tarball ファイル名の .tar.bz2 を適宜修正してください。

MinimalインストールCDのときと同じく、stageファイルを検証して確認するためのファイルもダウンロードすることができます。これらの手順は飛ばしてもかまいませんが、ダウンロードしたファイルの妥当性を気にするユーザのためにこれらのファイルが提供されています。

  • stage tarball内のファイル一覧を含む.CONTENTSファイル。
  • stage ファイルの各種アルゴリズムでのチェックサムを含む.DIGESTSファイル。
  • .DIGESTSと同様にstageファイルの各種アルゴリズムでのチェックサムを含み、それがGentooプロジェクトから提供されたものであることを保証するために電子署名された.DIGESTS.ascファイル。

opensslを使って、その出力を.DIGESTS.DIGESTS.ascファイルに含まれるチェックサムと比較してください。

例えば、SHA512チェックサムを検証するには以下を入力します。

root #openssl dgst -r -sha512 stage3-mips-<release>.tar.bz2

sha512sumコマンドを使う方法もあります。

root #sha512sum stage3-mips-<release>.tar.bz2

Whirlpoolチェックサムを検証する場合は以下を入力します。

root #openssl dgst -r -whirlpool stage3-mips-<release>.tar.bz2

これらのコマンドの出力を.DIGESTS(.asc)ファイルに記録されている値と比較してください。これらの値は合致している必要があります。合致していないのなら、ダウンロードしたファイルか、ダイジェストファイルが壊れているかもしれません。

ISOファイルと同様に、チェックサムが改竄されていないことを確認するために、gpgを使って.DIGESTS.ascファイルの電子署名を検証することもできます:

root #gpg --verify stage3-mips-<release>.tar.bz2,.DIGESTS.asc

stage tarball を展開する

ここで、ダウンロードしたstageを解凍しましょう。tarを使います。

root #tar xpvf stage3-*.tar.bz2 --xattrs-include='*.*' --numeric-owner

同じオプション(xpf--xattrs-include='*.*')が使われていることに留意してください。xは展開(extract)を示し、pはパーミッションを保持(preserve)すること、fは処理対象が標準入力ではなくファイル(file)であることを示しています。--xattrs-include='*.*'は、アーカイブに保存されている拡張属性をすべての名前空間について保持し含めることを示しています。最後の--numeric-ownerは、たとえ冒険的なユーザが公式Gentooインストールメディアを使わずに作業をしている場合であっても、tarballから展開されるファイルのユーザIDとグループIDがGentooリリースエンジニアリングチームの意図通りに保たれることを、確実にするためのものです。

これでステージファイルは展開されました。この続きはコンパイルオプションを設定するで。

コンパイルオプションを設定する

はじめに

Gentooを最適化するために、Portage(Gentooの公式なパッケージマネージャ)の挙動に影響するいくつかの変数を設定できます。これらの変数はすべて環境変数として(exportを使って)設定できますが、この場合は永続的なものではありません。設定を保存するために、Portageは設定ファイルとして/etc/portage/make.confを読み込みます。

注意
/mnt/gentoo/usr/share/portage/config/make.conf.exampleに、すべての利用可能な変数のリストが、コメント付きで記載されています。Gentooのインストールを成功させるためには、以降で示す変数だけは設定する必要があります。

これから詳しく見ていく最適化変数を設定するために、エディタ(このガイドではnanoを使います)を起動してください。

root #nano -w /mnt/gentoo/etc/portage/make.conf

make.conf.exampleファイルを読めば、記述形式は分かるでしょう。コメント行は"#"で始まり、他の行は「変数="内容"」の形式で変数を定義します。これらの変数のうちのいくつかについてこれから見ていきます。

CFLAGS と CXXFLAGS

CFLAGSCXXFLAGS変数はそれぞれ、GCC CコンパイラとC++コンパイラのための最適化フラグを定義します。この2つの変数は通常ここで定義されますが、真に最高のパフォーマンスを発揮するためには、このフラグはプログラム毎に別々に設定する必要があるでしょう。すべてのプログラムは異なるからです。しかし、それでは管理が大変なので、make.confファイルでこれらのフラグを定義します。

make.confでは、一般にシステムの応答が速くなるように最適化フラグを設定するべきです。この変数に実験的な設定を書かないでください。過剰な最適化はプログラムの挙動をおかしくすることがあり、クラッシュや誤動作の元となります。

ここではすべての最適化オプションを説明することはしません。すべてを理解するためには、GNUオンラインマニュアルやGCC infoページ(info gcc - Linuxシステムでのみ使えます)を読んでください。make.conf.exampleファイルにはたくさんの設定例と情報が含まれているので、これを読むこともお忘れなく。

最初の設定は-march=または-mtune=フラグです。これはターゲットアーキテクチャの名前を指定します。可能な選択肢はmake.conf.exampleファイル内にコメントとして書かれています。nativeを指定すると、コンパイラは(Gentooをインストールしようとしている)現在のシステムのアーキテクチャをターゲットとして選択してくれるので、よく使われます。

ふたつめの設定は-Oフラグ(ゼロではなく大文字のオー)です。これはgcc最適化クラスフラグを指定します。可能なクラスは、s(サイズ最適化)、0(ゼロ、最適化無し)、1、2、3(速度最適化)です。速度最適化については、各クラスは1段階前のクラスが持つものと同じフラグに加えて、追加のフラグを持ちます。-O2は推奨されるデフォルト設定です。-O3をシステム全体で使うと問題を起こすことが知られているので、-O2にとどめることをおすすめします。

他によく使われる最適化フラグには-pipeがあります。これは、コンパイルステージ間での連絡方法として、一時ファイルではなくパイプを使うよう指定します。生成されるコードには影響しませんが、より多くのメモリを使うようになります。メモリの少ないシステムでは、gccが強制終了するかもしれません。そのような場合には、このフラグは使わないでください。

-fomit-frame-pointerを使うと、必要の無い場合にはフレームポインタをレジスタに保持しなくなります。これはアプリケーションのデバッグ時に深刻な影響を与えるかもしれません。

CFLAGSCXXFLAGS変数を定義するときには、最適化フラグは1つの文字列として結合してください。stage3アーカイブから解凍したデフォルト値で十分でしょう。以下に例を示します:

CODE CFLAGSCXXFLAGS変数の設定例
CFLAGS="-mabi=32 -mips4 -pipe -O2"
# Use the same settings for both variables
CXXFLAGS="${CFLAGS}"
Tip
各種コンパイルオプションがどのようにシステムに影響するかについてはGCCの最適化の記事に詳しい情報がありますが、初心者がシステムの最適化を始めるにはSafe CFLAGSの記事のほうがもっと実践的な場所かもしれません。

MAKEOPTS

MAKEOPTS変数は、パッケージのインストール時にどれだけ並行してコンパルを走らせるかを定義します。CPU数(コア数)プラス1を選択するのがよい選択とされていますが、ガイドラインは常に最良とは限りません。

CODE make.confのMAKEOPTSの設定例
MAKEOPTS="-j2"

よーい、ドン!

好みの設定に合わせて/mnt/gentoo/etc/portage/make.confを変更し、保存してください。nanoではCtrl+Xで保存できます。

それではGentooベースシステムのインストールに進んでください。




MIPS ハンドブック
インストール
インストールについて
メディアの選択
ネットワーク設定
ディスクの準備
stage3のインストール
Gentooベースシステムのインストール
カーネルの設定
システムの設定
ツールのインストール
ブートローダの設定
締めくくり
Gentooの操作
Portageについて
USEフラグ
Portageの機能
Initスクリプトシステム
環境変数
Portageの操作
ファイルとディレクトリ
変数
ソフトウェアブランチの併用
追加ツール
カスタムPortageツリー
高度な機能
ネットワーク設定
はじめに
高度な設定
モジュール式ネットワーク
無線
機能の追加
動的な管理


chroot する

任意自由選択: ミラーサーバーを選択する

ファイルの配布

ソースコードを短時間でダウンロードするために、速いミラーを選択することをお薦めします。Portageはmake.confの中のGENTOO_MIRRORS変数に指定されたミラー群を使用します。Gentooのミラー一覧から、インストール対象のマシンから物理的に最も近い一つ、もしくは複数のミラーを選択することができます(これらは高い頻度で最も高速になり得ます)。しかし、Gentooはmirrorselectという良いツールを提供しています。このツールは必要なミラーを選択するためによいユーザーインターフェースを提供できます。単純に選択可能なミラーが表示され、Spacebarを押せば、一つもしくは複数のミラーを選択できます。

root #mirrorselect -i -o >> /mnt/gentoo/etc/portage/make.conf

Gentoo ebuild リポジトリ

ミラーを選択するために次に重要なステップは、/etc/portage/repos.conf/gentoo.confファイルでGentoo ebuildリポジトリを設定することです。このファイルはパッケージリポジトリを更新するときに必要になる同期情報を含んでいます(パッケージリポジトリは、Portageがソフトウェアパッケージをダウンロード、インストールする時に必要なすべての情報を含むebuildと関連ファイルを集めたものです)。

リポジトリの設定は単純な数ステップでできます。最初に(それが存在しなければ)repos.confディレクトリを作成します。

root #mkdir --parents /mnt/gentoo/etc/portage/repos.conf

次に、Portageが提供するGentooリポジトリ設定ファイルを(新規作成した)repos.confディレクトリにコピーします。

root #cp /mnt/gentoo/usr/share/portage/config/repos.conf /mnt/gentoo/etc/portage/repos.conf/gentoo.conf

エディタで覗き見するか、catコマンドを使いましょう。そのファイルは.iniフォーマットで、以下のような記述になっているはずです。

FILE /mnt/gentoo/etc/portage/repos.conf/gentoo.conf
[DEFAULT]
main-repo = gentoo

[gentoo]
location = /usr/portage
sync-type = rsync
sync-uri = rsync://rsync.gentoo.org/gentoo-portage
auto-sync = yes
sync-rsync-verify-jobs = 1
sync-rsync-verify-metamanifest = yes
sync-rsync-verify-max-age = 24
sync-openpgp-key-path = /usr/share/openpgp-keys/gentoo-release.asc
sync-openpgp-key-refresh-retry-count = 40
sync-openpgp-key-refresh-retry-overall-timeout = 1200
sync-openpgp-key-refresh-retry-delay-exp-base = 2
sync-openpgp-key-refresh-retry-delay-max = 60
sync-openpgp-key-refresh-retry-delay-mult = 4

# for daily squashfs snapshots
#sync-type = squashdelta
#sync-uri = mirror://gentoo/../snapshots/squashfs

上に記載されているデフォルトのsync-uri変数は、ローテーション可能なミラーの場所を決めています。これはGentooインフラストラクチャーの帯域にかかるストレスを軽減することに役立ち、また特定のミラーがオフラインになっている場合のバックアップとなります。よって、デフォルトのURIは、ローカルのプライベートPortageミラーを使わない限り、そのままにしておくことが推奨されます。

Tip
興味のある人は、PortageプロジェクトのSync articleにあるPlug-in sync APIが役に立つでしょう。

DNS 情報をコピーする

新しい環境に入る前に一つだけやるべきことが残っています。それは/etc/resolv.confに記載されているDNS情報をコピーすることです。これは新しい環境に入った後でネットワークを使うために必要です。/etc/resolv.confは、そのネットワークのネームサーバーの情報を含んでいます。

この情報をコピーするときは、cpコマンドに--dereferenceオプションを付与することを推奨します。これは/etc/resolv.confがシンボリックリンクのときに、シンボリックリンクをコピーするのではなく、シンボリックリンクのリンク先の実ファイルをコピーします。そうしないと新しい環境でシンボリックリンクが存在しないファイルを指し示すでしょう(新しい環境では、元の環境でリンク先に指定していたファイルはほぼ利用できません)。

root #cp --dereference /etc/resolv.conf /mnt/gentoo/etc/

必要なファイルシステムをマウントする

もう少しで、Linuxルートは新しい場所に変わります。新しい環境を適切に動作させるために、いくつかのファイルシステムを使えるようにしなければなりません。

使えるようにしなければならないファイルシステムは以下の通りです。

  • /proc/ はLinuxカーネルから情報を引き出すための擬似ファイルシステムです(一見通常ファイルに見えますが、ファイルとしての実体はありません)。
  • /sys//proc/同様、擬似ファイルシステムです。/proc/より構造化されており、一度は/proc/を置き換えることを目的としていました。
  • /dev/は通常のファイルシステムです。一部はLinuxのデバイス管理機構(通常はudev)により管理されており、すべてのデバイスファイルを含んでいます。

/proc/は、/mnt/gentoo/proc/にマウントされるでしょう。他の2つはbindマウントされます。後者は、例えば/mnt/gentoo/sys/は事実/sys/となります(同じファイルシステムへの2番目のエントリです)。ここで/mnt/gentoo/proc/はファイルシステムの新しいエントリ(インスタンスとも言えるでしょう)となります。

root #mount --types proc /proc /mnt/gentoo/proc
root #mount --rbind /sys /mnt/gentoo/sys
root #mount --make-rslave /mnt/gentoo/sys
root #mount --rbind /dev /mnt/gentoo/dev
root #mount --make-rslave /mnt/gentoo/dev
注意
インストールの後半で出てくるsystemdを使う場合、--make-rslaveが必要です。
Warning
When using non-Gentoo installation media, this might not be sufficient. Some distributions make /dev/shm a symbolic link to /run/shm/ which, after the chroot, becomes invalid. Making /dev/shm/ a proper tmpfs mount up front can fix this:
root #test -L /dev/shm && rm /dev/shm && mkdir /dev/shm
root #mount --types tmpfs --options nosuid,nodev,noexec shm /dev/shm

そしてモード 1777 がセットされていることを確実にしてください:

root # chmod 1777 /dev/shm

新しい環境に入る

ようやく、すべてのパーティションが初期化され、ベース環境がインストールされました。chrootを実行して新しいインストール環境に入りましょう。これは、セッションのroot(アクセスできる最も上位レベル)を、現状のインストール環境(インストールCDもしくは他のインストールメディア)から、インストールシステム(つまり初期化されたパーティション)に変更することを意味しています。これが"change root"もしくは"chroot"の意味です。

chrootは次の3ステップで実行されます。

  1. chrootコマンドによって、最上位ディレクトリを(インストールメディアの)/から(パーティションをマウントしている)/mnt/gentoo/に変更する。
  2. /etc/profileのいくつかの設定をsourceコマンドでリロードする。
  3. chroot環境であることを忘れないようするために、シェルのプロンプトを変更する。
root #chroot /mnt/gentoo /bin/bash
root #source /etc/profile
root #export PS1="(chroot) ${PS1}"

この時から、すべての操作は新しいGentoo Linux環境で実行されます。もちろん、まだゴールには程遠いです。その証拠にまだいくつもの章が残っていますよね!

Tip
これ以降の時点で Gentoo インストールを中断しても、インストール作業をこのステップから「再開」することができるようになっているはずです。ディスクをまたパーティショニングする必要はありません!ただ単にルートパーティションをマウントして、上のステップを DNS 情報をコピーするところから実行すれば、作業中の環境に再び入ります。ブートローダの問題を解決するのにもこれが役に立ちます。さらなる情報は chroot の記事にあります。

ブートパーティションをマウントする

新環境に入った今、/boot パーティションを作成してマウントする必要があります。このことはカーネルをコンパイルするときとブートローダをインストールするときに重要な意味を持ちます。

root #mkdir /boot
root #mount /dev/sda1 /boot

Portageを設定する

Web から ebuild リポジトリのスナップショットをインストールする

次に基本のebuildリポジトリのスナップショットをインストールします。このスナップショットには、インストール可能なパッケージの情報、システム管理者が選択するプロファイルの一覧、パッケージやプロファイルごとのお知らせなどをPortageに伝えるファイルが含まれます。

ここで紹介するemerge-webrsyncは、HTTP/FTPプロトコル以外でのダウンロードがファイアウォールで制限されるような環境や、ネットワーク帯域を節約したい場合にお薦めです。これらの制約がなければ、この手順は省いて次のセクションに進んでも構いません。

次のコマンドで、毎日更新される最新のスナップショットをGentooのミラーサイトから取得し、インストールします:

root #emerge-webrsync
注意
この作業中、 emerge-webrsync が「/usr/portage/がない」というメッセージを出すかもしれません。これは想定内で、このディレクトリは自動的に作成されます。

この時点で、Portageはいくつかのアップデートが推奨されていることを通知するかもしれません。これは、stageファイルでインストールされたシステム関連のパッケージについて、より新しいバージョンが利用可能であることを示しています。今回新しいリポジトリスナップショットがインストールされたことで、Portageがそれを認識したのです。このメッセージは今のところは無視して、Gentooのインストールが完了してから対応しても問題ありません。

任意自由選択: Gentoo ebuildリポジトリを更新する

Gentoo ebuildリポジトリを最新版にアップデートできます。先のemerge-webrsyncコマンドはほぼ最新の(通常は24時間以内に作成される)スナップショットをインストールするため、このステップは本当に任意です。

最新(一時間以内)のパッケージ更新があるかもしれません。その更新を取り込むためにemerge --syncを実行しましょう。このコマンドはGentoo ebuildリポジトリ(先程emerge-webrsyncコマンドで取得したもの)をアップデートするためにrsyncプロトコルを使用します。

root #emerge --sync

アップデートの時間を短縮するために、特定のフレームバッファもしくはシリアルコンソール等の遅いターミナルでは、--quietオプションを使うことをお薦めします。

root #emerge --sync --quiet

ニュースを読む

Gentoo ebuildリポジトリの更新時、Portage が次のようなメッセージを伴う警告を出すことがあります。

* IMPORTANT: 2 news items need reading for repository 'gentoo'.
* Use eselect news to read news items.

ニュース項目は、rsyncしたツリーを通じて、ユーザーに重要なメッセージを通知するためのコミュニケーション手段です。これらニュース項目を管理するためにeselect newsを使用します。eselectはGentooのアプリケーションで、システムの変更や操作に対する共通の管理インターフェースを提供します。この場合、eselectnewsモジュールを使うことを指示されます。

newsモジュールに対しては、主に3つの操作が使用されます。

  • listを指定すると、現在有効なニュースアイテムの概要が表示されます。
  • readを指定すると、そのニュースアイテムを読むことができます。
  • purgeを指定すると、一度購読したニュースを削除することができます。これにより、それらのニュースを二度と目にすることはないでしょう。
root #eselect news list
root #eselect news read

ニュースリーダーに関するほとんどの情報はマニュアルページを通じて得ることができます。

root #man news.eselect

適切なプロファイルを選ぶ

Warning
対応する 17.1 ニュースアイテムを読むまではどの 17.1 プロファイルも選択しないでください。このプロファイルは実験的なものであり、特別な移行作業を要します。

プロファイルはあらゆるGentooシステムの基礎を構成します。プロファイルはUSECFLAGS等の重要な変数の初期値を決めるだけではありません。プロファイルは、パッケージのバージョンを決まった範囲に固定する役目を持っています。プロファイルはGentooのPortage開発者によって完全にメンテナンスされています。

eselectを使えば、現状のプロファイルがわかります。profileモジュールを指定しましょう。

root #eselect profile list
Available profile symlink targets:
  [1]   default/linux/mips/13.0 *
  [2]   default/linux/mips/13.0/desktop
  [3]   default/linux/mips/13.0/desktop/gnome
  [4]   default/linux/mips/13.0/desktop/kde
注意
コマンドの出力は一例で、常に更新されています。

上の例の通り、いくつかのアーキテクチャではデスクトップ向けのサブプロファイルが見られるでしょう。

Warning
Profile upgrades are not to be taken lightly. When selecting the initial profile, make sure to use profile corresponding to the same version as the one initially used by stage3 (e.g. 13.0). Each new profile version is announced through a news item containing migration instructions. Make sure to read it and follow them before switching to a newer profile.

mipsアーキテクチャで利用可能なプロファイルを確認後、別のプロファイルを選択できます。

root #eselect profile set 2



Note
developerサブプロファイルはGentoo Linux開発向けの固有のプロファイルであり、通常のユーザーが使用するものではありません。

@worldの更新

At this point, it is wise to update the system's @world set so that a base can be established.

This following step is necessary so the system can apply any updates or USE flag changes which have appeared since the stage3 was built and from any profile selection:

root #emerge --ask --verbose --update --deep --newuse @world
Tip
フルスケールのデスクトップ環境を選択した場合、このプロセスはインストール時間を格段に長くしてしまうかもしれません。時間に追われている人は次の経験則が成り立つでしょう。「名前が短く、特定のシステムを示さないプロファイルの@world setを選択する」、「もっとも一般的な@worldセットは、より少ないパッケージのアップデートですむ」。別の言い方をすると、
  • default/linux/amd64/13.0を選択すると、パッケージのアップデートは少なくてすみます。
  • default/linux/amd64/13.0/desktop/gnome/systemdを選択すると多くのパッケージがインストールされます。なぜなら、initシステムがOpenRCからsystemdに変更され、GNOMEのデスクトップ環境がインストールされるためです。

USE変数を設定する

USEは、Gentooがユーザに提供する最もパワフルな変数の一つです。多くのプログラムに対して、決められた追加機能を含めたり、もしくは含めずにコンパイルすることが可能です。例えば、いくつかのプログラムはGTK+サポートもしくはQtサポートを有効にしてコンパイルできます。別のプログラムにはSSLサポートを含めたり、もしくは含めずにコンパイルすることが可能です。いくつかのプログラムはX11サポート(Xサーバー)の代わりに、フレームバッファサポート(svgalib)と共にコンパイルできます。

多くのディストリビューションでは、各種のサポートを最大限含むようにコンパイルします。これはプログラムサイズと起動時間を増大させます。多くの依存関係を発生させることは言うまでもありません。Gentooでは、ユーザーはパッケージをコンパイルする時のオプションを定義できます。ここでUSEが登場します。

USE変数を使って、ユーザーはコンパイルオプションにマップされるキーワードを指定します。例えば、sslキーワードはSSLをサポート可能なプログラムでSSLを有効にしてコンパイルします。-XキーワードはXサーバーのサポートを含まない(最初のマイナス記号で指定)ようにコンパイルします。gnome gtk -kde -qt4 -qt5は、GNOME(とGTK+)サポートを有効にして、KDE(とQt)サポートを無効にします。これにより、(もし、アーキテクチャがGNOMEをサポートしていれば)システムはGNOME向けに最大限調整されます。

デフォルトのUSEの設定は、システムによって使用されるGentooプロファイルのmake.defaultsファイルに記述されています。Gentooはプロファイルをサポートするために、(複雑な)継承システムをサポートします。これにより今の段階でUSEの詳細に立ち入る必要はありません。現在有効なUSE設定を知るためのもっとも簡単な方法は、emerge --infoを実行してUSEで始まる行を抜き出すことです。

root #emerge --info | grep ^USE
USE="X acl alsa amd64 berkdb bindist bzip2 cli cracklib crypt cxx dri ..."
注意
上記の例は出力のほとんどを省略しています。実際には、USE 変数のリストはずっとずっと長いものです。

使用可能なUSEフラグの完全な記述は、/usr/portage/profiles/use.descにあります。

root #less /usr/portage/profiles/use.desc

lessコマンドでは、キーとキーを使ってスクロールすることができます。qを押すと終了します。

例として、DVD、ALSA、CD書き込みをサポートしたKDEベースのUSE設定を示します。

root #nano -w /etc/portage/make.conf
FILE /etc/portage/make.confDVD、ALSA、CD書き込みをサポートしたKDEベースのUSE設定
USE="-gtk -gnome qt4 qt5 kde dvd alsa cdr"

/etc/portage/make.confUSEが定義されたとき、それはデフォルトのリストに追加されます(-で始まるサポートは削除されます)。デフォルトのUSE設定を無視したい、もしくはUSE設定を自身で完全に制御したいときは、make.confUSE-*で始めます。

FILE /etc/portage/make.confデフォルトのUSEフラグを無視する
USE="-* X acl alsa"
警告
例示したように -* を指定することは可能ではあるものの、推奨されません。ebuildによっては、競合やエラーが起きないようにデフォルトのUSEフラグが慎重に調整されていることがあるためです。


タイムゾーン

タイムゾーンを選択します。/usr/share/zoneinfo/から利用可能なタイムゾーンを探してください。そして、それを/etc/timezoneファイルに記述しましょう。

root #ls /usr/share/zoneinfo

選択したタイムゾーンがEurope/Brusselsの場合は以下となります。

root #echo "Europe/Brussels" > /etc/timezone

/usr/share/zoneinfo/Etc/GMT*のタイムゾーンは、その名前が期待されるゾーンを示していないため、避けましょう。たとえば、GMT-8は実際にはGMT+8となります。

次に、sys-libs/timezone-dataパッケージを再設定しましょう。これは/etc/timezoneを元に、/etc/localtimeをアップデートします。/etc/localtimeは、システムのCライブラリが、自身が属するタイムゾーンを知るために使われます。

root #emerge --config sys-libs/timezone-data

ロケールの設定

ほとんどのユーザは、一つもしくは二つのロケールを必要とします。

ロケールはシステムで使用する言語を指定するだけではなく、単語のソート順や日付、時間等のルールにも使用されます。

システムがサポートすべきロケールは、/etc/locale.genに記述する必要があります。

root #nano -w /etc/locale.gen

次のロケールの例では、英語(United States)とドイツ語(Germany)を(UTF-8のような)文字コードと共に指定しています。

FILE /etc/locale.genUSとDEロケールを適切な文字コードと共に有効にする
en_US ISO-8859-1
en_US.UTF-8 UTF-8
de_DE ISO-8859-1
de_DE.UTF-8 UTF-8
警告
UTF-8 のロケールを少なくとも一つは有効にすることを強く勧めます。おそらくいくつかのアプリケーションはUTF-8を必要とするためです。

次にlocale-genを実行します。これにより、/etc/locale.genファイルに記載されているすべてのロケールを生成します。

root #locale-gen

現在使用可能なすべてのロケールを確認するためには、locale -aを実行してください。

この時点で、システム全体で有効になるロケールを設定できます。eselectlocaleモジュールと共に使いましょう。

eselect locale listを実行すると、利用可能なターゲットが表示されます。

root #eselect locale list
Available targets for the LANG variable:
  [1] C
  [2] POSIX
  [3] en_US
  [4] en_US.iso88591
  [5] en_US.utf8
  [6] de_DE
  [7] de_DE.iso88591
  [8] de_DE.iso885915
  [9] de_DE.utf8
  [ ] (free form)

eselect locale set VALUE を実行することで、適切なロケールを設定することができます。

root #eselect locale set 9

手動で設定する場合は、/etc/env.d/02localeを編集してください。

FILE /etc/env.d/02localeシステムのロケールをマニュアル設定する
LANG="de_DE.UTF-8"
LC_COLLATE="C"

ロケールが設定されていることを再確認してください。そうしないと、後でカーネルをビルドしたり、他のソフトをインストールした時にワーニングやエラーが出ます。

ここで、環境をリロードします。

root #env-update && source /etc/profile && export PS1="(chroot) $PS1"

私たちは、このユーザーガイドを補完するための完全なドキュメントであるローカライゼーションガイドを作成しました。他の興味深い記事は、UTF-8を有効にするための情報であるガイドUTF-8です。




MIPS ハンドブック
インストール
インストールについて
メディアの選択
ネットワーク設定
ディスクの準備
stage3のインストール
Gentooベースシステムのインストール
カーネルの設定
システムの設定
ツールのインストール
ブートローダの設定
締めくくり
Gentooの操作
Portageについて
USEフラグ
Portageの機能
Initスクリプトシステム
環境変数
Portageの操作
ファイルとディレクトリ
変数
ソフトウェアブランチの併用
追加ツール
カスタムPortageツリー
高度な機能
ネットワーク設定
はじめに
高度な設定
モジュール式ネットワーク
無線
機能の追加
動的な管理


カーネルソースのインストール

すべてのディストリビューションが構築されるその中心にあるのがLinuxカーネルです。カーネルレイヤーはユーザープログラムとハードウェアの間に存在します。Gentooではカーネルソースについて複数の選択肢があります。説明付きのすべてのカーネルソースのリストは、Kernel overview pageで見ることができます。

mipsベースのシステムのために、Gentooは sys-kernel/mips-sourcesパッケージを推奨しています。

適切なカーネルソースを選択して、emergeでインストールします。

root #emerge --ask sys-kernel/mips-sources

このコマンドはカーネルソースを/usr/src/にインストールします。このディレクトリにあるlinuxがインストールされたカーネルソースへのシンボリックリンクとなります。

root #ls -l /usr/src/linux
lrwxrwxrwx    1 root   root    12 Oct 13 11:04 /usr/src/linux -> linux-3.16.5-gentoo

これで、カーネルソースを設定、コンパイルする準備が整いました。この設定およびコンパイルには二つのアプローチがあります。

  1. カーネルをマニュアルで設定およびビルドする。
  2. Linuxカーネルを自動的にビルド・インストールするgenkernelを使用する。

ここでは、環境を最適化するのに最も適した"マニュアル設定"をデフォルトとして説明します。

デフォルト: マニュアル設定

はじめに

カーネルのマニュアル設定は、しばしばLinuxユーザーがしなければならない最も難しい手続きと考えられます。これは真実ではありません。カーネルを数回設定してみれば、それが難しいと言われていたことなど忘れてしまうでしょう。

しかし、一つだけ真実があります。カーネルをマニュアルで設定する時、ハードウェア情報を知ることはとても役に立ちます。ほとんどの情報は、lspciコマンドを含むsys-apps/pciutilsをインストールすることで得られます。

root #emerge --ask sys-apps/pciutils
注意
chroot環境では、lspciが出力していると思われる(pcilib: cannot open /sys/bus/pci/devicesのような)pcilibの警告は、無視しても構いません。

システム情報を得るための別の方法は、lsmodを使ってインストールCDが使っているカーネルモジュールを把握することです。その情報は何を有効にすべきかとてもよいヒントを与えてくれるでしょう。

では、カーネルソースがあるディレクトリに移動して、make menuconfigを実行しましょう。このコマンドはメニューベースの設定画面を起動します。

root #cd /usr/src/linux
root #make menuconfig

Linuxカーネルの設定はとても多くのセクションを持っています。まず最初にいくつかの必須オプションを述べましょう(そうでない場合、Gentooは動作しない、もしくは追加の処置なしには正しく動作しません)。 Gentoo wikiのGentoo カーネルコンフィグレーションガイドには、さらに役立つ記述があるでしょう。

必須オプションを有効にする

システムのブートに必須となるドライバ(SCSIコントローラ等)は、モジュールではなく、カーネルの一部としてコンパイルしなければなりません。そうでないと、システムは全くブートできないでしょう。

次に正確なプロセッサタイプを選択します。このとき、もし使えるのであればMCE機能を有効にすることが推奨されます。これによりハードウェアの異常が通知されるようになるでしょう。いくつかのアーキテクチャ(x86_64)で、これらのエラーはdmesgでは確認できませんが、/dev/mcelogにログが残ります。この機能を有効にするためにapp-admin/mcelogパッケージが必要になります。

また、Maintain a devtmpfs file system to mount at /devを選択することで、必須となるデバイスファイルがブートプロセスの初期段階で使えるようになります (CONFIG_DEVTMPFSCONFIG_DEVTMPFS_MOUNT):

KERNEL devtmpfsサポートを有効にする
Device Drivers --->
  Generic Driver Options --->
    [*] Maintain a devtmpfs filesystem to mount at /dev
    [ ]   Automount devtmpfs at /dev, after the kernel mounted the rootfs

SCSI ディスクサポートが有効になっているか確認してください(CONFIG_BLK_DEV_SD):

KERNEL SCSIディスクサポートを有効にする
Device Drivers --->
   SCSI device support  --->
      <*> SCSI disk support

次にFile Systemsで、使用するファイルシステムに必要なサポートを選択しましょう。ルートファイルシステムに使われるファイルシステムをモジュールとしてコンパイルしてはいけません。モジュールにした場合、Gentooシステムはパーティションをマウントできないでしょう。また、ここでVirtual memory/proc file systemも選択してください。システムの必要に応じて以下の選択肢から1個以上を選択してください (CONFIG_EXT2_FS, CONFIG_EXT3_FS, CONFIG_EXT4_FS, CONFIG_MSDOS_FS, CONFIG_VFAT_FS, CONFIG_PROC_FS, and CONFIG_TMPFS):

KERNEL 必要なファイルシステムを選択する
File systems --->
  <*> Second extended fs support
  <*> The Extended 3 (ext3) filesystem
  <*> The Extended 4 (ext4) filesystem
  <*> Reiserfs support
  <*> JFS filesystem support
  <*> XFS filesystem support
  <*> Btrfs filesystem support
  DOS/FAT/NT Filesystems  --->
    <*> MSDOS fs support
    <*> VFAT (Windows-95) fs support
 
Pseudo Filesystems --->
    [*] /proc file system support
    [*] Tmpfs virtual memory file system support (former shm fs)

もしインターネットに接続するために、PPPoEもしくはダイヤルアップモデムを使う場合、次のオプションを有効にしてください (CONFIG_PPP, CONFIG_PPP_ASYNC, and CONFIG_PPP_SYNC_TTY):

KERNEL PPPoEに必要なドライバを選択する
Device Drivers --->
  Network device support --->
    <*> PPP (point-to-point protocol) support
    <*>   PPP support for async serial ports
    <*>   PPP support for sync tty ports

2つの圧縮オプションは選択しても差し支えありませんが、必須というわけでもありません。PPP over Ethernetオプションも同様です。これはカーネルモードのPPPoEをするために設定された時だけにpppによって使用されるものです。

カーネルにネットワークカード(イーサネットもしくはワイヤレス)のサポートを組み込むことを忘れてはいけません。

多くのシステムではマルチコアを使用できます。Symmetric multi-processing supportを有効にすることは重要です (CONFIG_SMP):

KERNEL SMPサポートを有効にする
Processor type and features  --->
  [*] Symmetric multi-processing support
注意
マルチコアシステムでは、それぞれのコアが1プロセッサとカウントされます。

USB接続の入力装置(キーボードやマウス)などのUSBデバイスを使用する場合、以下を必ず有効にしてください (CONFIG_HID_GENERIC and CONFIG_USB_HID, CONFIG_USB_SUPPORT, CONFIG_USB_XHCI_HCD, CONFIG_USB_EHCI_HCD, CONFIG_USB_OHCI_HCD):

KERNEL 入力装置のためにUSBサポートを有効にする
Device Drivers --->
  HID support  --->
    -*- HID bus support
    <*>   Generic HID driver
    [*]   Battery level reporting for HID devices
      USB HID support  --->
        <*> USB HID transport layer
  [*] USB support  --->
    <*>     xHCI HCD (USB 3.0) support
    <*>     EHCI HCD (USB 2.0) support
    <*>     OHCI HCD (USB 1.1) support


設定を準備する

Important
On the Origin 200/2000, Indigo2 Impact (R10000), Octane/Octane2 and O2, a 64-bit kernel is required to boot these systems. For these machines, emerge sys-devel/kgcc64 to create a cross-compiler for building 64-bit kernels.

Many of the systems supported have sample .configs hiding in amongst the kernel source. Not all systems have configs distributed in this way. Those that do, can be configured using the commands mentioned in the table below.

System Configure command
Cobalt Servers make cobalt_defconfig
Indy, Indigo2 (R4k), Challenge S make ip22_defconfig
Origin 200/2000 make ip27_defconfig
Indigo2 Impact (R10k) make ip28_defconfig
O2 make ip32_defconfig

All of the Gentoo installation images provide a kernel config option as part of the image itself, accessible as /proc/config.gz. This may be used in many cases. It is best though if the kernel source matches closely the kernel that is currently running. To extract it, simply run it through zcat as shown below.

root #zcat /proc/config.gz > .config
Important
This kernel config is set up for a netboot image. That is, it will expect to find a root filesystem image somewhere nearby, either as a directory for initramfs, or a loopback device for initrd. When executing make menuconfig, don't forget to go into General Setup and disable the options for initramfs.

設定をカスタマイズする

Once a configuration is found, download it into the kernel source directory, and rename it to .config. From there, run make oldconfig to bring everything up to date according to the instructions above, and customize the configuration before compiling.

root #cd /usr/src/linux
root #cp /path/to/example-config .config
root #make oldconfig

Just press the ENTER (or Return) key at each prompt to accept the defaults for now ...

root #make menuconfig
Important
In the Kernel Hacking section, there is an option named "Are You Using A Cross Compiler?". This tells the kernel Makefiles to prepend "mips-linux-" (or mipsel-linux ... etc) to gcc and as commands when compiling the kernel. This should be turned off, even if cross-compiling. Instead, if a cross-compiler needs to be called, specify the prefix using the CROSS_COMPILE variable as shown in the next section.
Important
There is a known issue with JFS and ALSA on Octane systems where the ALSA fails to work. Given the experimental nature of JFS on MIPS, it is recommended that people avoid using JFS for the time being.

コンパイルおよびインストール

カーネルのコンフィグレーションが完了し、コンパイルとインストールをする時がきました。コンフィグレーションを終了させ、コンパイル作業を開始しましょう:

注意
64 ビットマシンでは、CROSS_COMPILE=mips64-unknown-linux-gnu- (または、リトルエンディアンシステムでは mips64el-... ) を指定することで 64 ビットコンパイラーを使用します。

ネイティブにコンパイルするには:

root #make vmlinux modules modules_install

Cross-compiling on target machine, adjust the mips64-unknown-linux-gnu- accordingly:

root #make vmlinux modules modules_install CROSS_COMPILE=mips64-unknown-linux-gnu-

When compiling on another machine, such as an x86 box, use the following commands to compile the kernel & install modules into a specific directory to be transferred to the target machine.

root #make vmlinux modules CROSS_COMPILE=mips64-unknown-linux-gnu-
root #make modules_install INSTALL_MOD_PATH=/somewhere
Important
When compiling a 64-bit kernel for the Indy, Indigo2 (R4k), Challenge S and O2, use the vmlinux.32 target instead of vmlinux. Otherwise, the machine will not be able to boot. This is to work around the PROM not understanding the ELF64 format.
root #make vmlinux.32
Note
It is possible to enable parallel builds using make -jX with X being the number of parallel tasks that the build process is allowed to launch. This is similar to the instructions about /etc/portage/make.conf earlier, with the MAKEOPTS variable.

上記の場合は vmlinux.32 が最終的なカーネルとして生成されます。

カーネルのコンパイルが終了したら、カーネルのイメージを /boot/ にコピーしましょう。

Note
On Cobalt servers, the bootloader will expect to see a compressed kernel image. Remember to gzip -9 the file once it is in /boot/.
root #cp vmlinux /boot/kernel-3.16.5-gentoo

Cobalt サーバー用では、カーネルイメージを圧縮します:

root #gzip -9v /boot/kernel-3.16.5-gentoo


任意自由選択: initramfsのビルド

いくつかの特別なケースでinitramfs(起動時のRAMベースのファイルシステム)のビルドが必要になります。最もよくある理由は、重要なディレクトリ(/usr//var/等)が別パーティションにある場合です。initramfsがあれば、initramfsの中にあるツールを使うことで、これらのパーティションをマウントすることができます。

initramfsがないケースで、ファイルシステムをマウントするツールがそのファイルシステムの中にある情報を必要としている場合、大きなリスクを負うことになります。initramfsはカーネルブートの直後かつ制御がinitツールに移る前に必要なファイルをアーカイブに引き込みます。initramfsのスクリプトはシステムがブートを継続するために必要なパーティションを正しくマウントすることを保証します。

initramfsをインストールするために、最初にsys-kernel/genkernelをインストールしましょう。そしてinitramfsを生成します。

root #emerge --ask sys-kernel/genkernel
root #genkernel --install initramfs

LVMやRAID等の特別なサポートをinitramfsで有効にするために、genkernelに適切なオプションを与えてください。詳しい情報については、genkernel --helpを参照してください。次の例では、LVMとソフトウェアRAID (mdadm)を有効にしています。

root #genkernel --lvm --mdadm --install initramfs

initramfsは/boot/に保存されます。生成されるファイルは単純にinitramfsで始まります。

root #ls /boot/initramfs*

次はカーネルモジュールです。

別の方法: genkernelを使用する

もしマニュアル設定に気後れしてしまった場合、genkernelがお薦めです。genkernelは自動的にカーネルを設定、ビルドします。

genkernelはインストールCDのカーネルが自動的に設定されるのとほぼ同じ方法でカーネルを設定します。これはカーネルのビルドにgenkernelを使った場合、インストールCDと同じようにブート時にすべてのハードウェアを検出することを意味します。genkernelはいかなるカーネルのマニュアル設定も要求しないため、ユーザー自身のカーネルをコンパイルすることを好まないユーザには理想的なソリューションです。

では、genkernelの使い方を見てみましょう。最初にsys-kernel/genkernelをemergeします。

root #emerge --ask sys-kernel/genkernel

次に、/etc/fstabファイルを編集します。2番目のフィールドに/boot/を含む行は、その1番目のフィールドで正しいデバイス指定します。もしハンドブックのパーティショニング例の通りであれば、このデバイスはほぼ間違いなくext2ファイルシステムを持つ/dev/sda1でしょう。この場合、エントリは次のようになります。

root #nano -w /etc/fstab
FILE /etc/fstab/bootマウントポイントを設定する
/dev/sda1	/boot	ext2	defaults	0 2
注意
Gentooインストールでは、/etc/fstabはさらにもう一回編集されますが、/bootの設定はgenkernelアプリケーションがそれを読み込むために今必要です

genkernel allを実行してカーネルソースをコンパイルしましょう。ただ、genkernelはほとんどすべてのハードウェアをサポートするカーネルを生成するため、コンパイルが完了するまでにかなりの時間が必要になることに注意しましょう。

注意
もしブートパーティションがファイルシステムとしてext2もext3も使用していない場合、おそらく、genkernel --menuconfig allを使ってマニュアルでカーネルを設定し、カーネルにこの特別なファイルシステムを(モジュールではなく)組み込む必要があるでしょう。また、LVM2のユーザーはおそらく引数に--lvmを加えることになるでしょう。
root #genkernel all

genkernel完了後、カーネル、モジュール群、初期RAMディスク(initramfs)が生成されるでしょう。このドキュメントの後半でブートローダーを設定する際、このカーネルとinitrdを使うことになります。ブートローダーの設定に必要になるため、カーネルとinitrdの名前をメモしておきましょう。"真の"システムが起動する前に(インストールCDがするように)ハードウェアを自動的に検出しなければならないため、initrdはブート後すぐに起動します。

root #ls /boot/kernel* /boot/initramfs*

カーネルモジュール

モジュールの設定

Note
ハードウェアモジュールを手作業で列挙する必要はありません。ほとんどの場合、udev は接続を検出したハードウェアのモジュールを自動でロードします。ですが、自動で検出されるモジュールを列挙することは特に有害ではありません。時として変なハードウェアは、ドライバをロードするのにこうした手助けが必要になることがあります。

/etc/modules-load.d/*.confファイルに、自動的にロードしなければならないモジュールを改行区切りで記載してください。モジュールに追加のオプションを与える必要があれば、/etc/modprobe.d/*.confファイルで設定すべきです。

すべての利用可能なモジュールを把握するためには、次のfindコマンドを実行してください。"<kernel version>"をたった今コンパイルしたカーネルのバージョンで置き換えることを忘れないでください。

root #find /lib/modules/<kernel version>/ -type f -iname '*.o' -or -iname '*.ko' | less

たとえば、3c59x.koモジュール(特定の3Comネットワークカード)を自動的にロードするためには、/etc/modules-load.d/network.confにモジュール名を記載してください。実際のファイル名はローダにとって重要ではありません。

root #mkdir -p /etc/modules-load.d
root #nano -w /etc/modules-load.d/network.conf
FILE /etc/modules-load.d/network.conf強制的に3c59x モジュールをロードする
3c59x

では、システムの設定に進み、インストールを続けましょう。

任意自由選択: ファームウェアのインストール

いくつかのドライバは、動作可能にするために追加のファームウェアのインストールを必要とします。これはしばしばネットワークインターフェース、特に無線ネットワークで必要になります。さらに、AMD、NVidia、Intelなどのベンダによる最近のビデオチップをオープンソースドライバで利用する場合にも、よく外部のファームウェアが必要になります。ファームウェアの多くはsys-kernel/linux-firmwareにパッケージされています。

root #emerge --ask sys-kernel/linux-firmware




MIPS ハンドブック
インストール
インストールについて
メディアの選択
ネットワーク設定
ディスクの準備
stage3のインストール
Gentooベースシステムのインストール
カーネルの設定
システムの設定
ツールのインストール
ブートローダの設定
締めくくり
Gentooの操作
Portageについて
USEフラグ
Portageの機能
Initスクリプトシステム
環境変数
Portageの操作
ファイルとディレクトリ
変数
ソフトウェアブランチの併用
追加ツール
カスタムPortageツリー
高度な機能
ネットワーク設定
はじめに
高度な設定
モジュール式ネットワーク
無線
機能の追加
動的な管理


ファイルシステムの情報

fstabについて

Linuxでは、システムで使用するすべてのパーティションは/etc/fstabに記載されていなければなりません。このファイルは、これらパーティションのマウントポイント(これらはファイルシステムに存在しなければなりません)、どのようにマウントされるべきか、また特別なオプション(自動マウントかそうでないか、ユーザー権限でマウントできるかどうか等)を定義します。

fstabファイルを作成する

/etc/fstabファイルは表のように記述します。それぞれの行はスペース(一つまたは複数のスペース、タブ、もしくはその組み合わせ)で区切られる6つのフィールドを持ちます。それぞれのフィールドの意味は以下の通りです。

  1. 最初のフィールドは使用するパーティションを示します。(デバイスファイルのパス)
  2. 2番目のフィールドはそのパーティションがマウントされるマウントポイントを示します。
  3. 3番目のフィールドはそのパーティションのファイルシステムを示します。
  4. 4番目のフィールドは、そのパーティションをマウントするmountコマンドが使用するオプションを示します。すべてのファイルシステムは、固有のマウントオプションを持っています。ユーザーはマウントコマンドのmanページ(man mount)を参照することですべてのオプションを確認できます。複数のマウントオプションを記述する場合はカンマで区切ります。
  5. 5番目のフィールドはそのパーティションをdumpでダンプするかどうかを示しています。このフィールドは通常0(ゼロ)のままにしておいてかまいません。
  6. 6番目のフィールドは、直前のシャットダウンが正常に完了しなかったときに、fsckが各パーティションをどの順番でチェックするか示しています。ルートファイルシステムは1であるべきです。残りのファイルシステムは2(ファイルシステムチェックが不要であれば0)に設定しましょう。
重要
Gentooが提供するデフォルトの/etc/fstabファイルは適切な記述ではありません。テンプレートとしてのみ使用してください
root #nano -w /etc/fstab

これ以降、パーティションとして、デフォルトのブロックデバイスファイルである/dev/sd*を使います。

Filesystem labels and UUIDs

Both MBR (BIOS) and GPT include support for filesystem labels and filesystem UUIDs. These attributes can be defined in /etc/fstab as alternatives for the mount command to use when attempting to find and mount block devices. Filesystem labels and UUIDs are identified by the LABEL and UUID prefix and can be viewed with the blkid command:

root #blkid
Warning
If the filesystem inside a partition is wiped, then the filesystem label and the UUID values will be subsequently altered or removed.

Because of uniqueness, readers that are using an MBR-style partition table are recommended to use UUIDs over labels to define mountable volumes in /etc/fstab.

パーティションラベルとUUID

Users who have gone the GPT route have a couple more 'robust' options available to define partitions in /etc/fstab. Partition labels and partition UUIDs can be used to identify the block device's individual partition(s), regardless of what filesystem has been chosen for the partition itself. Partition labels and UUIDs are identified by the PARTLABEL and PARTUUID prefixes respectively and can be viewed nicely in the terminal by running the blkid command:

root #blkid

ラベルも絶対にとは言えないのに対し、fstab でUUIDを使ったパーティション指定を使えば、ブートローダーがパーティション検出に迷うことはありません。ブロックデバイスファイルが変わったとしてもです。従来のブロックデバイスファイル (/dev/sd*N) を使った指定は、SATAブロックデバイスの追加・削除とシステムの再起動が頻繁に行われるシステムでは危険です。

ブロックデバイスのファイル名は様々な要素 (例えばディスクがどんな順番でいくつ接続されているか) によって変化します。つまり、ディスクの順序を頻繁にいじったりしない限りは、デフォルトのブロックデバイスファイルを使うのはシンプルで素直な方法です。


Let us take a look at how to write down the options for the /boot/ partition. This is just an example, and should be modified according to the partitioning decisions made earlier in the installation. In our mips partitioning example, /boot/ is usually the /dev/sda1 partition, with ext2 as filesystem. It needs to be checked during boot, so we would write down:

FILE /etc/fstabAn example /boot line for /etc/fstab
/dev/sda1   /boot     ext2    defaults        0 2

Some users don't want their /boot/ partition to be mounted automatically to improve their system's security. Those people should substitute defaults with noauto. This does mean that those users will need to manually mount this partition every time they want to use it.

実際のパーティション構成にあわせたルールや、CD-ROMドライブのためのルールを追加してください。他にパーティションやドライブがあれば、それも忘れずに追加しておきましょう。

以下は、より詳細な/etc/fstabの例です。


FILE /etc/fstabA full /etc/fstab example
/dev/sda1   /boot        ext2    defaults,noatime     0 2
/dev/sda10   none         swap    sw                   0 0
/dev/sda5   /            ext4    noatime              0 1
  
/dev/cdrom  /mnt/cdrom   auto    noauto,user          0 0

3番目のフィールドでautoを使う場合、mountコマンドはそのパーティションのファイルシステムが何かを推測します。これは様々なファイルシステムを使う可能性があるリムーバルメディアで推奨されます。4番目のuserオプションで、ルート権限を持たないユーザーがCDをマウントできるようになります。

パフォーマンスを改善するために、多くのユーザーはマウントオプションとしてnoatimeオプションを付け加えたいと考えるでしょう。アクセス時間が記録されないので、結果としてより高速なシステムになります(一般的にこの記録はほとんど必要ありません)。TRIMコマンドが動くようにdiscardオプション(現時点ではext4とbtrfsのみ)を使ってSSDをマウントする場合も、noatimeオプションを付けるとよいでしょう。

再度/etc/fstabを確認して、保存、エディタを終了します。

ネットワーク接続のための情報

ホストとドメインのための情報

さて、PCには名前をつけなければいけません。至極簡単に思えますが多くのユーザーはPCに名前を付けるのに苦労しています。事を早く進めるために、選んだ名前は後で変更できることを知っておいてください。判りやすいように、ここでは単にマシンをtux、ドメイン名をhomenetworkと呼ぶことにします。

root #nano -w /etc/conf.d/hostname
# hostname変数にホスト名を設定する。
hostname="tux"

次に、もしドメイン名が必要なら、/etc/conf.d/netに設定します。ISPやネットワーク管理者からそう言われているか、DNSサーバがありDHCPサーバがない場合には、ドメイン名が必要になります。もし、ダイナミックIPアドレスやネットワーク設定のためにDHCPを使っている場合は、DNSやドメイン名は気にしなくても構いません。

注意
デフォルトで/etc/conf.d/netが無い場合、新規作成する必要があります。
root #nano -w /etc/conf.d/net
# dns_domain_lo変数にドメイン名を設定する。
dns_domain_lo="homenetwork"
注意
もしドメイン名を設定しない場合、ログイン画面に"This is hostname.(none)"というメッセージが現れるでしょう。これは/etc/issueを編集して、.\Oを消去することで対策できます。

もし、NISドメインが必要であれば(それが何かを知らないユーザは必要ありません)、以下のように定義してください。

root #nano -w /etc/conf.d/net
# nis_domain_lo変数にNISドメイン名を設定。
nis_domain_lo="my-nisdomain"
注意
DNSとNISの設定詳細については、/usr/share/doc/netifrc-*/net.example.bz2にある例を参照してください。このファイルはbzlessで読むことができます。また、DNS/NIS設定を管理する場合、net-dns/openresolvをインストールすることは興味深いでしょう。

ネットワークを設定する

Gentoo Linuxをインストールしている間、ネットワークが使えるように設定されています。しかし、それはインストールCDのためのネットワーク設定であり、インストールされた環境のためのものではありません。では、インストールされたGentoo Linuxのネットワークを設定しましょう。

注意
bonding、ブリッジ、802.1Q VLAN、無線ネットワークに間するより詳細な情報は、Gentoo Network Configurationセクションを参照してください。

すべてのネットワーク設定は/etc/conf.d/netにあります。直接的ではありますが、おそらく直感で理解できる構文ではありません。しかし恐れることはありません。すべては以下で説明されます。/usr/share/doc/netifrc-*/net.example.bz2に、多くの異なる設定に対して完全にコメントが付与された例が記載されています。

最初に net-misc/netifrc をインストールします。

root #emerge --ask --noreplace net-misc/netifrc

DHCPはデフォルトで使用されます。DHCPを動かすために、DHCPクライアントをインストールしなければなりません。これは Installing Necessary System Toolsで説明されます。

もし、特別なDHCPのオプションを設定している、もしくはDHCPをまったく使いたくない等の理由で、ネットワーク接続をしなければならないときは、/etc/conf.d/netを編集します。

root #nano -w /etc/conf.d/net

IPアドレスとルーティングを設定するのはconfig_eth0routes_eth0です。

注意
ここではネットワークインターフェイスがeth0であると仮定していますが、これはシステムによって違います。もし、最近のインストールメディアから起動しているのであれば、インストール時と同じインターフェイス名が使われると思ってよいでしょう。より詳しい情報はNetwork Interface Namingを参照してください。
FILE /etc/conf.d/net
config_eth0="192.168.0.2 netmask 255.255.255.0 brd 192.168.0.255"
routes_eth0="default via 192.168.0.1"

DHCPを使う場合は、config_eth0を設定してください。

FILE /etc/conf.d/netDHCPの定義
config_eth0="dhcp"

使用可能なオプションのリストについては、/usr/share/doc/netifrc-*/net.example.bz2を参照してください。もし特定のDHCPを設定しなければならないときは、DHCPクライアントのmanページも必ず読みましょう。

もし、システムが複数のネットワークインターフェースを持っている場合は、config_eth1config_eth2、…に対して上記の手順を繰り返してください。

設定を保存し、エディタを終了しましょう。

起動時に自動でネットワーク接続する

ブート時にネットワークインターフェースを有効にする場合は、デフォルトランレベルにそれらを追加する必要があります。

root #cd /etc/init.d
root #ln -s net.lo net.eth0
root #rc-update add net.eth0 default

もし、複数のネットワークインターフェースがある場合は、net.eth0と同じ方法で、適切なnet.*ファイルを作成しなければなりません。

もし、ブート後、ネットワークインターフェース名(現在、このドキュメントではeth0と記述)が間違っていた場合、次の手順で修正してください。

  1. 正しいインターフェース名で/etc/conf.d/netファイルを更新します。(例えばeth0enp3s0と修正)
  2. 新しいシンボリックリンクを作成。(例えば/etc/init.d/net.enp3s0
  3. 古いシンボリックリンクを消去。(rm /etc/init.d/net.eth0
  4. 新しいスクリプトをデフォルトランレベルに追加。
  5. rc-update del net.eth0 defaultで古いスクリプトを消去。

hostsファイル

次に、ネットワーク環境をLinuxに伝えます。これは/etc/hostsに定義され、ネームサーバでは解決できないホストについて、ホスト名からIPアドレスを決められるようになります。

root #nano -w /etc/hosts
FILE /etc/hostsネットワーク情報の記述
# 以下は本システムの定義です。必ず設定されなければなりません。
127.0.0.1     tux.homenetwork tux localhost
  
# ネットワーク上にあるその他のホストの定義です。任意設定です。
192.168.0.5   jenny.homenetwork jenny
192.168.0.6   benny.homenetwork benny

設定をセーブし、エディタを終了しましょう。

任意自由選択: PCMCIAを機能させる

PCMCIAユーザーは、sys-apps/pcmciautilsパッケージをインストールする必要があります。

root #emerge --ask sys-apps/pcmciautils

システム情報

rootパスワード

passwdコマンドでルートのパスワードを設定します。

root #passwd

ルートアカウントはとてもパワフルなアカウントなので、強いパスワードを与えてください。後で、日常の作業のための一般ユーザーアカウントを作成します。

initとboot設定

(少なくともOpenRCを使っているときは)Gentooは、システムのサービス、スタートアップ、シャットダウンの設定に/etc/rc.confを使います。/etc/rc.confを開いて、ファイル中のすべてのコメントを楽しみましょう。設定をレビューして、必要な箇所を変更してください。

root #nano -w /etc/rc.conf

次に、キーボードを設定するために/etc/conf.d/keymapsを開いて、正しいキーボードを選択、設定します。

root #nano -w /etc/conf.d/keymaps

keymap変数に特に注意してください。もしキーマップを間違えた場合、キーボードを叩くたびに、奇妙な現象が起こるでしょう。

最後に、クロック設定をするために/etc/conf.d/hwclockを編集します。個々の好みに合わせて設定できます。

root #nano -w /etc/conf.d/hwclock

もし、ハードウェアクロックがUTCになっていない場合、このファイルにclock="local"を記述しなければなりません。そうでない場合、クロックスキューが発生するでしょう。




MIPS ハンドブック
インストール
インストールについて
メディアの選択
ネットワーク設定
ディスクの準備
stage3のインストール
Gentooベースシステムのインストール
カーネルの設定
システムの設定
ツールのインストール
ブートローダの設定
締めくくり
Gentooの操作
Portageについて
USEフラグ
Portageの機能
Initスクリプトシステム
環境変数
Portageの操作
ファイルとディレクトリ
変数
ソフトウェアブランチの併用
追加ツール
カスタムPortageツリー
高度な機能
ネットワーク設定
はじめに
高度な設定
モジュール式ネットワーク
無線
機能の追加
動的な管理


システムロガー

同じ機能が複数のパッケージによって提供されるツールがいくつかあります。そういったツールはstage3アーカイブには含まれていません。どのパッケージをインストールしたいのかをあなた次第で選んでください。

まずシステムにロギング機能を提供するツールを決定しましょう。UnixとLinuxでは歴史をかけて素晴らしいログ機能を発展させてきました -- お望みならログファイルにシステムで起こった全てを記録できます。これはシステムロガーを使って行ないます。

Gentooでは複数のシステムロガーから使いたいものを選択することができます。このうちのいくつかを紹介します。

  • app-admin/sysklogdは、システムのログを取得するための伝統的なデーモンを集めたものです。デフォルトのログ設定をそのまま使ってもうまく働くので、このパッケージは初心者にはいい選択肢です。
  • app-admin/syslog-ngは、進化したシステムロガーです。1つの大きなファイルにログを取る以上のことをするには、何らかの設定が必要です。更に上級のユーザは、ロギングの発展性に基いてこのパッケージを選択できます。スマートなロギングのためには追加の設定が必要になることに注意してください。
  • app-admin/metalogは、高度な設定ができるシステムロガーです。

Portageツリーにはまだまだ他の選択肢があることでしょう。日毎にPortageツリーのパッケージは増えていますから。

Tip
もしsysklogdかsyslog-ngを使おうと思っているなら、これらのシステムログツールにはログファイルをローテーションする機構が無いので、後でlogrotateをインストールして設定しましょう。
Tip
systemd provides its own logging facility called the "journal". Installing a separate syslog provider is optional on systems running systemd, and may require additional configuration to have the syslog daemon read messages from the journal.

選択したシステムログツールをインストールするには、それをemergeして、rc-updateを使ってデフォルトのランレベルにスクリプトを追加してください。次の例ではapp-admin/sysklogdをインストールします。

root #emerge --ask app-admin/sysklogd
root #rc-update add sysklogd default

任意自由選択: cronデーモン

次はcronデーモンです。cronデーモンは入れても入れなくてもよく、システムに必須ではありませんが、インストールしておくのが賢明でしょう。

cronデーモンは予定されたコマンドを実行します。定期的(例えば日毎、週毎、月毎)にあるコマンドを実行する必要があるならとても重宝します。

Gentooではいくつものcronデーモンを提供しています。例をあげると sys-process/bcronsys-process/dcronsys-process/fcron、そしてsys-process/cronieです。その内の1つをインストールするのはシステムロガーをインストールするのに似ています。次の例はsys-process/cronieをインストールします。

root #emerge --ask sys-process/cronie
root #rc-update add cronie default

dcronかfcronを使う場合、初期設定のための追加コマンドが必要です。

root #crontab /etc/crontab

任意自由選択: ファイルのインデックスを作成

より高速なファイル検索のためにファイルシステム中の各ファイルのインデックスを作成するときは、sys-apps/mlocateをインストールしてください。

root #emerge --ask sys-apps/mlocate

任意自由選択: リモートアクセス

インストール後、システムにリモートからアクセスできるようにするためには、sshdをデフォルトのランレベルに追加してください。

root #rc-update add sshd default

(たとえばリモートサーバで)シリアルコンソールからアクセスしなければならない場合、/etc/inittabのシリアルコンソールの部分のコメントを外します。

root #nano -w /etc/inittab
# SERIAL CONSOLES
s0:12345:respawn:/sbin/agetty 9600 ttyS0 vt100
s1:12345:respawn:/sbin/agetty 9600 ttyS1 vt100

ファイルシステムツール

使っているファイルシステムよって、(ファイルシステムの整合性をチェックしたり、追加のファイルシステムを作成する等のために)必須のファイルシステムツールをインストールする必要があります。ext2/ext3/ext4ファイルシステムを管理するためのツール(sys-fs/e2fsprogs)は@system セットの一部としてインストール済みであることに注意してください。

次の表は、ファイルシステム毎にどのツールをインストールすべきかを示します。

ファイルシステム パッケージ
Ext2, 3, 4 sys-fs/e2fsprogs
XFS sys-fs/xfsprogs
ReiserFS sys-fs/reiserfsprogs
JFS sys-fs/jfsutils
VFAT (FAT32, ...) sys-fs/dosfstools
Btrfs sys-fs/btrfs-progs
Tip
Gentooのファイルシステムについてのさらなる情報は、ファイルシステムの記事を参照してください。

ネットワークツール

もし、追加のネットワークツールを必要としない場合、ブートローダーに進みましょう。

DHCPクライアントをインストールする

重要
DHCPはあくまで任意選択ですが、多くのユーザはネットワークに接続するためにDHCPクライアントが必要になるでしょう。この機会にDHCPクライアントをインストールしましょう。もしこの設定を忘れた場合、ネットワークに接続できないことになり、これによりDHCPクライアントがダウンロードできなくなってしまいます。

netifrcスクリプトを使用して、一つ以上のネットワークに自動的にIPアドレスを付与するときは、DHCPクライアントをインストールする必要があります。Gentooリポジトリには多くのDHCPクライアントがありますが、net-misc/dhcpcdがお薦めです。

root #emerge --ask net-misc/dhcpcd

dhcpcd articledhcpcdに関するより多くの情報があります。

任意自由選択: PPPoEクライアントのインストール

もしインターネットに接続するためにPPPを使うのであれば、net-dialup/pppパッケージをインストールします。

root #emerge --ask net-dialup/ppp

Optional: Install wireless networking tools

If the system will be connecting to wireless networks, install the net-wireless/iw package for Open or WEP networks and/or the net-wireless/wpa_supplicant package for WPA or WPA2 networks. iw is also a useful basic diagnostic tool for scanning wireless networks.

root #emerge --ask net-wireless/iw net-wireless/wpa_supplicant

次はブートローダーです。




MIPS ハンドブック
インストール
インストールについて
メディアの選択
ネットワーク設定
ディスクの準備
stage3のインストール
Gentooベースシステムのインストール
カーネルの設定
システムの設定
ツールのインストール
ブートローダの設定
締めくくり
Gentooの操作
Portageについて
USEフラグ
Portageの機能
Initスクリプトシステム
環境変数
Portageの操作
ファイルとディレクトリ
変数
ソフトウェアブランチの併用
追加ツール
カスタムPortageツリー
高度な機能
ネットワーク設定
はじめに
高度な設定
モジュール式ネットワーク
無線
機能の追加
動的な管理



arcload for Silicon Graphics machines

arcload was written for machines that require 64-bit kernels, and therefore can't use arcboot (which can't easily be compiled as a 64-bit binary). It also works around peculiarities that arise when loading kernels directly from the volume header. Let's proceed with the installation:

root #emerge arcload dvhtool

Once this has finished, find the arcload binary inside /usr/lib/arcload/. Now, two files exist:

  • sashARCS: The 32-bit binary for Indy, Indigo2 (R4k), Challenge S and O2 systems
  • sash64: The 64-bit binary for Octane/Octane2, Origin 200/2000 and Indigo2 Impact systems

Use dvhtool to install the appropriate binary for the system into the volume header:

For Indy/Indigo2/Challenge S/O2 users:

root #dvhtool --unix-to-vh /usr/lib/arcload/sashARCS sashARCS

For Indigo2 Impact/Octane/Octane2/Origin 200/Origin 2000 users:

root #dvhtool --unix-to-vh /usr/lib/arcload/sash64 sash64
Note
The name sashARCS or sash64 does not have to be used, unless the operation is installing to the volume header of a bootable CD. For normal boot from hard-disk, it can be named whatever the user wants.

Now just use dvhtool to verify they are in the volume header:

root #dvhtool --print-volume-directory
----- directory entries -----
Entry #0, name "sash64", start 4, bytes 55859

The arc.cf file has a C-like syntax. For the full detail on how one configures it, see the arcload page on the Linux/MIPS wiki. In short, define a number of options, which are enabled and disabled at boot time using the OSLoadFilename variable.

Filearc.cfAn example arc.cf

'"`UNIQ--pre-00000060-QINU`"'

This is a deprecated template. Help us update this template!

Starting with arcload-0.5, arc.cf and kernels may reside either in the volume header, or on a partition. To utilize this newer feature, place the files in the /boot/ partition (or / if the boot partition is not separate). arcload uses the filesystem driver code from the popular grub bootloader, and thus supports the same range of filesystems.

root #dvhtool --unix-to-vh arc.cf arc.cf
root #dvhtool --unix-to-vh /usr/src/linux/vmlinux new

CoLo for Cobalt MicroServers

Installing CoLo

On Cobalt servers, these machines have a much less capable firmware installed on chip. The Cobalt BOOTROM is primitive, by comparison to the SGI PROM, and has a number of serious limitations.

  • There's a 675kB (approximate) limit on kernels. The current size of Linux 2.4 makes it nearly impossible to make a kernel this size. Linux 2.6 and 3.x is totally out of the question.
  • 64-bit kernels are not supported by the stock firmware (although these are highly experimental on Cobalt machines at this time)
  • The shell is basic at best

To overcome these limitations, an alternative firmware, called CoLo (Cobalt Loader) was developed. This is a BOOTROM image that can either be flashed into the chip inside the Cobalt server, or loaded from the existing firmware.

Note
This guide will go through setting up CoLo so that it is loaded by the stock firmware. This is the only truly safe, and recommended way to set up CoLo.
Warning
If wanted, these can be flashed into the server to totally replace the original firmware -- however, you are entirely on your own in that endeavour. Should anything go wrong, physically remove the BOOTROM and reprogram it with the stock firmware. If this sounds scary -- then DO NOT flash the machine. We take no responsibility for whatever happens if you ignore this advice.

Let's get on with installing CoLo. First, start by emerging the package.

root #emerge --ask sys-boot/colo

With that installed, take a look inside the /usr/lib/colo/ directory to find two files:

  • colo-chain.elf (the "kernel" for the stock firmware to load), and
  • colo-rom-image.bin (a ROM image for flashing into the BOOTROM)

We start by mounting /boot/ and dumping a compressed copy of colo-chain.elf in /boot/ where the system expects it.

root #gzip -9vc /usr/lib/colo/colo-chain.elf > /boot/vmlinux.gz

Configuring CoLo

Now, when the system first boots up, it'll load CoLo which will spit up a menu on the back LCD. The first option (and default that is assumed after roughly 5 seconds) is to boot to the hard disk. The system would then attempt to mount the first Linux partition it finds, and run the script default.colo. The syntax is fully documented in the CoLo documentation (have a peek at /usr/share/doc/colo-X.YY/README.shell.gz -- where X.YY is the version installed), and is very simple.

Note
Just a tip: when installing kernels, it is recommended to create two kernel images, kernel.gz.working -- a known working kernel, and kernel.gz.new -- a kernel that's just been compiled. It is possible to use symlinks to point to the curent "new" and "working" kernels, or just rename the kernel images.
Filedefault.coloAn example CoLo configuration

'"`UNIQ--pre-00000063-QINU`"'

This is a deprecated template. Help us update this template!

Note
CoLo will refuse to load a script that does not begin with the #:CoLo:# line. Think of it as the equivalent of saying #!/bin/sh in shell scripts.

It is also possible to ask a question, such as which kernel & configuration to boot, with a default timeout. The following configuration does exactly this, asks the user which kernel they wish to use, and executes the chosen image. vmlinux.gz.new and vmlinux.gz.working may be actual kernel images, or just symlinks pointing to the kernel images on that disk. The 50 argument to select specifies that it should proceed with the first option ("Working") after 50/10 seconds.

Filedefault.coloMenu-based configuration

'"`UNIQ--pre-00000066-QINU`"'

This is a deprecated template. Help us update this template!

See the documentation in /usr/share/doc/colo-VERSION for more details.

Setting up for serial console

Okay, the Linux installation as it stands now, would boot fine, but assumes the user will be logged in at a physical terminal. On Cobalt machines, this is particularly bad -- there's no such thing as a physical terminal.

Note
Those who do have the luxury of a supported video chipset may skip this section if they wish.

First, pull up an editor and hack away at /etc/inittab. Further down in the file, notice the following:

File/etc/inittabSnippet from inittab

'"`UNIQ--pre-00000069-QINU`"'

This is a deprecated template. Help us update this template!

First, uncomment the c0 line. By default, it's set to use a terminal baud rate of 9600 bps. On Cobalt servers, this may be changed to 115200 to match the baud rate decided by the BOOT ROM. The following is how that section looks then. On a headless machine (e.g. Cobalt servers), we also recommend commenting out the local terminal lines (c1 through to c6) as these have a habit of misbehaving when they can't open /dev/ttyX.

File/etc/inittabExample snippet from inittab

'"`UNIQ--pre-0000006C-QINU`"'

This is a deprecated template. Help us update this template!

Now, lastly... we have to tell the system, that the local serial port can be trusted as a secure terminal. The file we need to poke at is /etc/securetty. It contains a list of terminals that the system trusts. We simply stick in two more lines, permitting the serial line to be used for root logins.

root #echo 'ttyS0' >> /etc/securetty

Lately, Linux also calls this /dev/tts/0 -- so we add this too:

root #echo 'tts/0' >> /etc/securetty

Tweaking the SGI PROM

Setting generic PROM settings

With the bootloader installed, after rebooting (which we will come to in a second), go to the System Maintenance Menu and select Enter Command Monitor (5) like did initially when netbooting the system.

CodeMenu after boot

'"`UNIQ--pre-0000006F-QINU`"'

This is a deprecated template. Help us update this template!

Provide the location of the Volume Header:

>>setenv SystemPartition scsi(0)disk(1)rdisk(0)partition(8)

Automatically boot Gentoo:

>>setenv AutoLoad Yes

Set the timezone:

>>setenv TimeZone EST5EDT

Use the serial console - graphic adapter users should have "g" instead of "d1" (one):

>>setenv console d1

Set the serial console baud rate. This is optional, 9600 is the default setting, although one may use rates up to 38400 if that is desired:

>>setenv dbaud 9600

Now, the next settings depend on how the system is booted.

Settings for direct volume-header booting

Note
This is covered here for completeness. It's recommended that users look into installing arcload instead.
Note
This only works on the Indy, Indigo2 (R4k) and Challenge S.

Set the root device to Gentoo's root partition, such as /dev/sda3:

>>setenv OSLoadPartition <root device>

To list the available kernels, type "ls".

>>setenv OSLoader <kernel name>
>>setenv OSLoadFilename <kernel name>

Declare the kernel parameters to pass:

>>setenv OSLoadOptions <kernel parameters>

To try a kernel without messing with kernel parameters, use the boot -f PROM command:

root #boot -f new root=/dev/sda5 ro

Settings for arcload

arcload uses the OSLoadFilename option to specify which options to set from arc.cf. The configuration file is essentially a script, with the top-level blocks defining boot images for different systems, and inside that, optional settings. Thus, setting OSLoadFilename=mysys(serial) pulls in the settings for the mysys block, then sets further options overridden in serial.

In the example file above, we have one system block defined, ip28 with working, new and debug options available. We define our PROM variables as so:

Select arcload as the bootloader:- sash64 or sashARCS:

>>setenv OSLoader sash64

Use the "working" kernel image, defined in "ip28" section of arc.cf:

>>setenv OSLoadFilename ip28(working)

Starting with arcload-0.5, files no longer need to be placed in the volume header -- they may be placed in a partition instead. To tell arcload where to look for its configuration file and kernels, one must set the OSLoadPartition PROM variable. The exact value here will depend on where the disk resides on the SCSI bus. Use the SystemPartition PROM variable as a guide -- only the partition number should need to change.

Note
Partitions are numbered starting at 0, not 1 as is the case in Linux.

To load from the volume header -- use partition 8:

>>setenv OSLoadPartition scsi(0)disk(1)rdisk(0)partition(8)

Otherwise, specify the partition and filesystem type:

>>setenv OSLoadPartition scsi(0)disk(1)rdisk(0)partition(0)[ext2]


システムのリブート

chroot環境を出て、全てのパーティションをアンマウントします。次に、最終かつ真のテストを実行するためのマジカルコマンドrebootを入力しましょう。

root #exit
cdimage ~#cd
cdimage ~#umount -l /mnt/gentoo/dev{/shm,/pts,}
cdimage ~#umount -R /mnt/gentoo
cdimage ~#reboot

もちろん、ブートCDを取り出しておいてください。そうしないと新しいGentooではなく、再度CDをブートしてしまいます。

新規にインストールされたGentooをリブートした後は、最終章インストールの締めくくりに進みましょう。




MIPS ハンドブック
インストール
インストールについて
メディアの選択
ネットワーク設定
ディスクの準備
stage3のインストール
Gentooベースシステムのインストール
カーネルの設定
システムの設定
ツールのインストール
ブートローダの設定
締めくくり
Gentooの操作
Portageについて
USEフラグ
Portageの機能
Initスクリプトシステム
環境変数
Portageの操作
ファイルとディレクトリ
変数
ソフトウェアブランチの併用
追加ツール
カスタムPortageツリー
高度な機能
ネットワーク設定
はじめに
高度な設定
モジュール式ネットワーク
無線
機能の追加
動的な管理


ユーザー管理

毎日使用するためのユーザを追加します

Unix/Linuxシステム上で、rootとして作業するのは危険であり、できるだけ避けるべきです。そのため、日々の使用のためのユーザーを追加することを強くお勧めします。

グループは、そのグループに所属するメンバーができることを定義します。次の表はいくつかの重要なグループを示します。

グループ 説明
audio オーディオデバイスにアクセスできます。
cdrom 光学デバイスに直接アクセスできます。
floppy フロッピーデバイスに直接アクセスできます。
games ゲームができます。
portage Portageの制限されたリソースにアクセスできます。
usb USBデバイスにアクセスできます。
video ビデオキャプチャのためのハードウェアにアクセスして、ハードウェアアクセラレーションを有効にできます。
wheel suを使うことができます。

例えばwheelusersaudioの3グループに所属するlarryというユーザを作成するには、最初にrootとしてログインし(rootだけがユーザを作ることができます)、useraddを実行します。

Login:root
Password: (rootのパスワードを入力してください)
root #useradd -m -G users,wheel,audio -s /bin/bash larry
root #passwd larry
Password: (larryのパスワードを入力してください)
Re-enter password: (確認のためにもう一度パスワードを入力してください)

もし、rootで何か作業をする場合は、一時的にroot権限を得るためにsu -を使います。別の方法はsudoパッケージを使用することです。これは(正しく設定されれば)とても安全です。

ディスクのクリーンアップ

tarファイルの削除

Gentooのインストールおよびリブート完了後、かつインストールがすべてうまくいった場合、ダウンロードしたステージ3のtarファイルを削除できます。このファイルは/ディレクトリにダウンロードされたことを思いだしましょう。

root #rm /stage3-*.tar.bz2*

次にすることは?

ドキュメント

次に何をしますか?どのような選択肢がありますか?どこを探索すればよいでしょう?Gentooには多くの可能性と共にユーザーが存在します。それゆえ多くのドキュメント化された機能を使うことができます(記述量は多くないのですが…)。

Definitely take a look at the next part of the Gentoo Handbook entitled Working with Gentoo which explains how to keep the software up to date, install additional software packages, details on USE flags, the OpenRC init system, etc.

ハンドブック以外では、コミュニティから追加提供されるドキュメントを見つけるために、Gentoo Wikiの他のコーナーを探索したいと思うでしょう。Gentoo Wikiチームは、Documentation topic overviewを提案します。これは、このWikiにある記事のよいセレクションを提供しています。例えば、システムをよりあなたの国に適したものとするためには、ローカライゼーションガイドを参照します。

Gentooオンライン

もちろん、私たちのGentoo forumsや多くのGentoo IRC channelsの一つに参加することはウェルカムです。

すべてのユーザーに問いかけるためにseveral mailing listsもあります。参加のための情報は上記に記載されています。

インストールを楽しみましょう! (^o^)/




Warning: Display title "Gentoo Linux mips ハンドブック: Gentoo をインストールする" overrides earlier display title "ハンドブック:MIPS/フル/インストール".