diff --git a/README.md b/README.md index 8f579e6..5ff6355 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,7 @@ This will build a minimal environment that does the following: * Checks if there are any gpu/gfx variables present and if so prompts a NVRAM reset. * If those variables are not present then it adds one to disable the discrete GPU. + +## Credit ## + +* Audio files were created using [Wideo Text-to-speech](https://wideo.co/text-to-speech/) diff --git a/profile/airootfs/etc/modprobe.d/sound.conf b/profile/airootfs/etc/modprobe.d/sound.conf new file mode 100644 index 0000000..aaf0a7a --- /dev/null +++ b/profile/airootfs/etc/modprobe.d/sound.conf @@ -0,0 +1 @@ +options snd-hda-intel model=intel-mac-auto diff --git a/profile/airootfs/root/mac-dgpu-disable-tool b/profile/airootfs/root/mac-dgpu-disable-tool index ed07f26..a95a353 100755 --- a/profile/airootfs/root/mac-dgpu-disable-tool +++ b/profile/airootfs/root/mac-dgpu-disable-tool @@ -13,6 +13,15 @@ YELLOW='\033[33m' ORANGE='\033[31;1m' BLUE='\033[34m' +# Play MP3 +function play_mp3() { + mpg123 "mp3/$1" >/dev/null 2>&1 +} + +# Set volume +amixer -q set Master 80% unmute >/dev/null 2>&1 +amixer -q set PCM 80% unmute >/dev/null 2>&1 + # Check for current variables for prefix in gfx gpu; do for var in /sys/firmware/efi/efivars/${prefix}*; do @@ -27,23 +36,28 @@ done echo "" if [[ ! -e "/sys/firmware/efi/efivars" ]]; then # Probably booted legacy + play_mp3 "EFIVARS not found.mp3" echo -e "${RED}ERROR:${CLEAR} EFIVARS not found" elif cmp "$SOURCE" "$DEST" >/dev/null 2>&1; then # EFI var matches desired state + play_mp3 "Discrete GPU already disabled.mp3" echo -e "${GREEN}Discrete GPU already disabled${CLEAR}" elif [[ "$needs_nvram_reset" == "yes" ]]; then # One or more gfx/gpu EFI vars detected + play_mp3 "Please reset the NVRAM.mp3" echo -e "${RED}ERROR:${CLEAR} Detected the above EFIVARS" - echo -e "Please reboot and reset the NVRAM" + echo -e "Please reset the NVRAM" else # No gfx/gpu EFI vars detected so we can apply the fix cp "$SOURCE" "$DEST" chattr +i "$DEST" sync umount /sys/firmware/efi/efivars - echo -e "${GREEN}Discrete GPU successfully disabled${CLEAR}" mount -t efivarfs efivarfs /sys/firmware/efi/efivars + play_mp3 "Discrete GPU successfully disabled.mp3" + echo -e "${GREEN}Discrete GPU successfully disabled${CLEAR}" fi echo "" +play_mp3 "Press Enter to poweroff the system.mp3" read -p "Press Enter to poweroff the system... " -r unusedvar poweroff diff --git a/profile/airootfs/root/mp3/Discrete GPU already disabled.mp3 b/profile/airootfs/root/mp3/Discrete GPU already disabled.mp3 new file mode 100644 index 0000000..10f7e9d Binary files /dev/null and b/profile/airootfs/root/mp3/Discrete GPU already disabled.mp3 differ diff --git a/profile/airootfs/root/mp3/Discrete GPU successfully disabled.mp3 b/profile/airootfs/root/mp3/Discrete GPU successfully disabled.mp3 new file mode 100644 index 0000000..e2b25ad Binary files /dev/null and b/profile/airootfs/root/mp3/Discrete GPU successfully disabled.mp3 differ diff --git a/profile/airootfs/root/mp3/EFIVARS not found.mp3 b/profile/airootfs/root/mp3/EFIVARS not found.mp3 new file mode 100644 index 0000000..93455c2 Binary files /dev/null and b/profile/airootfs/root/mp3/EFIVARS not found.mp3 differ diff --git a/profile/airootfs/root/mp3/Please reset the NVRAM.mp3 b/profile/airootfs/root/mp3/Please reset the NVRAM.mp3 new file mode 100644 index 0000000..7dfb454 Binary files /dev/null and b/profile/airootfs/root/mp3/Please reset the NVRAM.mp3 differ diff --git a/profile/airootfs/root/mp3/Press Enter to poweroff the system.mp3 b/profile/airootfs/root/mp3/Press Enter to poweroff the system.mp3 new file mode 100644 index 0000000..2161ccd Binary files /dev/null and b/profile/airootfs/root/mp3/Press Enter to poweroff the system.mp3 differ diff --git a/profile/efiboot/loader/entries/dgpu.conf b/profile/efiboot/loader/entries/dgpu.conf index ba3b4b3..224aad8 100644 --- a/profile/efiboot/loader/entries/dgpu.conf +++ b/profile/efiboot/loader/entries/dgpu.conf @@ -4,4 +4,4 @@ title Mac dGPU Disable Tool linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img -options archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% nomodeset +options archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% nomodeset module_blacklist=i915 diff --git a/profile/packages.x86_64 b/profile/packages.x86_64 index ffefeae..1c067d7 100644 --- a/profile/packages.x86_64 +++ b/profile/packages.x86_64 @@ -1,4 +1,6 @@ +alsa-utils base linux mkinitcpio mkinitcpio-archiso +mpg123