Difference between revisions of "Kernel parameters (简体中文)"

From ArchWiki
Jump to: navigation, search
(常见参数列表)
m (Fix Category.)
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[Category:Kernel]]
+
[[Category:Kernel (简体中文)]]
 +
[[en:Kernel parameters]]
 
[[es:Kernel parameters]]
 
[[es:Kernel parameters]]
 
[[zh-CN:Kernel parameters]]
 
[[zh-CN:Kernel parameters]]
Line 76: Line 77:
 
== 常见参数列表 ==
 
== 常见参数列表 ==
  
{{Expansion|The list needs more parameters.}}
+
{{Expansion|列表还需要继续扩充}}
  
 
{{Note|Not all of the listed options are always available. Most are associated with subsystems and work only if the kernel is configured with those subsystems built in. They also depend on the presence of the hardware they are associated with.}}
 
{{Note|Not all of the listed options are always available. Most are associated with subsystems and work only if the kernel is configured with those subsystems built in. They also depend on the presence of the hardware they are associated with.}}
Line 83: Line 84:
 
![[SysVinit(即将过时)]]!![[systemd]]!!描述
 
![[SysVinit(即将过时)]]!![[systemd]]!!描述
 
|-
 
|-
| {{ic|3}} || {{ic|1=systemd.unit=multi-user}} || Boot to a specified runlevel (3, in this case). Works with 1-6.
+
| {{ic|3}} || {{ic|1=systemd.unit=multi-user}} || 不启动x(可进入后启动)
 
|-
 
|-
| {{ic|1}}  || {{ic|1=systemd.unit=rescue}} || Boot to Single-user mode (root).
+
| {{ic|1}}  || {{ic|1=systemd.unit=rescue}} || 进入根用户模式(root).
 
|-
 
|-
| {{ic|nomodeset}} || {{ic|nomodeset}} || Disable [[Kernel Mode Setting]].
+
| {{ic|nomodeset}} || {{ic|nomodeset}} || 关闭 [[内核显示模式设置功能 Kernel Mode Setting]].
 
|-
 
|-
 
| {{ic|1=loglevel=3}} || {{ic|1=loglevel=3}} || Removes "misaligned reg" and "unknown connector type" messages during boot with the [[Nouveau]] driver. See [https://bbs.archlinux.org/viewtopic.php?id=137509 this] topic.
 
| {{ic|1=loglevel=3}} || {{ic|1=loglevel=3}} || Removes "misaligned reg" and "unknown connector type" messages during boot with the [[Nouveau]] driver. See [https://bbs.archlinux.org/viewtopic.php?id=137509 this] topic.
 
|-
 
|-
| -- || {{ic|1=init=/usr/lib/systemd/systemd}} || Boot using [[Systemd#Installation|systemd]] instead of SysVinit.
+
| -- || {{ic|1=init=/usr/lib/systemd/systemd}} || 使用[[Systemd#Installation|systemd]] 替代 SysVinit 启动.
 
|-
 
|-
 
| {{ic|1=init=/bin/sh rw}} || {{ic|1=init=/bin/sh rw}} || 进入超级终端模式,一般用于急救
 
| {{ic|1=init=/bin/sh rw}} || {{ic|1=init=/bin/sh rw}} || 进入超级终端模式,一般用于急救

Revision as of 09:29, 29 November 2012


一共有三种办法,可以给内核传递参数,用于控制其行为方式:

  1. 在编译内核时(这个最根本,会决定后面两种方法)
  2. 内核启动时(通常是在一个启动管理器里设置).
  3. 在运行时 (通过修改在 /proc/sys中的文件).

本页面主要是讲第二种方法。

配置

内核参数可以在启动时临时修改,也可以永久性写到启动管理器的配置文件中,永远起作用。

下面示例:把参数quietsplash 加到启动管理器 Syslinux, GRUB, GRUB LegacyLILO中.

Syslinux

> .linux ../vmlinuz-linux root=/dev/sda3 ro initrd=../initramfs-linux.img quiet splash
Press Template:Keypress to boot with these parameters.
  • To make the change persistent after reboot, edit /boot/syslinux/syslinux.cfg and add them to the APPEND line:
APPEND root=/dev/sda3 ro quiet splash

更多详情请见Syslinux

GRUB

linux   /boot/vmlinuz-linux root=UUID=978e3e81-8048-4ae1-8a06-aa727458e8ff ro  quiet splash
Press Template:Keypress to boot with these parameters.
  • To make the change persistent after reboot, while you could manually edit /boot/grub/grub.cfg with the exact line from above, for beginners it's recommended to:
Edit /etc/default/grub and append your kernel options to the GRUB_CMDLINE_LINUX_DEFAULT line:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
And then automatically re-generate the grub.cfg file with:
# grub-mkconfig -o /boot/grub/grub.cfg

For more information on configuring GRUB, see the GRUB article.

GRUB Legacy

kernel /boot/vmlinuz-linux root=/dev/sda3 ro quiet splash
Press Template:Keypress to boot with these parameters.
  • To make the change persistent after reboot, edit /boot/grub/menu.lst and add them to the kernel line, exactly like above.

For more information on configuring GRUB Legacy, see the GRUB Legacy article.

LILO

  • Add them to /etc/lilo.conf:
image=/boot/vmlinuz-linux
        ...
        quiet splash

For more information on configuring LILO, see the LILO article.

常见参数列表

Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: 列表还需要继续扩充 (Discuss in Talk:Kernel parameters (简体中文)#)
Note: Not all of the listed options are always available. Most are associated with subsystems and work only if the kernel is configured with those subsystems built in. They also depend on the presence of the hardware they are associated with.
SysVinit(即将过时) systemd 描述
3 systemd.unit=multi-user 不启动x(可进入后启动)
1 systemd.unit=rescue 进入根用户模式(root).
nomodeset nomodeset 关闭 内核显示模式设置功能 Kernel Mode Setting.
loglevel=3 loglevel=3 Removes "misaligned reg" and "unknown connector type" messages during boot with the Nouveau driver. See this topic.
-- init=/usr/lib/systemd/systemd 使用systemd 替代 SysVinit 启动.
init=/bin/sh rw init=/bin/sh rw 进入超级终端模式,一般用于急救

All of these parameters are case-sensitive.

For a complete list of all known options, please see the kernel documentation.

更多信息