Handbook:Parts/Installation/Stage/zh-cn

设置日期和时间
Before installing Gentoo, it is a good idea to be sure the date and time are set correctly. A mis-configured clock may lead to strange results: base system files should be extracted with accurate time stamps. In fact, due to several websites and services using encrypted communications (SSL/TLS), it might not be possible to download the installation files at all if the system clock is too far skewed!

Verify the current date and time by running the command:

If the date/time displayed is wrong, update it using one of the methods below.

Automatic
Official Gentoo installation media includes the command (available through the  package). Official media includes a configuration file pointing to ntp.org time servers. It can be used to automatically sync the system clock to UTC time using a time server. Using this method requires a working network configuration and may not be available on all architectures.

Manual
The command can also be used to perform a manual set on the system clock. Use the  syntax (Month, Day, hour, minute and Year).

UTC time is recommended for all Linux systems. Later on during the installation a timezone will be defined. This will modify the display of the clock to local time.

For instance, to set the date to October 3rd, 13:16 in the year 2016:

multilib（32和64位）
选择一个基础压缩包的系统可以在稍后的安装过程节省大量的时间，特别是当它是一次 choose a system profile. 一个stage包的选择将直接影响未来的系统配置，可以在以后省的头痛. 该压缩包multilib尽可能使用64位的库，只必要时对32位版本兼容. 这对于大多数安装一个很好的选择，因为它在未来的定制提供了极大的灵活性量. 那些谁希望自己的系统，能够容易地切换配置,应该下载根据各自的处理器架构multilib的压缩包选项.

大多数用户应该不需要使用“高级”tar包选项；它们用于特定的软件或硬件配置.

no-multilib（纯64位）
选择一个no-multilib压缩包:no-multilib是在系统的基础上提供了一个完整的64位操作系统环境. 这有效地使得切换到multilib的profile是不可能的(不是完全不可能). 这些刚刚开始使用Gentoo的新手不应该选择一个 no-multilib 压缩包，除非"绝对必要". 而且应该有很好的理由并做出负责任的选择.

下载阶段tar包
前往挂载根文件系统的Gentoo挂载点（很像）：

根据不同的安装媒介，这里有一堆工具可用来下载一个阶段. 这些工具之一就是，一个非图形化、目录驱动的浏览器. 要下载一个阶段，访问到Gentoo镜像列表形如：

要为使用一个HTTP代理，在URL上传入一个 选项：

之外还有一个浏览器. 像是它是一个非图形化浏览器，但不是目录驱动.

如果需要定义一个代理，设置 http_proxy 和/或 ftp_proxy 变量：

On the mirror list, select a mirror close by. Usually HTTP mirrors suffice, but other protocols are available as well. Move to the directory. There all available stage files are displayed (they might be stored within subdirectories named after the individual sub-architectures). Select one and press to download.

还有些像是最小化安装CD的附加下载：


 * A 文件包含stage压缩包内的所有文件的列表
 * A 文件，其中包含的阶段文件的校验和，在不同的算法
 * A 像文件一样, 包含不同的stage文件的校验和，但也加密签名，以确保它是由Gentoo项目提供的.

完成以后，按退出这个浏览器.

在下载stage文件后，就可以验证所下载的stage包的完整性. 使用 并比较,提供的校验输出与或者 文件的内容是否一致.

比如，要验证SHA512校验值：

使用命令的另外一种方式：

要验证Whirlpool校验值：

该值需要匹配，否则下载的文件可能已损坏（或摘要文件）. 比较这些命令的输出与中的值. 该值需要匹配，否则下载的文件可能已损坏（或digests文件）.

就像在ISO文件中，它也可以来验证加密签名的. 使用 以确保DIGESTS.asc文件校验和未被篡改:

解开阶段tar包
现在，解压下载的stage到系统. 我们使用 来进行：

确保你使用了同样的参数 ( 即使用 ). 表示解开（Extract）， 表示详细信息（Verbose）可以用来查看解压缩时发生了什么（可选参数），  表示使用bzip2解压缩，the  表示保留权限（Preserve permissions），还有  表示我们要解开一个文件，而不是标准输入. 最后， 的是包括存储在归档以及扩展属性.

现在stage已经安装好，下面我们继续,Configuring the compile options.

介绍
To optimize Gentoo, it is possible to set a couple of variables which impacts the behavior of Portage, Gentoo's officially supported package manager. All those variables can be set as environment variables (using ) but that isn't permanent. To keep the settings, Portage reads in the file, a configuration file for Portage.

Fire up an editor (in this guide we use ) to alter the optimization variables we will discuss hereafter.

From the file it is obvious how the file should be structured: commented lines start with "#", other lines define variables using the VARIABLE="content" syntax. Several of those variables are discussed next.

CFLAGS和CXXFLAGS
The CFLAGS and CXXFLAGS variables define the optimization flags for the GCC C and C++ compiler respectively. Although those are defined generally here, for maximum performance one would need to optimize these flags for each program separately. The reason for this is because every program is different. However, this is not manageable, hence the definition of these flags in the file.

In one should define the optimization flags that will make the system the most responsive generally. Don't place experimental settings in this variable; too much optimization can make programs behave bad (crash, or even worse, malfunction).

We will not explain all possible optimization options. To understand them all, read the GNU Online Manual(s) or the gcc info page ( - only works on a working Linux system). The file itself also contains lots of examples and information; don't forget to read it too.

A first setting is the  or   flag, which specifies the name of the target architecture. Possible options are described in the file (as comments). A commonly used value is native as that tells the compiler to select the target architecture of the current system (the one users are installing Gentoo on).

A second one is the  flag (that is a capital O, not a zero), which specifies the gcc optimization class flag. Possible classes are s (for size-optimized), 0 (zero - for no optimizations), 1, 2 or even 3 for more speed-optimization flags (every class has the same flags as the one before, plus some extras). is the recommended default. is known to cause problems when used system-wide, so we recommend to stick to.

Another popular optimization flag is  (use pipes rather than temporary files for communication between the various stages of compilation). It has no impact on the generated code, but uses more memory. On systems with low memory, gcc might get killed. In that case, do not use this flag.

Using  (which doesn't keep the frame pointer in a register for functions that don't need one) might have serious repercussions on the debugging of applications.

When the CFLAGS and CXXFLAGS variables are defined, combine the several optimization flags in one string. The default values contained in the stage3 archive that is unpacked should be good enough. The following one is just an example:

MAKEOPTS
The MAKEOPTS variable defines how many parallel compilations should occur when installing a package. A good choice is the number of CPUs (or CPU cores) in the system plus one, but this guideline isn't always perfect.

Ready, set, go!
Update the file to match personal preference and save (nano users would hit +).

Then continue with Installing the Gentoo base system.