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

From Gentoo Wiki
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 手册
安装
关于安装
选择安装媒介
配置网络
准备磁盘
安装 stage3
安装基础系统
配置内核
配置系统
安装系统工具
配置引导程序
安装收尾
使用 Gentoo
Portage 介绍
USE 标记
Portage 功能特性
Initscript 系统
环境变量
使用 Portage
文件和目录
变量
混合使用不同的软件分支
额外的工具
自定义软件包仓库
高级特性
配置网络
开始
高级配置
模块化网络
无线网络
添加功能
动态管理


硬件需求

安装之前,为了使 ppc64 系统架构能成功安装 Gentoo,我们应该满足最低硬件要求。

Handbook:PPC64/Blocks/HWReqs/zh-cn

使用Gentoo Linux安装光盘

提示
虽然推荐使用官方安装媒介,但还是可以选择其他非 Gentoo 安装媒介。Gentoo 安装媒介可以确保 live 操作系统环境中有必要的工具。当使用非 Gentoo 安装媒介时,可以直接跳到准备磁盘

最小化安装CD

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

最小化安装 CD 命名的格式为: install-<arch>-minimal-<release timestamp>.iso

偶尔用到的Gentoo LiveDVD

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

stage 文件是什么?

stage3压缩包是一个包含有最小化的特定profile的Gentoo环境的压缩包,Stage3可用来按照本手册介绍继续安装Gentoo。以前的Gentoo手册描述了使用三个 stage tarballs 的其中一个来进行安装。Gentoo不再提供stage1和stage2压缩包供下载,因为它们主要用于内部使用和在新架构上对Gentoo进行bootstrap。

stage 3 文件可以在任意一个Gentoo官方镜像站releases/ppc64/autobuilds/ 内下载。Stage 文件更新比较频繁因此不不包含在官方 live 镜像中。

提示
For now, stage files can be ignored. They will be described in greater detail later when they are needed
附注
Historically, the handbook described installation steps for stage files with versions lower than 3. These stages contained environments unsuitable for typical installations, and are no longer covered in the handbook.

下载

获得安装媒介

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

Navigating Gentoo mirrors

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

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

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

代码 releases/amd64/autobuilds/current-install-amd64-minimal/ 内可下载的文件列表示例
[TXT]	install-amd64-minimal-20231112T170154Z.iso.asc	        2023-11-12 20:41        488
[TXT]	install-amd64-minimal-20231119T164701Z.iso.asc	        2023-11-19 18:41        488
[TXT]	install-amd64-minimal-20231126T163200Z.iso.asc	        2023-11-26 18:41        488
[TXT]	install-amd64-minimal-20231203T170204Z.iso.asc	        2023-12-03 18:41        488
[TXT]	install-amd64-minimal-20231210T170356Z.iso.asc	        2023-12-10 19:01        488
[TXT]	install-amd64-minimal-20231217T170203Z.iso.asc	        2023-12-17 20:01        488
[TXT]	install-amd64-minimal-20231224T164659Z.iso.asc	        2023-12-24 20:41        488
[TXT]	install-amd64-minimal-20231231T163203Z.iso.asc	        2023-12-31 19:01        488
[ ]     install-amd64-minimal-20240107T170309Z.iso              2024-01-07 20:42        466M
[ ]     install-amd64-minimal-20240107T170309Z.iso.CONTENTS.gz	2024-01-07 20:42        9.8K
[ ]     install-amd64-minimal-20240107T170309Z.iso.DIGESTS      2024-01-07 21:01        1.3K
[TXT]   install-amd64-minimal-20240107T170309Z.iso.asc	        2024-01-07 21:01        488
[ ]     install-amd64-minimal-20240107T170309Z.iso.sha256       2024-01-07 21:01        660
[TXT]	latest-install-amd64-minimal.txt                        2024-01-08 02:01        653

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

  • .CONTENTS.gz 文件是使用 gz 压缩的文本文件,它列出了安装媒介中的所有文件。这个文件可用于在下载前确认安装媒介是否包含特定的固件和驱动程序。
  • .DIGESTS 文件包含了ISO文件的 Hash 值,有不同的 Hash 格式/算法。这个文件可以用来验证已 ISO 文件完整性。
  • .asc 文件是 ISO 文件的加密签名。这个文件即可用于验证镜像完整性和准确性 —— 下载的文件确实是由 Gentoo 发行工程团队 提供的,以免文件被篡改。

