Disable startup sound of MacBook and iMac

Is there any way to disable startup sound of MacBook and iMac’s from Linux?

I saw it is possible through efi variables but when I try to write suggested sysfs variables, I always getting operation not permitted error.

Yes, it is quite easy.

Starting from the kernel version 3.8, if CONFIG_EFIVAR_FS support enabled, Linux kernel exposes EFI variables data to userspace via efivarfs and mounted using efivarfs kernel module at /sys/firmware/efi/efivars

You’re getting operation not permitted errors because of the i flags on the these variable attributes:

$ lsattr /sys/firmware/efi/efivars/
...
------------------- /sys/firmware/efi/efivars/ConOut-8be4df61-93ca-11d2-aa0d-00e098032b8c
----i-------------- /sys/firmware/efi/efivars/MemoryConfig-8be4df61-93ca-11d2-aa0d-00e098032b8c
----i-------------- /sys/firmware/efi/efivars/MTC-eb704011-1402-11d3-8e77-00a0c969723b
----i-------------- /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82
...

Before writing an efi variable which has i attribute, you need to remove the attribute first with chattr like this:

sudo chattr -i /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82

Now you can write this variable. You can use bash’s printf function to write binary values. Try following command as root (or use tee if you run through sudo):

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

and reboot the system.

1 Like