rugarciap / Turbo-Boost-Switcher

Turbo Boost disabler / enable app for Mac OS X
GNU General Public License v2.0
1.49k stars 149 forks source link

Source code for kexts doesn't seem to be in the repository #132

Closed tbodt closed 4 years ago

tbodt commented 4 years ago

If this is true, and it's not available somewhere else, I think this is a violation of the GPLv2 license.

rugarciap commented 4 years ago

Hi!

Thanks for your feedback! As the copyright holder of the kext (it was created and compiled by me), I decided to include it in its binary form as part source code (I'm not an expert, but I think is called aggregate in the license or something like that) which is fine. I mean, the binary form of the kext should be considered part of the source code of this project.

This was for a couple of reasons:

1.- The most important one, if I included the kext source in the project instead of the binary, no one would be able to run the app without disabling SIP! because Apple forces all kexts to be signed and/or explicitly allowed by them, as the case of this kext. Even without changing anything in the code, the binary would have a different hash and wouldn't comply with Apple restrictions.

2.- Related with previous one, this allows others to use the source of the app directly and even embed the kext on other applications. In fact, there are some around that include a link and mention to this project (others don't) and a binary copy (sometimes without permission :( ) of the kext.

In summary, I think it's perfectly ok and compliant with GPLv2 due to that and even if I wasn't the copyright holder and included an unmodified third party binary, It'd still comply just by adding a copy of the corresponding license.

Thanks again for your feedback and happy coding!

tbodt commented 4 years ago

Regarding considering the binary form of the kext as part of the source code: The license says:

The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.

I wouldn't agree that a binary kext is a preferred form for making modifications.

rugarciap commented 4 years ago

Hi

Thanks, I understand what you mean, but as the holder, I could also have chosen to not distribute that binary as GPL (in fact I can change that at anytime) not allowing any other app to reuse the software, but choose this way since, on Apple ecosystem, is the most "open" in terms of allowing everyone to directly download the source, compile and run without hassle.

In fact, if Apple required me to do so, I'd probably have to change this policy at anytime (not distributing binary) and releasing only source so the kext can only be loaded from this app. They added this kind of restrictions to newer system extensions framework (control which app can use an extension) to which the app will be ported when they release support for it (although, if they decide to completely abandon Intel in the future.., it wouldn't make any sense).

Best!

tbodt commented 4 years ago

Thanks for taking the time to respond! The reason I'm asking about this is I want to look into adding more control over cpu frequency than a turbo on/off switch, and I would presumably need to modify the kext for that. I took a closer look at the source and it seems like the kext just disables turbo boost on load and enables it on unload, which is not that complicated, so I would probably end up just rewriting it.

tbodt commented 4 years ago

Actually, is there any reason not to publish the code for this kext (I'm guessing about 20 lines)? It's not really impossible for me to run it (by disabling SIP), and I could still build it myself and verify I get the same output ignoring the code signature.

If you're concerned about the GPL infecting the pro version: that shouldn't be a problem as long as you own the copyright on the kext code (i.e. don't use other people's contributions). Distributing a closed-source program that links with GPL software you own is fine, since it's not possible to violate your own copyright.