现在可以先忽略当前位置的其他文件——它们在安装的后续步骤中会被提到。下载 .ISO,另外如果想要验证下载的文件,同时下载ISO文件对应的 .iso.asc

提示
.DIGESTS 文件只在 .iso.asc 文件签名未验证时需要。

校验下载的文件

附注
这是一个可选步骤,并不是安装 Gentoo Linux 所必须的。但是,我们仍然推荐这么做,以此来确保下载的文件没有损坏,以及确保下载文件确实由 Gentoo基础设施团队提供。

.asc 文件提供了 ISO 的加密签名。验证了加密签名,可以确保安装文件是由Gentoo发行工程组( Gentoo Release Engineering team )提供,并且没有损坏和修改。

在微软 Windows 操作系统上校验

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

在已有的 Linux 系统上校验

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

提示
导入 Gentoo 密钥时,需要验证指纹与 (BB572E0E2D182910) 匹配。
Gentoo 密钥可以从 hkps://keys.gentoo.org 下载,可用的指纹可以在数字签名页 找到:
user $gpg --keyserver hkps://keys.gentoo.org --recv-keys 13EBBDBEDE7A12775DFDB1BABB572E0E2D182910
gpg: directory '/root/.gnupg' created
gpg: keybox '/root/.gnupg/pubring.kbx' created
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key BB572E0E2D182910: public key "Gentoo Linux Release Engineering (Automated Weekly Release Key) <releng@gentoo.org>" imported
gpg: Total number processed: 1
gpg:               imported: 1

或者,您可以使用 WKD 来下载密钥:

user $gpg --auto-key-locate=clear,nodefault,wkd --locate-key releng@gentoo.org
gpg: key 9E6438C817072058: public key "Gentoo Linux Release Engineering (Gentoo Linux Release Signing Key) <releng@gentoo.org>" imported
gpg: key BB572E0E2D182910: public key "Gentoo Linux Release Engineering (Automated Weekly Release Key) <releng@gentoo.org>" imported
gpg: Total number processed: 2
gpg:               imported: 2
gpg: no ultimately trusted keys found
pub   dsa1024 2004-07-20 [SC] [expires: 2025-07-01]
      D99EAC7379A850BCE47DA5F29E6438C817072058
uid           [ unknown] Gentoo Linux Release Engineering (Gentoo Linux Release Signing Key) <releng@gentoo.org>
sub   elg2048 2004-07-20 [E] [expires: 2025-07-01]

或者使用 Gentoo 官方发行的安装媒介,从 /usr/share/openpgp-keys/gentoo-release.asc 导入密钥(由 sec-keys/openpgp-keys-gentoo-release 提供):

user $gpg --import /usr/share/openpgp-keys/gentoo-release.asc
gpg: directory '/home/larry/.gnupg' created
gpg: keybox '/home/larry/.gnupg/pubring.kbx' created
gpg: key DB6B8C1F96D8BF6D: 2 signatures not checked due to missing keys
gpg: /home/larry/.gnupg/trustdb.gpg: trustdb created
gpg: key DB6B8C1F96D8BF6D: public key "Gentoo ebuild repository signing key (Automated Signing Key) <infrastructure@gentoo.org>" imported
gpg: key 9E6438C817072058: 3 signatures not checked due to missing keys
gpg: key 9E6438C817072058: public key "Gentoo Linux Release Engineering (Gentoo Linux Release Signing Key) <releng@gentoo.org>" imported
gpg: key BB572E0E2D182910: 1 signature not checked due to a missing key
gpg: key BB572E0E2D182910: public key "Gentoo Linux Release Engineering (Automated Weekly Release Key) <releng@gentoo.org>" imported
gpg: key A13D0EF1914E7A72: 1 signature not checked due to a missing key
gpg: key A13D0EF1914E7A72: public key "Gentoo repository mirrors (automated git signing key) <repomirrorci@gentoo.org>" imported
gpg: Total number processed: 4
gpg:               imported: 4
gpg: no ultimately trusted keys found

