nvram params

Following nvram boot args are generally helpful with diagnostics/investigations:

  1. nvram boot-args="-v" –> verbose mode, ample of text as MBP boots
  2. nvram boot-args="-x" –> will always boot in safe mode
  3. nvram boot-args="-s" –> will always boot in single user mode

A few of the other ones:

  1. nvram boot-args="iog=0x0" –> This reverses the “Clamshell” mode for Apple’s laptop systems, where when you close the display but connect the system to an external monitor and keyboard the system will stay awake. Well I couldn’t make use of it due to a defective discrete GPU.
  2. nvram boot-args="cpus=2" –> Limits the number of active processors in the system to the set level.

To clear all nvram boot-args one can either reset nvram or just clear boot-args:

sudo nvram boot-args=""
sudo nvram -d boot-args

This link at superuser has a pretty good list of such args and how to use them.


Browsing thru bsd_init.c file at https://opensource.apple.com/source/xnu/, provides a bit more information, keep looking for function PE_parse_boot_argn:

// https://opensource.apple.com/source/xnu/xnu-2782.10.72/bsd/kern/bsd_init.c
static void
parse_bsd_args(void)
{
	char namep[16];
	int msgbuf;

	if ( PE_parse_boot_argn("-s", namep, sizeof (namep)))
		boothowto |= RB_SINGLE;

	if (PE_parse_boot_argn("-b", namep, sizeof (namep)))
		boothowto |= RB_NOBOOTRC;

	if (PE_parse_boot_argn("-x", namep, sizeof (namep))) /* safe boot */
		boothowto |= RB_SAFEBOOT;

Searching for function PE_parse_boot_argn on github, leads to some very interesting results:

  1. https://github.com/XLNCs/HighSierraXNU-AMD
  2. https://github.com/nanoant/DisableTurboBoost.kext
  3. https://github.com/aerror2/NGFixLG5K
  4. https://github.com/Negative-Hallucination/ubik_asus_rog_z370i/tree/master/kexts
  5. https://github.com/acidanthera/Lilu
  6. https://www.insanelymac.com/forum/topic/321371-lilu-%E2%80%94-kext-and-process-patcher/