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

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

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


硬件需求

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


Pretty much every IA64 should be able to boot Gentoo. At the moment we only have a LiveCD, so the machine must have a CDROM drive installed.


使用Gentoo Linux安装光盘

最小化安装CD

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

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

最小化安装CD叫做install-ia64-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/ia64/autobuilds/ 路径下选择下载。

下载

获得安装媒介

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

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

  1. 进入 releases/ 目录
  2. 选择相应的架构, 如 ia64/
  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/中的文件样本ia64/autobuilds/current-iso/
[DIR] hardened/                                          05-Dec-2014 01:42    -   
[   ] install-ia64-minimal-20141204.iso                 04-Dec-2014 21:04  208M  
[   ] install-ia64-minimal-20141204.iso.CONTENTS        04-Dec-2014 21:04  3.0K  
[   ] install-ia64-minimal-20141204.iso.DIGESTS         04-Dec-2014 21:04  740   
[TXT] install-ia64-minimal-20141204.iso.DIGESTS.asc     05-Dec-2014 01:42  1.6K  
[   ] stage3-ia64-20141204.tar.bz2                      04-Dec-2014 21:04  198M  
[   ] stage3-ia64-20141204.tar.bz2.CONTENTS             04-Dec-2014 21:04  4.6M  
[   ] stage3-ia64-20141204.tar.bz2.DIGESTS              04-Dec-2014 21:04  720   
[TXT] stage3-ia64-20141204.tar.bz2.DIGESTS.asc          05-Dec-2014 01:42  1.5K

在上面的例子中, install-ia64-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-ia64-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-ia64-minimal-20141204.iso.DIGESTS.asc
# SHA512 HASH
364d32c4f8420605f8a9fa3a0fc55864d5b0d1af11aa62b7a4d4699a427e5144b2d918225dfb7c5dec8d3f0fe2cddb7cc306da6f0cef4f01abec33eec74f3024  install-ia64-minimal-20141204.iso
--
# SHA512 HASH
0719a8954dc7432750de2e3076c8b843a2c79f5e60defe43fcca8c32ab26681dfb9898b102e211174a895ff4c8c41ddd9e9a00ad6434d36c68d74bd02f19b57f  install-ia64-minimal-20141204.iso.CONTENTS

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

user $sha512sum install-ia64-minimal-20141204.iso
364d32c4f8420605f8a9fa3a0fc55864d5b0d1af11aa62b7a4d4699a427e5144b2d918225dfb7c5dec8d3f0fe2cddb7cc306da6f0cef4f01abec33eec74f3024  install-ia64-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-ia64-minimal-20141204.iso

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

启动

Booting the installation CD

Once the installation CD is burned, it is time to boot it. Remove all CDs from the CD drives, and insert the Gentoo installation CD. Reboot the system and wait for the EFI firmware to load on the console. The exact option to select will differ depending on the hardware.

Most implementations usually present an option directly on the first menu (the EFI Boot Manager). The exact wording would differ but would usually be something like "CD Boot", "Removable Media Boot" or "Internal Bootable DVD". Select this option.

If the EFI implementation does not present such an option, boot the CD using the EFI Shell. All implementations will present an option to enter the shell on the Boot Manager menu. Select this option. The EFI Shell will display a list of usable block devices (blkn:) and also a list of filesystems the EFI Shell can actually access (fsn:).

