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

手册:PPC64/安装/选择安装媒介

From Gentoo Wiki (test)
Jump to:navigation Jump to:search
This page is a translated version of the page Handbook:PPC64/Installation/Media and the translation is 100% complete.
PPC64 Handbook
安装
关于安装
选择安装媒介
配置网络
准备磁盘
安装stage3
安装基本系统
配置Linux内核
配置系统
安装系统工具
配置系统引导程序Bootloader
收尾安装工作
使用Gentoo
Portage介绍
USE标记
Portage功能特性
初始化脚本(Initscript)系统
环境变量
使用Portage
文件和目录
变量
混合使用不同的软件分支
额外的工具
定制Portage树
高级特性
网络配置
入门
高级配置
模块化网络
无线
添加功能
动态管理


硬件需求

在开始之前,我们先列出在一台 ppc64 的主机上成功安装Gentoo所必须的硬件需求。


CPU Any PowerPC64 CPU
Systems IBM RS/6000s, Power Macintosh G5, IBM pSeries, and IBM iSeries.
Memory 64 MB
Diskspace 1.5 GB (excluding swap space)
Swap space At least 256 MB

For a full list of supported systems visit http://penguinppc.org/about-2/.


使用Gentoo Linux安装光盘

最小化安装CD

附注
在 2018 年 8 月 23 日,官方的最小CD“可以”在UEFI模式下启动。预览版仅支持在BIOS(MBR)模式下引导。如果希望使系统以UEFI启动,读者必须下载最新的ISO。

Gentoo最小化安装CD是一张包含有完整Gentoo环境的可引导镜像。它允许用户从CD或其它安装媒介引导进入Linux。在引导过程中将检测硬件并加载适当的驱动。这个镜像由Gentoo开发人员维护,能让任何有Internet连接的人来安装Gentoo。

最小化安装CD叫做install-ppc64-minimal-<release>.iso

偶尔用到的Gentoo LiveDVD

有时候需要用一张由Gentoo Ten项目特制的DVD来安装Gentoo。接下来的介绍是针对最小化安装CD的,因此可能会有一点不同。不管怎么样,LiveDVD(或任何其他可引导的Linux环境)支持通过在终端调输入 sudo su - 或者 sudo -i 来获取所需权限。

stage又是什么?

stage3压缩包是一个包含有最小化Gentoo环境的文件,可用来按照本手册介绍继续安装Gentoo。以前的Gentoo手册描述了使用三个 stage tarballs的其中一个来进行安装。现在Gentoo仍然提供stage1和stage2的压缩包,但是官方安装方法只使用stage3压缩包。如果你对使用stage1或stage2压缩包安装Gentoo感兴趣,请阅读 Gentoo 常见问题中的如何使用stage1或stage2 tarball安装Gentoo?

Stage 文件更新比较频繁并且不在安装镜像中提供,但可以在任意一个Gentoo官方镜像站 releases/ppc64/autobuilds/ 路径下选择下载。

下载

获得安装媒介

Gentoo Linux使用最小化安装CD做为默认安装媒介,它带有一个非常小的可引导的Gentoo Linux环境。此环境包含所有正确的安装工具. CD镜像本身可以从官方下载页(推荐)或任意一个镜像站下载。

在这些镜像站上,最小化安装CD可以通过以下方式找到:

  1. 进入 releases/ 目录
  2. 选择相应的架构, 如 ppc64/
  3. 选择 autobuilds/ 目录
  4. 对于 amd64x86 平台的用户,请选择 current-install-amd64-minimal/current-install-x86-minimal/ 目录。如果需要所有其它平台的,请进入 current-iso/ 目录。
附注
一些架构例如armmips,和s390 是没有最小化安装 CD 的。 这是因为 Gentoo 发行工程项目 ( Gentoo Release Engineering project ) 不支持构建这些平台的.iso文件。

在这个位置,安装媒体文件是那些带有.iso扩展名的文件。比如下面的清单:

CODE releases/中的文件样本ppc64/autobuilds/current-iso/
[DIR] hardened/                                          05-Dec-2014 01:42    -   
[   ] install-ppc64-minimal-20141204.iso                 04-Dec-2014 21:04  208M  
[   ] install-ppc64-minimal-20141204.iso.CONTENTS        04-Dec-2014 21:04  3.0K  
[   ] install-ppc64-minimal-20141204.iso.DIGESTS         04-Dec-2014 21:04  740   
[TXT] install-ppc64-minimal-20141204.iso.DIGESTS.asc     05-Dec-2014 01:42  1.6K  
[   ] stage3-ppc64-20141204.tar.bz2                      04-Dec-2014 21:04  198M  
[   ] stage3-ppc64-20141204.tar.bz2.CONTENTS             04-Dec-2014 21:04  4.6M  
[   ] stage3-ppc64-20141204.tar.bz2.DIGESTS              04-Dec-2014 21:04  720   
[TXT] stage3-ppc64-20141204.tar.bz2.DIGESTS.asc          05-Dec-2014 01:42  1.5K

在上面的例子中, install-ppc64-minimal-20141204.iso文件是最小化安装CD。但可以看到,还有其他相关文件存在:

  • .CONTENTS 文件是一个文本文件,它列出了安装媒介中的所有文件。这个文件可用于在下载前确认安装媒介是否包含特定的固件和驱动程序。
  • .DIGESTS 文件包含了ISO文件的Hash值,有不同的Hash格式/算法。这个文件可以用来验证已下载的ISO文件有没有损坏。
  • .DIGESTS.asc 文件不仅包含了ISO文件的Hash值(和 .DIGESTS 文件一样),还包含了它的加密签名。这个文件即可用于验证已下载的ISO文件是否损坏,也可验证文件确实是由Gentoo发行工程组(Gentoo Release Engineering Team)发布而没有被篡改。

现在可以先忽略当前位置的其他文件——它们在安装的后续步骤中会被提到。下载 .ISO,另外如果想要验证下载的文件,同时下载ISO文件对应的 .DIGESTS.asc.CONTENTS 文件不需要下载,因为安装指南后续不会用到这个文件。 .DIGESTS 这个文件和.DIGESTS.asc 文件包含相同的信息,除此以外后者还包含有上面文件的数字签名。

校验下载的文件

附注
这是一个可选步骤,并不是安装 Gentoo Linux 所必须的。但是,我们仍然推荐这么做,以此来确保下载的文件没有损坏,以及确保下载文件确实由 Gentoo发行工程组( Gentoo Release Engineering Team ) 提供。

通过 .DIGESTS.DIGESTS.asc 文件,可以使用合适的工具来校验 ISO 文件的有效性。校验通常有两个步骤:  

  1. 首先,验证加密签名,确保安装文件是由Gentoo发行工程组( Gentoo Release Engineering team ) 提供
  2. 如果加密签名是有效的,就验证它的文件校验值 (比如 SHA512,WHIRLPOOL),以此来确认下载的文件没有损坏。

在微软 Windows 操作系统上校验

在微软 Windows 系统上,已经安装用来验证校验和加密签名工具的可能性很低。

首先验证文件数字( GPG )签名,可以使用类似 GPG4Win 这样的工具。安装完工具后,需要导入 Gentoo 发行工程组(Gentoo Release Engineering Team)的公钥。 公钥列表在: 数字签名页。 一但导入完成,用户就可以验证 .DIGESTS.asc 文件的数字签名。

重要
这并不能验证 .DIGESTS 文件是否正确,只是验证有.DIGESTS.asc 文件。这同时也意味着 .DIGESTS.asc 文件所包含的校验和的值也一起被验证了,这就是为什么上面的说明只要求下载 .DIGESTS.asc 文件。

