0xbb / gpu-switch

gpu-switch is an application that allows to switch between the graphic cards of dual-GPU Macbook Pro models
MIT License
543 stars 58 forks source link

Linux 4.5 compat: efivarfs entries immutable by default #23

Closed l1k closed 8 years ago

l1k commented 8 years ago

Fix regression introduced by torvalds/linux@ed8b0de5a33d ("efi: Make efivarfs entries immutable by default").

chattr fails on pre-4.5 kernels or if the gpu-power-prefs entry is missing (e.g. after booting into OS X). My initial version checked the kernel release and existence of the file but then I settled on this one liner which just calls chattr unconditionally and pipes any error messages to /dev/null.

0xbb commented 8 years ago

Very good catch! Thank you!