Kernel parameters (简体中文)
一共有三种办法,可以给内核传递参数,用于控制其行为方式:
- 在编译内核时(这个最根本,会决定后面两种方法)
- 内核启动时(通常是在一个启动管理器里设置).
- 在运行时 (通过修改在
/proc和/sys中的文件).
本页面主要是讲第二种方法。
配置
内核参数可以在启动时临时修改,也可以永久性写到启动管理器的配置文件中,永远起作用。
下面示例:把参数quiet 和 splash 加到启动管理器 Syslinux, GRUB, GRUB Legacy 和 LILO中.
Syslinux
- 当出现启动选择菜单的时候,按
Tab进入修改模式:
> .linux ../vmlinuz-linux root=/dev/sda3 ro initrd=../initramfs-linux.img ''quiet splash''
- Press
Enterto boot with these parameters.
- To make the change persistent after reboot, edit
/boot/syslinux/syslinux.cfgand add them to theAPPENDline:
更多详情请见Syslinux 。
systemd-boot
- 当启动菜单出现时 按 进入编辑界面:
- 按
Enter即可按照输入的参数启动。
- 如果想永久加入参数,编辑 (假设你已经设置好了 EFI system partition (简体中文)) 的 行:
options root=/dev/sda2 ''quiet splash''
更多信息请参见 systemd-boot .
GRUB
- 在菜单出现后按 然后将它们添加至 行:
- 按 以便用这些参数启动。
- 要使改变在重启后仍生效,您可以手动编辑
/boot/grub/grub.cfg中的如上内容。对于初学者,建议:
- 编辑 并将您的内核选项添加至 行:
- 然后重新生成 文件:
有关配置GRUB的更多信息,请参阅 GRUB 。
GRUB Legacy
- Press when the menu shows up and add them on the
kernelline:
- Press to boot with these parameters.
- To make the change persistent after reboot, edit and add them to the
kernelline, exactly like above.
For more information on configuring GRUB Legacy, see the GRUB Legacy article.
常见参数列表
| SysVinit(即将过时) | systemd | 描述 |
|---|---|---|
| 不启动x(可进入后启动) | ||
1 | 进入根用户模式(root). | |
| 关闭内核显示模式设置功能. | ||
| Removes "misaligned reg" and "unknown connector type" messages during boot with the Nouveau driver. See this topic. | ||
| -- | 使用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.
This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.