可以使用 Hashcalc 应用 来计算校验和,当然还有许多其他工具也可以用。在大多数情况下,这些工具将向用户显示计算出来的校验值,用户需要将它和 .DIGESTS.asc 文件中的值进行比对验证。

在已有的 Linux 系统上校验

在 Linux 系统上,最常用的验证加密签名的方法就是使用 app-crypt/gnupg 这个软件。安装了这个程序,就可以使用以下命令来验证 .DIGESTS.asc 文件中的数字(GPG)签名。

首先,下载 数字签名页 中正确的密匙:

user $gpg --keyserver hkp://keys.gnupg.net --recv-keys 0xBB572E0E2D182910
gpg: requesting key 0xBB572E0E2D182910 from hkp server pool.sks-keyservers.net
gpg: key 0xBB572E0E2D182910: "Gentoo Linux Release Engineering (Automated Weekly Release Key) <releng@gentoo.org>" 1 new signature
gpg: 3 marginal(s) needed, 1 complete(s) needed, classic trust model
gpg: depth: 0  valid:   3  signed:  20  trust: 0-, 0q, 0n, 0m, 0f, 3u
gpg: depth: 1  valid:  20  signed:  12  trust: 9-, 0q, 0n, 9m, 2f, 0u
gpg: next trustdb check due at 2018-09-15
gpg: Total number processed: 1
gpg:         new signatures: 1

下一步验证 .DIGESTS.asc 文件的数字(GPG)签名:

user $gpg --verify install-ppc64-minimal-20141204.iso.DIGESTS.asc
gpg: Signature made Fri 05 Dec 2014 02:42:44 AM CET
gpg:                using RSA key 0xBB572E0E2D182910
gpg: Good signature from "Gentoo Linux Release Engineering (Automated Weekly Release Key) <releng@gentoo.org>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 13EB BDBE DE7A 1277 5DFD  B1BA BB57 2E0E 2D18 2910

为了绝对确定所有文件都是有效的,验证上面显示的密匙指纹信息是否和 数字签名页 的密匙指纹信息一致。

确认数字签名有效后,接下来就是验证校验值,以确保下载的ISO文件没有损坏。 .DIGESTS.asc 文件包含了多个哈希算法,所以验证正确校验和的方法之一是先找到登记在文件 .DIGESTS.asc 中的相应的校验值。例如,获取 SHA512 的校验值:

user $grep -A 1 -i sha512 install-ppc64-minimal-20141204.iso.DIGESTS.asc
# SHA512 HASH
364d32c4f8420605f8a9fa3a0fc55864d5b0d1af11aa62b7a4d4699a427e5144b2d918225dfb7c5dec8d3f0fe2cddb7cc306da6f0cef4f01abec33eec74f3024  install-ppc64-minimal-20141204.iso
--
# SHA512 HASH
0719a8954dc7432750de2e3076c8b843a2c79f5e60defe43fcca8c32ab26681dfb9898b102e211174a895ff4c8c41ddd9e9a00ad6434d36c68d74bd02f19b57f  install-ppc64-minimal-20141204.iso.CONTENTS

在上面的输出中,显示了两个SHA512校验和:一个用于文件:install-ppc64-minimal-20141204.iso,一个用于与之对应的 .CONTENTS 文件。只有第一个校验值有用,因为要用它来和下面计算出来的 SHA512 的校验值进行比较:

user $sha512sum install-ppc64-minimal-20141204.iso
364d32c4f8420605f8a9fa3a0fc55864d5b0d1af11aa62b7a4d4699a427e5144b2d918225dfb7c5dec8d3f0fe2cddb7cc306da6f0cef4f01abec33eec74f3024  install-ppc64-minimal-20141204.iso

如果两个校验值匹配,那么表明文件没有损坏,安装可以继续进行。损坏的文件会导致安装出现问题,请重新下载。

刻录光盘

当然,只是下载一个 ISO 文件是无法开始 Gentoo Linux 的安装的。需要将这个ISO文件刻录成一张用来启动的 CD 光盘,是要将 ISO 文件里的内容而不是 ISO 文件本身刻录到CD光盘上。下面介绍了一些常见的方式 - 这里可以找到其他更复杂的方式:[如何刻录ISO文件].

在微软 Windows上刻录

在微软 Windows 上有许多工具支持将 ISO 文件刻录到 CD 光盘。

  • 使用 EasyCD Creator,选择菜单“文件从CD镜像刻录CD”(File,Record CD from CD image)。然后选择“文件类型”(Files of type)为“ISO镜像文件”(ISO image file)。找到ISO文件所在位置,点击“打开”(Open)。点击“开始刻录”(Start recording)后 ISO 镜像将会正确地刻录到 CD-R 光盘上。
  • 使用 Nero Burning ROM,取消自动弹出的向导,从“文件”(File)菜单选择“刻录镜像”(Burn Image)。 选择要刻录的镜像文件然后点击“打开”(Open)。选择“刻录”(Burn)按键,然后等待 CD 光盘刻录完成。

在已有的 Linux 系统上刻录

在 Linux 系统上,可以通过 cdrecord 命令将ISO文件刻录到CD光盘上,这个命令由 app-cdr/cdrtools 软件包提供。

例如,将ISO文件刻录到 /dev/sr0 设备的 CD 光碟上(这是系统上的第一个 CD 设备-在必要时将其替换为正确的设备):

user $cdrecord dev=/dev/sr0 install-ppc64-minimal-20141204.iso

喜欢使用图形化界面的用户可以使用 K3B ,它由 kde-app/k3b 软件包提供。在 K3B 软件中,选择“工具”Tools)菜单,然后选择“刻录CD镜像”(Burn CD Image)。然后按照 K3B 提供的使用说明操作。

启动

Default: Booting the installation CD on an Apple/IBM

Place the installation CD in the CD-ROM and reboot the system. Hold down the c key at bootup. A friendly message will show up together with a boot: prompt at the bottom of the screen.

Tip
Hold the left mouse button during the boot process to open the CD/DVD drive tray.

On this prompt, the default Linux kernel (called gentoo) can be booted, which will boot up from the installation CD further.

Some kernel options can be tweaked at this prompt. The following table lists the available boot options that can be added:

Boot option Description
video= This option takes one of the following vendor-specific values: radeonfb, rivafb, atyfb, aty128, nvidiafb, or ofonly. Follow this tag with the resolution and refresh rate that is needed. For instance video=radeonfb:1280x1024@75. When uncertain what to choose, ofonly will almost certainly work.
nol3 Disables level 3 cache on some Powerbooks (needed for at least the 17").
debug Enables verbose booting, spawns an initrd shell that can be used to debug the installation CD.
sleep=N Wait N seconds (where N is an integer number) before continuing. This can be needed by some very old SCSI CD-ROMs which do not speed up the CD quick enough.
bootfrom=X Where X is substituted for a another device name to from a different device.
dosshd Starts sshd. Useful for unattended installs.
passwd=foo Sets whatever is after the = as the root password. Use with dosshd for remote installs.

At this prompt, hit enter, and a complete Gentoo Linux environment will be loaded from the CD.

IBM pSeries

On the IBM pSeries, the CD should autoboot, but sometimes it does not. In that case, set up the CD-ROM as a bootable device in the multi-boot menu. If a monitor and a keyboard is attached, then the multi-boot menu can be reached by pressing the F1 key on startup. However, if the system is reached through the serial console, then press 1. Press the key when the beginning of the following line on the serial console is visible:

CODE Line at which point '1' should be pressed
memory      keyboard     network      scsi      speaker

The other option is to jump into Open Firmware and do it from there:

  1. Boot into Open Firmware: same procedure as getting into multi-boot (described a few lines above), but use F8 and 8 instead of F1 and 1.
  2. Run the command 0> boot cdrom:1,yaboot
  3. Stand back and enjoy!
Note
If the following output is displayed, then Open Firmware isn't set up correctly. Please use the multi-boot option described above:
CODE Output if Open Firmware is not set up correctly
0 > boot cdrom:1,yaboot
 ok
0 >

Setting keyboard layout

On the console, a root (#) prompt will become visible. It is also possible to switch to other consoles by pressing and holding Alt+fn then F2, F3, or F4. Get back to the initial prompt by pressing Alt+fn+F1.

When installing Gentoo on a system with a non-US keyboard, use loadkeys to load the keymap for the keyboard. To list the available keymaps, execute ls on the /usr/share/keymaps/i386/ directory:

root #ls /usr/share/keymaps/i386/

Load the keymap of choice with the loadkeys command:

root #loadkeys be-latin1

Another common option would be the QWERTY PC110 key configuration:

root #loadkeys pc110


额外的硬件配置

当安装媒介启动时,它会尝试检测所有的硬件设备并加载合适的内核模块来支持硬件。在绝大多数的情况下,它工作得很好。然而,在某些情况下它可能没有自动加载系统所需的内核模块。如果 PCI 自动检测错过了一些系统硬件,相应的内核模块就必须手动加载了。

下面例子手工加载了 8139too 模块(它提供对某些类型的网卡的支持):

root #modprobe 8139too

可选:用户账号

如果其他人需要访问安装环境,或者需要以非 root 用户的身份在安装媒介上运行命令(例如出于安全原因使用没有 root 特权的 irssi 聊天),这时就需要创建额外的用户帐户,并将 root 用户密码设为强密码。

使用 passwd 命令来修改 root 用户密码:

root #passwd
New password: (Enter the new password)
Re-enter password: (Re-enter the password)

要创建一个用户账户,先输入他们的信息,然后设置密码。用 useraddpasswd 命令来完成这些操作。

在下面的例子中,创建了一个名为“john”的用户。

root #useradd -m -G users john
root #passwd john
New password: (Enter john's password)
Re-enter password: (Re-enter john's password)

使用 su 命令可以从 root 用户(当前用户)切换到新建的用户:

root #su - john

可选:在安装时查看文档

TTYs

要在安装期间查看 Gentoo 安装手册,首先要按照上面的方法创建一个新的用户帐户。然后按 Alt+F2 进入一个新的终端。

在安装期间, 可以用 links 命令来浏览 Gentoo 安装手册 - 当然,只有在互联网连接可用的时候才行。

user $links https://wiki.gentoo.org/wiki/Handbook:PPC64

要回到原来的终端,请按 Alt+F1

GNU Screen

GNU Screen是官方Gentoo安装介质中默认安装的实用程序。对于经验丰富的Linux爱好者来说,使用 screen 分割窗口查看安装说明,而不是上面提到的多个TTY的方法, 这可能更高效。

可选:启动SSH服务

要在安装期间允许其他用户访问你的系统(可能是为了在安装过程中提供技术支持,甚至远程安装),需要添加一个用户账户(就像之前的文档描述的那样)同时 SSH 服务也要启动。

若要在 OpenRC init 启动 SSH 服务,请执行以下命令:

root #rc-service sshd start
附注
如果用户登录到系统,他们将看到一个本系统主机密钥需要确认的信息(也就是我们说的密匙指纹)。此行为是典型的并且可以像预期一样与SSH服务器进行初始连接。但是,以后当系统设置好,并有人登录到新安装的系统时,SSH客户端会警告主机密钥已被更改。这是因为现在用户登录 - 对于SSH来讲 - 是一个不同的服务器(即新安装的Gentoo系统,而不是现在正在使用的安装系统环境)。请按照屏幕上的指示,去替换用户端的主机密钥

网络需要能正常工作,sshd 才能使用。请参照 配置网络 的内容继续安装。