7

I have a single boot Kali Linux installation on MacBook Air 2018 hardware.

After solving some issues to make all working I'm in trouble with this:

I'm trying to disable the startup sound before the boot. The typical sound of a MacBook.

I found on Apple docs that it's possible to modify the sound running from the terminal

sudo nvram SystemAudioVolume=%80

but nvram command is not available on Linux; there is however, another program called nvramtool.

Reading the man of nvramtool it's possible to get all coreboot parameters running nvramtool -a but the output of the command is:

nvramtool: coreboot table not found. coreboot does not appear to be
installed on this system.

So, after investigating a little bit I found a program called efivar that permits modifying EFI variables.

Typing efivar -l | grep -i SystemAudioVolume I get the variable indicated by Apple (SystemAudioVolume) with this value:

7c436110-ab2a-4bbb-a880-fe41995c9f82-SystemAudioVolume

Now typing ,

efivar --print --name 7c436110-ab2a-4bbb-a880-fe41995c9f82-SystemAudioVolume

I get this kind of output:

     GUID: 7c436110-ab2a-4bbb-a880-fe41995c9f82
     Name: "SystemAudioVolume"
     Attributes:
         Non-Volatile
         Boot Service Access
         Runtime Service Access
     Value:
     00000000  69        |i        |

EDIT
I tried creating a boot-able USB key of macOS Mojave.
Turning on the Mac, inserting the key and holding the alt I can go into the installation process from where I can get an instance of Terminal.app so I can try to run nvram from there. But I think, as suggested from Apple docs, that administrator permissions are needed.
Trying to execute nvram -p I get a list of all variables, executing nvram -p | grep -i SystemAudioVolume I get

7c436110-ab2a-4bbb-a880-fe41995c9f82-SystemAudioVolume=i

typing nvram SystemAudioVolume=%80 and rerunning nvram -p | grep -i SystemAudioVolume I get

7c436110-ab2a-4bbb-a880-fe41995c9f82-SystemAudioVolume=%80

but after rebooting the sound is still there and returning in the installation process running nvram -p | grep -i SystemAudioVolume I get again

7c436110-ab2a-4bbb-a880-fe41995c9f82-SystemAudioVolume=i

Do you know how to modify the value? (if possible)

PS.
I can't create the TAG efivar cause I'm less than 300. But I think it should be added.

1 Answer 1

5
+50

Per this article, Disabling MacBook Startup Sound in Linux,

several Internet sources suggest that writing EFI variables from Linux may sometimes corrupt your Apple firmware. I didn't research this any further. If you happen to figure out how to successfully write to these variables under Linux please let everyone know in the comments (in case OS X recovery mode goes missing, you know).

Their solution was to simply use nvram to disable the sound via the following command:

nvram SystemAudioVolume=%00

They also used recovery mode to do this by holding Cmd+Option+R.

Another option is to simply write to the variable using printf, a method discussed in the comments of the blog.

Note: This method is potentially dangerous, it is advised to use the previous method first.

# Ensure efivars are mounted
mount | grep efivars
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,relatime)

# Remove immutable bit, allows modification
chattr -i /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82

# Set volume to 00
printf "\x07\x00\x00\x00\x00" > /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82

# Display new value
efivar -n 7c436110-ab2a-4bbb-a880-fe41995c9f82-SystemAudioVolume -p
GUID: 7c436110-ab2a-4bbb-a880-fe41995c9f82
Name: "SystemAudioVolume"
Attributes:
    Non-Volatile
    Boot Service Access
    Runtime Service Access
Value:
00000000  00
4
  • 1
    Yeah, thank you for your response. I think is too dangerous trying changing it from Linux, i adopted another solution. I made a fresh install of Mac OS then i changed the value from a system's terminal session. Then i reinstalled my backuped version of kali linux. I think this is the right way, the best solution to get all things working clean!! Thanks again :D Commented Sep 2, 2019 at 3:46
  • 1
    I've tried the "dangerous" method on a MacBook 5,1 (2008) from Linux Mint 20.3, and it worked. In fact, the variable did not exist, so i did not use chattr -i. So far so good.
    – Alexey
    Commented May 11, 2022 at 12:33
  • The dangerous method worked fine for me on an iMac. At first it gave "permission denied" (even as root, removing the immutable bit and with efivar mounted rw) but it allowed file deletion. So I deleted them, created in home and copyed back. It worked fine!
    – Davide
    Commented May 14, 2022 at 14:36
  • The recovery/nvram command can't be used if you don't have MacOS or a network connection. The "dangerous" method works fine from Linux except I used the more portable echo -ne instead of printf to create a new EFI variable (it didn't exist because I don't have MacOS). I don't see how writing an EFI variable in the nvram could possibly affect the firmware. All sorts of systems manipulate that EFI data all the time with boot information.
    – CR.
    Commented Dec 4, 2022 at 3:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .