I have an application that is built on a Linux image with some libraries that contain licenses like GPL-2.0, GPL-3.0, LGPL-2.1, and MPL-2.0 which I understand to be copyleft. I'm new to OSS licenses so it's possible I misunderstand what copyleft means, but I believe it means that if I use a library with a copyleft license, then I also need to use that license and publish my source code. Is this correct? Or do I only need to publish if I modify the source code of the library with the copyleft license?

The full situation is that I have an application that runs on a piece of hardware and I build a Linux image and then my application on the hardware and sell that to people but am not sure if I need to publish my source code since the Linux image I'm deploying on has copyleft libraries on it.

  • 1
    Does your application actually make use any of the copyleft libraries (either directly or indirectly) or are they there to support other applications installed on the Linux image? Commented Jun 20 at 16:44
  • My application does make use of some of the copyleft libraries. Commented Jun 20 at 16:56
  • No, you do not need to put your code under a copyleft license unless you are including other copyleft code in your code base. Linking against a Linux library does not infect your code's license. Otherwise you'd never seem commercial, licensed packages running on Linux.
    – doneal24
    Commented Jun 20 at 18:11
  • 1
    @doneal24 Let's say for example I'm using bluez (GPL-2.0) in my codebase which is part of the standard Linux image and not something extra that is being added. Does this mean I don't need to copyleft the license? Commented Jun 20 at 18:56
  • The answer will vary based on whether it's a GPL library you're using, or a LGPL. In general LGPL allows what you describe without releasing your source code. I believe MPL might as well, but the requirements are different. For GPL, then in general, if you link to a GPL library, then you must distribute the code as well. That's why it's called copyleft. They gave you the GPL code, so you must give your code back in return.
    – Brandin
    Commented Jun 21 at 9:09

2 Answers 2


Copyleft license roughly come in two flavours.

Weak copyleft licenses (like LGPL and MPL) extend their copyleft nature only to the library (for LGPL) or file (for MPL) boundary. It is fully possible to combine a library under a weak copyleft license with a closed-source application without any obligation to reveal the source code of the closed-source application.

Strong copyleft licenses (like GPL) extend their copyleft nature to the entire executable/application that the GPL-licensed code gets used in. If you use a GPL-licensed library in your application, then every part of your application needs to be distributed under the GPL license terms, including the requirement that the source code is provided.

With (embedded) Linux applications, there are a few special cases to what I wrote above:

  1. Although the Linux kernel is licensed under the strong copyleft GPLv2 license, it has an exception to the license terms for user-space applications. If your application only accesses the kernel and kernel modules through the syscall interface (the normal, unprivileged interface), then the Linux kernel places no requirements on the licensing terms of your application.

    Most convenience libraries for accessing kernel facilities by regular applications are also licensed under a permissive license or at most a weak copyleft license.

  2. When you distribute a hardware product containing GPL or LGPL licensed code (including a Linux kernel), then you must give the people who poses one of your products the possibility to obtain the source code of every part that is distributed under the GPL or LGPL license.

    The (L)GPLv3 license has the additional requirement that your users must be allowed to update the (L)GPLv3 licensed parts with a version they built themselves (unless there is physically no way to perform software updates of any kind in the field, not even by you).


No Free Software / Open Source licence, forces you to publish.

If you don't publish, then you don't have to publish source code. Private use is OK. Including modifications.

  • Para 2 of the original question makes it pretty clear that distribution is occurring.
    – MadHatter
    Commented Jul 2 at 6:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.