The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.
Difference between revisions of "Install/Configuration Files/zh-cn"
Mmwweettyy (talk | contribs) (Created page with "{{c|USE}} 字段指定了在软件包包安装时所启用的功能。在安装的过程中我们不推荐向 USE 标志中加入很多字段;在改变 USE 选项之前,...") |
(Updating to match new version of source page) |
||
(12 intermediate revisions by 2 users not shown) | |||
Line 12: | Line 12: | ||
Chroot 环境下包含的默认文本编辑器是 {{c|nano}}。若要编辑文本,可以按照下述方法使用 Nano: | Chroot 环境下包含的默认文本编辑器是 {{c|nano}}。若要编辑文本,可以按照下述方法使用 Nano: | ||
<div class="mw-translate-fuzzy"> | |||
{{console|body= | {{console|body= | ||
%chroot% ##i##nano -w /etc/fstab | %chroot% ##i##nano -w /etc/fstab | ||
}} | }} | ||
在编辑器中,可以使用方向键移动光标,并且退格和删除这一类的按键都会像往常一样工作。可以按 Control-X 并且用 {{c|y}} 来回答是/否将改动保存到文件的提示来保存文件。 | 在编辑器中,可以使用方向键移动光标,并且退格和删除这一类的按键都会像往常一样工作。可以按 Control-X 并且用 {{c|y}} 来回答是/否将改动保存到文件的提示来保存文件。 | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
When in the editor, you can use arrow keys to move the cursor, and common keys like backspace and delete will work as expected. To save the file, press Control-X, and answer {{c|y}} when prompted to save the modified buffer if you would like to save your changes. | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
We will edit the {{f|/etc/fstab}} file later, when we set up the boot loader. | |||
</div> | |||
==== 配置文件 ==== | ==== 配置文件 ==== | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
Here are a full list of files that you may want to edit, depending on your needs: | Here are a full list of files that you may want to edit, depending on your needs: | ||
{{TableStart}} | {{TableStart}} | ||
Line 31: | Line 42: | ||
<td>Your timezone, which will default to UTC if not set. This should be a symbolic link to something located under /usr/share/zoneinfo (e.g. /usr/share/zoneinfo/America/Montreal) </td> | <td>Your timezone, which will default to UTC if not set. This should be a symbolic link to something located under /usr/share/zoneinfo (e.g. /usr/share/zoneinfo/America/Montreal) </td> | ||
</tr><tr> | </tr><tr> | ||
<td>{{c|/etc | <td>{{c|/etc/make.conf}}</td> | ||
<td>'' | <td>''NO - not required or recommended''</td> | ||
<td> | <td>''Unlike Gentoo, it is normal and correct for this file to be empty in Funtoo Linux, as settings have been migrated to our enhanced profile system. Adding settings from this file will cause your system to be considered a non-standard setup and not officially supported. If you feel you need to add something to this file, be sure to ask on Discord for guidance. You probably don't.''</td> | ||
</tr><tr> | |||
<td>{{c|/etc/hosts}}</td> | |||
<td>''No''</td> | |||
<td> You no longer need to manually set the hostname in this file. This file is automatically generated by {{c|/etc/init.d/hostname}}.</td> | |||
</tr><tr> | </tr><tr> | ||
<td>{{c|/etc/conf.d/hostname}}</td> | <td>{{c|/etc/conf.d/hostname}}</td> | ||
<td>''Maybe - recommended''</td> | <td>''Maybe - recommended''</td> | ||
<td>Used to set system hostname. Set the {{c|hostname}} variable to the fully-qualified (with dots, ie. {{c|foo.funtoo.org}}) name if you have one. Otherwise, set to the local system hostname (without dots, ie. {{c|foo}}). Defaults to {{c|localhost}} if not set.</td> | <td>Used to set system hostname. Set the {{c|hostname}} variable to the fully-qualified (with dots, ie. {{c|foo.funtoo.org}}) name if you have one. Otherwise, set to the local system hostname (without dots, ie. {{c|foo}}). Defaults to {{c|localhost}} if not set.</td> | ||
</tr><tr> | </tr><tr> | ||
<td>{{c|/etc/conf.d/keymaps}}</td> | <td>{{c|/etc/conf.d/keymaps}}</td> | ||
Line 58: | Line 69: | ||
<td>Optional</td> | <td>Optional</td> | ||
<td>Allows you to specify the default console font. To apply this font, enable the consolefont service by running rc-update add consolefont.</td> | <td>Allows you to specify the default console font. To apply this font, enable the consolefont service by running rc-update add consolefont.</td> | ||
</tr><tr> | |||
<td>{{c|/etc/conf.d/swap}}</td> | |||
<td>Optional</td> | |||
<td>When using a '''swap file''' that is not on the root filesystem, localmount service must be configured to be a dependency of swap service.</td> | |||
</tr><tr> | </tr><tr> | ||
<td>{{c|profiles}}</td> | <td>{{c|profiles}}</td> | ||
Line 64: | Line 79: | ||
</tr> | </tr> | ||
{{TableEnd}} | {{TableEnd}} | ||
</div> | |||
如果你正在安装一个英文版的 Funtoo Linux,那就可以按照原样使用大部分的配置文件。如果你在安装其他语言的版本,不必担心,我们在 [[Funtoo Linux Localization]] 页面上写出了必要的准备步骤。如有需要,还有许多友好的帮助在等着你。(参见 [[Getting Help]]) | 如果你正在安装一个英文版的 Funtoo Linux,那就可以按照原样使用大部分的配置文件。如果你在安装其他语言的版本,不必担心,我们在 [[Funtoo Linux Localization/zh-cn|Funtoo Linux 本地化]]页面上写出了必要的准备步骤。如有需要,还有许多友好的帮助在等着你。(参见 [[Getting Help]]) | ||
继续安装步骤。使用 {{c|nano -w <name_of_file>}} 来编辑文件 -- "{{c|-w}}" 指令会禁用自动换行,这样让编辑配置配置文件更顺手。你可以从示例文件中复制粘贴。 | 继续安装步骤。使用 {{c|nano -w <name_of_file>}} 来编辑文件 -- "{{c|-w}}" 指令会禁用自动换行,这样让编辑配置配置文件更顺手。你可以从示例文件中复制粘贴。 | ||
Line 71: | Line 87: | ||
{{Warning|在重启之前编辑 {{c|/etc/fstab}} 是很重要的!你需要修改 ''fs'' 和 ''type'' 栏,让他们与你使用 {{c|gdisk}} 或 {{c|fdisk}} 创建的文件系统和分区相匹配。跳过这个步骤有可能会让 Funtoo Linux 无法正确启动。}} | {{Warning|在重启之前编辑 {{c|/etc/fstab}} 是很重要的!你需要修改 ''fs'' 和 ''type'' 栏,让他们与你使用 {{c|gdisk}} 或 {{c|fdisk}} 创建的文件系统和分区相匹配。跳过这个步骤有可能会让 Funtoo Linux 无法正确启动。}} | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
==== /etc/localtime ==== | |||
</div> | |||
==== /etc/localtime ==== | |||
{{f|/etc/localtime}} 用来明确你的机器处于哪个时区,默认是 UTC。如果想让 Funtoo Linux 系统使用当地时间,你需要将 {{|/etc/localtime}} 用一个符号链接指向你想要使用的时区。 | {{f|/etc/localtime}} 用来明确你的机器处于哪个时区,默认是 UTC。如果想让 Funtoo Linux 系统使用当地时间,你需要将 {{|/etc/localtime}} 用一个符号链接指向你想要使用的时区。 | ||
<div class="mw-translate-fuzzy"> | |||
{{console|body= | {{console|body= | ||
(chroot) ###i## ln -sf /usr/share/zoneinfo/MST7MDT /etc/localtime | (chroot) ###i## ln -sf /usr/share/zoneinfo/MST7MDT /etc/localtime | ||
}} | }} | ||
上面的命令会将时区设置为 Mountain Standard Time(包括夏令时)。用 {{c|ls /usr/share/zoneinfo}} 命令来显示可用的时区。其中也有子目录包含了以地区描述的时区。 | 上面的命令会将时区设置为 Mountain Standard Time(包括夏令时)。用 {{c|ls /usr/share/zoneinfo}} 命令来显示可用的时区。其中也有子目录包含了以地区描述的时区。 | ||
</div> | |||
==== /etc/conf.d/hwclock ==== | ==== /etc/conf.d/hwclock ==== | ||
如果你想让 Funtoo Linux 与 Windows 双系统启动,你需要编辑这个文件,把 '''clock''' 的值从 '''UTC''' 改为 '''local''',原因是 Windows 在每次启动时都会将硬件时钟设置为本地时钟。其他一般的情况下,是不需要编辑这个文件的。 | |||
{{console|body= | {{console|body= | ||
%chroot% ##i##nano -w /etc/conf.d/hwclock | %chroot% ##i##nano -w /etc/conf.d/hwclock | ||
}} | }} | ||
本地化 | |||
默认情况下,Funtoo Linux 被配置为启用 Unicode (UTF-8) ,并且对应了美国英语的本地化以及键盘布局。如果你想要将你的系统配置为非英语的环境和键盘布局,参见 [[Funtoo Linux Localization/zh-cn|Funtoo Linux 本地化]]。 | |||
<noinclude>{{InstallNavigation|num=11|prev=Download Portage Tree|next=Introducing Portage|align=right}}</noinclude> | <noinclude>{{InstallNavigation|num=11|prev=Download Portage Tree|next=Introducing Portage|align=right}}</noinclude> |
Latest revision as of 16:34, March 21, 2024
安装指南:配置文件
Install Guide, Chapter 11 | < Prev | Next > |
正如对任何一个 Linux 发行版期盼的那样,Funtoo Linux 有一套自己的配置文件。为了确保 Funtoo Linux 成功启动,你必须编辑的文件是 /etc/fstab
。其他的文件是可选的。
使用 Nano
Chroot 环境下包含的默认文本编辑器是 nano
。若要编辑文本,可以按照下述方法使用 Nano:
chroot # nano -w /etc/fstab
在编辑器中,可以使用方向键移动光标,并且退格和删除这一类的按键都会像往常一样工作。可以按 Control-X 并且用 y
来回答是/否将改动保存到文件的提示来保存文件。
When in the editor, you can use arrow keys to move the cursor, and common keys like backspace and delete will work as expected. To save the file, press Control-X, and answer y
when prompted to save the modified buffer if you would like to save your changes.
We will edit the /etc/fstab
file later, when we set up the boot loader.
配置文件
Here are a full list of files that you may want to edit, depending on your needs:
File | Do I need to change it? | Description |
---|---|---|
/etc/fstab |
YES - required | Mount points for all filesystems to be used at boot time. This file must reflect your disk partition setup. We'll guide you through modifying this file below. |
/etc/localtime |
Maybe - recommended | Your timezone, which will default to UTC if not set. This should be a symbolic link to something located under /usr/share/zoneinfo (e.g. /usr/share/zoneinfo/America/Montreal) |
/etc/make.conf |
NO - not required or recommended | Unlike Gentoo, it is normal and correct for this file to be empty in Funtoo Linux, as settings have been migrated to our enhanced profile system. Adding settings from this file will cause your system to be considered a non-standard setup and not officially supported. If you feel you need to add something to this file, be sure to ask on Discord for guidance. You probably don't. |
/etc/hosts |
No | You no longer need to manually set the hostname in this file. This file is automatically generated by /etc/init.d/hostname . |
/etc/conf.d/hostname |
Maybe - recommended | Used to set system hostname. Set the hostname variable to the fully-qualified (with dots, ie. foo.funtoo.org ) name if you have one. Otherwise, set to the local system hostname (without dots, ie. foo ). Defaults to localhost if not set. |
/etc/conf.d/keymaps |
Optional | Keyboard mapping configuration file (for console pseudo-terminals). Set if you have a non-US keyboard. See Funtoo Linux Localization. |
/etc/conf.d/hwclock |
Optional | How the time of the battery-backed hardware clock of the system is interpreted (UTC or local time). Linux uses the battery-backed hardware clock to initialize the system clock when the system is booted. |
/etc/conf.d/modules |
Optional | Kernel modules to load automatically at system startup. Typically not required. See Additional Kernel Resources for more info. |
/etc/conf.d/consolefont |
Optional | Allows you to specify the default console font. To apply this font, enable the consolefont service by running rc-update add consolefont. |
/etc/conf.d/swap |
Optional | When using a swap file that is not on the root filesystem, localmount service must be configured to be a dependency of swap service. |
profiles |
Optional | Some useful portage settings that may help speed up intial configuration. |
如果你正在安装一个英文版的 Funtoo Linux,那就可以按照原样使用大部分的配置文件。如果你在安装其他语言的版本,不必担心,我们在 Funtoo Linux 本地化页面上写出了必要的准备步骤。如有需要,还有许多友好的帮助在等着你。(参见 Getting Help)
继续安装步骤。使用 nano -w <name_of_file>
来编辑文件 -- "-w
" 指令会禁用自动换行,这样让编辑配置配置文件更顺手。你可以从示例文件中复制粘贴。
在重启之前编辑 /etc/fstab
是很重要的!你需要修改 fs 和 type 栏,让他们与你使用 gdisk
或 fdisk
创建的文件系统和分区相匹配。跳过这个步骤有可能会让 Funtoo Linux 无法正确启动。
/etc/localtime
/etc/localtime
用来明确你的机器处于哪个时区,默认是 UTC。如果想让 Funtoo Linux 系统使用当地时间,你需要将 {{|/etc/localtime}} 用一个符号链接指向你想要使用的时区。
(chroot) # ln -sf /usr/share/zoneinfo/MST7MDT /etc/localtime
上面的命令会将时区设置为 Mountain Standard Time(包括夏令时)。用 ls /usr/share/zoneinfo
命令来显示可用的时区。其中也有子目录包含了以地区描述的时区。
/etc/conf.d/hwclock
如果你想让 Funtoo Linux 与 Windows 双系统启动,你需要编辑这个文件,把 clock 的值从 UTC 改为 local,原因是 Windows 在每次启动时都会将硬件时钟设置为本地时钟。其他一般的情况下,是不需要编辑这个文件的。
chroot # nano -w /etc/conf.d/hwclock
本地化
默认情况下,Funtoo Linux 被配置为启用 Unicode (UTF-8) ,并且对应了美国英语的本地化以及键盘布局。如果你想要将你的系统配置为非英语的环境和键盘布局,参见 Funtoo Linux 本地化。
Install Guide, Chapter 11 | < Prev | Next > |