下一步,验证加密签名:

user $gpg --verify install-amd64-minimal-20240107T170309Z.iso.asc
gpg: assuming signed data in 'install-amd64-minimal-20240107T170309Z.iso'
gpg: Signature made Sun 07 Jan 2024 03:01:10 PM CST
gpg:                using RSA key 534E4209AB49EEE1C19D96162C44695DB9F6043D
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
     Subkey fingerprint: 534E 4209 AB49 EEE1 C19D  9616 2C44 695D B9F6 043D

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

附注
It's generally good practice to mark an imported key as trusted, once it's certain the key is trustworthy. When trusted keys are verified, gpg will not say unknown and warn about the signature being untrusted.

Writing the boot media

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

Writing a bootable USB

大多数的现代系统支持从 USB 设备启动。

使用 Linux 写入

dd is typically available on most Linux distros, and can be used to write the Gentoo boot media to a USB drive.

Determining the USB device path

Before writing, the path to the desired storage device must be determined.

dmesg will display detailed information describing the storage device as it is added to the system:

root #dmesg
[268385.319745] sd 19:0:0:0: [sdd] 60628992 512-byte logical blocks: (31.0 GB/28.9 GiB)

Alternatively, lsblk can be used to display available storage devices:

root #lsblk
sdd           8:48   1  28.9G  0 disk
├─sdd1        8:49   1   246K  0 part
├─sdd2        8:50   1   2.8M  0 part
├─sdd3        8:51   1 463.5M  0 part
└─sdd4        8:52   1   300K  0 part

Once the device name has been determined, this can be added to the path prefix /dev/ to get the device path /dev/sdd.

提示
Using the base device path, ie. sdd opposed to sdd1, is recommend as the Gentoo boot media contains a full GPT partition scheme.
使用 dd 写入
警告
Be sure to check the target (of=target) path before executing dd, as it will be overwritten.

With the device path (/dev/sdd) and boot media install-amd64-minimal-<release timestamp>.iso ready:

root #dd if=install-amd64-minimal-<release timestamp>.iso of=/dev/sdd bs=4096 status=progress && sync
附注
if= specifies the input file, of= specifies the output file, which in this case, is a device.
提示
bs=4096 is used as it speeds up transfers in most cases, status=progress displays transfers stats.

刻录光盘

另请参阅
A more elaborate set of instructions can be found in CD/DVD/BD_writing#Image_writing.

在Microsoft Windows 7和更高版本上刻录

Microsoft Windows 7 及更高版本可以将 ISO 映像装载和刻录到光学媒体,无需第三方软件。 只需插入可刻录磁盘,浏览到下载的 ISO 文件,在 Windows 资源管理器中右键单击该文件,然后选择“刻录磁盘映像”。

在已有的 Linux 系统上刻录

app-cdr/cdrtools中的cdrecord可以在Linux下烧录ISO镜像

将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)。

启动

Handbook:PPC64/Blocks/Booting/zh-cn

额外的硬件配置

当安装媒介启动时,它会尝试检测所有的硬件设备并加载合适的内核模块来支持硬件。在绝大多数的情况下,它工作得很好。然而,在某些情况下它可能没有自动加载系统所需的内核模块。如果 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

可选:在安装时查看文档

终端

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

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

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

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

提示
启动到最小化 Gentoo 或者 Gentoo 管理环境后,有 7 个终端可供使用。可以按 AltF1F7 之间的功能键来切换。当等待任务完成的时候,切换到一个新的终端可以很方便的用来打开文档等。

GNU Screen

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

可选:启动SSH服务

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

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

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

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