Skip to content

Commit

Permalink
Add NVRAM module
Browse files Browse the repository at this point in the history
  • Loading branch information
mayankk2308 committed Jun 20, 2021
1 parent b79a987 commit 35a5969
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions Installer/installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
source "opencore.sh"
source "resources.sh"
source "requirements.sh"
source "nvram.sh"

version="1.0.0"

Expand Down
26 changes: 26 additions & 0 deletions Installer/nvram.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# nvram.sh
# Manipulate NVRAM variables.

source "tools.sh"

power_prefs="FA4CE28D-B62F-4C99-9CC3-6815686E30F9:gpu-power-prefs"

# Set mux.
nvram_mux() {
local val="${1}"

nvram "${power_prefs}=${val}"
exit_if_failed "Unable to set mux."
}

# Set mux to integrated GPU.
nvram_muxigpu() {
nvram_mux "%01%00%00%00"
}

# Set mux to discrete GPU.
nvram_muxdgpu() {
nvram_mux "%00%00%00%00"
}

0 comments on commit 35a5969

Please sign in to comment.