In most cases the option will be the fs0: choice; regardless, (provided the CD drive recognizes the CD), one fsn entry for the CD drive (the CD drive's EFI device path will contain CDROM in the wording) will be displayed. Enter fsn:, replacing n as required and including the colon, followed by the Enter key. Next just type elilo followed by the Enter key.

The ELILO boot message is up next, and asks the user to enter a kernel to boot as well as any additional options to pass to the kernel command line. In most cases just hit the Enter key or wait five seconds. Only one kernel is supplied on the IA64 installation CD, the gentoo kernel.

Several kernel aliases are provided which add extra options to the kernel command line, which may need to be used instead of the default gentoo option depending on the hardware:

  • The gentoo-serial option forces a serial console on the first serial port (ttyS0) at 9600bps. This may be required on some older EFI implementations where the kernel can't detect what console to use. Try this option if booting the default gentoo kernel produces no output and if a serial console is used. If the serial console is not connected to the the first serial port then manually select the console by typing gentoo console=ttyS#,9600 where # is the number of the serial port.
  • The gentoo-ilo option forces a serial console on the ttyS3 serial port at 9600bps. This should be used when installing using the HP iLO remote console feature.
  • The gentoo-sgi option forces a serial console on the ttySG0 serial port at 115200bps. This should only be needed on SGI hardware; if the console is properly selected in the default EFI settings, or when using a video console, then this option should not be required.

It is also possible to provide additional kernel options. They represent optional settings to (de)activate at will.

Hardware options
acpi=on This loads support for ACPI and also causes the acpid daemon to be started by the CD on boot. This is only needed if the system requires ACPI to function properly. This is not required for Hyperthreading support.
acpi=off Completely disables ACPI. This is useful on some older systems and is also a requirement for using APM. This will disable any Hyperthreading support of your processor.
console=X This sets up serial console access for the CD. The first option is the device, usually ttyS0 on x86, followed by any connection options, which are comma separated. The default options are 9600,8,n,1.
dmraid=X This allows for passing options to the device-mapper RAID subsystem. Options should be encapsulated in quotes.
doapm This loads APM driver support. This also requires that acpi=off.
dopcmcia This loads support for PCMCIA and Cardbus hardware and also causes the pcmcia cardmgr to be started by the CD on boot. This is only required when booting from PCMCIA/Cardbus devices.
doscsi This loads support for most SCSI controllers. This is also a requirement for booting most USB devices, as they use the SCSI subsystem of the kernel.
sda=stroke This allows the user to partition the whole hard disk even when the BIOS is unable to handle large disks. This option is only used on machines with an older BIOS. Replace sda with the device that requires this option.
ide=nodma This forces the disabling of DMA in the kernel and is required by some IDE chipsets and also by some CDROM drives. If the system is having trouble reading from the IDE CDROM, try this option. This also disables the default hdparm settings from being executed.
noapic This disables the Advanced Programmable Interrupt Controller that is present on newer motherboards. It has been known to cause some problems on older hardware.
nodetect This disables all of the autodetection done by the CD, including device autodetection and DHCP probing. This is useful for doing debugging of a failing CD or driver.
nodhcp This disables DHCP probing on detected network cards. This is useful on networks with only static addresses.
nodmraid Disables support for device-mapper RAID, such as that used for on-board IDE/SATA RAID controllers.
nofirewire This disables the loading of Firewire modules. This should only be necessary if your Firewire hardware is causing a problem with booting the CD.
nogpm This disables gpm console mouse support.
nohotplug This disables the loading of the hotplug and coldplug init scripts at boot. This is useful for doing debugging of a failing CD or driver.
nokeymap This disables the keymap selection used to select non-US keyboard layouts.
nolapic This disables the local APIC on Uniprocessor kernels.
nosata This disables the loading of Serial ATA modules. This is used if the system is having problems with the SATA subsystem.
nosmp This disables SMP, or Symmetric Multiprocessing, on SMP-enabled kernels. This is useful for debugging SMP-related issues with certain drivers and motherboards.
nosound This disables sound support and volume setting. This is useful for systems where sound support causes problems.
nousb This disables the autoloading of USB modules. This is useful for debugging USB issues.
slowusb This adds some extra pauses into the boot process for slow USB CDROMs, like in the IBM BladeCenter.
Logical volume/device management
dolvm This enables support for Linux's Logical Volume Management.
Other options
debug Enables debugging code. This might get messy, as it displays a lot of data to the screen.
docache This caches the entire runtime portion of the CD into RAM, which allows the user to umount /mnt/cdrom and mount another CDROM. This option requires that there is at least twice as much available RAM as the size of the CD.
doload=X This causes the initial ramdisk to load any module listed, as well as dependencies. Replace X with the module name. Multiple modules can be specified by a comma-separated list.
dosshd Starts sshd on boot, which is useful for unattended installs.
passwd=foo Sets whatever follows the equals as the root password, which is required for dosshd since the root password is by default scrambled.
noload=X This causes the initial ramdisk to skip the loading of a specific module that may be causing a problem. Syntax matches that of doload.
nonfs Disables the starting of portmap/nfsmount on boot.
nox This causes an X-enabled LiveCD to not automatically start X, but rather, to drop to the command line instead.
scandelay This causes the CD to pause for 10 seconds during certain portions the boot process to allow for devices that are slow to initialize to be ready for use.
scandelay=X This allows the user to specify a given delay, in seconds, to be added to certain portions of the boot process to allow for devices that are slow to initialize to be ready for use. Replace X with the number of seconds to pause.
Note
The CD will check for no* options before do* options, so that options can be overriden in the exact order specified.

Next the user will be greeted with a boot screen and progress bar. If the installation is done on a system with a non-US keyboard, make sure to immediately press Alt+F1 to switch to verbose mode and follow the prompt. If no selection is made in 10 seconds the default (US keyboard) will be accepted and the boot process will continue. Once the boot process completes, the user is automatically logged in to the "Live" Gentoo Linux environment as the root user, the super user. A root prompt is displayed on the current console, and one can switch to other consoles by pressing Alt+F2, Alt+F3 and Alt+F4. Get back to the one started on by pressing Alt+F1.


额外的硬件配置

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

要回到原来的终端,请按 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 才能使用。请参照 配置网络 的内容继续安装。