本文总结如何在 macOS
上设置 boot-args
以及 boot-args
的作用。
Update: 2022 / 10 / 18
debug=0x144
参考这里 1
sudo nvram boot-args="debug=0x144"
这是内核调试功能的组合,将向您显示有关内核进程的额外信息,如果系统遇到内核崩溃,这将非常有用。
另一种选择是使用 debug=0x14e
,它将显示更多的日志记录选项。这样做的主要用途是它启用旧式内核恐慌,在屏幕上显示有关系统恐慌原因的滚动文本,而不是显示灰色背景和仅重新启动系统的消息。
替代调试选项如下,尽管这些可能只对内核程序员有用:
0x01 - Stop at boot time and wait for the debugger to attach
0x02 - Send kernel debugging output to the console
0x04 - Drop into debugger on a nonmaskable interrupt
0x08 - Send kernel debugging information to a serial port
0x10 - Make ddb the default debugger
0x20 - Output diagnostics information to the system log
0x40 - Allow the debugger to ARP and route
0x80 - Support old versions of gdb on newer systems
0x100 - Disable the graphical panic dialog screen
Source: Boot argument options in OS X
ddb
只是一个调试器。一旦遇到系统问题,启用这些模式来收集信息是绝对安全的。
问题
iokit/common not permitted
当遇到如下的报错时 2:
% sudo nvram boot-args="debug=0x144"
Password:
Sorry, try again.
Password:
nvram: Error setting variable - 'boot-args': (iokit/common) not permitted
因为从 macOS Sierra
开始,您必须启动到 recovery partition
才能运行 nvram
命令来正确设置 boot-args NVRAM
变量。
此外,SIP
适用于 Mac
上的所有用户,包括管理员和 root
。
在 recovery patition
下使用 csrutil disable
来禁用 SIP
将允许您在正常的启动中设置引导参数。
警告:除非确实需要,否则不应禁用
SIP
。
进入 recovery partition
-
非苹果芯片 PC 3
通过重新启动并按住⌘+R
进入恢复模式,直到出现Apple
标志。
在顶部菜单中单击实用程序 > 终端。
在终端窗口中输入csrutil disdable
。然后重新启动Mac
。 -
苹果芯片 PC 4
启动 Mac 并继续按住电源按钮,直至您看到启动选项窗口。选择“选项”,然后点按“继续”。
参考链接
-
What does "sudo nvram boot-args=“debug=0x10"” do to my Mac? ↩︎
-
How to overcome Error Setting Variable - ‘boot-args’ : (iokit/common) not permitted ↩︎
-
Trying to set boot-args with nvram gets “general error” on Sierra ↩︎文章来源:https://www.toymoban.com/news/detail-449285.html
-
Mac电脑进入恢复模式详细教程 ↩︎文章来源地址https://www.toymoban.com/news/detail-449285.html
到了这里,关于macOS | nvram boot-args的作用及设置方式的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!